start populating the new System.Web.Configuration_2.0 dir
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2  
3         * cs-tokenizer.cs: Warning text fix.
4
5         * driver.cs: AllWarningNumbers exposed on public interface.
6
7         * report.cs (): Reviewed warning numbers.
8         (IsValidWarning): Use binary search.
9
10 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
11  
12         * driver.cs: Implemeted resource visibility.
13         (Resources): New class for code sharing between /res: and
14         /linkres:
15  
16 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
17
18         Fix #76568.
19         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
20         folding.
21         
22         * convert (Convert.ImplicitReferenceConversion): NullCast holds
23         contants only.
24         
25         * ecore.cs (NullCast): Child is contant only.
26         
27         * literal.cs (NullLiteral.Reduce): null can be converted to any
28         reference type.
29
30 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
31
32         * driver.cs: Use Encoding.Default as default code page instead
33           of ISO-28591.
34
35 2005-10-27  Raja R Harinath  <rharinath@novell.com>
36
37         Fix #76085.
38         * expression.cs (Invocation.Error_InvalidArguments): Handle
39         __arglist parameters.
40         (Invocation.VerifyArgumentsCompat): Likewise.
41         * support.cs (ReflectionParameters.GetSignatureForError): Print
42         __arglist parameters.
43         (InternalParamters.GetSignatureForError): Likewise.
44         * parameter.cs (Parameters.GetSignatureForError): Likewise.
45
46 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
47
48         * attribute.cs (GetPropertyValue): Made public.
49
50         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
51         Resolve.
52         Add new property WrapNonExceptionThrows to handle 2.0 assembly
53         attribute.
54         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
55         is not defined.
56         
57         * driver.cs: Reflect method name change.
58         
59         * statement.cs (Try.Resolve): Warn when try has both general
60         exception handlers.
61         
62         * typemanager.cs: runtime_compatibility_attr_type new predefined
63         type.
64
65 2005-10-26  Raja R Harinath  <harinath@gmail.com>
66
67         Fix #76419.
68         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
69         treat it as an empty parameter list.
70
71 2005-10-26  Raja R Harinath  <rharinath@novell.com>
72
73         Fix #76271.     
74         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
75         ResolveAsTypeStep silent.
76         * statement.cs (Block.AddConstant): Mark block as used.
77         (Block.ResolveMeta): Avoid piling on error messages
78         if a constant initializer resolution fails.
79
80 2005-10-25  Raja R Harinath  <rharinath@novell.com>
81
82         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
83         Remove.
84         (NamespaceEntry.VerifyAllUsing): New.
85         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
86         behaviour.  Delegates actual resolution of alias to ...
87         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
88         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
89         Update.
90         * driver.cs (Driver.MainDriver): Update.
91         
92         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
93         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
94         property.
95         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
96         Remove.
97         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
98         RootNamespace.DefineNamespacesForAll.
99
100 2005-10-24  Raja R Harinath  <harinath@gmail.com>
101
102         * typemanager.cs (assemblies, external_aliases, modules)
103         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
104         (ComputeNamespaces, GetRootNamespace): Remove extra staging
105         overhead.  Move resposibility ...
106         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
107         * driver.cs, attribute.cs, codegen.cs: Update to changes.
108
109 2005-10-23  Raja R Harinath  <harinath@gmail.com>
110
111         * namespace.cs (RootNamespace.all_namespaces): Renamed from
112         cached_namespaces.  Improve usage.
113         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
114         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
115         Move from GlobalRootNamespace and simplify.
116         (RootNamespace.Global): Make instance variable.
117         (RootNamespace.RootNamespace): Add "alias name" parameter.
118         (GlobalRootNamespace): Simplify drastically.
119         (Namespace.Lookup): Don't use GetNamespace.
120         * typemanager.cs (GetRootNamespace): Rename from
121         ComputeNamespaceForAlias.
122         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
123
124 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
125
126         * anonymous.cs (AnonymousContainer): Don't crash when container
127         doesn't exist.
128
129 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
130
131         * expression.cs (Binary.DoResolve): Warn when comparing same
132         values.
133
134 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
135
136         Fix #76486.
137         * expression.cs (Binary.DoResolve): It looks like there are no
138         convetsion rules in enum context.
139
140 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
141
142         Add support for extern alias qualifiers.
143         * typemanager.cs: Move some LookupTypeReflection code
144         to namespace.cs, to have cleaner code. Added some methods
145         to help us keep track of the extern aliased references.
146         * driver.cs: Add suport for extern alias assemblies on command
147         line and check for their warnings/errors. Also keep track of the
148         extern aliased assemblies.
149         * namespace.cs: Move the global functionality of Namespace
150         to GlobalRootNamespace/RootNamespace. Now the global namespace
151         is GlobalRootNamespace.Globa. Also the code moved from 
152         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
153         Finally added LocalAliasEntry (AliasEntry before) and
154         ExternAliasEntry, to handle alias statements.
155         * cs-parser.jay: Add support in the grammar for extern alias
156         statement.
157         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
158         Update callings to Namespace (now in GlobalRootNamespace).
159
160 2005-10-18  Raja R Harinath  <rharinath@novell.com>
161
162         Fix #76371.
163         * class.cs (TypeContainer.DefineType): Move updating of
164         topological sort earlier in the code.
165         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
166
167 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
168
169         Fix #76273.
170         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
171         
172         * constant.cs (Constant.TryReduce): Moved from Cast class.
173         (Reduce): Made little bit more OO and fixed missing conversions.
174         
175         * ecore.cs (Reduce): Implemented.
176         (Binary.EnumLiftUp): New method to upgrade values to enum values.
177         
178         * literal.cs (Reduce): Implemented.
179         
180         * class.cs: Reverted Miguel's wrong commit.
181
182 2005-10-14  Miguel de Icaza  <miguel@novell.com>
183
184         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
185
186 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
187
188         * cs-parser.jay, expression.cs : CS0214 was missing error location
189           for constants. Fixed bug #76404.
190
191 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
192
193         Fix #76370.
194         * convert.cs (ExplicitConversionCore): Fixed object->enum
195         conversion.
196
197 2005-10-10  Raja R Harinath  <rharinath@novell.com>
198
199         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
200         InstanceExpression.
201         (PropertyExpr.EmitCall): Likewise.
202         * expression.cs (Invocation.EmitArguments): Handle case where
203         arguments == null.
204         (Invocation.EmitCall): Avoid allocating temporary variable if
205         there are no arguments.
206
207 2005-10-07  Raja R Harinath  <rharinath@novell.com>
208
209         Fix #76323.
210         * convert.cs (ImplicitConversionStandard): Move conversion of
211         void* to arbitrary pointer types ...
212         (ExplicitConversionStandard): .. here.
213         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
214         error to always print typenames.
215
216 2005-10-07  Raja R Harinath  <rharinath@novell.com>
217
218         * convert.cs (GetConversionOperator): Rename from
219         GetConversionOperators.  Move operator selection code from ...
220         (UserDefinedConversion): ... here.
221
222 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
223
224         * convert.cs (ExplicitConversionCore): Removed duplicate enum
225         conversion.
226
227 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
228
229         * assign.cs (Assign.DoResolve): Error method changed.
230
231         * cfold.cs (DoConstantNumericPromotions): Error method changed.
232         
233         * const.cs (ResolveValue): Reset in_transit immediately.
234         
235         * constant.cs: Error method changed.
236         
237         * convert.cs: Removed useless location parameter.
238         (ExplicitNumericConversion): Don't do double enum check.
239         (ExplicitConversionCore): Renamed from ExplicitConversion.
240         (ExplicitUnsafe): Extracted from ExplicitConversion.
241         (ExplicitConversion): Uses for error reporting.
242         
243         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
244         error messages.
245         (ResolveBoolean): Uses common error method.
246         (CastToDecimal): Get rid of ec.
247         (CastFromDecimal): Optimized.
248         (ConvCast): Get rid of ec.
249         
250         * enum.cs (ResolveValue): Reset in_transit immediately.
251         (Emit): Return after first error.
252         
253         * expression.cs: Convert changes.
254         
255         * literal.cs: Error method changed.
256         
257         * statement.cs: Error method changed.
258
259 2005-10-03  Raja R Harinath  <rharinath@novell.com>
260
261         * support.cs (SeekableStreamReader.Position): Don't error out when
262         the requested position is just beyond the end of the current
263         buffered data.
264
265 2005-09-28  Raja R Harinath  <rharinath@novell.com>
266
267         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
268         try to keep in sync with the byte count of the underlying Stream.
269         However, this limits us to a window size of 2048 characters: i.e.,
270         the maximum lookahead of our lexer/parser can be 2048 characters.
271
272 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
273
274         Fix #76255.
275         * driver.cs: Fix compilation files with full root path.
276
277 2005-09-25  Miguel de Icaza  <miguel@novell.com>
278
279         * report.cs (SymbolRelatedToPreviousError): Format the output so
280         it does not use an open parenthesis that is never closed. 
281
282         * driver.cs: Follow coding guidelines
283
284 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
285
286         Fix #72930.
287         * const.cs (Const.ResolveValue): Check for assigning non-null
288         value to reference type.
289
290 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
291
292         * anonymous.cs: Implemented ExprClassName.
293         
294         * assign.cs (Assign.DoResolve): Don't chrash when type is not
295         delegate.
296         
297         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
298         check.
299         
300         * class.cs (StaticClass.DefineContainerMembers): Report protected
301         members as error.
302         
303         * codegen.cs: if(ed) PRODUCTION.
304         
305         * convert.cs (Error_CannotImplicitConversion): Better error
306         distinction.
307         
308         * cs-parser.jay: More error checks.
309         
310         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
311         
312         * driver.cs (CSCParseOption): Enabled wrong option check.
313         
314         * ecore.cs (Expression.ExprClassName): Turned to property.
315         (MemberExpr.CheckIntermediateModification): For checking boxed
316         value types     modification.
317         
318         * statement.cs (Fixed.Resolve): Expression type must be
319         convertible to fixed type.
320         (CollectionForeach.GetEnumeratorFilter,TryType):
321         Small refactoring for easier error checking.
322
323 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
324
325         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
326         attributes.
327         
328         * class.cs (GeneratedBaseInitializer): New class for customization
329         compiler generated initializers.
330         (MemberBase.DoDefine): Check Obsolete attribute here.
331         (FieldMember.DoDefine): Ditto.
332         
333         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
334         constants.
335         
336         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
337         (MemberCore.GetObsoleteAttribute): Removed argument.
338         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
339         (MemberCore.CheckObsoleteType): New helper.
340         
341         * delegate.cs,
342         * enum.cs,
343         * statement.cs: Updates after MemberCore changes.
344         
345         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
346         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
347         
348         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
349         obsolete attribute for compiler construct.
350         (As.DoResolve): Cache result.
351         
352         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
353
354 2005-09-26  Raja R Harinath  <rharinath@novell.com>
355
356         Fix #76133.
357         * expression.cs (This.VerifyFixed): In a value type T, the type of
358         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
359         value type R, 'this' is treated as a value parameter.
360
361 2005-09-22  Miguel de Icaza  <miguel@novell.com>
362
363         * statement.cs (Lock): Use the TemporaryVariable class instead of
364         manually using local variables as those do not work when variables
365         are captured.
366
367         * ecore.cs: Moved the TemporaryVariable class from being a nested
368         class inside Foreach to be a public class that can be employed in
369         other places. 
370
371 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
372
373         * cs-parser.jay: interface_accessors replaced by
374         accessor_declarations.
375
376         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
377         location.
378         
379         * statement.cs (GotoCase.Resolve): Convert null constant to
380         null case.
381         (SwitchLabel.ResolveAndReduce): Ditto.
382         (SwitchLabel.NullStringCase): Custom null stamp.
383         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
384         
385         typemanager.cs (CSharpSignature): Don't skip first argument
386         for full names.
387
388 2005-09-18  Miguel de Icaza  <miguel@novell.com>
389
390         * driver.cs: Set InEmacs based on the environment variable EMACS. 
391
392         * location.cs (InEmacs): in this mode, do not report column
393         location as it confuses Emacs.
394
395 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
396
397         * cfold.cs, constant.cs, convert.cs, ecore.cs,
398         expression.cs, iterators.cs, literal.cs: Store constants and
399         literals location.
400         
401         * class.cs (MemberBase.ShortName): Pass location.
402         
403         * cs-parser.jay: Some location fixes.
404         
405         * ecore.cs (Expression.Location): Made virtual.
406
407 2005-09-05  Miguel de Icaza  <miguel@novell.com>
408
409         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
410         if the underlying types are the same, otherwise we need to produce
411         code that will do the proper cast.
412
413         This was exposed by Marek's constant rewrite which produced
414         invalid code for the call site:
415
416         enum X : long { a }
417         void Method (X v) {}
418
419         Method ((X) 5)
420
421         This fixes test-49.cs
422
423 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
424
425         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
426           Type/Object should be allowed as well. Fixed bug #75968.
427
428 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
429
430         * expression.cs : (Binary.DoResolve): when one is enum constant and
431           another is constant 0, then return enum one *as enum type*.
432           Fixed bug 74846.
433
434 2005-09-02  Raja R Harinath  <rharinath@novell.com>
435
436         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
437         internal.
438
439         Fix #75941.
440         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
441         flow-branching for LocalVariableReferences in case we were invoked
442         from a MemberAccess.
443         * expression.cs (LocalVariableReference.VerifyAssigned): New.
444         Carved out of ...
445         (LocalVariableReference.DoResolveBase): ... this.
446         (MemberAccess.Resolve): Do the check that was disabled during
447         SimpleNameResolve.
448
449 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
450
451         * class.cs :
452           (PartialContainer.Create): check abstract/sealed/static strictly
453           but abstract/sealed can exist only at one side. Fixed bug #75883.
454
455 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
456
457         Fix #75945.
458         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
459         specified, don't default to UnmanagedType.I4.
460
461 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
462
463         * expression.cs : conditional operator should check possibly
464           incorrect assign expression. Fixed bug #75946.
465
466 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
467
468         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
469           Reverting the change. gmcs is much complex than mcs on this matter.
470
471 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
472
473         * cs-tokenizer.cs : To read another token ahead of the actual 
474           consumption, use new SavedToken and cache token instead of moving
475           back the stream with SeekableStreamReader (it seemed problematic).
476         * cs-parser.jay,
477           driver.cs : Thus use StreamReader directly.
478         * support.cs : Thus removed SeekableStreamReader.
479
480 2005-08-30  Raja R Harinath  <rharinath@novell.com>
481
482         Fix #75934.
483         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
484         (ScopeInfo.EmitScopeType): Use it to construct field names from
485         names of captured locals.
486
487         Fix #75929.
488         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
489         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
490         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
491         (ExplicitConversion): Remove enum cases already handled by
492         implicit conversion.  Move implicit conversion check to the beginning.
493         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
494         * expression.cs (ArrayCreation.EmitDynamicInitializers):
495         Don't treat System.Enum as a struct.
496
497 2005-08-30  Jb Evain  <jbevain@gmail.com>
498
499         * attribute.cs: handles as expression in parameters.
500
501 2005-08-30  Raja R Harinath  <rharinath@novell.com>
502
503         Fix #75802.
504         * class.cs (TypeContainer.VerifyClsName): Don't use a
505         PartialContainer when verifying CLS compliance.
506         (AbstractPropertyEventMethod): Set Parent here, ...
507         (PropertyMethod): ... not here.
508
509 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
510
511         * attribute.cs : escaped attribute name should not be allowed to be
512           resolved (e.g. @class as classAttribute). Fixed bug #75930.
513
514 2005-08-29  Raja R Harinath  <rharinath@novell.com>
515
516         Fix #75927.
517         * convert.cs (ImplicitStandardConversionExists): Allow zero also
518         when converting a long constant to unsigned long.
519         * expression.cs (Invocation.OverloadResolve): Add sanity check to
520         detect where IsApplicable and VerifyArgumentsCompat disagree.
521
522 2005-08-29  Raja R Harinath  <rharinath@novell.com>
523         and Carlos Alberto Cortez  <carlos@unixmexico.org>
524
525         Fix #75848.
526         * class.cs (TypeContainer.CanElideInitializer): New helper.
527         (TypeContainer.EmitFieldInitializers): Use it to determine if we
528         can safely emitting the initializer of a field.
529
530 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
531
532         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
533           allowed inside a switch (without loop). Fixed bug #75433.
534
535 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
536
537         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
538         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
539
540 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
541
542         * driver.cs : kinda reverting the default encoding changes (not exact 
543           revert since I noticed that "codepage:reset" might not work fine).
544
545 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
546
547         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
548           Location. Now getter and setter store location correctly.
549           (errors/cs0111-12.cs now reports the expected location.)
550
551 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
552
553         * driver.cs : Use default encoding on the environment.
554           Removed (now that) extra parameter for SeekableStreamReader.
555         * support.cs : (SeekableStreamReader) third .ctor() argument for
556           StreamReader is not required (always true). preamble size could
557           be acquired in simpler and safe way.
558
559 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
560
561         * cs-parser.jay: report CS0642 at warning level 3
562           and report CS0642 for an if else statement also
563           fixes bug #74745. Patch by John Luke (and a bit
564           modified by me).
565           Removed extra CS0642 warning check for "while",
566           "for" and "fixed".
567         * statement.cs: In Block.Resolve(), CS0642 check
568           is reimplemented to check a sequence of an empty
569           statement and a block.
570
571           Both fix bug #66777.
572
573 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
574
575         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
576         detection until I fix it.
577         
578         * cs-tokenizer.cs: Changed error message.
579         
580         * cs-parser.jay: Fixed 2 error locations.
581         
582         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
583         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
584         properties.
585         
586         * enum.cs (GetSignatureForError): Fixed.
587         
588         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
589         method detection.
590         
591         * class.cs,
592         * typemanager.cs (RegisterProperty): Removed.
593         
594         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
595
596 2005-08-24  Raja R Harinath  <rharinath@novell.com>
597
598         Fix #75874.
599         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
600         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
601
602 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
603
604         * expression.cs : tiny fix is required for not warning positive ulong.
605           See test-441.cs.
606
607 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
608
609         * expression.cs : add CS0652 check for constant and integral
610           expression. Fixed bug #53974.
611
612 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
613
614         * expression.cs : in DoNumericPromotions(), check if there is implicit
615           conversion overload for string (to check CS0034). Fixed bug #52492.
616
617 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
618
619         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
620
621 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
622
623         * ecore.cs : report location when it is *not* Null.
624
625 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
626
627         * codegen.cs,
628           ecore.cs,
629           flowanalysis.cs,
630           expression.cs:
631           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
632           correctly. Fixed bug #75721.
633
634 2005-08-23  Raja R Harinath  <rharinath@novell.com>
635
636         * support.cs (SeekableStreamReader.Position): Avoid an expensive
637         loop that performs 'min (pos, char_count)'.
638
639         Fix #75862.
640         * expression.cs (Unary.ResolveOperator): Don't discard implicit
641         converted value in Operator.OnesComplement.
642
643 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
644
645         * anonymous.cs: If the anon method is pulled into a helper class,
646         it needs to be `internal' not `private'. Fixes runtime behavior on
647         msft. bug #75704
648
649 2005-08-20  Martin Baulig  <martin@ximian.com>
650
651         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
652         scope if we don't already have it.
653
654         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
655         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
656         fixes #75867.
657
658 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
659
660         Fix #75803
661         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
662         is a partial class.
663
664 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
665
666         The big constants rewrite
667         Fix #75746, #75685 and more
668         As a side effect saved 1MB for MWF ;-)
669         
670         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
671         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
672         enum based for corlib compilation.
673         
674         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
675         subtractions.
676         
677         * class.cs (FixedField.Define): Use ResolveAsConstant.
678         
679         * const.cs (IConstant): Interface constants and enums.
680         (Const.ResolveValue): New method for constant resolvning.
681         (ExternalConstant): Constants from imported assemblies.
682         
683         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
684         conversion; like enums.
685         (Constant.ToType): Converts this constant to different type.
686         (Constant.Increment): Adds 1.
687         
688         * convert.cs (ImplicitConversionRequired): Simplified.
689         
690         * cs-parser.jay: Create EnumMember directly.
691         
692         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
693         
694         * doc.cs (GenerateEnumDocComment): Removed.
695         
696         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
697         (ConvertIntLiteral): Removed.
698         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
699         
700         * enum.cs (EnumMember): Implement IConstant.
701         (Enum.IsValidEnumConstant): Removed.
702         (Enum.GetNextDefaultValue): Removed.
703         (Enum.FindMembers): Updated.
704         (Enum.GenerateDocComment): Iterate enum members.
705         
706         * expression.cs (Cast.TryReduce): Handle enums correctly.
707         (New.Constantify): Made public.
708         (MemberAccess.DoResolve): Removed contant specific if(s).
709         
710         * literal.cs (NullLiteral): Implement new abstract methods.
711         
712         * statement.cs (GotoCase.Resolve): Use new constant methods.
713         (SwitchLabel.ResolveAndReduce): Use new constant methods.
714         
715         * typemanager.cs (LookupEnum): Removed.
716         (IsEnumType): Fixed to work with corlib.
717         (RegisterConstant): Removed.
718         (LookupConstant): Removed.
719         (GetConstant): Changed to work with IConstant.
720
721 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
722
723         * location.cs : Fixed overflown (>255) column number.
724
725 2005-08-03  Raja R Harinath  <rharinath@novell.com>
726
727         First cut of the qualified-alias-member feature.
728         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
729         token.
730         * cs-parser.jay (DOUBLE_COLON): New token.
731         (namespace_or_type_name): Add rule for recognizing
732         qualified-alias-members.
733         (primary_expression): Likewise.
734         (element_access): Allow QualifiedAliasMember as a possible
735         type-bearing expression.
736         (local_variable_type, local_variable_pointer_type): Likewise.
737         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
738         aliases in the current and enclosing namespace declarations.
739         (NamespaceEntry.UsingAlias): Add CS0440 warning.
740         * decl.cs (MemberName.is_double_colon): New.
741         (MemberName.MemberName): Add new constructor for alias-member.
742         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
743         * expression.cs (QualifiedAliasMember): New expression type.
744
745 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
746
747         * location.cs : it borked when no argument was specified.
748
749 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
750
751         * location.cs : tiny ToString() format fix.
752
753 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
754
755         * statement.cs : oops, it was missing.
756
757 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
758
759         A set of fixes for precise line/column location.
760
761         * location.cs :
762           "token" field now holds a file/line "delta", a line number offset 
763           from the segment, and a column number. See also:
764           http://lists.ximian.com/pipermail/mono-devel-list/2004-
765           December/009508.html
766           Removed static IsNull. Use instance IsNull property instead.
767         * cs-tokenizer.cs :
768           For some tokens it stores Location. For Identifier it stores
769           LocatedToken which is a pair of string name and location.
770           Column numbers are adjusted only at getChar().
771         * report.cs :
772           Use Location.ToString() for reporting (it now contains column).
773         * cs-parser.jay :
774           Largely modified to use LocatedToken instead of
775           string (IDENTIFIER), and to acquire Location from some tokens.
776         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
777           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
778           codegen.cs :
779           Now MemberName holds Location. DeclSpace.ctor() receives Location
780           as a parameter. Removed extra parameters to all derived classes.
781           Replaced Location.IsNull() with instance property.
782         * assign.cs, expression.cs :
783           Added .ctor() overload that omits Location.
784         * attribute.cs :
785           Added "nameEscaped" flag that indicates the identifier was escaped
786           in the source file. This fixes bug #57047.
787
788 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
789
790         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
791         New method, looking for lo-case imported cls type.
792
793         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
794         here.
795
796         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
797
798         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
799
800         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
801         all_imported_types.
802         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
803
804         Optimized to save 3.5 MB for SWF compilation.
805
806 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
807
808         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
809         (PartialContainer.Create): Moved logic AddToContainer.
810         (PartialContainer.MarkForDuplicationCheck): Shares name.
811         
812         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
813         place.
814         
815         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
816         initialization.
817         (Namespace.GetSignatureForError): New method.
818         
819         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
820         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
821
822 2005-08-01  Raja R Harinath  <rharinath@novell.com>
823
824         Fix #75669.
825         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
826         member lookup rather than qualifier_type, since qualifier_type can
827         be null.
828
829 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
830
831         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
832         enum member.
833
834 2005-07-31  Miguel de Icaza  <miguel@novell.com>
835
836         * statement.cs: Copy the local exception into the exception
837         captured local.  Fixes 75674
838
839 2005-07-31  Raja R Harinath  <harinath@gmail.com>
840
841         Fix #75658.
842         * expression.cs (Invocation.OverloadResolve): Don't report error
843         CS1501 if error CS1502 has been reported.
844         (New.DoResolve): Delegate CS1501 reporting to
845         Invocation.OverloadResolve.
846
847         Fix #75656.
848         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
849         invariant-meaning-in-block property in an enclosing block if
850         necessary.
851
852 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
853
854         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
855         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
856         (Switch.CheckSwitch): Just save 50kb for SWF.
857
858 2005-07-27  Martin Baulig  <martin@ximian.com>
859
860         * anonymous.cs (CaptureContext.AddField): Added
861         `AnonymousContainer am' argument; compute its toplevel scope if
862         it's not already computed.  Fixes #75649.
863
864 2005-07-26  Raja R Harinath  <rharinath@novell.com>
865
866         Fix #75628.
867         * class.cs (Constructor.Emit): Reset block to null if the block
868         resolve fails.
869
870 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
871
872         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
873
874 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
875
876         * class.cs (MethodData.Define): Check whether accessor implementing
877         interface is public.
878
879         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
880
881 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
882
883         Fix #57245
884         * namespace.cs (LookupType): Moved same type check to...
885         
886         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
887         with the same name.
888
889 2005-07-21  Raja R Harinath  <rharinath@novell.com>
890
891         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
892         already found a typebuilder.
893         * class.cs (MethodCore.IsDuplicateImplementation): Compare
894         MemberNames, not strings.
895
896         * const.cs (Error_ExpressionMustBeConst): 
897         Rename from Error_EpressionMustBeConst.
898         * const.cs, class.cs, statement.cd: Update.
899
900 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
901
902         Fix #65573
903
904         * const.cs (Const.LookupConstantValue): Report missing contant expression
905         everytime.
906         (Error_EpressionMustBeConstant): Only one error method.
907
908         * class.cs, statement.c: Updated.
909
910 2005-07-20  Raja R Harinath  <rharinath@novell.com>
911
912         * statement.cs (Block.Flags): Add back HasVarargs.
913         (Block.flags): Make protected.
914         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
915
916         * typemanager.cs (types, typecontainers, user_types): Remove.
917         (UserTypes, TypeContainers): Likewise.
918         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
919         (CleanUp, Reset): Update.
920         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
921         (GetNestedType): Use Type.GetNestedType.
922         (CoreLookupType): Take two arguments, the namespace and the
923         basename of the type.  Update to use the Namespace.Lookup
924         mechanism.
925         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
926         (RealMemberLookup): Use IsNestedChildOf instead of playing with
927         string concatenation and substring matches.
928         * class.cs, enum.cs, delegate.cs: Update to changes.
929
930 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
931
932         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
933         Expression and made virtual.
934
935         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
936         (ImplicitStandardConversionExists): Fixed `byte' typo ?
937
938         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
939
940         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
941         error message.
942
943         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
944         change.
945
946 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
947
948         Fix #57707
949         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
950         AssemblyCultureAttribute is not used on executable.
951
952         * rootcontext.cs,
953         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
954
955 2005-07-16  Raja R Harinath  <rharinath@novell.com>
956
957         Fix #60638.
958         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
959         New.  Reports CS0252/CS0253.
960         Mostly taken from preliminary patch by Duncak Mak.
961         (Binary.DoResolveOperator): Store results of operator lookup.
962         Use them to detect if we need to warn about unintended reference
963         comparisons.
964
965 2005-07-15  Raja R Harinath  <rharinath@novell.com>
966
967         Fix #72969.
968         * namespace.cs (Namespace.Lookup): Add back location parameter.
969         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
970         * delegate.cs, ecore.cs, expression.cs: Update to changes.
971
972         * codegen.cs (EmitContext.DeclSpace): Make readonly.
973         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
974         (Namespace.LookupType): ... this.
975         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
976         of namespaces.
977         * typemanager.cs (LookupTypeReflection): Remove buggy code that
978         purported to handle pointers.
979         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
980         CoreLookupType.
981
982 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
983
984         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
985         type as namespace.
986
987 2005-07-15  Raja R Harinath  <rharinath@novell.com>
988
989         * namespace.cs (Namespace.Lookup): Drop location parameter.
990         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
991         (NamespaceEntry.Lookup): ... this.
992         (NamespaceEntry.Error_AmbiguousTypeReference):
993         Move here from DeclSpace.
994         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
995         names ...
996         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
997         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
998         Move to NamespaceEntry.
999         * delegate.cs, expression.cs: Update to changes.
1000
1001 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1002
1003         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1004         CheckAttributeType and refactored.
1005         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1006         ResolveAsTypeTerminal error handling.
1007         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1008         handling.
1009         (GetSignatureForError): Print errors in same way.
1010
1011         * class.cs,
1012         * codegen.cs: Reflect attribute GetSignatureForError change.
1013
1014         * ecore.cs,
1015         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1016
1017         * namespace.cs (UsingEntry): Refactored to make fields private.
1018
1019         * assign.cs,
1020         statement.cs: Error_UnexpectedKind has extra parameter.
1021
1022 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1023
1024         * ecore.cs (IAlias): Remove.
1025         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1026         that implement the interface.
1027         * namespace.cs (Namespace): Likewise.
1028         (Namespace.declspaces): Renamed from 'defined_names'.
1029         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1030         DeclSpace instead of an IAlias.
1031         * tree.cs (Tree.AddDecl): Update.
1032
1033 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1034
1035         * statement.cs (Block.Flags); Remove HasVarargs.
1036         (Block.HasVarargs): Move to ToplevelBlock.
1037         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1038         (Block.Variables): Make protected.  Initialize variable hashtable
1039         if necessary.
1040         (Block.AddVariable): Update.
1041         (Block.Resolve): Update to changes.
1042         (ToplevelBlock.HasVarargs): New boolean.
1043         (ToplevelBlock.ThisVariable): Move here from Block.
1044         (ToplevelBlock.AddThisVariable): Likewise.
1045         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1046         * expression.cs (This.ResolveBase): Update to changes.
1047         (ArglistAccess.DoResolve): Likewise.
1048
1049 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1050
1051         Fix #75321
1052         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1053
1054         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1055         not used and not used & assigned.
1056         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1057
1058 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1059
1060         Fix #75053
1061         * expression.cs (Is.DoResolve): null is never provided type.
1062
1063 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1064
1065         Fix #52496
1066         * cs-parser.jay: Less strict event error rule to catch more errors.
1067
1068 2005-07-08  Martin Baulig  <martin@ximian.com>
1069
1070         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1071         gettter (allowed) or setter (not allowed).
1072
1073         * class.cs (Accessor): Implement IIteratorContainer.
1074         (Accessor.Yields): New public field.
1075         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1076         per-accessor basis.
1077
1078         * cs-parser.jay
1079         (get_accessor_declaration, set_accessor_declaration): Set the
1080         `yields' flag on the accessor, not the property.
1081         (property_declaration): Do the iterators check on a per-accessor
1082         basis and not for the whole property.
1083
1084 2005-07-08  Martin Baulig  <martin@ximian.com>
1085
1086         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1087         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1088
1089 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1090
1091         Fix #74975
1092         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1093         (ExtractSecurityPermissionSet): Cope with self referencing security
1094         attributes properly.
1095
1096         * driver.cs (SetOutputFile): Made public property OutputFile.
1097
1098 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1099
1100         Fix #75486.
1101         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1102         has_nonstatic_fields.  Make into a FieldBase pointer.
1103         (TypeContainer.AddField): Add CS0282 check.
1104         (TypeContainer.EmitType): Update.
1105
1106 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1107
1108         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1109         compare if they start with __.
1110
1111 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1112
1113         * statement.cs (Switch.SwitchGoverningType): Only look at
1114         UserCasts that don't need implicit standard conversions to one of
1115         the allowed switch types (Fixes test-322.cs).
1116         (LocalInfo.Resolve): Re-enable sanity-test.
1117
1118 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1119
1120         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1121         
1122         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1123         
1124         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1125
1126 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1127
1128         Fix #75472.
1129         * ecore.cs (SimpleName.GetSignatureForError): Add.
1130         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1131         (MemberAccess.GetSignatureForError): Add.
1132
1133 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1134  
1135         The big error and warning messages review.
1136         
1137         * anonymous.cs,
1138         * assign.cs,
1139         * attribute.cs,
1140         * class.cs,
1141         * codegen.cs,
1142         * convert.cs,
1143         * cs-parser.jay,
1144         * cs-tokenizer.cs,
1145         * decl.cs,
1146         * delegate.cs,
1147         * doc.cs,
1148         * driver.cs,
1149         * ecore.cs,
1150         * enum.cs,
1151         * expression.cs,
1152         * flowanalysis.cs,
1153         * iterators.cs,
1154         * literal.cs,
1155         * location.cs,
1156         * modifiers.cs,
1157         * namespace.cs,
1158         * parameter.cs,
1159         * pending.cs,
1160         * report.cs,
1161         * rootcontext.cs,
1162         * statement.cs,
1163         * support.cs,
1164         * tree.cs,
1165         * typemanager.cs: Updated.
1166         
1167         * class.cs: (MethodCore.SetYields): Moved here to share.
1168         (PropertyMethod.Define): Moved iterator setup here.
1169         
1170         * iterators.cs: Add orig_method to have full access to parent
1171         container.
1172
1173 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1174
1175         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1176         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1177         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1178         variable of struct type.
1179         * expression.cs (Unary.ResolveOperator): Update to change.
1180         (Indirection.VerifyFixed): Likewise.
1181         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1182         (ParameterReference.VerifyFixed): Value parameters are fixed.
1183         (This.VerifyFixed): Treat 'this' as a value parameter.
1184         * statement.cs (LocalInfo.IsFixed): Remove.
1185
1186 2005-07-01  Martin Baulig  <martin@ximian.com>
1187
1188         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1189         `ec.EmitThis ()' to get the correct scope.
1190
1191 2005-07-01  Martin Baulig  <martin@ximian.com>
1192
1193         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1194         instance is a ParameterReference; fixes #75299.
1195
1196 2005-07-01  Martin Baulig  <martin@ximian.com>
1197
1198         Reverted Marek's latest patch (r46725):
1199         - it contains structural changes which are neither mentioned in
1200           the ChangeLog nor explained anywhere; for example the additional
1201           argument of EmitContext's and Iterator's .ctor's and the
1202           TypeContainer.DefineMembers() change.
1203         - structural changes like this should go in in seperate patches
1204           and not be hidden in a huge patch which just seems to affect
1205           warnings and errors.
1206           a big and hard to understand patch.
1207         - it breaks iterators and causes regressions, for instance in
1208           test-iter-03.cs.      
1209
1210 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1211
1212         Fix #75412.
1213         * expression.cs (Indexers.map): Remove.
1214         (Indexers.Append): Filter out inaccessible setters and getters.
1215         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1216
1217         Fix #75283.
1218         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1219         Refactored from ...
1220         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1221         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1222         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1223         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1224
1225 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1226
1227         Fix #75322
1228         * class.cs (FieldBase.GetInitializerExpression): One more field
1229         for backup.
1230
1231 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1232
1233         * pending.cs: Do not define a proxy if the base method is virtual,
1234         it will be picked up by the runtime (bug 75270).
1235
1236 2005-06-08  Martin Baulig  <martin@ximian.com>
1237
1238         The big Iterators rewrite :-)
1239
1240         * iterators.cs: Rewrite this to use the anonymous methods framework.
1241
1242         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1243         before the TypeContainers; see 2test-21.cs.
1244
1245         * class.cs
1246         (TypeContainer.DefineType): Don't create a new EmitContext if we
1247         already have one (this only happens if we're an Iterator).
1248         (TypeContainer.Define): Also call Define() on all our iterators.
1249         (Method.CreateEmitContext): Added support for iterators.
1250
1251         * anonymous.cs
1252         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1253         (AnonymousContainer.CreateMethodHost): Moved here from
1254         AnonymousMethod and made abstract.
1255         (AnonymousContainer.CreateScopeType): New abstract method.
1256         (AnonymousContainer.IsIterator): New public property.
1257         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1258         get the ScopeTypeBuilder rather than manually defining it here. 
1259         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1260         iterators here.
1261
1262         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1263         before RootContext.DefineTypes().
1264
1265         * codegen.cs (EmitContext.RemapToProxy): Removed.
1266         (EmitContext.CurrentAnonymousMethod): Changed type from
1267         AnonymousMethod -> AnonymousContainer.
1268         (EmitContext.ResolveTopBlock): Protect from being called twice.
1269         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1270         (EmitContext.EmitThis): Removed the iterators hacks; use the
1271         anonymous methods framework for that.
1272
1273         * statement.cs
1274         (ToplevelBlock.Container): Make this a property, not a field.
1275         (ToplevelBlock.ReParent): New public method; move the
1276         ToplevelBlock into a new container.
1277         (Foreach.TemporaryVariable): Simplify.
1278
1279 2005-06-05  Martin Baulig  <martin@ximian.com>
1280
1281         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1282         (Block.AddTemporaryVariable): New public method; creates a new
1283         `LocalInfo' for a temporary variable.
1284         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1285         variables here.
1286         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1287         non-iterator variables.
1288
1289 2005-06-05  Martin Baulig  <martin@ximian.com>
1290
1291         * statement.cs (Foreach.TemporaryVariable): Create the
1292         LocalBuilder in the Emit phase and not in Resolve since in some
1293         situations, we don't have an ILGenerator during Resolve; see
1294         2test-19.cs for an example.
1295
1296 2005-06-04  Martin Baulig  <martin@ximian.com>
1297
1298         **** Merged r45395 from GCS ****
1299
1300         The big Foreach rewrite - Part II.
1301
1302         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1303         with `PropertyInfo ienumerator_getcurrent'.
1304
1305         * codegen.cs (VariableStorage): Removed.
1306
1307         * statement.cs
1308         (Foreach): Derive from Statement, not ExceptionStatement.
1309         (Foreach.CollectionForeach): New nested class.  Moved all the code
1310         dealing with collection foreach here.
1311         (Foreach.ForeachHelperMethods): Removed.
1312         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1313
1314 2005-05-23  Martin Baulig  <martin@ximian.com>
1315
1316         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1317         don't need to.  Fix #75014.
1318
1319 2005-05-20  Martin Baulig  <martin@ximian.com>
1320
1321         Merged r44808 from GMCS.
1322
1323         * class.cs (TypeContainer.CircularDepException): Removed.
1324         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1325         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1326         (CS0146) and interface (CS0529) dependencies here.
1327
1328 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1329
1330         * expression.cs (Invocation.EmitCall): Fix initialization
1331         'this_call' to reflect current behaviour.  Fix indentation.
1332
1333         * convert.cs (FindMostEncompassedType): Add two trivial special
1334         cases (number_of_types == 0 || number_of_types == 1).
1335         (FindMostEncompasingType): Likewise.
1336
1337 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1338
1339         Some cleanups preparing for the fix of #75283.
1340         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1341         error testing.
1342         (EventExpr.InstanceResolve): Likewise.
1343         (EventExpr.DoResolve): Remove redundant checks.
1344
1345 2005-06-10  Duncan Mak  <duncan@novell.com>
1346
1347         * cs-tokenizer.cs (process_directives): New flag for controlling
1348         the processing of preprocessor directives.
1349         (x_token): After seeing a '#', return Token.NONE instead of going
1350         to handle_preprocessing_directive() when not processing
1351         directives. This avoids unnecessary processing during the token peek in
1352         is_punct().
1353
1354         This fixes #74939.
1355
1356         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1357         the existing error reporting methods instead of Report.Error.
1358
1359         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1360         after Raja's rewrite.
1361
1362 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1363
1364         * class.cs: Small fix.
1365
1366 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1367
1368         Fix #75160.
1369         * class.cs (GetPartialBases): Fix return value check of
1370         part.GetClassBases.
1371
1372 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1373
1374         Ensure that partial classes are registered in their enclosing
1375         namespace.  Initial part of fix of #75160.
1376         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1377         Register declspace with namespace here, not in
1378         DeclSpace.RecordDecl.
1379         * cs-parser.jay: Pass namespace to RecordDecl.
1380         * class.cs (PartialContainer.Create): Likewise.
1381         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1382         called.
1383         * decl.cs (Declspace.RecordDecl): Remove.
1384         * namespace.cs (NamespaceEntry.DefineName): Remove.
1385
1386 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1387
1388         * rootcontext.cs: Reset TargetExt as well.
1389
1390 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1391
1392         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1393         -langversion:ISO-1.
1394
1395 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1396
1397         Fix #75080, cs0119.cs.
1398         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1399         of ...
1400         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1401         allowing ExprClass.Type and ExprClass.Namespace for
1402         ResolveFlags.VariableOrValue.
1403         (Expression.Resolve) [1-argument variant]: Change default resolve
1404         flags based on language version.
1405         (Expression.Error_UnexpectedKind): Use a simple string array
1406         rather than an ArrayList.
1407         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1408         not ExprClass.Type.
1409         (TypeOfVoid.DoResolve): Likewise.
1410         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1411         flags argument -- it always has the same value.
1412
1413 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1414
1415         Fix #75081.
1416         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1417         Use it in the error message.
1418         * assign.cs, expression.cs, statement.cs: Update.
1419
1420 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1421
1422         Fix #75088.
1423         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1424         the "almostMatchedMember" case too.
1425         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1426         that failed the accessibility checks to 'almost_match'.
1427
1428 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1429
1430         * attribute.cs: Use internal MethodBuilder methods to set
1431         ExactSpelling and SetLastError on PInvoke methods, instead
1432         of passing them via charset.  Fixes #75060.
1433
1434 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1435
1436         * parameter.cs (Parameter): Remove TODO comment.
1437         (Parameter.DefineParameter): Remove Location parameter.
1438         (Parameters.LabelParameters): Likewise.
1439         * class.cs (Constructor.Emit): Update to change.
1440         (MethodData.Emit): Likewise.
1441         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1442         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1443
1444 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1445
1446         * parameter.cs,
1447           Removed Parameters.Location and added Parameter.Location instead.
1448           Removed Location parameter from Emit() and GetSignature().
1449         * anonymous.cs,
1450           class.cs,
1451           cs-parser.jay,
1452           delegate.cs,
1453           iterators.cs,
1454           statement.cs :
1455           Modified all related calls.
1456
1457 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1458
1459         Improve user-defined conversion handling.
1460         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1461         applicable operators.
1462         (AddConversionOperators): New.  Helper for GetConversionOperators.
1463         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1464         there is only one most encompassed/encompassing type.
1465         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1466         "applicable operator" handling.
1467         (UserConversion): Move cache here from GetConversionOperators.
1468         Directly cache the chosen operator, rather than the whole
1469         MethodGroup.
1470         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1471         case.  Allow conversion of decimal to sbyte and byte too.
1472         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1473         New static methods.  Used to avoid allocating EmptyExpressions in
1474         convert.cs.
1475
1476 2005-05-24  Duncan Mak  <duncan@novell.com>
1477
1478         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1479         another class, used in Convert.ExplicitNumericConversion.
1480         (CastToDecimal): New class, similar to above, but casts to
1481         System.Decimal, used in Convert.ImplicitNumericConversion and also
1482         in explicit convesion from double/float to decimal.
1483
1484         * convert.cs (ImplicitNumericConversion): Handle implicit
1485         conversions to System.Decimal.
1486         (ExplicitNumericConversion): handle explicit conversions to
1487         System.Decimal.
1488
1489         This fixes #68711.
1490         
1491 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1492
1493         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1494         know the type at this stage, just break through.   Fixes #75008 
1495
1496 2005-05-19  Martin Baulig  <martin@ximian.com>
1497
1498         * delegate.cs
1499         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1500         to disable error reporting.
1501
1502         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1503         here since we don't want to report an error; see the new test-336.cs.
1504
1505 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1506
1507         * statement.cs (ToplevelBlock.GetParameterReference)
1508         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1509         Move here from class Block.
1510         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1511         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1512
1513 2005-05-18  Martin Baulig  <martin@ximian.com>
1514
1515         Fix #74978.
1516
1517         * flowanalysis.cs
1518         (FlowBranching.Reachability): Add non-static public And() and Or()
1519         methods.
1520         (FlowBranchingSwitch): New class; do the `break_origins' thing
1521         like in FlowBranchingLoop.
1522         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1523         reachability, not just locals and parameters.
1524         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1525         switch; MergeBreakOrigins() now takes care of that.
1526
1527 2005-05-18  Martin Baulig  <martin@ximian.com>
1528
1529         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1530         a loop and may leave it, reset the barrier; fixes #74974.
1531
1532 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1533         
1534         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1535         is back.
1536         
1537         * cs-parser.jay: Catch more lexical errors.
1538         
1539         * report.cs: Add one more Error method.
1540         
1541         * rootcontext.cs,
1542         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1543
1544 2005-05-17  Martin Baulig  <martin@ximian.com>
1545
1546         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1547         #70970. 
1548
1549 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1550
1551         Fix test-382.cs.  Emit values of decimal constants.
1552         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1553         Carved out of ...
1554         (TypeContainer.AddField): ... this.
1555         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1556         with initializers to include 'Const's.
1557         (ClassPart.RegisterFieldForInitialization): Forward to
1558         PartialContainer.
1559         * const.cs (Const.Const): Pass initializer to base class.
1560         (Const.Define): In case of decimal constants, register them for
1561         initialization in a static constructor.
1562
1563 2005-05-14  Martin Baulig  <martin@ximian.com>
1564
1565         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1566         do not call ResolveUnreachable() on unreachable statements in
1567         here, see the comment in the source code.
1568
1569 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1570
1571         Fix #74934.
1572         * expression.cs (BinaryResolveOperator): If one of the operands of
1573         an equality comparison is 'null' and the other is a pointer type,
1574         convert the null to a NullPointer.
1575         * convert.cs (ImplicitReferenceConversion): If the expression is a
1576         NullLiteral and the target type is a pointer type, return a
1577         NullPointer instead.
1578         (ImplicitConversionStandard): Likewise.
1579
1580 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1581         
1582         * cs-parser.jay: Set readonly context based on special constructs.
1583         
1584         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1585         readonly variable error handling.
1586         
1587         * rootcontext.cs (EmitCode): Don't verify members when error
1588         occurred.
1589         
1590         * statement.cs (LocalInfo): Add reaodnly context information.
1591         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1592
1593 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1594
1595         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1596         for #74041 to initialize 'resolved' to false only for explicit
1597         blocks.  Fixes #74873.
1598
1599 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1600
1601         Fix #74920.
1602         * typemanager.cs (unmanaged_enclosing_types): New.
1603         (IsUnmanagedType): Avoid infloops by using
1604         'unmanaged_enclosing_types' to talk with recursive invocations.
1605
1606 2005-05-13  Martin Baulig  <martin@ximian.com>
1607
1608         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1609         instance variable, not a local.  Fix #74873.
1610         (Block.ResolveUnreachable): Set it to true here.
1611
1612 2005-05-11  Duncan Mak  <duncan@novell.com>
1613
1614         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1615         continuing to process for 'arg'.
1616         (handle_preprocessing_directive): Check the argument of the #endif
1617         directive and report error CS1025 if there are any trailing
1618         characters.
1619
1620         According to the C# spec, having even whitespace after the #endif
1621         directive is illegal; however, because we call arg.TrimEnd ()
1622         beforehand, we have the same behavior as csc, allowing whitespace
1623         after the directive.
1624
1625         Fixes #74892.
1626
1627 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1628
1629         Fix #74863.
1630         
1631         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1632         (Constructor.GetObsoleteAttribute): Implemented correctly.
1633
1634 2005-05-10  Martin Baulig  <martin@ximian.com>
1635
1636         * support.cs (ReflectionParameters.ParameterModifier): Use
1637         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1638         and `ParameterAttributes.In'.  Fixes #74884.
1639
1640 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1641
1642         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1643         
1644         * expression.cs (Argument.GetParameterModifier): Turned to property.
1645         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1646         
1647         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1648         its C# equivalent.
1649         
1650 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1651
1652         Fix #74852.
1653         * decl.cs (MemberCache.AddMethods): Register override methods,
1654         rather than non-override methods.
1655         * typemanager.cs (RegisterOverride): New.
1656         (IsOverride): Update.
1657
1658 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1659
1660         Fix #73105.
1661         
1662         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1663         recursive declaration.
1664         
1665         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1666         
1667 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1668
1669         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1670         
1671         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1672
1673 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1674
1675         Fix #74797.
1676         * decl.cs (DeclSpace.FamilyAccessible): 
1677         Use TypeManager.IsNestedFamilyAccessible.
1678
1679         Fix reopened #64812.
1680         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1681         internal'.
1682
1683 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1684             Abin Thomas  <projectmonokochi@rediffmail.com>
1685             Anoob V E  <projectmonokochi@rediffmail.com>
1686             Harilal P R  <projectmonokochi@rediffmail.com>
1687
1688         Fix #64812.
1689         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1690         allow access to all static members.
1691
1692 2005-05-04  Martin Baulig  <martin@ximian.com>
1693
1694         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1695
1696 2005-05-04  Martin Baulig  <martin@ximian.com>
1697
1698         Fix #74655.
1699
1700         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1701         section at the end; make things work if `default' is not the last
1702         section.        
1703
1704 2005-05-04  Martin Baulig  <martin@ximian.com>
1705
1706         Fix #70400.
1707
1708         * statement.cs (Switch): Replaced the `got_default' field with a
1709         `default_section' one.
1710         (Switch.CheckSwitch): Set `default_section' here.
1711         (Switch.Resolve): If we're a constant switch and the constant is
1712         not found, use the default section.
1713
1714 2005-05-03  Martin Baulig  <martin@ximian.com>
1715
1716         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1717
1718         * statement.cs (Foreach.ArrayForeach): New nested class.
1719         (Foreach.TemporaryVariable): New nested class.
1720         (Foreach.EmitArrayForeach): Removed; this is now in the new
1721         ArrayForeach class.
1722
1723 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1724
1725         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1726         more conservative.
1727         (VerifyPendingMethods): Revert change below.
1728
1729         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1730         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1731         that used to trigger warning -28.  Remove warning -28.
1732         * expression.cs (Invocation.OverloadResolve): Use
1733         TypeManager.IsOverride to distinguish override methods.
1734
1735         Fix #74773.
1736         * pending.cs (VerifyPendingMethods): If a base type implements the
1737         requested interface, don't bother checking individual methods of
1738         the base type.  As a side-effect, this prevents the creation of
1739         unnecessary proxies.
1740
1741 2005-05-02  Martin Baulig  <martin@ximian.com>
1742
1743         Fix #70182.
1744
1745         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1746         Also `And' the locals if the old vector is null.
1747         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1748         null; in this case we basically reset all the variables.        
1749
1750 2005-05-02  Martin Baulig  <martin@ximian.com>
1751
1752         Fix #74529.
1753
1754         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1755         Added `FlowBranching branching' argument; always `and' the
1756         variables instead of `or'ing them unless we're an infinite loop.
1757
1758         * statement.cs (While.Resolve): Create a new sibling unless we're
1759         infinite.       
1760
1761 2005-05-02  Martin Baulig  <martin@ximian.com>
1762
1763         Fix #70140.
1764
1765         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1766         arguments; use it instead of creating a new TopLevelBlock.
1767         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1768         our ConstructorInitializer.
1769
1770         * statement.cs
1771         (TopLevelBlock.TopLevelBranching): New public property.
1772         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1773         and create our `TopLevelBranching'.
1774
1775         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1776         anonymous method host, use `block.TopLevelBranching' rather than
1777         creating a new branching.
1778
1779 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1780
1781         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1782         a ScopeInfo, if any of the current children is a child of the new
1783         entry, move those children there.
1784
1785 2005-04-30  Martin Baulig  <martin@ximian.com>
1786
1787         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1788         at the beginning of a SwitchSection.  Fix #73335.
1789
1790 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1791
1792         Fix #74378
1793         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1794         
1795         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1796         (FieldExpr.DoResolve): Obsolete members are ignored for field
1797         initializers.
1798         
1799 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1800
1801         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1802         of arrays detection.
1803
1804         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1805         verification.
1806         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1807
1808         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1809         arrays report.
1810
1811 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1812
1813         * cs-parser.jay: Use the prefered version of -unsafe in error
1814         message.
1815
1816 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1817
1818         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1819         circumstances.
1820
1821 2005-04-20  John Luke  <john.luke@gmail.com>
1822
1823         * driver.cs: fix typo in error message, --outout to --output
1824
1825 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1826
1827         * codegen.cs (InRefOutArgumentResolving): New field.
1828         
1829         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1830         fields outside contructor.
1831         
1832         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1833         
1834 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1835
1836         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1837         parameter code was not completed ever, so it was not as up-to-date
1838         as local variables.  Must finish it.
1839
1840         The bug fix was to compare the Toplevel of the block, not the
1841         current block.  Thanks for Ben for pointing this out. 
1842
1843 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1844
1845         * decl.cs (AddMethods): Use the declaring type of the problem
1846         method to determine if we want to squash a warning.
1847
1848 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1849
1850         * attribute.cs: Removed debug output.
1851
1852         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1853         
1854         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1855         Report.Stderr.
1856         
1857 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1858
1859         Fix #74481.
1860         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1861         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1862         all null comparisons against reference types.
1863
1864 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1865
1866         Fix# 74565
1867         * class.cs (TypeContainer.CircularDepException) New nested
1868         exception class.
1869         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1870         (TypeContainer.DefineType): Removed error, reset InTransit before
1871         exit.
1872         (Class.DefineType): Throw exception when is in Transit.
1873         Catch exception and report error.
1874         (Struct.DefineType): Throw exception when is in Transit.
1875         Catch exception and report error.
1876         (Interface.DefineType): Throw exception when is in Transit.
1877         Catch exception and report error.
1878
1879         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1880         handle nested exception handlers.
1881
1882         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1883         a catch.
1884
1885         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1886         InFinally and InCatch storage.
1887
1888         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1889         (Catch.Resolve): Set and Restore ec.InCatch.
1890         (Try.Resolve): Set and Restore ec.InFinally.
1891         (Try.HasCatch): True when try has catch.
1892
1893 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1894
1895         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1896           for the same event member, so exclude such cases from warning 419.
1897           Fixed bug #74633.
1898
1899 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1900
1901         * expression.cs (Binary.ResolveOperator): Apply patch from John
1902         Luke to fix bug 59864: operators &, | and ^ on enumerations
1903         require that the same enum type on both sides.
1904
1905         * driver.cs: Add warnings to old flag usage, this is to assist
1906         people who produce Makefiles and hope that the Makefiles will be
1907         used on Windows.
1908
1909         * class.cs (TypeContainer.EmitType): Moved the definition of the
1910         special $PRIVATE$ field from the resolve phase to the Emit phase.
1911         During resolve we do not know if we are a struct with
1912         HasExplicitLayout, we know this only after the attributes for the
1913         type are emitted.
1914
1915         Set the FieldOffset to zero on the dummy field that we create for
1916         the class.   Fixes 74590.
1917
1918 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1919
1920         Fix #73834.
1921         * ecore.cs (PropertyExpr.resolved): New.
1922         (DoResolve): Use it to handle a case of double resolution here.
1923         Handle a case of identical-name-and-type-name.
1924         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1925         resolution by storing the results of expression resolution back
1926         into the "probes" array.
1927
1928 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1929
1930         Fix cs0208-7.cs and cs0208-8.cs.
1931         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1932         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1933         error reporting to point out the reason a struct is not unmanaged.
1934
1935 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1936
1937         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1938           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1939
1940 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1941
1942         Fix #74528.
1943         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1944         IdenticalNameAndTypeName here.
1945         (EventExpr.InstanceResolve): Likewise.
1946
1947 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1948
1949         C# 2.0 DefaultCharSetAttribute implementation
1950         
1951         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1952         which allows us to set GlobalNamespace for every resolve.
1953         (Attribute.ResolveArguments): Cut from Resolve.
1954         (Attribute.GetCharSetValue): Returns CharSet named argument.
1955         (Attribute.DefinePInvokeMethod): Gets default charset from
1956         module settings.
1957         (GlobalAttribute.ResolveAsTypeStep): Override.
1958         (GlobalAttribute.ResolveArguments): Override.
1959         
1960         * class.cs (TypeAttr): Is protected.
1961         
1962         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1963         (ModuleClass.DefaultCharSetType): New memeber.
1964         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1965         
1966         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1967         charset from module.
1968         
1969         * delegate.cs (TypeAttr): Override.
1970         (Delegate.DefineType): Use this TypeAttr.
1971         
1972         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1973         at very early stage (before types are defined) to resolve model
1974         module attributes. It will probably not work with corlib but it
1975         should be ok.
1976         
1977         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1978         charset from module.
1979         
1980         * typemanager.cs (default_charset_type): New type.
1981
1982 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1983
1984         * decl.cs (MemberCache.AddMethods): Don't warn if
1985         System.Object.Finalize has buggy MethodAttributes.
1986
1987         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1988         removed below.
1989
1990 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1991
1992         * doc.cs : detect ambiguous reference to overloaded members.
1993           Fixed bug #71603. MS 1.1 csc does not detect it.
1994
1995 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1996
1997         * doc.cs : delegates must not be referenced with parameters.
1998           Fixed bug #71605.
1999
2000 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2001
2002         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2003
2004 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2005
2006         * driver.cs (MainDriver): Stop processing if the CLS stage found
2007         errors. 
2008
2009         (CompilerCallableEntryPoint.InvokeCompiler): Always
2010         reset after execution;   Take a TextWriter argument for the
2011         output.
2012
2013         * report.cs: Use the error stream instead of hardcoding stderr. 
2014
2015 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2016
2017         * class.cs: Reduce code paths to test, too small of an
2018         optimization to make it worth the extra testing.  Always perform
2019         it. 
2020
2021 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2022
2023         Fix #74510.
2024         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2025         operators that had errors reported on them.
2026
2027 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2028
2029         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2030         argument types.
2031         (Attribute.Resolve): Add named argument type checking.
2032         
2033         * class.cs (FixedField.Define): Use IsPrimitiveType
2034         
2035         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2036         
2037         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2038         unsafe parameter types.
2039         
2040         * statement.cs (Using.ResolveExpression): Add better error description.
2041         
2042         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2043         
2044 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2045
2046         Fix #74484.
2047         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2048         AttributeUsageAttribute in the emitcontext of the attribute class,
2049         not in the emitcontext of the attributable entity it was attached to.
2050         * cs-parser.jay: Use 'current_class', not 'current_container',
2051         when creating a GlobalAttribute.
2052
2053 2005-04-08  Alp Toker  <alp@atoker.com>
2054
2055         * pending.cs: The fix to #58413 failed to compile methods implementing
2056         interfaces with/without params modifiers and vice versa, even though
2057         params modifiers aren't part of the signature. Make the modifier check
2058         less strict as in csc.
2059
2060 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2061             Anoob V E  <projectmonokochi@rediffmail.com>
2062             Harilal P R  <projectmonokochi@rediffmail.com>
2063
2064         Fix #58413.
2065         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2066         modifiers of pending methods.
2067         (PendingImplementation.PendingImplementation): Initialize it.
2068         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2069         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2070         with ParameterData.  Add check for modifiers.
2071         * class.cs (MethodData.Define): Update to changes.
2072
2073 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2074
2075         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2076
2077 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2078
2079         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2080         property.
2081         
2082         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2083         
2084         * rootcontext.cs,
2085         * typemanager.cs: Registered RequiredAttributeAttribute.
2086         
2087 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2088
2089         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2090         Warning CS0169 is back at level 3.
2091         (IMethodData.SetMemberIsUsed): New method.
2092         
2093         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2094         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2095         
2096         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2097
2098         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2099         contants.
2100         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2101         is used.
2102         
2103         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2104         is used.
2105         
2106         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2107         to avoid the problems with nested types.
2108
2109 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2110             Anoob V.E  <projectmonokochi@rediffmail.com>
2111             Harilal P.R  <projectmonokochi@rediffmail.com>
2112             Raja R Harinath  <rharinath@novell.com>
2113
2114         Fix #73820.
2115         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2116         attribute.
2117         * typemanager (GetConstructor): Make public.
2118
2119 2005-04-05  John Luke  <john.luke@gmail.com>
2120             Raja R Harinath  <rharinath@novell.com>
2121
2122         Fix #62232.
2123         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2124         struct too.  Return false quicker in a few cases.
2125         (VerifyUnManaged): Use it.
2126
2127 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2128
2129         Fix #74041.
2130         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2131         not 'unreachable_seen'.
2132
2133 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2134
2135         * attribute.cs (Attribute.GetValue): Removed unused.
2136         
2137         * codegen.cs (CodeGen.TrimExt): Removed unused.
2138         
2139         * cs-parser.jay (output): Removed unused.
2140         
2141         * cs-tokenizer.cs (hex_digits): Removed unused.
2142         
2143         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2144         
2145         * expression.cs (Indirection.LoadExprValue): Removed unused.
2146         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2147         
2148         * iterators.cs (Iterator.param_types): Removed unused.
2149         
2150         * statement.cs (Goto.block): Removed unused.
2151         (ToplevelBlock.did): Removed unused.
2152         (Switch.ResolveConstantSwitch): Removed unused.
2153
2154 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2155
2156         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2157         resetting thingy.
2158
2159 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2160
2161         Fix #74232 and cs0208-3.cs.
2162         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2163         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2164         unmanaged type.  Don't use FieldBuilders when 't' is a
2165         TypeBuilder.  Use ModFlags and MemberType fields.
2166         * class.cs (MemberBase.member_type): Rename from MemberType.
2167         (MemberBase.MemberType): New property.  Determines member_type on
2168         demand.
2169         (MemberBase.DoDefine): Don't initialize MemberType here.
2170         (FieldMember.Define): Likewise.
2171
2172 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2173
2174         Fix #74241
2175         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2176         Attributes are emitted there.
2177         
2178 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2179
2180         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2181         keyword in 'partial enum' too.
2182         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2183         is not allowed).
2184         Report from Kamil Skalski <nazgul@omega.pl>.
2185
2186         Fix #74309.
2187         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2188         have partial containers too.
2189
2190         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2191         in block' checks to Block.CheckInvariantMeaningInBlock.
2192         * statement.cs (Block.GetKnownVariableInfo): Make private.
2193         (Block.IsVariableUsedInChildBlock): Remove.
2194         (Block.IsVariableUsedInBlock): Likewise.
2195         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2196         conflicting declaration.
2197         (Block.AddVariable): Make error messages less long-winded and more
2198         specific.  Show location of conflicting declaration.
2199         * parameter.cs (Parameters.Location): New readonly property.
2200
2201 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2202
2203         Clean up semantics of invoking ResolveMemberAccess.
2204         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2205         can have an instance, ensure that we pass in a non-TypeExpression
2206         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2207         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2208         argument.  Update to changes and simplify.
2209         (FieldExpr.Emitinstance): Remove CS0120 check.
2210         (PropertyExpr.EmitInstance): Likewise.
2211         * expression.cs (Argument.Resolve): Likewise.
2212         (Invocation.DoResolve): Update to changes in semantics of
2213         InstanceExpression.
2214
2215 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2216
2217         Fix #74241
2218         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2219         customization.
2220         
2221         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2222
2223 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2224
2225         Fix difference in behaviour with commandline invocation.
2226         * driver.cs (Driver.Reset): New.
2227         (CompilerCallableEntryPoint): Call it.
2228
2229         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2230         variable" warnings if the boolean expression failed to resolve.
2231
2232 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2233
2234         * attribute.cs: Fix the union of several permissions when some of them
2235         are unrestricted (so the result isn't an unrestricted permission set).
2236         Fix #74036.
2237
2238 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2239
2240         * ecore.cs (MemberExpr): New class.  Convert from interface
2241         IMemberExpr.
2242         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2243         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2244         error checks.
2245         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2246         (MethodGroupExpr.IsExplicitImpl): Remove.
2247         (Expression.GetFieldFromEvent): Remove.
2248         (SimpleName.MemberStaticCheck): Remove.
2249         (SimpleName.DoSimpleNameResolve): Update to changes.
2250         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2251         (MemberAccess.IdenticalNameAndTypeName): Remove.
2252         (MemberAccess.error176): Move to MemberExpr.
2253         (MemberAccess.DoResolve): Update to changes.
2254         (BaseAccess.DoResolve): Likewise.
2255
2256 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2257
2258         C# 2.0 Conditional attribute class implementation
2259         
2260         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2261         Analyzes class whether it has attribute which has ConditionalAttribute
2262         and its condition is not defined.
2263         
2264         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2265         (Class.IsExcluded): New method. Search for at least one defined
2266         condition in ConditionalAttribute of attribute class.
2267
2268 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2269
2270         * ecore.cs (PropertyExpr): Derive from Expression, not
2271         ExpressionStatement.
2272         (PropertyExpr.EmitStatement): Remove.
2273
2274 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2275
2276         Fix #74060.
2277         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2278         internal field "value__" of an enum be private.  The examples for
2279         "value__" that I found on MSDN all used FieldAttributes.Private.
2280
2281         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2282         Don't mention IL method attribute names.
2283
2284         Fix #47991.  Remove a TODO.
2285         * statement.cs (Block.Toplevel): Make into a field.
2286         (Block.Parameters): Move into ToplevelBlock.
2287         (Block.known_variables): Rename from child_variable_names.
2288         (Block.Block): Remove variants that take Parameters.  Initialize
2289         'Toplevel' with the immediately surrounding toplevel block.
2290         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2291         LocalInfo parameter.
2292         (Block.GetKnownVariableInfo): New.
2293         (Block.IsVariableNameUsedInChildBlock): Update.
2294         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2295         the block, even though it may not be in scope.
2296         (Block.AddVariable): Remove Parameters parameter.  Use
2297         Toplevel.Parameters instead.
2298         (Block.AddConstant): Remove Parameters parameter.
2299         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2300         (Block.IsParamaterReference): Likewise.
2301         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2302         (ToplevelBlock.Parameters): New.  Moved from Block.
2303         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2304         initialize Parameters to a non-null value.
2305         * cs-parser.jay: Update to changes.
2306         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2307         simple names that mean different things in the same block.  Use
2308         Block.IsVariableNameUsedInBlock.
2309
2310 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2311
2312         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2313         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2314         GetTypeHandle.  It is possible for a reflected type to derive from
2315         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2316         System.Array during mscorlib compilation).
2317         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2318         contain a method_hash, don't create one either.  Don't create a
2319         deep copy of the base cache's method_hash.
2320         (MemberCache.SetupCache): Rename back from DeepCopy.
2321         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2322         already initialized.  If we see an override function, add its
2323         underlying base virtual function to the member_hash too.
2324
2325         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2326
2327 2005-03-26  Raja R Harinath  <harinath@acm.org>
2328
2329         Fix #73038.
2330         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2331         fails to resolve, ensure that the LHS is still resolved as an
2332         lvalue.
2333
2334 2005-03-25  Raja R Harinath  <harinath@acm.org>
2335
2336         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2337         ec.ContainerType.
2338         (Enum.current_ec): Remove.
2339         (Enum.LookupEnumValue): Remove EmitContext argument.
2340         Just uses the one created during DefineType.
2341         (Enum.FindMembers): Update.
2342         * expression.cs (MemberAccess.DoResolve): Update.
2343
2344 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2345
2346         * assign.cs (Assign.DoResolve): Check for CS1717 when
2347         source and target are same (uses Equals).
2348
2349         * expression.cs (LocalVariableReference, ParameterReference,
2350         This): Implemented Equals, GetHashCode.
2351
2352         * statement.cs (Block.GetParameterReference): Removed useless
2353         local variable.
2354
2355 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2356
2357         Fix cs0128.cs
2358         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2359         blocks before deciding whether the error is cs0136 or cs0128.
2360
2361         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2362         (using_alias_directive, using_namespace_directive): Pass
2363         MemberName, not an expression to Namespace.UsingAlias and
2364         Namespace.Using.
2365         (MakeName): Use the MemberName of the namespace.
2366         * namespace.cs (Namespace.MemberName): New.
2367         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2368         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2369         Likewise.
2370         * decl.cs (MemberName.Name): Make readonly.
2371         (MemberName.FromDotted): New "constructor".
2372         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2373         (MemberCore.Name): Compute from MemberName on demand.
2374         (MemberCore.SetMemberName): Provide a way to change the
2375         MemberName.
2376         (MemberCore.AddToContainer): Don't take a fullname parameter.
2377         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2378         fully qualified name of the container to the member name.
2379         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2380         only if the type is a member of the root container.
2381         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2382         MemberName.Left rather than searching for an embedded ".".
2383         (PartialContainer.CreatePart): Update to changes in RootContext.
2384         (MemberBase.ShortName): Turn into a property.  Use
2385         MemberCore.SetMemberName.
2386         (MemberBase.ExplicitInterfaceName): Remove.
2387         (MemberBase.UpdateMemberName): Remove.
2388         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2389         (PropertyBase.SetMemberName): New override.
2390         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2391         (Tree.GetDecl): New.
2392         (Tree.AllDecls): Rename from Decls.
2393         * attribute.cs, enum.cs, report.cs: Update to changes.
2394         * driver.cs (MainDriver): Use MemberName.FromDotted on
2395         RootContext.MainClass.
2396
2397 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2398
2399         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2400         checks.
2401
2402         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2403
2404 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2405
2406         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2407         property accessor modifiers.
2408
2409         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2410         fixed buffer attribute (CS1716).
2411         (PropertyMethod.HasCustomAccessModifier): When property accessor
2412         has custom modifier.
2413
2414         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2415         modifiers.
2416         (PropertyExpr.DoResolveLValue): Add CS0272.
2417
2418 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2419
2420         * convert.cs: When converting to a pointer, use the proper Conv.U
2421         or Conv.I depending on the source data type.
2422
2423         * cs-tokenizer.cs: Make the size for large decimal constants,
2424         fixes #72957.
2425
2426 2005-03-17  Martin Baulig  <martin@ximian.com>
2427
2428         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2429         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2430
2431 2005-03-17  Martin Baulig  <martin@ximian.com>
2432
2433         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2434         to bool so we can return an error condition.
2435         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2436         returned an error.
2437
2438 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2439
2440         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2441         attributes.
2442
2443 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2444
2445         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2446         Refactor to avoid traversing the list of assemblies, and to avoid
2447         string concatenation.
2448         * typemanager.cs (guid_attr_type): Remove.
2449         (negative_hits, pointers, references): Remove hashes.
2450         (type_hash): New.
2451         (GetConstructedType): New.  Uses type_hash to handle constructed
2452         types (arrays, references, pointers).
2453         (GetReferenceType, GetPointerType): Use it.
2454         (GetNestedType): New.  Uses type_hash to handle nested types of
2455         reflected types.
2456         (LookupType, LookupTypeDirect): Remove.
2457         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2458         'types' hash and LookupTypeReflection directly.
2459         (params_string, params_object): Use GetConstructedType.
2460         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2461         top-level types.
2462         (Namespace.Lookup): Use cached_types.
2463         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2464         provided by old TypeManager.LookupType.
2465         * rootcontext.cs (MakeFQN): Remove.
2466         * decl.cs (DeclSpace.MakeFQN): Likewise.
2467         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2468         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2469         TypeManager.GetConstructedType.
2470         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2471
2472 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2473
2474         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2475         indexers.
2476
2477         * cs-parser.jay: Reports CS1527 for any namespace element.
2478
2479         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2480         Added CS0407.
2481
2482         * expression.cs (ParameterReference.IsAssigned): Changed error to
2483         CS0269.
2484         (Error_WrongNumArguments): Moved CS0245 detection here.
2485
2486         * statement.cs (Return.Resolve): Add CS1622 report.
2487
2488 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2489
2490         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2491
2492 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2493
2494         * attribute.cs expression.cs: Get rid of some allocations.
2495
2496 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2497
2498         * doc.cs : just eliminate the latest change.
2499
2500 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2501
2502         * doc.cs : commented out the latest change. It breaks xml-030.cs
2503
2504 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2505
2506         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2507           fail. So invoke CreateType() in FindDocumentedType().
2508
2509 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2510
2511         * cs-tokenizer.cs : added IsKeyword().
2512         * doc.cs : Detect keyword incorrectly used as identifier.
2513           Allow identifiers prefixed by @.
2514
2515 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2516
2517         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2518         It caused exception in namespace resolving (again!).
2519         
2520         * class.cs (Class.ctor): Removed exit.
2521         (PropertyMethod.ctor): ditto.
2522         
2523         * codegen.cs (Codegen.Reset): Reset static data.
2524         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2525         
2526         * cs-tokenizer.cs (Cleanup): Removed.
2527         
2528         * driver.cs (GetSystemDir): Rewrote to one line command.
2529         It caused problem with unloaded dynamic modules.
2530         (UnixParseOption): Removed Exit.
2531         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2532         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2533         Now can be mcs used as library.
2534         
2535         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2536         empty location.
2537         
2538         * location.cs (Reset): Reset static data.
2539         
2540         * namespace.cs (Reset): Reset static data.
2541         
2542         * report.cs (Report.Reset): Reset static data.
2543         
2544         * rootcontext.cs (RootContext.Reset): Reset static data.
2545         
2546         * tree.cs (RootTypes.ctor): Use Location.Null
2547         
2548         * typemanager.cs (TypeManager.Reset): Reset static data.
2549         (CoreLookupType): Removed Exit.
2550         (TypeHandle.Reset): Reset static data.
2551         
2552 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2553
2554         Fix #73516.
2555         * typemanager.cs (ComputeNamespaces): Import namespaces from
2556         referenced modules too.
2557
2558 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2559
2560         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2561         than '.'.
2562
2563 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2564
2565         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2566         enclosing DeclSpace.  This ensures that a name-lookup populates
2567         more caches and there are fewer 'TypeExpression's.  Carve out
2568         nested type lookup into ...
2569         (LookupNestedTypeInHierarchy): ... this.
2570
2571 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2572
2573         Clean up a few partial-class semantics.  
2574         Fixes test-357.cs and cs1618-2.cs.
2575         * cs-parser.jay (struct_declaration): Use 'current_class' as
2576         parent of newly-created struct.  Remove call to Register ().
2577         Use 'pop_current_class' to complete handing the current struct.
2578         (interface_declaration): Likewise.
2579         (class_declaration): Likewise.
2580         (enum_declaration): Use 'current_class' as parent of newly created
2581         enum.
2582         (delegate_declaration): Likewise.
2583         (pop_current_class): New function.  This is used to handle closing
2584         up the 'current_class' and 'current_container', and pointing them
2585         to the enclosing class/container.
2586         (CSharpParser): Initialize 'current_class' too.
2587         * decl.cs (MemberCore): Add check for invariant: a partial
2588         container is not a parsed entity, and thus does not enclose any
2589         parsed members.
2590         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2591         (DeclSpace.BaseTypeExpr): Use it.
2592         (DeclSpace.LookupType): Add check for invariant.
2593         * class.cs (TypeContainer): Add check for invariant: a nested
2594         class should have the same NamespaceEntry as its enclosing class.
2595         (TypeContainer.EmitFieldInitializers): Make virtual.
2596         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2597         MemberCore.
2598         (TypeContainer.Register): Remove.
2599         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2600         null.  Use TypeResolveEmitContext for resolving base types and
2601         interfaces.  Move initialization of Parts.TypeBuilder here from
2602         ...
2603         (TypeContainer.DefineNestedTypes): ... here.
2604         (PartialContainer): Take a Namespace not a NamespaceEntry.
2605         (PartialContainer.Create): Don't use Register.  Call the
2606         appropriate Add... function directly.
2607         (ClassPart): Take both the PartialContainer and the enclosing
2608         class as constructor arguments.
2609         (ClassPart.EmitFieldInitializers): Override.
2610         (ClassPart.PartFindNestedTypes): Remove.
2611         (FieldBase.GetInitializerExpression): Resolve the initializer
2612         expression in the emit context of the enclosing class.
2613         * tree.cs (RootTypes): Remove Register ().
2614         
2615 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2616
2617         * cs-parser.jay: Removed CS0134.
2618         
2619         * driver.cs: Removed CS1901.
2620         
2621         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2622         for predefined types.
2623
2624 2005-03-07  Duncan Mak  <duncan@novell.com>
2625
2626         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2627         well. Fixes bug #73454.
2628
2629 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2630
2631         * cs-tokenizer.cs (xtoken): Add CS1035.
2632         
2633         * class.cs (MethodData.Define): Add CS0683.
2634         (FieldMember.ctor): Add CS0681.
2635
2636 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2637
2638         * ecore.cs (SimpleName.DoResolve): Rename from
2639         SimpleName.DoResolveAllowStatic.
2640         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2641         Pass 'intermediate' flag to MemberStaticCheck.
2642         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2643         of "intermediate" lookups via MemberAccess.
2644         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2645         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2646
2647 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2648
2649         Fix #73394.
2650         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2651         slipped in because of variable names that are identical to a
2652         builtin type's BCL equivalent ('string String;', 'int Int32;').
2653         (PropertyExpr.EmitInstance): Likewise.
2654
2655 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2656
2657         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2658         
2659         * report.cs (warning_ignore_table): Made public.
2660
2661 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2662
2663         Fix #73282.
2664         * class.cs (MethodData.Emit): Pass 'container' to
2665         container.GetObsoleteAttribute instead of 'container.Parent'.
2666
2667 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2668
2669         * cs-parser.jay: Add 1534 error test.
2670
2671         * iterators.cs (Yield.CheckContext): Add error 1629.
2672         (Iterator.ctor): Save unsafe modifier.
2673         (MoveNextMethod.DoEmit): Restore unsafe context.
2674
2675         * namespace.cs (UsingAlias): Better error message.
2676
2677 2005-03-03  Dan Winship  <danw@novell.com>
2678
2679         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2680         the warning message [#73219]
2681
2682 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2683
2684         Fix compile with MCS 1.0.0.0.
2685         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2686         w_restore to not depend on string constant folding.
2687
2688 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2689
2690         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2691         CS0246 check to users who passed 'silent = false'.
2692         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2693         check.
2694         (SimpleName.SimpleNameResolve): Update.
2695         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2696         (MemberAccess.IdenticalNameAndTypeName): Update.
2697         * doc.cs (FindDocumentedTypeNonArray): Update.
2698
2699 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2700
2701         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2702         * parameters.cs (ComputeAndDefineParameters): Remove.
2703         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2704         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2705         Use GetParameterInfo.
2706
2707 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2708
2709         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2710
2711 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2712
2713         Unify DeclSpace.LookupType and DeclSpace.FindType.
2714         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2715         is in charge of defining nested types on demand.
2716         (DeclSpace.LookupType): Use it when the current_type is a
2717         TypeBuilder.  Use LookupTypeDirect for reflected types.
2718         (DeclSpace.FindType): Remove.
2719         (DeclSpace.LookupInterfaceOrClass): Likewise.
2720         (DeclSpace.DefineTypeAndParents): Likewise.
2721         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2722         DeclSpace.LookupType.
2723         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2724         * typemanager.cs (LookupType): Simplify.
2725         (AddUserType): Remove type from negative_hits.
2726         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2727         * class.cs (TypeContainer.FindMembers): Move handling of nested
2728         types ...
2729         (TypeContainer.FindMembers_NestedTypes): ... here.
2730         (TypeContainer.FindNestedType): Implement override.
2731         (ClassPart.FindNestedType): Delegate to PartialContainer.
2732         (ClassPart.PartFindNestedType): Looks up the nested types of the
2733         part alone.
2734
2735 2005-03-02  Martin Baulig  <martin@ximian.com>
2736
2737         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2738         static constructor in static classes.
2739
2740 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2741
2742         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2743         sizeParamIndex is not specified.
2744
2745 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2746
2747         Fix #73117
2748         * report.cs (WarningMessage.IsEnabled): Missing null check.
2749
2750 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2751
2752         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2753         in the fields and not in the properties.
2754
2755 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2756
2757         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2758         fields as well.
2759
2760 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2761
2762         * attribute.cs: Small refactoring (improved robustness).
2763         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2764         (ValidateGuid): Removed.
2765         (Resolve): Removed referenced to above mentioned.
2766         (GetAttributeUsage): Made private and changed to work without
2767         class assistance.
2768         (GetIndexerAttributeValue): Don't crash.
2769         (GetConditionalAttributeValue): Ditto.
2770         (GetClsCompliantAttributeValue): Ditto.
2771         (ExtractSecurityPermissionSet): All attributes exceptions are
2772         error 648.
2773         (GetPropertyValue): New helper.
2774         (GetMethodImplOptions): New method.
2775         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2776         some missing properties.
2777         
2778         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2779         (Method.ApplyAttributeBuilder): Updated.
2780         
2781         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2782         exception.
2783
2784 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2785
2786         Fix #73052.
2787         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2788         non-simple types (array, pointer, reference).
2789
2790 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2791
2792         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2793
2794         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2795         for operators.
2796         (Method.CheckBase): Catch wrong destructor here.
2797         (MethodData.Define): Add errors 550, 668.
2798
2799         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2800
2801         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2802
2803         * pending.cs (VerifyPendingMethods): Add error 551.
2804
2805         * typemanager.cs (CSharpName): Next error report helper.
2806
2807 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2808
2809         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2810         attributes. Removed useless attribute double check.
2811         It saves almost 2MBs for corlib.
2812
2813 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2814
2815         Fix #72924.
2816         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2817         called twice in case of error.
2818
2819 2005-02-23  Chris Toshok  <toshok@ximian.com>
2820
2821         Fix compiler portions of #72827.
2822         * statement.cs (Block.Emit): call Begin/EndScope on the
2823         EmitContext instead of the ILGenerator.
2824
2825         * codegen.cs (EmitContext.BeginScope): new method, call
2826         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2827         we have one.)
2828         (EmitContext.BeginScope): same, but EndScope and CloseScope
2829
2830         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2831         offset and call the superclass's OpenScope(int) with it.
2832         (SymbolWriter.CloseScope): get the current il
2833         offset and call superclass's CloseScope(int) with it.
2834
2835 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2836
2837         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2838         CS1677 for out and ref as well.
2839
2840         * class.cs (Method.Define): Add error CS1599 detection.
2841         
2842         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2843         
2844         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2845         
2846         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2847         
2848         * support.cs.cs (ModifierDesc): New helper method.
2849
2850 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2851             Abin Thomas  <projectmonokochi@rediffmail.com>
2852             Anoob V E  <projectmonokochi@rediffmail.com>
2853             Harilal P R  <projectmonokochi@rediffmail.com>
2854
2855         Fix #57851, #72718.
2856         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2857         MemberLookup (used for error reporting) actually returns a result.
2858         Fix error report number (122, not 112).
2859
2860 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2861             Anoob V E  <projectmonokochi@rediffmail.com>
2862             Harilal P R  <projectmonokochi@rediffmail.com>
2863
2864         Fix #71134.
2865         * pending.cs (PendingImplementation.GetAbstractMethods):
2866         Find NonPublic members too.
2867
2868 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2869
2870         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2871         Fixed error 217.
2872         
2873         * class.cs (MethodCore.CheckMethodAgainstBase):
2874         Add error 239 report.
2875
2876 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2877
2878         Fix #68955.
2879         * expression.cs (Invocation.IsApplicable): Make public.
2880         (Invocation.IsParamsMethodApplicable): Likewise.
2881         * delegate.cs (Delegate.VerifyApplicability): Don't use
2882         Invocation.VerifyArgumentCompat for parameter applicability
2883         testing.  Use Invocation.IsApplicable and
2884         Invocation.IsParamsMethodApplicable.
2885
2886 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2887
2888         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2889         
2890         * class.cs (Operator.Define): Add error 217 report.
2891         
2892 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2893
2894         * namespace.cs (UsingEntry.Resolve): Undo change below.
2895
2896 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2897
2898         Fix #72756.
2899         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2900         disable the error message when the extended MemberLookup also
2901         fails.
2902         (Expression.MemberLookupFinal): Update.
2903         (SimpleName.DoSimpleNameResolve): Update.
2904         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2905         Don't use MemberLookupFinal.
2906         (New.DoResolve): Update.
2907         (BaseAccess.CommonResolve): Update.
2908
2909 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2910
2911         Fix #72732.
2912         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2913         occured previously, don't resolve again.
2914
2915 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2916
2917         Fix #69949
2918         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2919         argument. Call ResolveAttributeUsage for unresolved.
2920         when types doesn't match ctor arguments.
2921         
2922         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2923         for nested attribute classes.
2924         (Class.attribute_usage): Removed.
2925         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2926         for attribute class.
2927         
2928         * ecore.cs (IsAttribute): Removed.
2929         
2930         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2931         
2932         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2933         now normal types.
2934         (attribute_types): Removed.
2935         (EmitCode): Global attributes are emited as the latest.
2936
2937 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2938
2939         * class.cs (EmitFieldInitializers): Don't emit field initializer
2940         for default values when optimilization is on.
2941         
2942         * constant.cs (Constant.IsDefaultValue): New property.
2943         
2944         * driver.cs: Add /optimize handling.
2945         
2946         * constant.cs,
2947         * ecore.cs,
2948         * literal.cs: Implement new IsDefaultValue property.
2949         
2950         * rootcontext.cs (Optimize): New field, holds /optimize option.
2951
2952 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2953
2954         Fix crasher in re-opened #72347.
2955         * namespace.cs (Namespace.Lookup): Return null if
2956         DeclSpace.DefineType returns null.
2957
2958         Fix #72678.
2959         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2960
2961 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2962
2963         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2964         now returns null if it cannot resolve to an lvalue.
2965         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2966         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2967         returned null.  Remove check for SimpleName.
2968         (EventExpr.DoResolveLValue): New.
2969         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2970         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2971         error from ...
2972         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2973         avoid CS0131 error.
2974         (Unary.ResolveOperator): Move CS0211 check ...
2975         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2976         CS0131 error.
2977         (Unary.DoResolveLValue): Simplify.
2978         (AddressOf.DoResolveLValue): New.
2979         (ArrayAccess.DoResolveLValue): New.
2980
2981 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2982
2983         * attribute.cs (Attribute.Resolve): Add arguments casting for
2984         when types doesn't match ctor arguments.
2985
2986 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2987
2988         Fix parts of #63202.
2989         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2990         lookup of operator in base type.  Ensure that all checks happen
2991         when the operator resolves to an "op_..." method.
2992
2993 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2994
2995         Fix #71992.
2996         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2997         'ignore_cs0104' parameter.  Pass it to ...
2998         (NamespaceEntry.Lookup): ... this.
2999         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3000         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3001         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3002         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3003         Update.  Request that cs0104 errors be ignored.
3004         (ComposedCast.ResolveAsTypeStep): Update.
3005
3006 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3007
3008         Fix #59209.
3009         * expression.cs (Invocation.BetterFunction): Remove support for
3010         comparing virtual functions and their overrides.
3011         (Invocation.IsOverride): New.
3012         (Invocation.OverloadResolve): Don't consider 'override' functions
3013         during candidate selection.  Store them in a lookaside list.
3014         If the selected method is a 'virtual' function, use the list to
3015         find any overrides that are closer to the LHS type.
3016
3017 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3018
3019         * expression.cs (New.DoResolve): Add complex core type reduction.
3020         (New.Constantify): Converts complex core type syntax like 'new int ()'
3021         to simple constant.
3022         
3023 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3024
3025         * decl.cs (EntryType.EntryType): New constructor to create an
3026         updated copy of a cache entry.
3027         (MemberCache.AddMethods): Use it.
3028         (MemberCache.ClearDeclaredOnly): Remove.
3029         (MemberCache.MemberCache): Update.
3030
3031 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3032
3033         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3034         variable.  This one is represents the actual low-level declaration
3035         of the method, as opposed to the semantic level `IsStatic'.   
3036
3037         An anonymous method which is hosted into a static method might be
3038         actually an instance method.  IsStatic would reflect the
3039         container, while MethodIsStatic represents the actual code
3040         generated.
3041
3042         * expression.cs (ParameterReference): Use the new MethodIsStatic
3043         instead of IsStatic.
3044
3045         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3046         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3047         set on the current EmitContext. 
3048
3049         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3050         resolve our casted expression as an LValue.  This triggers the
3051         proper LValue processing that is later required by Assign.
3052
3053         This fixes 72347.
3054
3055         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3056
3057 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3058
3059         C# 2.0 Fixed buffer implementation
3060
3061         * anonymous.cs: Update after RegisterHelperClass renaming.
3062
3063         * attribute.cs (AttributeTester.fixed_buffer_cache):
3064         Cache of external fixed buffers.
3065         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3066         implementation if field is fixed buffer else null.
3067
3068         * class.cs
3069         (TypeContainer.AddField): Accept FieldMember instead of Field.
3070         (FieldBase.IsFieldClsCompliant): Extracted code from
3071         VerifyClsCompliance descendant customization.
3072         (FixedField): New class handles fixed buffer fields.
3073         (FixedFieldExternal): Keeps information about imported fixed
3074         buffer.
3075         (IFixedField): Make access to internal or external fixed buffer
3076         same.
3077
3078         * cs-parser.jay: Add fixed buffer parsing.
3079
3080         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3081         buffer.
3082
3083         * expression.cs (Indirection): Extended implementation to accept
3084         fixed buffer field.
3085         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3086         (ElementAccess.MakePointerAccess): Get type as parameter.
3087         (DoResolve): Add fixed buffer field expression conversion.
3088         (DoResolveLValue): Ditto.
3089         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3090         (ArrayPtr): Derives from FixedBufferPtr.
3091         (ArrayPtr.Emit): Add extra emit for array elements.
3092
3093         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3094
3095         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3096         for compiler generated types.
3097         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3098
3099         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3100         and consume less memory.
3101         (Fixed.Resolve): Add fixed buffer case.
3102
3103         * typemanager.cs (compiler_generated_attr_ctor,
3104         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3105         (HasElementType): Add our own implementation to work on every
3106         runtime.
3107
3108 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3109
3110         * anonymous.cs (CaptureContext): Track whether `this' has been
3111         referenced.   
3112
3113         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3114         only captured `this' if it was implicitly done (instance
3115         methods/variables were used). 
3116
3117         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3118         `this' must be captured.
3119
3120 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3121  
3122         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3123         is null it means that there has been no need to capture anything,
3124         so we just create a sibling.
3125
3126         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3127
3128         Just a partial fix.  The other half is fairly elusive.
3129         
3130 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3131
3132         Fix #52586, cs0121-4.cs.
3133         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3134         and return a hashtable.
3135         (MemberCache.ClearDeclaredOnly): New.
3136         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3137         the method_hash of a base type too.
3138         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3139         type methods.  Overwrite entries with the same MethodHandle so
3140         that the ReflectedType is correct.  The process leaves in base
3141         virtual functions and their overrides as distinct entries.
3142         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3143         matters since it was boxed in a ArrayList before.
3144         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3145         modifier.
3146         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3147         case of a virtual function and its override (choose the overload
3148         as better).
3149         (Invocation.OverloadResolve): Avoid 'override' members during
3150         'applicable_type' calculation.
3151
3152 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3153
3154         Combine two near-redundant caches.
3155         * typemanager.cs (method_params): Rename from method_internal_params.
3156         (TypeManager.GetParameterData): New.  Replace
3157         Invocation.GetParameterData.
3158         (TypeManager.LookupParametersByBuilder): Remove.
3159         * expression.cs (Invocation.method_parameter_cache): Remove.
3160         (Invocation.GetParameterData): Remove.
3161         Update to changes.
3162         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3163         Update to changes.
3164
3165 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3166
3167         Fix #72015.
3168         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3169         TypeManager.multicast_delegate_type is null, resolve it by looking
3170         up "System.MulticastDelegate".
3171         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3172
3173 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3174             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3175             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3176
3177         Fix cs0164.cs.
3178         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3179         (LabeledStatement.AddReference): New.  Set 'referenced'.
3180         (Goto.Resolve): Use it.
3181
3182 2005-02-05  John Luke  <john.luke@gmail.com>
3183
3184         * driver.cs: remove duplicate -doc line in Usage ()
3185
3186 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3187
3188         * location.cs (Location.AddFile): Fix CS2002 error report.
3189
3190 2005-02-02  Martin Baulig  <martin@ximian.com>
3191
3192         * delegate.cs (Delegate.DefineType): Report an internal error if
3193         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3194         details.        
3195
3196 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3197
3198         Fix a crasher in a variant of #31984.
3199         * const.cs (Constant.CheckBase): New override that defers the
3200         new-or-override check in case the base type hasn't been populated
3201         yet.
3202         (Constant.Define): Ensure the new-or-override check is performed.
3203
3204 2005-02-01  Duncan Mak  <duncan@ximian.com>
3205
3206         * const.cs (LookupConstantValue): Check that `ce' is not null
3207         before calling GetValue ().
3208
3209 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3210
3211         Fix test-334.cs (#69519).
3212         * cs-parser.jay (using_alias_directive): Pass in an expression to
3213         NamespaceEntry.UsingAlias.
3214         (using_namespace_directive): Pass in an expression to
3215         NamespaceEntry.Using.
3216         (namespace_name): Don't flatten to a string.
3217         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3218         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3219         ResolveAsTypeStep.
3220         (NamespaceEntry.UsingEntry): Likewise.
3221         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3222         changes.
3223         (NamespaceEntry.LookupForUsing): Remove.
3224         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3225         names.
3226         (NamespaceEntry.Lookup): Remove support for dotted names.
3227
3228 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3229
3230         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3231         split into two.
3232         (NamespaceEntry.ImplicitParent): Compute on demand.
3233         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3234         parallels the current.
3235         (NamespaceEntry.LookupForUsing): Use it.
3236         (NamespaceEntry.Lookup): If the current namespace-entry is
3237         implicit, don't search aliases and using tables.
3238
3239 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3240
3241         Fix #31984.
3242         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3243         BaseCache here.
3244         (TypeContainer.BaseCache): Compute on demand.
3245         (TypeContainer.FindMembers): Define constants and types if they're
3246         not already created.
3247         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3248         check.
3249         * const.cs (Constant.Define): Make idempotent.
3250
3251 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3252
3253         * pending.cs: Produce better code (no nops produced by using Ldarg
3254         + value).
3255         
3256         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3257         i - 1' it should be arg + 1.
3258
3259         Fixes bug #71819.
3260
3261 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3262
3263         * attribute.cs (Attribute.CheckAttributeType): Make private
3264         non-virtual.
3265         (Attribute.ResolveType): Make virtual.
3266         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3267         handling of RootContext.Tree.Types.
3268
3269 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3270
3271         Update attribute-handling to use the SimpleName/MemberAccess
3272         mechanisms.
3273         * cs-parser.jay (attribute): Pass in an expression to the
3274         constructors of Attribute and GlobalAttribute.
3275         * attribute.cs (Attribute): Take an expression for the name.
3276         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3277         passed in attribute name expression.
3278         (Attribute.CheckAttributeType): Use it.
3279         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3280         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3281         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3282         argument to prevent error messages if the lookup fails.
3283
3284 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3285
3286         * expression.cs (Indirection): Implemented IVariable interface
3287         to support indirection in AddressOf operator.
3288         (PointerArithmetic.Emit): Add optimalization for case where
3289         result can be precomputed.
3290
3291 2005-01-26  Martin Baulig  <martin@ximian.com>
3292
3293         * class.cs (TypeContainer.AttributeTargets): Return the correct
3294         AttributeTargets depending on our `Kind' instead of throwing an
3295         exception; fixes #71632.
3296
3297 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3298
3299         Fix #71257
3300         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3301         constant members.
3302
3303 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3304
3305         Fix #71602.
3306         * expression.cs (MemberAccess.DoResolve): Don't complain with
3307         cs0572 when the LHS of a member access has identical name and type
3308         name.
3309
3310 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3311
3312         Fix #71651, #71675
3313         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3314         CreatePermission.
3315         Create custom PermissionSet only for PermissionSetAttribute.
3316
3317 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3318
3319         Fix #71649
3320         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3321         delegates in static class.
3322
3323 2005-01-24  Martin Baulig  <martin@ximian.com>
3324
3325         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3326         merging an implicit block, just use its reachability.
3327
3328         * statement.cs (Block.Resolve): Make the unreachable code check
3329         work wrt. implicit blocks; see test-337 from #63842.
3330
3331 2005-01-21  Alp Toker  <alp@atoker.com>
3332  
3333         * cs-parser.jay: destructor_declaration's container is PartialContainer
3334         not Class when partial types are used, so use Kind prop instead of
3335         'is'.
3336         
3337 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3338
3339         * cs-parser.jay: Improve error reporting when an interface
3340         declares new types.
3341
3342 2005-01-20  Dick Porter  <dick@ximian.com>
3343
3344         * support.cs: SeekableStreamReader fix from Sandor Dobos
3345         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3346         chars are read.  Fixes bug 70369.
3347
3348 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3349
3350         * cs-parser.jay (catch_clause): Simplify current_block handling
3351         somewhat.
3352
3353 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3354
3355         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3356         code with ImplicitStandardConversion to handle the implicit
3357         conversion of method groups into valid delegate invocations. 
3358
3359         The problem is that in parameter handling we were using this code
3360         path.  Fixes bug #64698
3361
3362 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3363
3364         * cs-parser.jay: Fix several infelicities.
3365         - Avoid assigning to the parser value stack.  Code like 
3366           '$3 = null' is unclean.  Synthesize a value for the code block
3367           instead. 
3368         - Avoid using oob_stack for storing location information.  Use ...
3369         (_mark_): ... this.  New (empty) rule.  Saves the current location
3370         in $$.
3371         (foreach_statement): Avoid using oob_stack for current_block
3372         handling.  Use technique used in for_statement and
3373         using_statement.  Synthesize a value for the code block to store
3374         additional intermediate information.
3375
3376 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3377
3378         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3379         of a different type is only allowed to private fields of a
3380         containing type, not on fields of a base class.
3381
3382         See test-174.cs and error cs0122-9.cs
3383
3384 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix test-335.cs (bug #58126).
3387         * cs-parser.jay (argument): Split out non-expression parts of the
3388         rule into 'non_simple_argument'.
3389         (invocation_expression): Support parenthesized invocations with
3390         multiple arguments, and with single non-simple arguments.
3391
3392 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3393
3394         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3395         places.
3396
3397 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3398
3399         Fix cs0038-1.cs, cs1640-6.cs.
3400         * ecore.cs (Expression.Resolve): Remove special-case for
3401         SimpleName in error-handling.
3402         (Expression.almostMatchedMembers): Relax access permission to
3403         protected.
3404         (Expression.MemberLookupFailed): Handle duplicates in
3405         almostMatchedMembers list.
3406         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3407         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3408         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3409         overload if the passed in MemberInfo is a MethodBase.
3410
3411 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3412
3413         Fix #70749
3414         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3415         for non-CAS & merge permission sets properly.
3416
3417 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3418
3419         Improve standard-compliance of simple name and member access 
3420         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3421         * ecore.cs (FullNamedExpression): New abstract base class 
3422         for Namespaces and TypeExpressions.
3423         (ResolveFlags.SimpleName): Remove.
3424         (SimpleName): Remove support for dotted names.
3425         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3426         DeclSpace.FindType and DeclSpace.LookupType.
3427         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3428         (Expression.ExprClassName): Make member function.
3429         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3430         a namespace.  Remove creation of dotted "SimpleName"s.
3431         (MemberAccess.DoResolve): Likewise.
3432         * decl.cs (DeclSpace.Cache): Make private.
3433         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3434         (DeclSpace.FindType): Update.
3435         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3436         FullNamedExpression.
3437         * namespace.cs (Namespace): Derive from FullNamedExpression
3438         so that it can be part of expression resolution.
3439         (Namespace.Lookup): Return an FullNamedExpression.
3440         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3441         namespace.
3442         * rootcontext.cs (NamespaceLookup): Remove.
3443         (LookupType): Move to DeclSpace.
3444         * attribute.cs (CheckAttributeType): Update.
3445         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3446         (FindDocumentedTypeNonArray): Likewise.
3447
3448 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3449
3450         Fix cs0509.cs, cs1632.cs.
3451         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3452         is the same as IsInterface.
3453         (TypeContainer.GetClassBases): Likewise.
3454         * statement.cs (LabeledStatement.ig): New field.
3455         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3456         label.
3457         (LabeledStatement.DoEmit): Check that the label was created with
3458         the same ILGenerator.
3459
3460 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3461
3462         Fix #71058
3463         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3464         accessors to its properties.
3465
3466         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3467         from accessors to property.
3468         
3469 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3470
3471         Fix #70722
3472         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3473         only for overrides.
3474         
3475 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3476
3477         * attribute.cs: Check for null and empty strings.  
3478
3479         I have lost another battle to Paolo.
3480
3481 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3482
3483         Fix #70942
3484         * class.cs (PropertyMethod): Set Parent field in ctors.
3485         (SetMethod.InternalParameters): Add unsafe switch hack.
3486         Override MarkForDuplicationCheck where it is appropriate.
3487
3488         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3489         It says whether container allows members with the same name.
3490         Base default is no.
3491         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3492         Removed is_method parameter.
3493
3494 2005-01-06  Duncan Mak  <duncan@ximian.com>
3495
3496         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3497         because the previous change led to incorrect reporting of CS1032
3498         ("Cannot define/undefine preprocessor symbols after first token in
3499         file"). Instead of using `tokens_seen' as the only flag that
3500         triggers CS1040, introduce `comments_seen'. This new flag is used
3501         to signify having seen comments on the current line, so it is
3502         unset after a newline.
3503
3504 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3505
3506         * doc.cs : When searching for a type, find nested type too.
3507           This fixes bug #71040.
3508
3509 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3510
3511         * doc.cs :
3512           - Warn missing member comment on those classes which also does not
3513             have doc comments. Fixed bug #71041.
3514           - Don't warn missing doc comment on default constructor.
3515             Fixed bug #71042.
3516
3517 2005-01-06  Duncan Mak  <duncan@ximian.com>
3518
3519         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3520         comments, set `tokens_seen' to true. This allows us to detect
3521         misplaced preprocessor directives (i.e. not at the beginning of
3522         the a line, nor after whitespaces). In that case, report error
3523         CS1040. This fixes bug #56460.
3524
3525         * cs-parser.jay (interface_member_declaration): Add checks for
3526         IsExplicitImpl, and report CS0541 error if an interface member is
3527         defined as an explicit interface declaration.
3528
3529 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3530
3531         Fix #70817
3532         * class.cs (PropertyMethod): Set Parent field in ctors.
3533         (SetMethod.InternalParameters): Add unsafe switch hack.
3534         
3535         * decl.cs (MemberCore.Parent): Cannot be readonly.
3536
3537 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3538
3539         * decl.cs (DeclSpace.ResolveType): Remove.
3540         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3541         Merge in code from ...
3542         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3543         * class.cs, enum.cs: Update to changes.
3544
3545 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3546
3547         * anonymous.cs: Ensure that we init the scope of our parent if it
3548         has not been initialized yet.
3549
3550 2004-12-30  Duncan Mak  <duncan@ximian.com>
3551
3552         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3553         if field.FieldBuilder is null. Fixes #70758.
3554
3555         * convert.cs: Fixed some typos and updated some of the comments.
3556         (ImplicitStandardConversionExists):
3557         (TryImplicitIntConversion): If `target_type' is an interface and
3558         the type of `ic' implements this interface, return true or a new
3559         BoxedCast instead of null. This fixes #70468.
3560
3561 2004-12-29  Duncan Mak  <duncan@ximian.com>
3562
3563         * expression.cs (Argument.Emit): Check that Expr is
3564         IMemoryLocation before casting to it, and report CS1510 otherwise.
3565
3566         This fixes #70402.
3567
3568 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3569
3570         * statement.cs (Block.ThisVariable): remove the recursion here, to
3571         make the --profile more sane.
3572
3573 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3574
3575         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3576         assembly, by JB Evain.
3577
3578 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3579
3580         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3581           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3582         "parent" refers to enclosing type/class.  "base" refers to superclass.
3583
3584 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3585
3586         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3587         Ensure that we only have GlobalAttributes.
3588         * attribute.cs (Attribute.Emit): Make non-virtual.
3589         (GlobalAttribute.Emit): Remove.
3590         (Attribute.Resolve): Make virtual.
3591         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3592         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3593         the argument. Don't create one.
3594         (Attribute.GetObsoleteAttribute): Likewise.
3595         (Attribute.GetClsCompliantAttributeValue): Likewise.
3596         * class.cs, decl.cs: Update to changes.
3597
3598 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3599
3600         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3601         
3602         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3603         
3604         * statement.cs (Foreach.Resolve): Add error 186 report.
3605
3606 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3607
3608         * expression.cs (Conditional.DoResolve): Add warning 429.
3609         
3610         * statement.cs (If.Resolve): Add warning 665.
3611
3612 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3613
3614         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3615         except when in the parser, and in GlobalAttribute.
3616         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3617         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3618         RootContext.Tree.Types.NamespaceEntry once work is done.
3619         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3620         and resets RootContext.Tree.Types.NamespaceEntry.
3621
3622 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3623
3624         * cs-parser.jay: Don't create a block for every variable.
3625
3626 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3627
3628         * location.cs: Provide extra information.
3629
3630         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3631         variables from the captured environment, it is the ldarg_0.
3632
3633 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3634
3635         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3636         find a conclusion.
3637         
3638         * class.cs: Changed warning level for 169 to avoid developer
3639         displeasure from warning flooding. It will be changed back when they
3640         fix most of current BCL warnings.
3641         
3642         * RootContext.cs: Pushed default WarningLevel to 3.
3643         
3644         * statement.cs: Removed unused variable.
3645
3646 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3647
3648         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3649         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3650         Add error 502 report.
3651         (StaticClass.DefineType): Add error 441 report.
3652         (Class.AllowedModifiersProp): New virtual property as temporary
3653         extension to AllowedModifiers.
3654         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3655         to share implementation with StaticClass and don't call virtual
3656         methods from ctor.
3657         
3658         * driver.cs (MainDriver): Add error 1558 test.
3659
3660         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3661         report. Moved error 36 test here.
3662
3663         * statement.cs (Throw.Resolve): Add error 724 report.
3664
3665         * typemanager.cs: Add out_attribute_type core type.
3666         
3667 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3668
3669         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3670         3018 report.
3671         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3672
3673         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3674         3017 report.
3675         
3676         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3677
3678         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3679         Add error 3023 report.
3680         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3681
3682         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3683         implementation.
3684
3685 2004-12-12  John Luke  <john.luke@gmail.com>
3686
3687         * driver.cs (AddArgs): take -- into account when
3688         adding arguments, fixes bug 65710 
3689
3690 2004-12-12  Martin Baulig  <martin@ximian.com>
3691
3692         * expression.cs (Unary.TryReduceNegative): Added support for
3693         SByteConstant and ByteConstant.
3694         (Unary.Reduce): Check error values from TryReduceNegative().
3695
3696 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3697
3698         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3699         and report exception as error 182.
3700
3701 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3702
3703         * driver.cs (Main): Fix message when there are warnings.
3704
3705 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3706
3707         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3708
3709 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3710
3711         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3712         Reduced number of warnings.
3713         
3714         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3715
3716 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3717
3718         * driver.cs: Removed message.
3719
3720         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3721
3722 2004-12-08    <vargaz@freemail.hu>
3723
3724         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3725
3726 2004-12-08  Martin Baulig  <martin@ximian.com>
3727
3728         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3729         instead of a CS3002 for properties and indexer.
3730
3731 2004-12-08  Martin Baulig  <martin@ximian.com>
3732
3733         * decl.cs (MemberName.ToString): Make this work again.
3734
3735 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3736
3737         * attribute.cs (Resolve): Add error 591 detection.
3738
3739         * class.cs (FieldMember.Define): Add error 1547 detection.
3740         (Indexer.Define): Add error 620 detection.
3741         (Operator.Define): Add error 590 detection.
3742
3743         * ecore.cs: Missing argument for error 79.
3744
3745         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3746         detection.
3747
3748 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3749
3750         Fix #70106
3751         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3752         only.
3753
3754 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3755
3756         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3757           Some operator comments were suppressed.
3758         * doc.cs : Implicit/explicit operator name in doc comments are like
3759           "op_Explicit(type)~returnType", so added suffix handling.
3760
3761 2004-12-07  Martin Baulig  <martin@ximian.com>
3762
3763         * decl.cs
3764         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3765         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3766         (DeclSpace.ec): New protected field; store the EmitContext here.
3767         (DeclSpace.EmitContext): New public property; moved here from
3768         `TypeContainer'.
3769         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3770         EmitContext.
3771
3772         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3773         (Enum.Emit): Don't create a new EmitContext.
3774
3775         * delegate.cs (Delegate.DefineType): Always create the
3776         EmitContext.
3777
3778         * iterators.cs (Iterators.DefineIterator): Create a new
3779         EmitContext and store it in `ec'.
3780
3781 2004-08-24  Martin Baulig  <martin@ximian.com>
3782
3783         * typemanager.cs
3784         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3785         this for accessibility checks.
3786         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3787         IsNestedFamilyAccessible.
3788         (TypeManager.IsSubclassOf): New method, do what the name actually
3789         says.   
3790
3791 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3792
3793         Fix crash on cs0657-17.cs.
3794         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3795         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3796         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3797         the case where the NamespaceEntry gets overwritten.
3798
3799 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3800
3801         Fixed #69195, #56821
3802         * ecore.cs (ResolveBoolean): Tiny refactoring.
3803
3804         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3805         of right expression resolving when left is false constant and
3806         operator is LogicalAnd OR true constant and operator is LogicalOr.
3807
3808         * statement.cs (ResolveUnreachable): Always reports warning.
3809
3810 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3811
3812         * class.cs: Distinguish between 1721 and 1722 (just a little help
3813         for the programmer).
3814
3815 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3816
3817         * delegate.cs: Only allow this on new versions of the language. 
3818
3819 2004-12-02  Duncan Mak  <duncan@ximian.com>
3820
3821         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3822         Expression class.
3823         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3824         here as a static method. Take an additional bool out parameter
3825         `must_do_cs1540_check' for signaling to InstanceResolve.
3826         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3827         member field from PropertyExpr class and made it an argument of
3828         the method instead.
3829         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3830         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3831         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3832         and `remove_accessor' as well as InstanceResolve: report CS0122
3833         where applicable.
3834
3835         Fixes #70129.
3836
3837 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3838
3839         Fix test-327.cs, test-328.cs, and put in early infrastructure
3840         for eventually fixing #52697.
3841         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3842         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3843         from other methods.
3844         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3845         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3846         (VerifyUsing, error246): Update.
3847         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3848         'NamespaceEntry.LookupNamespaceOrType'.
3849
3850 2004-12-03  Martin Baulig  <martin@ximian.com>
3851
3852         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3853         method as our child, call AnonymousMethod.Compatible() on it.
3854
3855 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3856
3857         Disable XML documentation support in 'basic' profile.
3858         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3859         Redirect XmlElement to System.Object.
3860         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3861         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3862         * mcs.exe.sources: Add doc-bootstrap.cs.
3863         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3864         of doc.cs.
3865
3866 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3867
3868         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3869           comments are allowed.
3870
3871 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3872
3873         * delegate.cs: Add checks for subtypes in paramaters and return values
3874         in VerifyMethod () to add support for Covariance/Contravariance
3875         in delegates.
3876         
3877 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3878
3879         * report.cs: Remove extra closing parenthesis.
3880
3881         * convert.cs (Error_CannotImplicitConversion): If the name of the
3882         types are the same, provide some extra information.
3883
3884         * class.cs (FieldBase): Use an unused bit field from the field to
3885         encode the `has_offset' property from the FieldMember.  This saves
3886         a couple of Ks on bootstrap compilation.
3887
3888         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3889         method as our child, return the AnonymousMethod resolved
3890         expression.
3891
3892         * expression.cs (New.DoResolve): Allow return values from
3893         NewDelegate to also include AnonymousMethods.
3894
3895         Fixes #70150.
3896
3897 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3898
3899         Fix bug #70102
3900         * attribute.cs (Resolve): Improved implementation of params
3901         attribute arguments.
3902
3903         * support.cs (ParameterData): Add HasParams to be faster.
3904
3905 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3906
3907         all things are for /doc support:
3908
3909         * doc.cs: new file that supports XML documentation generation.
3910         * mcs.exe.sources: added doc.cs.
3911         * driver.cs:
3912           Handle /doc command line option.
3913           Report error 2006 instead of 5 for missing file name for /doc.
3914           Generate XML documentation when required, after type resolution.
3915         * cs-tokenizer.cs:
3916           Added support for picking up documentation (/// and /** ... */),
3917           including a new XmlCommentState enumeration.
3918         * cs-parser.jay:
3919           Added lines to fill Documentation element for field, constant,
3920           property, indexer, method, constructor, destructor, operator, event
3921           and class, struct, interface, delegate, enum.
3922           Added lines to warn incorrect comment.
3923         * rootcontext.cs :
3924           Added Documentation field (passed only when /doc was specified).
3925         * decl.cs:
3926           Added DocComment, DocCommentHeader, GenerateDocComment() and
3927           OnGenerateDocComment() and some supporting private members for
3928           /doc feature to MemberCore.
3929         * class.cs:
3930           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3931         * delegate.cs:
3932           Added overriden DocCommentHeader.
3933         * enum.cs:
3934           Added overriden DocCommentHeader and GenerateDocComment().
3935
3936 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3937
3938         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3939         unwrapping the enumeration values, chain to
3940         DoConstantNumericPromotions again, so we can promote things to the
3941         fundamental types (takes care of enums that are bytes, sbytes).
3942
3943         Fixes bug #62054.
3944
3945 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3946
3947         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3948         Fix long-standing bug in type-lookup.  Use FindType instead of
3949         LookupType when ec.ResolvingTypeTree.
3950         (Attribute.ResolveType, Attribute.Resolve)
3951         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3952         Update to changes.
3953         (Attributes.Search): Remove internal version.  Update.
3954         (Attributes.SearchMulti): Update.
3955         (Attributes.GetClsCompliantAttribute): Remove.
3956         (Attributes.GetIndexerNameAttribute): Remove.
3957         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3958         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3959         * class.cs (Indexer.Define): Likewise.
3960
3961 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3962
3963         Fix bug #68790
3964         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3965         MarshallByReference members access.
3966
3967         * expression.cs: Use CheckMarshallByRefAccess;
3968         Better error CS0197 message.
3969
3970         * report.cs: Print whole related error message.
3971
3972 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3973
3974         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3975         the current directory to help debugging.
3976
3977 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3978
3979         * class (GetClassBases): Better error 60 report.
3980         (EventProperty): Disabled warning 67 detection.
3981
3982 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3983
3984         Fix bug #60324
3985         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3986
3987         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3988         precise values.
3989
3990 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3991
3992         Fix bug #49488
3993         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3994
3995         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3996
3997 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3998
3999         * attribute.cs (Attribute.Resolve): Refine error reporting and
4000         report a cs0117 if the identifier does not exist, to distinguish
4001         from 0617 which is a miss-use of the actual identifier.
4002
4003         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4004         between cs0070 and cs0079.
4005
4006         * class.cs (MemberBase.DoDefine): When reporting a wrong
4007         accessibility level, we use MethodCore to compare instead of
4008         Method (this was a regression in some refactoring effort).
4009
4010         So now we correctly report cs0056 again.
4011
4012         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4013         testing the target_type (which was known to be object_type) and
4014         not the source type (which is anonymous_method).
4015
4016         Fixed reporting of error cs1660.
4017
4018         * expression.cs (UserCast.Source): Expose the underlying cast.
4019
4020         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4021         allowed types to find a match to int32 first (most common).
4022
4023         In addition, it ignores any ImplicitUserConversions that did an
4024         internal implicit conversion (as the switch statement allows only
4025         one integral conversion to exist).
4026
4027         * class.cs (PartialContainer.Create): rename `name' to
4028         `member_name' for clarity.  Then replace the string calls with a
4029         call to MemberName.GetPartialName, as now using
4030         MemberName.ToString is an error (this is due to the side effects
4031         it had, that were fixed in the past).
4032
4033         This will restore the error reporting on a number of partial class
4034         errors that were missusing this (and getting an exception as a
4035         results, which is now just a plain textual warning, because
4036         yyparse debug output would crash otherwise).
4037
4038 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4039
4040         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4041
4042 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4043
4044         * rootcontext.cs (LookupType): Make sure to cache lookups that
4045         don't give us a negative result. This saves about 5% of corlib
4046         compilation time.
4047
4048 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4049
4050         * report.cs (AbstractMessage.Print): messages are sent to stderr
4051
4052         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4053         non-interface in the list of interfaces (at this point, either
4054         parent was properly set, or a base class is being listed in the
4055         interfaces section).
4056
4057         This flags error 1722, and resolves the crash from bug 69259.
4058
4059 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4060
4061         * statement.cs (Using.EmitExpressionFinally): make this work right
4062         for valuetypes. Fixes 69926.
4063
4064 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4065
4066         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4067         converted to an enum" here, before we try to change the underlying
4068         type.  This code exists, but it is a different code path than the
4069         one used while encoding constants.
4070
4071         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4072         old bug: when converting from the null literal to a pointer,
4073         return an EmptyCast, not the NullLiteral.
4074
4075         This fixes #69921, the recent null_type changes probably made this
4076         bug more prominent.
4077
4078         (ImplicitReferenceConversionExists): In addition, resynchronized
4079         the code here, so it matches the same code in
4080         ImplicitReferenceConversionExists for the `from any class-type S
4081         to any interface-type T'.
4082         
4083
4084 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4085
4086         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4087
4088 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4089
4090         * cs-parser.jay: Use verbosity accordingly. 
4091
4092 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4093
4094         * expression.cs (Unary.ResolveOperator): Do not report warning;
4095         AddressOf reads from variable.
4096         
4097         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4098
4099 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4100
4101         Fix bug #69462
4102
4103         * attribute.cs (Attributable): Removed CheckTargets.
4104         (Attributes.Emit): Explicit attribute targets are tested here.
4105
4106         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4107         not enabled for interfaces.
4108
4109         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4110         (GetAssemblyName): Ouch next bug there.
4111
4112 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4113
4114         * expression.cs: Error 275 added.
4115         
4116 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4117
4118         Fix bug #69177 (Implemented decimal constant support)
4119
4120         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4121         (BinaryFold): Add DecimalConstant.
4122
4123         * const.cs (Define): Decimal constant 
4124         (is not constant.
4125         (ChangeType): Add decimal type handling.
4126         (LookupConstantValue): Don't set value for decimal type but
4127         emit DecimalConstantAttribute. Needed for constant optimization.
4128
4129         * constant.cs (ToDecimal): New method.
4130         (ConvertToDecimal): New method.
4131         (IntConstant): Implemented ConvertToDecimal.
4132         (DecimalConstant.Emit): Emit optimized version for decimals in
4133         int range.
4134
4135         * expression.cs (ResolveOperator): Changed order of constant
4136         reduction to work correctly with native types which have
4137         overloaded operators.
4138         (ResolveMemberAccess): Extract constant value from attribute
4139         for decimal type.
4140
4141         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4142
4143         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4144         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4145         (ChangeType): Decimal is special.
4146         (TypeToCoreType): Add decimal type.
4147
4148 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4149
4150         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4151         decimal types.
4152
4153 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4154
4155         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4156         test cs1667-5.cs.
4157
4158 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4161
4162         * pending.cs (PendingImplementation): Grab only interfaces.
4163
4164 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4165
4166         * statement.cs (ForeachHelperMethods): Add location member and
4167         error 202 detection.
4168
4169 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4170
4171         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4172         automatically handled by executable.make.
4173         (PROGRAM): Make profile-specific.
4174
4175 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4176
4177         * expression.cs (DoResolveBase): Fixed wrong warning for out
4178         variables.
4179
4180 2004-11-18  Martin Baulig  <martin@ximian.com>
4181
4182         Merged latest changes into gmcs.  Please keep this comment in
4183         here, it makes it easier for me to see what changed in MCS since
4184         the last time I merged.
4185
4186 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4187
4188         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4189         (TypeHandle.GetMemberCache): New.
4190         (TypeHandle.TypeHandle): Update.
4191         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4192         (TypeManager.LookupParentInterfacesCache):
4193         Rename from LookupInterfaceCache.  Optimize slightly.
4194         (TypeManager.MemberLookup_FindMembers): Update.
4195         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4196         multi-type variant.
4197         (AddCacheContents): Rename from AddHashtable.
4198         * class.cs (TypeContainer.parent_container): Remove.
4199         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4200         (TypeContainer.DoDefineMembers): Don't initialize it.
4201         Update to name changes.
4202         
4203 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4204
4205         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4206         that factors the code to check access modifiers on override.  
4207
4208         (PropertyBase): Use the code here.
4209
4210         Patch from Lluis S'anchez, fixes bug #69361.
4211
4212 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4213
4214         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4215         routine that is used to report the use of a captured variable
4216         whose address has been taken.
4217
4218         There are two checks: one when variables are being captured and
4219         the other check is when the address of a variable is taken. 
4220         
4221         (because an anonymous methods might be resolved before *or* after
4222         the address has been taken) and 
4223
4224         * expression.cs (Conditional.DoResolve): Remove the special
4225         casing that Martin added to trueExpr and falseExpr being both
4226         NullLiteral.  We get the right behavior now just by introducing
4227         the null_type into the compiler. 
4228
4229         * convert.cs (ExplicitConversion): Change the code to use
4230         null_type instead of testing `expr is NullLiteral'.
4231         (ImplicitConversionStandard): use null_type too.
4232         (ImplicitReferenceConversionExists): use null_type too.
4233         (ImplicitReferenceConversion): use null_type too.
4234
4235         * literal.cs: The type of `NullLiteral' is now null_type instead
4236         of object_type. 
4237         (Resolve): Set the type here.
4238
4239         * typemanager.cs: Introduce null_type.
4240
4241 2004-11-17  Martin Baulig  <martin@ximian.com>
4242
4243         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4244         direction, like FindMembers() does.  Fixes #69546, testcase is in
4245         test-315.cs.    
4246
4247 2004-11-16  Martin Baulig  <martin@ximian.com>
4248
4249         This is based on a patch from Marek Safar, see bug #69082.
4250         Fixes bugs #63705 and #67130.
4251
4252         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4253         method; create a MemberCache for an interface type and cache the
4254         result.
4255
4256         * decl.cs (IMemberContainer.ParentContainer): Removed.
4257         (IMemberContainer.ParentCache): New property.
4258         (MemberCache.SetupCacheForInterface): Removed.
4259         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4260         to create a cache for an interface's "parent".
4261
4262         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4263         interfaces too.
4264
4265 2004-11-16  Martin Baulig  <martin@ximian.com>
4266
4267         Merged back from gmcs; these changes already went into gmcs a
4268         couple of weeks ago.
4269
4270         * typemanager.cs
4271         (TypeManager.AddUserType): Removed the `ifaces' argument.
4272         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4273         `TypeExpr []'.
4274         (TypeManager.AddUserInterface): Removed.
4275         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4276         `TypeExpr []'.
4277         (TypeManager.GetInterfaces): Likewise.
4278         (TypeManager.GetExplicitInterfaces): Likewise.
4279
4280         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4281
4282         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4283         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4284
4285 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4286
4287         * statement.cs: Avoid adding bools to a hashtable.
4288
4289 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4290
4291         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4292         calling an unsafe method from a safe location.
4293
4294 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4295
4296         Fix #69167
4297         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4298
4299 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4300
4301         * namespace.cs (VerifyUsing): use GetPartialName instead of
4302         ToString. 
4303
4304 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4305
4306         * statement.cs (Return.Resolve): Fix regression in typo: if
4307         `in_exc', we have to request a NeedReturnLabel, this was a typo
4308         introduced in the anonymous method check-in.  Fixes #69131.
4309
4310         * Indexers were using the ShortName when defining themselves,
4311         causing a regression in the compiler bootstrap when applying the
4312         patch from 2004-11-02 (first part), now they use their full name
4313         and the bug is gone.
4314
4315 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4316
4317         * driver.cs: Strip the path from the names of embedded resources. Fixes
4318         #68519.
4319
4320 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4321
4322         Fix error message regression: cs0104-2.cs.
4323         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4324         (AliasEntry.Resolve): Update.
4325         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4326         'silent' flag.
4327         (RootContext.LookupType): Update.
4328
4329 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4330
4331         * cs-parser.jay: Add support for handling accessor modifiers
4332         * class: Add support port accessor modifiers and error checking,
4333         define PropertyMethod.Define as virtual (not abstract anymore)
4334         * ecore.cs: Add checking for proeprties access with access modifiers
4335         * iterators.cs: Modify Accessor constructor call based in the modified
4336         constructor
4337 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4338
4339         * expression.cs (StringConcat): Handle being called twice,
4340         as when we have a concat in a field init with more than two
4341         ctors in the class
4342
4343 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4344
4345         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4346         special case explicit implementations, we should always produce
4347         the .property or .event declaration.
4348         
4349         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4350         since it will not return correct data if people use this
4351         unresolved in the presence of using statements (see test-313).
4352
4353         * class.cs (MethodData.Define): If we are an explicit interface
4354         implementation, set the method name to the full name of the
4355         interface plus the name of the method.  
4356
4357         Notice that using the method.MethodName.GetFullName() does not
4358         work, as it will only contain the name as declared on the source
4359         file (it can be a shorthand in the presence of using statements)
4360         and not the fully qualifed type name, for example:
4361
4362         using System;
4363
4364         class D : ICloneable {
4365                 object ICloneable.Clone ()  {
4366                 }
4367         }
4368
4369         Would produce a method called `ICloneable.Clone' instead of
4370         `System.ICloneable.Clone'.
4371
4372         * namespace.cs (Alias.Resolve): Use GetPartialName.
4373         
4374 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4375
4376         * cs-parser.jay: Add error 1055 report.
4377
4378 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4379
4380         * assign.cs (Assign.DoResolve): Only do the transform of
4381         assignment into a New if the types are compatible, if not, fall
4382         through and let the implicit code deal with the errors and with
4383         the necessary conversions. 
4384
4385 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4386
4387         * cs-parser.jay: Add error 1031 report.
4388
4389         * cs-tokenizer.cs: Add location for error 1038.
4390
4391 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4392
4393         * cs-parser.jay: Add error 1016 report.
4394
4395 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4396
4397         * cs-parser.jay: Add errors 1575,1611 report.
4398
4399 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4400
4401         * cs-parser.jay: Add error 1001 report.
4402
4403 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4404
4405         Fix #68850
4406         * attribute.cs (GetMarshal): Add method argument for
4407         caller identification.
4408
4409         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4410         agument for GetMarshal and RuntimeMissingSupport.
4411
4412 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4413
4414         * attribute.cs (ExtractSecurityPermissionSet): Removed
4415         TypeManager.code_access_permission_type.
4416
4417         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4418
4419 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4420
4421         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4422         for obsolete use of a variable here.   Fixes regression on errors
4423         cs0619-25 and cs0619-26.
4424
4425 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4426
4427         Fix #62358, implemented security attribute encoding.
4428
4429         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4430         Tests permitted SecurityAction for assembly or other types.
4431         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4432         data from SecurityPermissionAttribute to PermisionSet class.
4433
4434         * class.cs (ApplyAttributeBuilder): Added special handling
4435         for System.Security.Permissions.SecurityAttribute based types.
4436
4437         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4438         special handling for System.Security.Permissions.SecurityAttribute
4439         based types.
4440
4441         * enum.cs (ApplyAttributeBuilder): Added special handling
4442         for System.Security.Permissions.SecurityAttribute based types.
4443
4444         * parameter.cs (ApplyAttributeBuilder): Added special handling
4445         for System.Security.Permissions.SecurityAttribute based types.
4446
4447         * rootcontext.cs: Next 2 core types.
4448
4449         * typemanager.cs (TypeManager.security_permission_attr_type):
4450         Built in type for the SecurityPermission Attribute.
4451         (code_access_permission_type): Build in type.
4452
4453 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4454
4455         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4456         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4457         all of this information into
4458         EmitContext.EmitCapturedVariableInstance.
4459         
4460         * codegen.cs (EmitCapturedVariableInstance): move here the
4461         funcionality of emitting an ldarg.0 in the presence of a
4462         remapping.   This centralizes the instance emit code.
4463
4464         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4465         then emit a load of this: it means that we have reached the
4466         topmost ScopeInfo: the one that contains the pointer to the
4467         instance of the class hosting the anonymous method.
4468
4469         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4470         captures to the topmost CaptureContext.
4471
4472 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4473
4474         * expression.cs (LocalVariableReference): Move the knowledge about
4475         the iterators into codegen's EmitCapturedVariableInstance.
4476
4477 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4478
4479         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4480         all code paths return a value from an anonymous method (it is the
4481         same as the 161 error, but for anonymous methods).
4482
4483 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4484
4485         The introduction of anonymous methods in the compiler changed
4486         various ways of doing things in the compiler.  The most
4487         significant one is the hard split between the resolution phase
4488         and the emission phases of the compiler.
4489
4490         For instance, routines that referenced local variables no
4491         longer can safely create temporary variables during the
4492         resolution phase: they must do so from the emission phase,
4493         since the variable might have been "captured", hence access to
4494         it can not be done with the local-variable operations from the runtime.
4495         
4496         * statement.cs 
4497
4498         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4499         is a toplevel block.
4500
4501         (ToplevelBlock): A new kind of Block, these are the blocks that
4502         are created by the parser for all toplevel method bodies.  These
4503         include methods, accessors and anonymous methods.
4504
4505         These contain some extra information not found in regular blocks:
4506         A pointer to an optional CaptureContext (for tracking captured
4507         local variables and parameters).  A pointer to the parent
4508         ToplevelBlock.
4509         
4510         (Return.Resolve): Catch missmatches when returning a value from an
4511         anonymous method (error 1662).
4512         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4513         phase.
4514
4515         (Break.Resolve): ditto.
4516
4517         (SwitchLabel): instead of defining the labels during the
4518         resolution phase, we now turned the public ILLabel and ILLabelCode
4519         labels into methods called GetILLabelCode() and GetILLabel() that
4520         only define the label during the Emit phase.
4521
4522         (GotoCase): Track the SwitchLabel instead of the computed label
4523         (its contained therein).  Emit the code by using
4524         SwitchLabel.GetILLabelCode ().
4525
4526         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4527         whether the Local has been captured or not.
4528
4529         (LocalInfo.IsCaptured): New property, used to tell whether the
4530         local has been captured.
4531         
4532         * anonymous.cs: Vastly updated to contain the anonymous method
4533         support.
4534
4535         The main classes here are: CaptureContext which tracks any
4536         captured information for a toplevel block and ScopeInfo used to
4537         track the activation frames for various local variables.   
4538
4539         Each toplevel block has an optional capture context associated
4540         with it.  When a method contains an anonymous method both the
4541         toplevel method and the anonymous method will create a capture
4542         context.   When variables or parameters are captured, they are
4543         recorded on the CaptureContext that owns them, for example:
4544
4545         void Demo () {
4546              int a;
4547              MyDelegate d = delegate {
4548                  a = 1;
4549              }
4550         }
4551
4552         Here `a' will be recorded as captured on the toplevel
4553         CapturedContext, the inner captured context will not have anything
4554         (it will only have data if local variables or parameters from it
4555         are captured in a nested anonymous method.
4556
4557         The ScopeInfo is used to track the activation frames for local
4558         variables, for example:
4559
4560         for (int i = 0; i < 10; i++)
4561                 for (int j = 0; j < 10; j++){
4562                    MyDelegate d = delegate {
4563                         call (i, j);
4564                    }
4565                 }
4566
4567         At runtime this captures a single captured variable `i', but it
4568         captures 10 different versions of the variable `j'.  The variable
4569         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4570         recorded on a child.  
4571
4572         The toplevel ScopeInfo will also track information like the `this'
4573         pointer if instance variables were referenced (this is necessary
4574         as the anonymous method lives inside a nested class in the host
4575         type of the method). 
4576
4577         (AnonymousMethod): Expanded to track the Toplevel, implement
4578         `AnonymousMethod.Compatible' to tell whether an anonymous method
4579         can be converted to a target delegate type. 
4580
4581         The routine now also produces the anonymous method content
4582
4583         (AnonymousDelegate): A helper class that derives from
4584         DelegateCreation, this is used to generate the code necessary to
4585         produce the delegate for the anonymous method that was created. 
4586
4587         * assign.cs: API adjustments for new changes in
4588         Convert.ImplicitStandardConversionExists.
4589
4590         * class.cs: Adjustments to cope with the fact that now toplevel
4591         blocks are of type `ToplevelBlock'. 
4592
4593         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4594         insteda of standard blocks.
4595
4596         Flag errors if params arguments are passed to anonymous methods.
4597
4598         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4599         `CurrentAnonymousMethod' which points to the current Anonymous
4600         Method.  The variable points to the AnonymousMethod class that
4601         holds the code being compiled.  It is set in the new EmitContext
4602         created for the anonymous method.
4603
4604         (EmitContext.Phase): Introduce a variable and an enumeration to
4605         assist in enforcing some rules about when and where we are allowed
4606         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4607         only one that enfonces this right now).
4608
4609         (EmitContext.HaveCaptureInfo): new helper method that returns
4610         whether we have a CapturedContext initialized.
4611
4612         (EmitContext.CaptureVariable): New method used to register that a
4613         LocalInfo must be flagged for capturing. 
4614
4615         (EmitContext.CapturedParameter): New method used to register that a
4616         parameters must be flagged for capturing. 
4617         
4618         (EmitContext.CapturedField): New method used to register that a
4619         field must be flagged for capturing. 
4620
4621         (EmitContext.HaveCapturedVariables,
4622         EmitContext.HaveCapturedFields): Return whether there are captured
4623         variables or fields. 
4624
4625         (EmitContext.EmitMethodHostInstance): This is used to emit the
4626         instance for the anonymous method.  The instance might be null
4627         (static methods), this (for anonymous methods that capture nothing
4628         and happen to live side-by-side with the current method body) or a
4629         more complicated expression if the method has a CaptureContext.
4630
4631         (EmitContext.EmitTopBlock): Routine that drives the emission of
4632         code: it will first resolve the top block, then emit any metadata
4633         and then emit the code.  The split is done so that we can extract
4634         any anonymous methods and flag any captured variables/parameters.
4635         
4636         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4637         during this phase, the ILGenerator should not be used as labels
4638         and local variables declared here might not be accessible to any
4639         code that is part of an anonymous method.  
4640
4641         Exceptions to this include the temporary variables that are
4642         created by some statements internally for holding temporary
4643         variables. 
4644         
4645         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4646         metadata for a cb
4647
4648         (EmitContext.TemporaryReturn): This method is typically called
4649         from the Emit phase, and its the only place where we allow the
4650         ReturnLabel to be defined other than the EmitMeta.  The reason is
4651         that otherwise we would have to duplicate a lot of logic in the
4652         Resolve phases of various methods that today is on the Emit
4653         phase. 
4654
4655         (EmitContext.NeedReturnLabel): This no longer creates the label,
4656         as the ILGenerator is not valid during the resolve phase.
4657
4658         (EmitContext.EmitThis): Extended the knowledge in this class to
4659         work in anonymous methods in addition to iterators. 
4660
4661         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4662         code is necessary on the stack to access the instance to a local
4663         variable (the variable will be accessed as a field).
4664
4665         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4666         EmitContext.EmitAddressOfParameter): Routines to support
4667         parameters (not completed at this point). 
4668         
4669         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4670         will also remove the parameters.
4671
4672         * convert.cs (Convert): Define a `ConstantEC' which points to a
4673         null.  This is just to prefity some code that uses
4674         ImplicitStandardConversion code and do not have an EmitContext
4675         handy.
4676
4677         The idea is to flag explicitly that at that point in time, it is
4678         known that the conversion will not trigger the delegate checking
4679         code in implicit conversions (which requires a valid
4680         EmitContext). 
4681
4682         Everywhere: pass new EmitContext parameter since
4683         ImplicitStandardConversionExists now requires it to check for
4684         anonymous method conversions. 
4685
4686         (Convert.ImplicitStandardConversionExists): If the type of an
4687         expression is the anonymous_method_type, and the type is a
4688         delegate, we invoke the AnonymousMethod.Compatible method to check
4689         whether an implicit conversion is possible. 
4690
4691         (Convert.ImplicitConversionStandard): Only do implicit method
4692         group conversions if the language level is not ISO_1.
4693
4694         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4695         MethodInfo for the Invoke method.  used by Delegate and
4696         AnonymousDelegate.
4697
4698         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4699         method conversions if the target type is a delegate.
4700
4701         Removed extra debugging nops.
4702
4703         (LocalVariableReference): Turn the `local_info' into a public
4704         field. 
4705
4706         Add `prepared' field, the same hack used for FieldExprs to cope
4707         with composed assignments, as Local variables do not necessarily
4708         operate purely on the stack as they used to: they can be captured
4709         fields. 
4710
4711         Add `temp' for a temporary result, like fields.
4712
4713         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4714
4715         It now copes with Local variables that are captured and emits the
4716         proper instance variable to load it from a field in the captured
4717         case. 
4718
4719         (ParameterReference.DoResolveBase): During the resolve phase,
4720         capture parameters if we are in an anonymous method.
4721
4722         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4723         anonymous method, use the EmitContext helper routines to emit the
4724         parameter reference.
4725
4726         * iterators.cs: Set RemapToProxy to true/false during the
4727         EmitDispose class.
4728
4729         * parameters.cs (GetParameterByName): New helper method. 
4730
4731         * typemanager.cs (anonymous_method_type) a new type that
4732         represents an anonyous method.  This is always an internal type,
4733         used as a fencepost to test against the anonymous-methodness of an
4734         expression. 
4735         
4736 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4737
4738         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4739         561 report.
4740         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4741
4742 2004-10-18  Martin Baulig  <martin@ximian.com>
4743
4744         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4745         `Type' directly, but call ResolveType() on it.
4746         (Catch.Resolve): Likewise.
4747         (Foreach.Resolve): Likewise.
4748
4749 2004-10-18  Martin Baulig  <martin@ximian.com>
4750
4751         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4752         `Type' directly, but call ResolveType() on it.
4753         (Probe.DoResolve): Likewise.
4754         (ArrayCreation.LookupType): Likewise.
4755         (TypeOf.DoResolve): Likewise.
4756         (SizeOf.DoResolve): Likewise.
4757
4758 2004-10-18  Martin Baulig  <martin@ximian.com>
4759
4760         * expression.cs (Invocation.BetterFunction): Put back
4761         TypeManager.TypeToCoreType().
4762
4763 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4764
4765         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4766         the ResolveType.
4767
4768 2004-10-18  Martin Baulig  <martin@ximian.com>
4769
4770         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4771         `Type' directly, but call ResolveType() on it.
4772
4773 2004-10-18  Martin Baulig  <martin@ximian.com>
4774
4775         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4776         `Type' directly, but call ResolveType() on it.
4777         (MemberBase.DoDefine): Likewise.
4778
4779         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4780         `Type' directly, but call ResolveType() on it.
4781         (ComposedCast.DoResolveAsTypeStep): Likewise.
4782
4783         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4784         `Type' directly, but call ResolveType() on it.
4785
4786 2004-10-17  John Luke  <john.luke@gmail.com>
4787
4788         * class.cs (Operator.GetSignatureForError): use CSharpName
4789
4790         * parameter.cs (Parameter.GetSignatureForError): Returns
4791         correct name even if was not defined.
4792
4793 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4794
4795         Fix #65816.
4796         * class.cs (TypeContainer.EmitContext): New property.
4797         (DefineNestedTypes): Create an emitcontext for each part.
4798         (MethodCore.DoDefineParameters): Use container's emitcontext.
4799         Pass type array to InternalParameters.
4800         (MemberBase.DoDefine): Use container's emitcontext.
4801         (FieldMember.Define): Likewise.
4802         (Event.Define): Likewise.
4803         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4804         Pass type array to InternalParameters.
4805         (SetIndexerMethod.GetParameterInfo): Likewise.
4806         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4807         * delegate.cs (Define): Pass emitcontext to
4808         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4809         array to InternalParameters.
4810         * expression.cs (ParameterReference.DoResolveBase): Pass
4811         emitcontext to GetParameterInfo.
4812         (ComposedCast.DoResolveAsTypeStep): Remove check on
4813         ec.ResolvingTypeTree.
4814         * parameter.cs (Parameter.Resolve): Change argument to
4815         EmitContext.  Use ResolveAsTypeTerminal.
4816         (Parameter.GetSignature): Change argument to EmitContext.
4817         (Parameters.ComputeSignature): Likewise.
4818         (Parameters.ComputeParameterTypes): Likewise.
4819         (Parameters.GetParameterInfo): Likewise.
4820         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4821         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4822         * support.cs (InternalParameters..ctor): Remove variant that takes
4823         a DeclSpace.
4824         * typemanager.cs (system_intptr_expr): New.
4825         (InitExpressionTypes): Initialize it.
4826
4827 2004-10-12  Chris Toshok  <toshok@ximian.com>
4828
4829         * cs-parser.jay: fix location for try_statement and catch_clause.
4830
4831 2004-10-11  Martin Baulig  <martin@ximian.com>
4832
4833         * report.cs: Don't make --fatal abort on warnings, we have
4834         -warnaserror for that.
4835
4836 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4837
4838         More DeclSpace.ResolveType avoidance.
4839         * decl.cs (MemberCore.InUnsafe): New property.
4840         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4841         with newly created EmitContext.
4842         (FieldMember.Define): Likewise.
4843         * delegate.cs (Delegate.Define): Likewise.
4844         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4845         only if normal name-lookup fails.
4846         (TypeExpr.DoResolve): Enable error-checking.
4847         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4848         (SizeOf.DoResolve): Likewise.
4849         (ComposedCast.DoResolveAsTypeStep): Likewise.
4850         (StackAlloc.DoResolve): Likewise.
4851         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4852         (Block.Unsafe): New property.
4853         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4854         (Unsafe): Set 'unsafe' flag of contained block.
4855         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4856         (Fixed.Resolve): Likewise.
4857         (Catch.Resolve): Likewise.
4858         (Using.ResolveLocalVariableDecls): Likewise.
4859         (Foreach.Resolve): Likewise.
4860
4861 2004-10-05  John Luke <john.luke@gmail.com>
4862
4863         * cs-parser.jay: add location to error CS0175
4864
4865 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4866
4867         * ecore.cs (Expression.Constantity): Add support for turning null
4868         into a constant.
4869
4870         * const.cs (Const.Define): Allow constants to be reference types
4871         as long as the value is Null.
4872
4873 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4874
4875         * namespace.cs (NamespaceEntry.Using): No matter which warning
4876         level is set, check if this namespace name has already been added.
4877
4878 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4879
4880         * expression.cs: reftype [!=]= null should always use br[true,false].
4881         # 67410
4882
4883 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4884
4885         Fix #67108
4886         * attribute.cs: Enum conversion moved to 
4887         GetAttributeArgumentExpression to be applied to the all
4888         expressions.
4889
4890 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4891
4892         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4893         * class.c (TypeContainer.DefineType): Flag error if
4894         base types aren't accessible due to access permissions.
4895         * decl.cs (DeclSpace.ResolveType): Move logic to
4896         Expression.ResolveAsTypeTerminal.
4897         (DeclSpace.ResolveTypeExpr): Thin layer over
4898         Expression.ResolveAsTypeTerminal.
4899         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4900         Refactor code into NestedAccess.  Use it.
4901         (DeclSpace.NestedAccess): New.
4902         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4903         argument to silence errors.  Check access permissions.
4904         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4905         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4906         (Cast.DoResolve): Likewise.
4907         (New.DoResolve): Likewise.
4908         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4909         (TypeOf.DoResolve): Likewise.
4910
4911         * expression.cs (Invocation.BetterConversion): Return the Type of
4912         the better conversion.  Implement section 14.4.2.3 more faithfully.
4913         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4914         section 14.4.2.2 explicit.
4915         (Invocation.OverloadResolve): Update.
4916         (Invocation): Remove is_base field.
4917         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4918         (Invocation.Emit): Likewise.
4919
4920 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4921
4922         * README: Update to changes.
4923
4924 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4925
4926         * cs-parser.jay: Reverted 642 warning fix.
4927
4928 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4929
4930         Fix bug #66615
4931         * decl.cs (FindMemberWithSameName): Indexer can have more than
4932         1 argument.
4933
4934 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * expression.cs (LocalVariableReference.DoResolveLValue):
4937         Do not report warning 219 for out values.
4938         (EmptyExpression.Null): New member to avoid extra allocations.
4939
4940 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4941
4942         * cs-parser.jay: Fix wrong warning 642 report.
4943
4944         * cs-tokenizer.cs (CheckNextToken): New helper;
4945         Inspect next character if is same as expected.
4946
4947 2004-09-23  Martin Baulig  <martin@ximian.com>
4948
4949         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4950         (Convert.ImplicitReferenceConversionExists): Likewise.
4951
4952 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4953
4954         * class.cs (Operator.Define): Add error 448 and 559 report.
4955
4956 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4957
4958         * class.cs (MemberBase.IsTypePermitted): New protected
4959         method for checking error CS0610.
4960
4961 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4962
4963         * class.cs (TypeContainer.HasExplicitLayout): New property
4964         Returns whether container has StructLayout attribute set Explicit.
4965         (FieldMember): New abstract class for consts and fields.
4966         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4967         (Field): Reuse FieldMember.
4968
4969         * const.cs (Const): Reuse FieldMember.
4970
4971         * rootcontext.cs: EmitConstants call moved to class.
4972
4973 2004-09-22  Martin Baulig  <martin@ximian.com>
4974
4975         Thanks to Peter Sestoft for this bug report.
4976
4977         * expression.cs (Conditional): If both the `trueExpr' and the
4978         `falseExpr' is a NullLiteral, return a NullLiteral.
4979
4980 2004-09-22  Martin Baulig  <martin@ximian.com>
4981
4982         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4983         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4984         for the "get_Current" call.
4985
4986 2004-09-22  Martin Baulig  <martin@ximian.com>
4987
4988         Marek and me just fixed one of our oldest bugs: #28562 :-)
4989
4990         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4991
4992         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4993         we're an EnumConstant, just return that.
4994         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4995         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4996         to get the value which'll actually be written into the attribute.
4997         However, we have to use GetValue() to access the attribute's value
4998         in the compiler.        
4999
5000 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5001
5002         * constant.cs (Constant.IsNegative): New abstract property
5003         IsNegative.
5004
5005         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5006         (StackAlloc.DoResolve): Reused IsNegative.
5007
5008 2004-09-21  Martin Baulig  <martin@ximian.com>
5009
5010         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5011         if we're used in an iterator, we may be called from different
5012         methods.
5013
5014         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5015         we actually have an exception block.
5016
5017 2004-09-20  John Luke <jluke@cfl.rr.com>
5018
5019         * class.cs, cs-parser.jay: Improve the error report for 1520:
5020         report the actual line where the error happens, not where the
5021         class was declared.
5022
5023         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5024         Pass location information that was available elsewhere.
5025
5026 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5027
5028         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5029         runtime to delay sign assemblies.
5030
5031 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5032
5033         * cs-parser.jay: Do not report the stack trace, this is barely
5034         used nowadays.
5035
5036 2004-08-22  John Luke  <john.luke@gmail.com>
5037  
5038         * driver.cs : check that a resource id is not already used
5039         before adding it, report CS1508 if it is, bug #63637
5040
5041 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5042
5043         * ecore.cs: Removed dead code.
5044
5045 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5046
5047         * class.cs: Do not report warning CS0067 on the interfaces.
5048
5049 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * cs-parser.jay: Add error 504 report.
5052
5053 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * rootcontext.cs: WarningLevel is 4 by default now.
5056
5057         * statement.cs (Fixed.Resolve): Do not null
5058         VariableInfo.
5059
5060 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5061
5062         Fixed bug #55780
5063         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5064         deep search when property is not virtual.
5065         (PropertyExpr.ResolveAccessors): Make one call for both
5066         accessors.
5067
5068 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5069
5070         Fixed bug #65766
5071         * statement.cs: Error 152 report constains also location.
5072
5073 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5074
5075         Fixed bug #65766
5076         * const.cs: Explicitly set constant as static.
5077
5078 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5079
5080         Fixed bug #64226
5081         * cs-parser.jay: Add error 1017 report.
5082
5083 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5084
5085         Fixed bug #59980, #64224
5086         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5087
5088         * typemanager.cs (IsSpecialMethod): Simplified
5089
5090 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5091
5092         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5093         condition with better params.
5094
5095 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5096
5097         Fixed bug #65238
5098         * attribute.cs (Resolve): Property has to have both
5099         accessors.
5100
5101 2004-09-14  Martin Baulig  <martin@ximian.com>
5102
5103         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5104
5105 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5106
5107         Fixed bug #61902
5108         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5109         called and is obsolete then this member suppress message
5110         when call is inside next [Obsolete] method or type.
5111
5112         * expression.cs: Use TestObsoleteMethodUsage member.
5113
5114 2004-09-14  Martin Baulig  <martin@ximian.com>
5115
5116         * cs-parser.jay: Sync a bit with the GMCS version.
5117
5118 2004-09-14  Martin Baulig  <martin@ximian.com>
5119
5120         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5121         (CSharpParser.yacc_verbose_flag): New public field.
5122
5123         * genericparser.cs: Removed.
5124
5125 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5126
5127         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5128
5129 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5130
5131         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5132
5133 2004-09-10  Martin Baulig  <martin@ximian.com>
5134
5135         Backported my MemberName changes from GMCS into MCS.
5136
5137         - we are now using a special `MemberName' class instead of using
5138         strings; in GMCS, the `MemberName' also contains the type
5139         arguments.
5140
5141         - changed the grammar rules a bit:
5142           * the old `member_name' is now a `namespace_or_type_name':
5143             The rule is that we use `namespace_or_type_name' everywhere
5144             where we expect either a "member name" (GetEnumerator) or a
5145             "member name" with an explicit interface name
5146             (IEnumerable.GetEnumerator).
5147             In GMCS, the explicit interface name may include type arguments
5148             (IEnumerable<T>.GetEnumerator).
5149           * we use `member_name' instead of just `IDENTIFIER' for
5150             "member names":
5151             The rule is that we use `member_name' wherever a member may
5152             have type parameters in GMCS.       
5153
5154         * decl.cs (MemberName): New public class.
5155         (MemberCore.MemberName): New public readonly field.
5156         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5157         (DeclSpace): Likewise.
5158
5159         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5160         * enum.cs (Enum.ctor): Likewise.
5161
5162         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5163         MemberName.     
5164         (AliasEntry.ctor): Take a MemberName, not an Expression.
5165         (AliasEntry.UsingAlias): Likewise.
5166
5167         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5168         (IMethodData.MemberName): Changed type from string to MemberName.
5169         (MemberBase.ExplicitInterfaceName): Likewise.
5170         (AbstractPropertyEventMethod.SetupName): Make this private.
5171         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5172         argument; compute the member name here.
5173         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5174         on the `member.MemberName' and the `prefix'.
5175
5176         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5177         not `type_name'.
5178         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5179         thus, we get a `MemberName' instead of a `string'.  These
5180         declarations may have type parameters in GMCS.
5181         (interface_method_declaration, delegate_declaration): Likewise.
5182         (class_declaration, interface_declaration): Likewise.
5183         (method_header): Use `namespace_or_type_name' instead of
5184         `member_name'.  We may be an explicit interface implementation.
5185         (property_declaration, event_declaration): Likewise.
5186         (member_name): This is now just an `IDENTIFIER', not a
5187         `namespace_or_type_name'.
5188         (type_name, interface_type): Removed.
5189         (namespace_or_type_name): Return a MemberName, not an Expression.
5190         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5191         call GetTypeExpression() on the MemberName to get an expression.
5192         (IndexerDeclaration.interface_type): Changed type from string to
5193         MemberName.
5194         (MakeName): Operate on MemberName's instead of string's.
5195
5196 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5197
5198         Fix bug #55770.
5199         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5200         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5201         lookup to avoid symbols introduced by 'using'.
5202         * rootcontext.cs (NamespaceLookup): Update.
5203
5204 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5205
5206         * class.cs (TypeContainer.DoDefineMembers): Do not call
5207         DefineDefaultConstructor for static classes.
5208
5209 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5210
5211         * attribute.cs (Attribute.Resolve): Add error 653 report.
5212
5213         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5214         report.
5215         (Method.ApplyAttributeBuilder): Add error 685 report.
5216         (Operator.Define): Add error 564 report.
5217
5218         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5219
5220         * expression.cs (Invocation.DoResolve): Add error
5221         245 and 250 report.
5222
5223         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5224         error 674 report.
5225
5226 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5227
5228         * class.cs (ConstructorInitializer.Resolve):
5229         Wrong error number (515->516).
5230
5231 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * class.cs (Indexer.Define): Add error 631 report.
5234
5235 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5236
5237         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5238
5239 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5240
5241         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5242
5243 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5244
5245         * cs-parser.jay: Added error CS0241 report.
5246
5247 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5248
5249         * cs-parser.jay (fixed_statement): Introduce a scope for the
5250         declaration in the 'fixed' statement.
5251
5252 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5253
5254         * cs-parser.jay: Added CS0230 error report.
5255
5256 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5257
5258         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5259
5260 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * expression.cs (Argument.Resolve): Added error CS0192 and
5263         CS0199 report.
5264
5265 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5266
5267         C# 2.0 #pragma warning feature
5268
5269         * cs-tokenizer.cs (PreProcessPragma): New method; 
5270         Handles #pragma directive.
5271
5272         * report.cs (WarningRegions): New class; Support
5273         class for #pragma warning directive. It tests whether
5274         warning is enabled for a given line.
5275
5276 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5277
5278         * const.cs: Add more descriptive error report, tahnks to
5279         Sebastien. 
5280
5281 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5282
5283         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5284
5285 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5286
5287         * expression.cs: Apply patch from Ben: Remove dead code from
5288         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5289         as that code just threw an exception anwyays.
5290
5291         * const.cs: Remove the call to the turnintoconstant, for details
5292         see bug: #63144
5293         
5294         * literal.cs: The type of the null-literal is the null type;  So
5295         we use a placeholder type (literal.cs:System.Null, defined here)
5296         for it.
5297
5298         * expression.cs (Conditional.DoResolve): Remove some old code that
5299         is no longer needed, conversions have been fixed.
5300
5301         (ArrayCreationExpression.DoResolve): Return false if we fail to
5302         resolve the inner expression.
5303
5304 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5305
5306         Fix test-290.cs.
5307         * cs-parser.jay (delegate_declaration): Record a delegate
5308         declaration as a type declaration.
5309         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5310
5311 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5312
5313         * parameter.cs: Do not crash if the type can not be resolved. 
5314
5315         * expression.cs: Report errors with unsafe pointers, fixes #64896
5316
5317 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5318
5319         * expression.cs: Pointer arith always needs to do a conv.i
5320         if the operand is a long. fix 65320
5321
5322 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5323
5324         Fixed cs0619-37.cs, cs0619-38.cs
5325
5326         * enum.cs (GetObsoleteAttribute): Removed.
5327
5328         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5329         on Enum member is double staged. The first is tested member
5330         and then enum.
5331
5332 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5333
5334         Fixed #56986, #63631, #65231
5335
5336         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5337         adds member to name container.
5338         (TypeContainer.AddToTypeContainer): New method, adds type to
5339         name container.
5340         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5341         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5342         AddOperator): Simplified by reusing AddToMemberContainer.
5343         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5344         instead of field.
5345         (Method.CheckForDuplications): Fixed implementation to test all
5346         possibilities.
5347         (MemberBase): Detection whether member is explicit interface
5348         implementation is now in constructor.
5349         (MemberBase.UpdateMemberName): Handles IndexerName.
5350         (Accessor): Changed to keep also location information.
5351         (AbstractPropertyEventMethod): Is derived from MemberCore.
5352         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5353         will be emited or not.
5354         (PropertyBase.AreAccessorsDuplicateImplementation):
5355         Tests whether accessors are not in collision with some method.
5356         (Operator): Is derived from MethodCore to simplify common
5357         operations.
5358
5359         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5360         must be performed.
5361         (DeclSpace.AddToContainer): Adds the member to defined_names
5362         table. It tests for duplications and enclosing name conflicts.
5363
5364         * enum.cs (EnumMember): Clean up to reuse the base structures
5365
5366 2004-09-03  Martin Baulig  <martin@ximian.com>
5367
5368         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5369         into TypeContainer, to make partial classes work again.
5370
5371 2004-09-03  Martin Baulig  <martin@ximian.com>
5372
5373         * rootcontext.cs (RootContext.V2): Removed.
5374
5375 2004-03-23  Martin Baulig  <martin@ximian.com>
5376
5377         * expression.cs (Invocation.OverloadResolve): Added `bool
5378         may_fail' argument and use it instead of the Location.IsNull() hack.
5379
5380 2004-09-03  Martin Baulig  <martin@ximian.com>
5381
5382         Merged latest changes into gmcs.  Please keep this comment in
5383         here, it makes it easier for me to see what changed in MCS since
5384         the last time I merged.
5385
5386 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5387
5388         Fix #61128.
5389         * expression.cs (BetterConversion): Don't allow either conversion 
5390         to be null.  Remove redundant implicit conversion test when 'q ==
5391         null' -- when this function is invoked, we already know that the
5392         implicit conversion exists.
5393         (BetterFunction): Assume that 'best' is non-null.  Remove
5394         redundant reimplementation of IsApplicable when 'best' is null.
5395         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5396         number of arguments.
5397         (IsAncestralType): Extract from OverloadResolve.
5398         (OverloadResolve): Make robust to the MethodGroupExpr being
5399         unsorted.  Implement all the logic of Section 14.5.5.1, and
5400         support overloading of methods from multiple applicable types.
5401         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5402
5403         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5404         (RealError, Warning): Append type of report to related symbol.
5405
5406 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5407
5408         * enum.cs: Fixed CLS-Compliance checks for enum members.
5409         Error tests cs3008-8.cs, cs3014-8.cs
5410
5411 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5412
5413         Fixed bug #62342, #63102
5414         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5415         like ImplementMethod.
5416
5417 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5418
5419         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5420         Fixed bug #65170.
5421
5422 2004-09-02  Martin Baulig  <martin@ximian.com>
5423
5424         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5425         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5426         on the MethodBase.
5427
5428 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5429
5430         C# 2.0 Static classes implemented
5431
5432         * class.cs (TypeContainer): instance_constructors,
5433         initialized_fields, initialized_static_fields,
5434         default_constructor, base_inteface_types are protected to be
5435         accessible from StaticClass.
5436         (TypeContainer.DefineDefaultConstructor): New virtual method
5437         for custom default constructor generating
5438         (StaticClass): New class to handle "Static classes" feature.
5439
5440         * cs-parser.jay: Handle static keyword on class like instance
5441         of StaticClass.
5442
5443         * driver.cs: Added "/langversion" command line switch with two
5444         options (iso-1, default).
5445
5446 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5447
5448         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5449
5450 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5451
5452         * delegate.cs: Style.
5453
5454 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5455
5456         * delegate.cs: Add seperate instance expr field for miguel.
5457
5458 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5459
5460         * PointerArithmetic (Resolve): make sure we are not doing
5461         pointer arith on void*. Also, make sure we are resolved
5462         by not setting eclass until resolve.
5463
5464         All callers: Make sure that PointerArithmetic gets resolved.
5465
5466 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5467
5468         * ArrayCreation (LookupType): If the type does not resolve 
5469         to an array, give an error.
5470
5471 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * statement.cs (Try.Resolve): Fixed bug #64222
5474
5475 2004-08-27  Martin Baulig  <martin@ximian.com>
5476
5477         * class.cs
5478         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5479         crash here.     
5480
5481 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5482
5483         * ecore.cs (Constantify): Get underlying type via
5484         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5485         Windows in special cases.
5486
5487 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5488
5489         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5490         for obtaining also private methods.
5491         (GetRemoveMethod): Used GetRemoveMethod (true)
5492         for obtaining also private methods.
5493
5494 2004-08-24  Martin Baulig  <martin@ximian.com>
5495
5496         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5497         MethodAttributes.HideBySig for operators.
5498
5499 2004-08-23  Martin Baulig  <martin@ximian.com>
5500
5501         Back to the old error reporting system :-)
5502
5503         * report.cs (Message): Removed.
5504         (Report.MessageData, ErrorData, WarningData): Removed.
5505         (Report.Error, Warning): Back to the old system.
5506
5507 2004-08-23  Martin Baulig  <martin@ximian.com>
5508
5509         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5510
5511         * class.cs (TypeContainer.ParentContainer): New public virtual
5512         method; replaces the explicit interface implementation.
5513         (ClassPart.ParentContainer): Override.
5514
5515 2004-08-23  Martin Baulig  <martin@ximian.com>
5516
5517         * statement.cs (Switch): Added support for constant switches; see
5518         #59428 or test-285.cs.
5519
5520 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5521
5522         Fixed bug #62740.
5523         * statement.cs (GetEnumeratorFilter): Removed useless
5524         logic because C# specs is strict. GetEnumerator must be
5525         public.
5526
5527 2004-08-22  Martin Baulig  <martin@ximian.com>
5528
5529         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5530         a switch and may break, reset the barrier.  Fixes #59867.
5531
5532 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5533
5534         CLS-Compliance speed up (~5% for corlib)
5535
5536         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5537         New method. Tests container for CLS-Compliant names
5538
5539         * class.cs (TypeContainer.VerifyClsName): New method.
5540         Checks whether container name is CLS Compliant.
5541         (Constructor): Implements IMethodData.
5542
5543         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5544         low-case table for CLS Compliance test.
5545         (MemberCache.VerifyClsParameterConflict): New method.
5546         Checks method parameters for CS3006 error.
5547
5548         * enum.cs (EnumMember): Is derived from MemberCore.
5549         (Enum.VerifyClsName): Optimized for better performance.
5550
5551 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5552
5553         * report.cs: Renamed Error_T to Error and changed all
5554         references.
5555
5556 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5557
5558         * class.cs (TypeContainer.IndexerArrayList): New inner class
5559         container for indexers.
5560         (TypeContainer.DefaultIndexerName): New constant for default
5561         indexer name. Replaced all "Item" with this constant.
5562         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5563
5564         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5565         DefaultMemberAttribute constructor.
5566
5567 2004-08-05  Martin Baulig  <martin@ximian.com>
5568
5569         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5570         Fix bug #59429.
5571
5572 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5573
5574         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5575         multi platforms problem.
5576
5577         * compiler.csproj: Included shared files.
5578
5579 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5580
5581         Fix bug 60333, 55971 in the more general way
5582         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5583         Added arg_type argument for constant conversion.
5584         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5585
5586 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5587
5588         Fix bug #59760
5589         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5590         OperatorArrayList, MethodCoreArrayList for typecontainer
5591         containers. Changed class member types to these new types.
5592         (MethodArrayList.DefineMembers): Added test for CS0659.
5593
5594 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5595
5596         * cfold.cs: Synchronize the folding with the code in expression.cs
5597         Binary.DoNumericPromotions for uint operands.
5598
5599         * attribute.cs: Revert patch from Raja, it introduced a regression
5600         while building Blam-1.2.1 (hard to isolate a test case).
5601
5602 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5603
5604         Fix for #55382
5605         * class.cs:
5606         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5607         name collision.
5608         (MethodCore.parent_method): New member. The method we're overriding
5609         if this is an override method.
5610         (MethodCore.CheckBase): Moved from Method class and made common.
5611         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5612         private.
5613         (MethodCore.CheckForDuplications): New abstract method. For custom
5614         member duplication search in a container
5615         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5616         method and its return type.
5617         (Event.conflict_symbol): New member. Symbol with same name in the
5618         parent class.
5619
5620         * decl.cs:
5621         (MemberCache.FindMemberWithSameName): New method. The method
5622         is looking for conflict with inherited symbols.
5623
5624 2004-08-04  Martin Baulig  <martin@ximian.com>
5625
5626         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5627
5628         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5629
5630 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5631
5632         * report.cs (Message): New enum for better error, warning reference in
5633         the code.
5634         (MessageData): New inner abstract class. It generally handles printing of
5635         error and warning messages.
5636         Removed unused Error, Warning, Message methods.
5637
5638 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5639
5640         Fix for cs0592-8.cs test
5641         * attribute.cs
5642         (Attributable.ValidAttributeTargets): Made public.
5643         (Attribute.ExplicitTarget): New member for explicit target value.
5644         (Attribute.CheckTargets): Now we translate explicit attribute
5645         target to Target here.
5646
5647 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5648
5649         * ecore.cs (MethodGroupExpr): new IsBase property.
5650
5651         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5652
5653         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5654         rather than an instance expr.
5655
5656         (DelegateCreation.Emit): Use the method group rather than
5657         the instance expression. Also, if you have base.Foo as the
5658         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5659
5660         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5661
5662         (NewDelegate.DoResolve): Only check for the existance of Invoke
5663         if the method is going to be needed. Use MethodGroupExpr.
5664
5665         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5666
5667         * expression.cs: For pointer arith., make sure to use
5668         the size of the type, not the size of the pointer to
5669         the type.
5670
5671 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5672
5673         Fix for #60722
5674         * class.cs (Class): Added error CS0502 test.
5675
5676 2004-08-03  John Luke  <jluke@cfl.rr.com>
5677             Raja R Harinath  <rharinath@novell.com>
5678
5679         Fix for #60997.
5680         * attribute.cs (Attribute.complained_before): New flag.
5681         (Attribute.ResolveType, Attribute.Resolve),
5682         (Attribute.DefinePInvokeMethod): Set it.
5683         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5684         
5685 2004-08-03  Martin Baulig  <martin@ximian.com>
5686
5687         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5688         use a user-defined operator; we still need to do numeric
5689         promotions in case one argument is a builtin type and the other
5690         one has an implicit conversion to that type.  Fixes #62322.
5691
5692 2004-08-02  Martin Baulig  <martin@ximian.com>
5693
5694         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5695         (LocalInfo.IsThis): New public property.
5696         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5697
5698 2004-08-01  Martin Baulig  <martin@ximian.com>
5699
5700         * class.cs (TypeContainer.GetClassBases): Don't set the default
5701         here since we may get called from GetPartialBases().
5702         (TypeContainer.DefineType): If GetClassBases() didn't return a
5703         parent, use the default one.
5704
5705 2004-07-30  Duncan Mak  <duncan@ximian.com>
5706
5707         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5708
5709 2004-07-30  Martin Baulig  <martin@ximian.com>
5710
5711         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5712
5713         * class.cs (SourceMethod): New public class, derive from the
5714         symbol writer's ISourceMethod.
5715         (Method): Use the new symbol writer API.
5716
5717         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5718         as argument and use the new symbol writer.
5719
5720         * location.cs
5721         (SourceFile): Implement the symbol writer's ISourceFile.
5722         (Location.SymbolDocument): Removed.
5723         (Location.SourceFile): New public property.
5724
5725         * symbolwriter.cs: Use the new symbol writer API.
5726
5727 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5728
5729         * Makefile (install-local): Remove.  Functionality moved to
5730         executable.make.
5731
5732 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5733
5734         * Makefile: Install mcs.exe.config file together with mcs.exe.
5735         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5736         correct runtime version.
5737         
5738 2004-07-25  Martin Baulig  <martin@ximian.com>
5739
5740         * class.cs
5741         (TypeContainer.RegisterOrder): Removed, this was unused.
5742         (TypeContainer, interface_order): Removed.
5743         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5744         TypeContainer as argument since we can also be called with a
5745         `PartialContainer' for a partial class/struct/interface.
5746         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5747         of checking whether we're an `Interface' - we could be a
5748         `PartialContainer'.
5749         (PartialContainer.Register): Override; call
5750         AddClass()/AddStruct()/AddInterface() on our parent.
5751
5752         * cs-parser.jay (interface_member_declaration): Add things to the
5753         `current_container', not the `current_class'.
5754
5755         * rootcontext.cs (RegisterOrder): The overloaded version which
5756         takes an `Interface' was unused, removed.
5757
5758         * typemanager.cs (TypeManager.LookupInterface): Return a
5759         `TypeContainer', not an `Interface'.
5760         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5761         contain a `PartialContainer' for an interface, so check it's
5762         `Kind' to figure out what it is.
5763
5764 2004-07-25  Martin Baulig  <martin@ximian.com>
5765
5766         * class.cs (Class.DefaultTypeAttributes): New public constant.
5767         (Struct.DefaultTypeAttributes): Likewise.
5768         (Interface.DefaultTypeAttributes): Likewise.
5769         (PartialContainer.TypeAttr): Override this and add the
5770         DefaultTypeAttributes.
5771
5772 2004-07-25  Martin Baulig  <martin@ximian.com>
5773
5774         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5775         we can just use the `Parent' field instead.
5776
5777 2004-07-25  Martin Baulig  <martin@ximian.com>
5778
5779         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5780
5781 2004-07-25  Martin Baulig  <martin@ximian.com>
5782
5783         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5784         our parts before defining any methods.
5785         (TypeContainer.VerifyImplements): Make this virtual.
5786         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5787         on our PartialContainer.
5788
5789 2004-07-25  Martin Baulig  <martin@ximian.com>
5790
5791         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5792
5793         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5794         argument, we can just use the `Parent' field instead.
5795
5796         * class.cs
5797         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5798         (MemberBase.DoDefine): Likewise.
5799
5800 2004-07-24  Martin Baulig  <martin@ximian.com>
5801
5802         * decl.cs (MemberCore.Parent): New public field.
5803         (DeclSpace.Parent): Moved to MemberCore.
5804
5805         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5806         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5807         parent's .ctor.
5808         (FieldBase, Field, Operator): Likewise.
5809         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5810         (EventField, Event): Likewise.
5811
5812 2004-07-23  Martin Baulig  <martin@ximian.com>
5813
5814         * class.cs (PartialContainer): New public class.
5815         (ClassPart): New public class.
5816         (TypeContainer): Added support for partial classes.
5817         (TypeContainer.GetClassBases): Splitted some of the functionality
5818         out into GetNormalBases() and GetPartialBases().
5819
5820         * cs-tokenizer.cs (Token.PARTIAL): New token.
5821         (Tokenizer.consume_identifier): Added some hacks to recognize
5822         `partial', but only if it's immediately followed by `class',
5823         `struct' or `interface'.
5824
5825         * cs-parser.jay: Added support for partial clases.
5826
5827 2004-07-23  Martin Baulig  <martin@ximian.com>
5828
5829         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5830         a `DeclSpace' and also made it readonly.
5831         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5832         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5833         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5834
5835         * cs-parser.jay: Pass the `current_class', not the
5836         `current_container' (at the moment, this is still the same thing)
5837         to a new Method, Property, Event, Indexer or Constructor.
5838
5839 2004-07-23  Martin Baulig  <martin@ximian.com>
5840
5841         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5842         and removed the `current_interface' one.
5843         (struct_declaration, class_declaration, interface_declaration):
5844         Set `current_class' to the newly created class/struct/interface;
5845         set their `Bases' and call Register() before parsing their body.
5846
5847 2004-07-23  Martin Baulig  <martin@ximian.com>
5848
5849         * class.cs (Kind): New public enum.
5850         (TypeContainer): Made this class abstract.
5851         (TypeContainer.Kind): New public readonly field.
5852         (TypeContainer.CheckDef): New public method; moved here from
5853         cs-parser.jay.
5854         (TypeContainer.Register): New public abstract method.
5855         (TypeContainer.GetPendingImplementations): New public abstract
5856         method.
5857         (TypeContainer.GetClassBases): Removed the `is_class' and
5858         `is_iface' parameters.
5859         (TypeContainer.DefineNestedTypes): Formerly known as
5860         DoDefineType().
5861         (ClassOrStruct): Made this class abstract.
5862
5863         * tree.cs (RootTypes): New public type. 
5864
5865 2004-07-20  Martin Baulig  <martin@ximian.com>
5866
5867         * tree.cs (Tree.RecordNamespace): Removed.
5868         (Tree.Namespaces): Removed.
5869
5870         * rootcontext.cs (RootContext.IsNamespace): Removed.
5871
5872         * cs-parser.jay (namespace_declaration): Just create a new
5873         NamespaceEntry here.
5874
5875 2004-07-20  Martin Baulig  <martin@ximian.com>
5876
5877         * statement.cs (ExceptionStatement): New abstract class.  This is
5878         now used as a base class for everyone who's using `finally'.
5879         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5880         our local variables before using them.
5881
5882         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5883         virtual method.  This is used by Yield.Resolve() to "steal" an
5884         outer block's `finally' clauses.
5885         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5886         argument.
5887
5888         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5889         version which takes an ExceptionStatement.  This version must be
5890         used to create exception branchings.
5891
5892         * iterator.cs
5893         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5894         (Iterator.EmitMoveNext): Added exception support; protect the
5895         block with a `fault' clause, properly handle 'finally' clauses.
5896         (Iterator.EmitDispose): Run all the `finally' clauses here.
5897
5898 2004-07-20  Martin Baulig  <martin@ximian.com>
5899
5900         * iterator.cs: This is the first of a set of changes in the
5901         iterator code.  Match the spec more closely: if we're an
5902         IEnumerable, then GetEnumerator() must be called.  The first time
5903         GetEnumerator() is called, it returns the current instance; all
5904         subsequent invocations (if any) must create a copy.
5905
5906 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5907
5908         * expression.cs: Resolve the constant expression before returning
5909         it. 
5910
5911 2004-07-19  Martin Baulig  <martin@ximian.com>
5912
5913         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5914         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5915         the return type of the new EmitContext.
5916
5917 2004-07-18  Martin Baulig  <martin@ximian.com>
5918
5919         * class.cs (Property.Define): Fix iterators.
5920
5921         * iterators.cs (Iterator.Define): Moved the
5922         `container.AddInterator (this)' call here from the .ctor; only do
5923         it if we resolved successfully.
5924
5925 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5926
5927         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5928         `true' for preprocessing directives that we parse.  The return
5929         value indicates whether we should return to regular tokenizing or
5930         not, not whether it was parsed successfully.
5931
5932         In the past if we were in: #if false ... #line #endif, we would
5933         resume parsing after `#line'.  See bug 61604.
5934
5935         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5936         building: IsEnumType should return true only for enums, not for
5937         enums or System.Enum itself.  This fixes #61593.
5938
5939         Likely what happened is that corlib was wrong: mcs depended on
5940         this bug in some places.  The bug got fixed, we had to add the
5941         hack, which caused bug 61593.
5942
5943         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5944         that was a workaround for the older conditions.
5945
5946 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5947
5948         * assign.cs: IAssignMethod has a new interface, as documented
5949         inline. All assignment code now uses this new api.
5950
5951         * ecore.cs, expression.cs: All classes which implement
5952         IAssignMethod now use the new interface.
5953
5954         * expression.cs (Invocation): add a hack to EmitCall so that
5955         IndexerAccess can be the target of a compound assignment without
5956         evaluating its arguments twice.
5957
5958         * statement.cs: Handle changes in Invocation api.
5959
5960 2004-07-16  Martin Baulig  <martin@ximian.com>
5961
5962         * iterators.cs: Rewrote this.  We're now using one single Proxy
5963         class for both the IEnumerable and the IEnumerator interface and
5964         `Iterator' derives from Class so we can use the high-level API.
5965
5966         * class.cs (TypeContainer.AddIterator): New method.
5967         (TypeContainer.DoDefineType): New protected virtual method, which
5968         is called from DefineType().
5969         (TypeContainer.DoDefineMembers): Call DefineType() and
5970         DefineMembers() on all our iterators.
5971         (TypeContainer.Emit): Call Emit() on all our iterators.
5972         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5973
5974         * codegen.cs (EmitContext.CurrentIterator): New public field.
5975
5976 2004-07-15  Martin Baulig  <martin@ximian.com>
5977
5978         * typemanager.cs
5979         (TypeManager.not_supported_exception_type): New type.   
5980
5981 2004-07-14  Martin Baulig  <martin@ximian.com>
5982
5983         * iterators.cs: Use real error numbers.
5984
5985 2004-07-14  Martin Baulig  <martin@ximian.com>
5986
5987         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5988         requires this to be a System.Collection.IEnumerable and not a
5989         class implementing that interface.
5990         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5991
5992 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5993
5994         * class.cs: Fixed previous fix, it broke some error tests.
5995
5996 2004-07-12  Martin Baulig  <martin@ximian.com>
5997
5998         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5999         Fixes #61293.
6000
6001 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6002
6003         * assign.cs (LocalTemporary): Add new argument: is_address,If
6004         `is_address' is true, then the value that we store is the address
6005         to the real value, and not the value itself.
6006         
6007         * ecore.cs (PropertyExpr): use the new local temporary
6008         stuff to allow us to handle X.Y += z (where X is a struct)
6009
6010 2004-07-08  Martin Baulig  <martin@ximian.com>
6011
6012         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6013         not always return, just like we're doing in Using.Resolve().
6014
6015 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6016
6017         * cs-parser.jay (fixed_statement): flag this as Pinned.
6018
6019 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6020
6021         * typemanager.cs (TypeManager): Removed MakePinned method, this
6022         mechanism is replaced with the .NET 2.x compatible mechanism of
6023         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6024
6025         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6026         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6027         `IsFixed' property which has a different meaning.
6028
6029 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6030
6031         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6032         visible from inside a nested class, not just the names of the
6033         immediately enclosing class.
6034         Fix for bug #60730.
6035
6036 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6037
6038         * expression.cs (BetterConversion): Remove buggy special-case
6039         handling of "implicit constant expression conversions".  At this
6040         point, we already know that the conversion is possible -- we're
6041         only checking to see which is better.
6042
6043 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * cs-parser.jay: Added error CS0210 test.
6046
6047 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6048
6049         * cs-parser.jay: Added error CS0134 test.
6050
6051 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6052
6053         Fix bug #52507
6054         * cs-parser.jay: Added error CS0145 test.
6055
6056 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6057
6058         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6059
6060 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6061         
6062         * expression.cs (StackAlloc.Resolve): The argument may not
6063         be a constant; deal with this case.
6064         
6065 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6066
6067         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6068         GetIndexerAttributeValue.
6069         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6070
6071         * class.cs (Indexer.Define): Added error tests for CS0415,
6072         CS0609.
6073
6074 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6077         property code.
6078
6079 2004-06-23  Martin Baulig  <martin@ximian.com>
6080
6081         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6082         neither return nor throw, reset the barrier as well.  Fixes #60457.
6083
6084 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6085
6086         * class.cs : EventAttributes is now set to None by default.
6087           This fixes bug #60459.
6088
6089 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6090
6091         Fix bug #60219
6092         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6093         Don't throw exception but return null (it's sufficient now).
6094
6095 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6096
6097         * typemanager.cs (GetArgumentTypes): Faster implementation.
6098
6099 2004-06-18  Martin Baulig  <martin@ximian.com>
6100
6101         * attribute.cs (Attribute.Resolve): Check whether we're an
6102         EmptyCast which a Constant child.  Fixes #60333.
6103
6104 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6105
6106         * statement.cs (EmitCollectionForeach): Account for the fact that
6107         not all valuetypes are in areas which we can take the address of.
6108         For these variables, we store to a temporary variable. Also, make
6109         sure that we dont emit a `callvirt' on a valuetype method.
6110
6111 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6112
6113         * expression.cs (StackAlloc.DoReSolve): Added test for
6114         negative parameter (CS0247).
6115
6116 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6117
6118         Fix bug #59792
6119         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6120
6121 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6122
6123         Fix bug #59781
6124         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6125         ulong.
6126
6127 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6128
6129         Fix bug #58254 & cs1555.cs, cs1556.cs
6130         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6131
6132 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6133
6134         * cs-parser.jay: Added error CS1669 test for indexers.
6135
6136 2004-06-11  Martin Baulig  <martin@ximian.com>
6137
6138         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6139         call this twice: for params and varargs methods.
6140
6141 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * class.cs:
6144         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6145
6146 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * attribute.cs (Attribute.GetValidTargets): Made public.
6149
6150         * class.cs: 
6151         (AbstractPropertyEventMethod): New class for better code sharing.
6152         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6153         CS1667 report.
6154         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6155
6156 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6157
6158         Fix bug #59477.
6159         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6160         that the call to Resolve is part of a MemberAccess.
6161         (Expression.Resolve): Use it for SimpleName resolution.
6162         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6163         Add 'intermediate' boolean argument.
6164         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6165         error message when the SimpleName can be resolved ambiguously
6166         between an expression and a type.
6167         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6168         public.
6169         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6170         call on the left-side.
6171
6172 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6173
6174         * class.cs:
6175         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6176
6177 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6178
6179         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6180
6181 2004-06-11  Martin Baulig  <martin@ximian.com>
6182
6183         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6184         varargs methods if applicable.
6185
6186 2004-06-11  Martin Baulig  <martin@ximian.com>
6187
6188         * expression.cs (Invocation.EmitCall): Don't use
6189         `method.CallingConvention == CallingConventions.VarArgs' since the
6190         method could also have `CallingConventions.HasThis'.
6191
6192 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6193
6194         * class.cs (Event.GetSignatureForError): Implemented.
6195         Fixed crash in error test cs3010.cs
6196
6197 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6198
6199         * cs-tokenizer.cs: Change the way we track __arglist to be
6200         consistent with the other keywords.
6201
6202 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6203
6204         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6205         tomorrow.
6206
6207 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6208
6209         * codegen.cs: Check that all referenced assemblies have a strongname
6210         before strongnaming the compiled assembly. If not report error CS1577.
6211         Fix bug #56563. Patch by Jackson Harper.
6212         * typemanager.cs: Added a method to return all referenced assemblies.
6213         Fix bug #56563. Patch by Jackson Harper.
6214
6215 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6216
6217         * class.cs:
6218         (Method.ApplyAttributeBuilder): Moved and added conditional
6219         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6220
6221         * delegate.cs:
6222         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6223
6224 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6225
6226         Fixed #59640
6227         * class.cs: (EventField.attribute_targets): Changed default target.
6228
6229 2004-06-08  Martin Baulig  <martin@ximian.com>
6230
6231         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6232
6233 2004-06-08  Martin Baulig  <martin@ximian.com>
6234
6235         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6236
6237 2004-06-07  Martin Baulig  <martin@ximian.com>
6238
6239         Added support for varargs methods.
6240
6241         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6242         keyword.
6243
6244         * cs-parser.jay: Added support for `__arglist'.
6245
6246         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6247
6248         * expression.cs (Argument.AType): Added `ArgList'.
6249         (Invocation): Added support for varargs methods.
6250         (ArglistAccess): New public class.
6251         (Arglist): New public class.
6252
6253         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6254
6255         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6256         a method's top-level block if the method has varargs.
6257
6258         * support.cs (ReflectionParameters, InternalParameters): Added
6259         support for varargs methods.    
6260
6261 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6262
6263         * class.cs: Provide location in indexer error report.
6264
6265         * driver.cs: Use standard names.
6266
6267         * namespace.cs: Catch the use of using after a namespace has been
6268         declared also on using aliases.
6269
6270 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6271
6272         Bug #50820.
6273         * typemanager.cs (closure_private_ok, closure_invocation_type)
6274         (closure_qualifier_type, closure_invocation_assembly)
6275         (FilterWithClosure): Move to ...
6276         (Closure): New internal nested class.
6277         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6278         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6279         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6280         (MemberLookup, MemberLookupFailed): Use it.
6281         * expression.cs (New.DoResolve): Treat the lookup for the
6282         constructor as being qualified by the 'new'ed type.
6283         (Indexers.GetIndexersForTypeOrInterface): Update.
6284
6285 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6286
6287         * attribute.cs
6288         (GetConditionalAttributeValue): New method. Returns
6289         condition of ConditionalAttribute.
6290         (SearchMulti): New method.  Returns all attributes of type 't'.
6291         Use it when attribute is AllowMultiple = true.
6292         (IsConditionalMethodExcluded): New method.
6293
6294         * class.cs
6295         (Method.IsExcluded): Implemented. Returns true if method has conditional
6296         attribute and the conditions is not defined (method is excluded).
6297         (IMethodData): Extended interface for ConditionalAttribute support.
6298         (PropertyMethod.IsExcluded): Implemented.
6299
6300         * decl.cs
6301         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6302
6303         * expression.cs
6304         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6305         on the method.
6306
6307 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6308
6309         * expression.cs (ArrayCreationExpression): Make this just an
6310         `expression'. It can't be a statement, so the code here was
6311         dead.
6312
6313 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6314
6315         Fixed #59072
6316         * typemanager.cs (GetFullNameSignature): New method for
6317         MethodBase types.
6318
6319 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6320
6321         Fixed #56452
6322         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6323         Use this method when MethodBuilder is null.
6324         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6325         Added test for error CS0626 (MONO reports error for this situation).
6326         (IMethodData.GetSignatureForError): Extended interface.
6327
6328 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6329
6330         * attribute.cs
6331         (AttributeTester.GetObsoleteAttribute): Returns instance of
6332         ObsoleteAttribute when type is obsolete.
6333
6334         * class.cs
6335         (TypeContainer.VerifyObsoleteAttribute): Override.
6336         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6337         (MethodCode.VerifyObsoleteAttribute): Override.
6338         (MemberBase.VerifyObsoleteAttribute): Override.
6339
6340         * decl.cs
6341         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6342         and report proper error.
6343
6344         *delegate.cs
6345         Delegate.VerifyObsoleteAttribute): Override.
6346
6347         * ecore.cs
6348         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6349         and report proper error.
6350         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6351
6352         * enum.cs
6353         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6354         and enum member.
6355
6356         * expression.cs
6357         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6358         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6359         Added test for ObsoleteAttribute.
6360
6361         * statement.cs
6362         (Catch): Derived from Statement.
6363
6364 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6365  
6366         Fixed bug #59071 & cs0160.cs
6367  
6368         * statement.cs (Try.Resolve): Check here whether order of catch
6369         clauses matches their dependencies.
6370
6371 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6372
6373         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6374         caused a regression: #59343.  Referencing nested classes from an
6375         assembly stopped working.
6376
6377 2004-05-31  Martin Baulig  <martin@ximian.com>
6378
6379         MCS is now frozen for beta 2.
6380
6381 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6382
6383         * convert.cs: add a trivial cache for overload operator resolution.
6384
6385 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6386
6387         * decl.cs: If possible, use lookuptypedirect here. We can only do
6388         this if there is no `.' after the namespace. Avoids using
6389         LookupType, which does lots of slow processing.
6390         (FindNestedType) New method, does what it says :-).
6391         * namespace.cs: use LookupTypeDirect.
6392         * rootcontext.cs: use membercache, if possible.
6393         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6394
6395 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6396
6397         * expression.cs:
6398         According to the spec, 
6399
6400         In a member access of the form E.I, if E is a single identifier,
6401         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6402         field, property, localvariable, or parameter with the same type as
6403         the meaning of E as a type-name (§3.8), then both possible
6404         meanings of E are permitted.
6405
6406         We did not check that E as a simple-name had the same type as E as
6407         a type name.
6408
6409         This trivial check gives us 5-7% on bootstrap time.
6410
6411 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6412
6413         * expression.cs (Invocation.OverloadResolve): Avoid the
6414         use of hashtables and boxing here by allocating on demand.
6415
6416 2004-05-30  Martin Baulig  <martin@ximian.com>
6417
6418         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6419         we're doing a silent lookup.  Don't try to lookup nested types in
6420         TypeManager.object_type (thanks to Ben Maurer).
6421
6422 2004-05-30  Martin Baulig  <martin@ximian.com>
6423
6424         Committing a patch from Ben Maurer.
6425
6426         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6427
6428 2004-05-29  Martin Baulig  <martin@ximian.com>
6429
6430         * class.cs (IMethodData.ShouldIgnore): New method.
6431
6432         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6433         `Location' argument, we don't need it anywhere.  Use
6434         `IMethodData.ShouldIgnore ()' instead of
6435         `MethodData.GetMethodFlags ()'.
6436         (TypeManager.AddMethod): Removed.
6437         (TypeManager.AddMethod2): Renamed to AddMethod.
6438
6439 2004-05-29  Martin Baulig  <martin@ximian.com>
6440
6441         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6442
6443         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6444         converting from a class type S to an interface type and we already
6445         have an object on the stack, don't box it again.  Fixes #52578.
6446
6447 2004-05-29  Martin Baulig  <martin@ximian.com>
6448
6449         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6450         Added support for `params' parameters.  Fixes #59267.
6451
6452 2004-05-29  Martin Baulig  <martin@ximian.com>
6453
6454         * literal.cs (NullPointer): Provide a private .ctor which sets
6455         `type' to TypeManager.object_type.  Fixes #59048.
6456
6457 2004-05-29  Martin Baulig  <martin@ximian.com>
6458
6459         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6460         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6461
6462         * ecore.cs (EventExpr.instance_expr): Make the field private.
6463
6464 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6465
6466         Fixed bug #50080 & cs0214-2.cs
6467         * expression.cs (Cast.DoResolve): Check unsafe context here.
6468         
6469         * statement.cs (Resolve.DoResolve): Likewise.
6470
6471 2004-05-26  Martin Baulig  <martin@ximian.com>
6472
6473         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6474
6475         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6476         (RootContext.LookupType): Pass down the `silent' flag.
6477
6478 2004-05-25  Martin Baulig  <martin@ximian.com>
6479
6480         * expression.cs
6481         (MethodGroupExpr.IdenticalTypeName): New public property.
6482         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6483         expression actually refers to a type.
6484
6485 2004-05-25  Martin Baulig  <martin@ximian.com>
6486
6487         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6488         for #56176 and made it actually work.
6489
6490 2004-05-25  Martin Baulig  <martin@ximian.com>
6491
6492         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6493         (FieldExpr, PropertyExpr): Override and implement
6494         CacheTemporaries.  Fixes #52279.
6495
6496 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6497
6498         * location.cs: In the new compiler listing a file twice is a
6499         warning, not an error.
6500
6501 2004-05-24  Martin Baulig  <martin@ximian.com>
6502
6503         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6504         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6505
6506 2004-05-24  Martin Baulig  <martin@ximian.com>
6507
6508         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6509         walking the `using' list.  Fixes #53921.
6510
6511 2004-05-24  Martin Baulig  <martin@ximian.com>
6512
6513         * const.cs (Const.LookupConstantValue): Added support for
6514         EmptyCast's; fixes #55251.
6515
6516 2004-05-24  Martin Baulig  <martin@ximian.com>
6517
6518         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6519         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6520         which does the CS0135 check.  The reason is that we first need to
6521         check whether the variable actually exists.
6522
6523 2004-05-24  Martin Baulig  <martin@ximian.com>
6524
6525         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6526         than RootContext.LookupType() to find the explicit interface
6527         type.  Fixes #58584.
6528
6529 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6530
6531         * Makefile: Simplify.  Use executable.make.
6532         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6533
6534 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6535
6536         * decl.cs:
6537         * enum.cs:
6538         Use the invariant culture when doing String.Compare for CLS case
6539         sensitivity.
6540         
6541 2004-05-23  Martin Baulig  <martin@ximian.com>
6542
6543         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6544         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6545
6546         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6547         
6548 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6549
6550         * class.cs (MemberBase.Define): Reuse MemberType member for 
6551         resolved type. Other methods can use it too.
6552
6553 2004-05-23  Martin Baulig  <martin@ximian.com>
6554
6555         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6556         the variable also exists in the current block (otherwise, we need
6557         to report a CS0103).  Fixes #58670.
6558
6559 2004-05-23  Martin Baulig  <martin@ximian.com>
6560
6561         * flowanalysis.cs (Reachability.Reachable): Compute this
6562         on-the-fly rather than storing it as a field.
6563
6564 2004-05-23  Martin Baulig  <martin@ximian.com>
6565
6566         * flowanalysis.cs (Reachability.And): Manually compute the
6567         resulting `barrier' from the reachability.      
6568        
6569 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6570
6571         Fix bug #57835
6572         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6573         instance of ObsoleteAttribute when symbol is obsolete.
6574
6575         * class.cs
6576         (IMethodData): Extended interface for ObsoleteAttribute support.
6577
6578 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6579
6580         * attribute.cs: Fix bug #55970
6581
6582 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6583
6584         Fix bug #52705
6585         * attribute.cs
6586         (GetObsoleteAttribute): New method. Creates the instance of
6587         ObsoleteAttribute.
6588         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6589         ObsoleteAttribute when member is obsolete.
6590         (AttributeTester.Report_ObsoleteMessage): Common method for
6591         Obsolete error/warning reporting.
6592
6593         * class.cs
6594         (TypeContainer.base_classs_type): New member for storing parent type.
6595
6596         * decl.cs
6597         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6598         for this MemberCore.
6599
6600 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6601
6602         * attribute.cs, const.cs: Fix bug #58590
6603
6604 2004-05-21  Martin Baulig  <martin@ximian.com>
6605
6606         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6607         out parameters if the end of the method is unreachable.  Fixes
6608         #58098. 
6609
6610 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6611
6612         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6613         Hari was right, why extra method.
6614
6615 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6616
6617         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6618
6619 2004-05-20  Martin Baulig  <martin@ximian.com>
6620
6621         Merged this back from gmcs to keep the differences to a minumum.
6622
6623         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6624         instead of a Declspace.
6625         (Attribute.ResolveType): Likewise.
6626         (Attributes.Search): Likewise.
6627         (Attributes.Contains): Likewise.
6628         (Attributes.GetClsCompliantAttribute): Likewise.
6629
6630         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6631         argument.
6632         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6633         DeclSpace.
6634
6635 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6636
6637         Fix bug #58688 (MCS does not report error when the same attribute
6638         is assigned twice)
6639
6640         * attribute.cs (Attribute.Emit): Distinction between null and default.
6641
6642 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6643
6644         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6645         of a top-level attribute without an attribute target.
6646         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6647         Make non-static.
6648         (Attribute.Conditional_GetConditionName), 
6649         (Attribute.Obsolete_GetObsoleteMessage): Update.
6650         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6651         part of ScanForIndexerName.
6652         (Attribute.CanIgnoreInvalidAttribute): New function.
6653         (Attribute.ScanForIndexerName): Move to ...
6654         (Attributes.ScanForIndexerName): ... here.
6655         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6656         (Attributes.Search): New internal variant that can choose not to
6657         complain if types aren't resolved.  The original signature now
6658         complains.
6659         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6660         complaints suppressed.
6661         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6662         only if it not useful.
6663         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6664         top-level for attributes that are shared between the assembly
6665         and a top-level class.
6666         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6667         * class.cs: Update to reflect changes.
6668         (DefineIndexers): Fuse loops.
6669         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6670         a couple more variants of attribute names.
6671
6672 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6673
6674         Fix bug #52585 (Implemented explicit attribute declaration)
6675
6676         * attribute.cs:
6677         (Attributable.ValidAttributeTargets): New abstract method. It gets
6678         list of valid attribute targets for explicit target declaration.
6679         (Attribute.Target): It holds target itself.
6680         (AttributeSection): Removed.
6681         (Attribute.CheckTargets): New method. It checks whether attribute
6682         target is valid for the current element.
6683
6684         * class.cs:
6685         (EventProperty): New class. For events that are declared like
6686         property (with add and remove accessors).
6687         (EventField): New class. For events that are declared like field.
6688         class.cs
6689
6690         * cs-parser.jay: Implemented explicit attribute target declaration.
6691
6692         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6693         Override ValidAttributeTargets.
6694
6695         * parameter.cs:
6696         (ReturnParameter): Class for applying custom attributes on 
6697         the return type.
6698         (ParameterAtribute): New class. Class for applying custom
6699         attributes on the parameter type.
6700
6701 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6702
6703         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6704         definitions. 
6705
6706         (Method): Allow UNSAFE here.
6707
6708         * modifiers.cs: Support unsafe reporting.
6709
6710 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6711
6712         * decl.cs: Fix bug #58478.
6713
6714 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6715
6716         * statement.cs: When checking for unreachable code on an EmptyStatement,
6717         set the location. Fixes bug #58488.
6718
6719 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6720
6721         * driver.cs: Add -pkg handling.
6722
6723         From Gonzalo: UseShelLExecute=false
6724
6725 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6726
6727         * attribute.cs:
6728         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6729         for attribute.
6730         (Attribute.IsClsCompliaceRequired): Moved to base for better
6731         accesibility.
6732         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6733         when attribute is AttributeUsageAttribute.
6734         (Attribute.GetValidTargets): Simplified.
6735         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6736         attribute for this type.
6737         (Attribute.ApplyAttributes): Method renamed to Emit and make
6738         non-static.
6739         (GlobalAttributeSection): New class for special handling of global
6740         attributes (assembly, module).
6741         (AttributeSection.Emit): New method.
6742
6743         * class.cs: Implemented Attributable abstract methods.
6744         (MethodCore.LabelParameters): Moved to Parameter class.
6745         (Accessor): Is back simple class.
6746         (PropertyMethod): Implemented Attributable abstract class.
6747         (DelegateMethod): Implemented Attributable abstract class.
6748         (Event): New constructor for disctintion between normal Event
6749         and Event with accessors.
6750
6751         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6752
6753         * codegen.cs, const.cs, decl.cs, delegate.cs:
6754         (CommonAssemblyModulClass): Implemented Attributable abstract class
6755         and simplified.
6756
6757         * enum.cs: Implement IAttributeSupport interface.
6758         (EnumMember): New class for emum members. Implemented Attributable
6759         abstract class
6760
6761         * parameter.cs:
6762         (ParameterBase): Is abstract.
6763         (ReturnParameter): New class for easier [return:] attribute handling.
6764
6765         * typemanager.cs: Removed builder_to_attr.
6766
6767 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6768
6769         Fix bug #57151.
6770         * attribute.cs (Attribute.GetPositionalValue): New function.
6771         * class.cs (TypeContainer.VerifyMembers): New function.
6772         (TypeContainer.Emit): Use it.
6773         (ClassOrStruct): New base class for Class and Struct.
6774         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6775         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6776         class.
6777         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6778         then each non-static field should have a FieldOffset attribute.
6779         Otherwise, none of the fields should have a FieldOffset attribute.
6780         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6781         and FieldOffset attributes.
6782         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6783         (TypeManager.field_offset_attribute_type): New core types.
6784         (TypeManager.InitCoreTypes): Initialize them.
6785
6786 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6787
6788         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6789         Return correct type.
6790         From bug #58270.
6791
6792 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6793
6794         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6795         be implicitly converted to ulong.
6796         
6797         * expression.cs: The logic for allowing operator &, | and ^ worked
6798         was wrong, it worked before because we did not report an error in
6799         an else branch.  Fixes 57895.
6800
6801         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6802         allow volatile fields to be reference types.
6803
6804 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6805
6806         * driver.cs: Add support for /debug-
6807
6808 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6809
6810         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6811         Add a 'complain' parameter to silence errors.
6812         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6813         silently overlooked type-resolutions.
6814         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6815         to reflect changes.
6816         (Attributes.Search): New function.
6817         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6818         (Attributes.GetAttributeFullName): Remove hack.
6819         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6820         Update to reflect changes.
6821         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6822         Use Attributes.Search instead of nested loops.
6823
6824 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6825
6826         * decl.cs:
6827         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6828         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6829         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6830
6831         * report.cs: (Report.Warning): Renamed to Warning_T because of
6832         parameter collision.
6833
6834 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6835
6836         * expression.cs (MemberAccess.ResolveMemberAccess):
6837         Exit with non-zero status after Report.Error.
6838         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6839         Likewise.
6840         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6841
6842 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6843
6844         * support.cs: Don't hang when the file is empty.
6845
6846 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6847
6848         * support.cs: In SeekableStreamReader, compute the preamble size of the
6849           underlying stream. Position changes should take into account that initial
6850           count of bytes.
6851
6852 2004-05-03  Todd Berman  <tberman@sevenl.net>
6853
6854         * driver.cs: remove unused GetSysVersion function.
6855
6856 2004-05-03  Todd Berman  <tberman@sevenl.net>
6857
6858         * driver.cs: Remove the hack from saturday, as well as the hack
6859         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6860         link_paths to get that bit proper.
6861
6862 2004-05-01  Todd Berman  <tberman@sevenl.net>
6863
6864         * driver.cs: Try a LoadFrom before a Load, this checks the current
6865         path. This is currently a bug in mono that is be fixed, however, this
6866         provides a workaround for now. This will be removed when the bug
6867         is fixed.
6868
6869 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6870
6871         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6872         incomplete key pairs (#57941).
6873
6874 2004-05-01  Todd Berman  <tberman@sevenl.net>
6875
6876         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6877         from the GAC
6878
6879 2004-04-30  Jackson Harper  <jackson@ximian.com>
6880
6881         * codegen.cs: Open keys readonly.
6882         
6883 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6884
6885         * typemanager.cs: don't report cyclic struct layout when a struct
6886         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6887         which has 2 Pango.Rectangle fields.
6888
6889 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6890
6891         * expression.cs: Handle IntPtr comparisons with IL code
6892         rather than a method call.
6893
6894 2004-04-29  Martin Baulig  <martin@ximian.com>
6895
6896         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6897         the list of PropertyInfo's in class hierarchy and find the
6898         accessor.  Fixes #56013.
6899
6900 2004-04-29  Martin Baulig  <martin@ximian.com>
6901
6902         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6903
6904 2004-04-29  Martin Baulig  <martin@ximian.com>
6905
6906         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6907
6908         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6909
6910 2004-04-29  Martin Baulig  <martin@ximian.com>
6911
6912         * class.cs (ConstructorInitializer.Resolve): Check whether the
6913         parent .ctor is accessible.  Fixes #52146.
6914
6915 2004-04-29  Martin Baulig  <martin@ximian.com>
6916
6917         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6918
6919         * statement.cs (Using.EmitLocalVariableDecls): Use
6920         TypeManager.idisposable_type, not typeof (IDisposable).
6921         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6922
6923 2004-04-29  Martin Baulig  <martin@ximian.com>
6924
6925         * class.cs (Event.Define): Don't emit the field and don't set
6926         RTSpecialName and SpecialName for events on interfaces.  Fixes
6927         #57703. 
6928
6929 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6930
6931         Refactor Attribute.ApplyAttributes.
6932         * attribute.cs (Attributable): New base class for objects that can
6933         have Attributes applied on them.
6934         (Attribute): Make AttributeUsage fields public.
6935         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6936         (Attribute.IsInternalCall): New property.
6937         (Attribute.UsageAttr): Convert to a public read-only property.
6938         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6939         (Attribute.ResolveType, Attribute.Resolve)
6940         (Attribute.ScanForIndexerName): Update to reflect changes.
6941         (Attribute.CheckAttributeTarget): Re-format.
6942         (Attribute.ApplyAttributes): Refactor, to various
6943         Attributable.ApplyAttributeBuilder methods.
6944         * decl.cs (MemberCore): Make Attributable.
6945         * class.cs (Accessor): Make Attributable.
6946         (MethodData.ApplyAttributes): Use proper attribute types, not
6947         attribute names.
6948         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6949         (TypeContainer.ApplyAttributeBuilder)
6950         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6951         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6952         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6953         (Operator.ApplyAttributeBuilder): New factored-out methods.
6954         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6955         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6956         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6957         * parameter.cs (ParameterBase): New Attributable base class
6958         that can also represent Return types.
6959         (Parameter): Update to the changes.
6960
6961 2004-04-29  Jackson Harper  <jackson@ximian.com>
6962
6963         * driver.cs: Prefer the corlib system version when looking for
6964         assemblies in the GAC. This is still a hack, but its a better hack
6965         now.
6966         
6967 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6968
6969         * decl.cs, enum.cs: Improved error 3005 reporting.
6970   
6971         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6972         (related_symbols): New private member for list of symbols
6973         related to reported error/warning.
6974         
6975         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6976
6977 2004-04-29  Martin Baulig  <martin@ximian.com>
6978
6979         * ecore.cs (Expression.Constantify): If we're an enum and
6980         TypeManager.TypeToCoreType() doesn't give us another type, use
6981         t.UnderlyingSystemType.  Fixes #56178.  
6982
6983 2004-04-29  Martin Baulig  <martin@ximian.com>
6984
6985         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6986         interfaces and for each interface, only add members directly
6987         declared in that interface.  Fixes #53255.
6988
6989 2004-04-28  Martin Baulig  <martin@ximian.com>
6990
6991         * expression.cs (ConditionalLogicalOperator): Use a temporary
6992         variable for `left' to avoid that we evaluate it more than once;
6993         bug #52588.
6994
6995 2004-04-28  Martin Baulig  <martin@ximian.com>
6996
6997         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6998         `void[]' (CS1547).
6999
7000 2004-04-28  Martin Baulig  <martin@ximian.com>
7001
7002         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7003         void (CS1547).
7004
7005         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7006         whether the type is not void (CS1547).
7007
7008 2004-04-28  Martin Baulig  <martin@ximian.com>
7009
7010         * expression.cs (Unary.DoResolveLValue): Override this and report
7011         CS0131 for anything but Operator.Indirection.
7012
7013 2004-04-28  Martin Baulig  <martin@ximian.com>
7014
7015         Committing a patch from Ben Maurer; see bug #50820.
7016
7017         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7018         check for classes.
7019
7020         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7021         classes.        
7022
7023 2004-04-28  Martin Baulig  <martin@ximian.com>
7024
7025         Committing a patch from Ben Maurer; see bug #50820.
7026
7027         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7028         check for classes.
7029
7030         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7031         classes.        
7032
7033 2004-04-28  Martin Baulig  <martin@ximian.com>
7034
7035         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7036         (Block.AddLabel): Call DoLookupLabel() to only search in the
7037         current block.
7038
7039 2004-04-28  Martin Baulig  <martin@ximian.com>
7040
7041         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7042         comparing StringConstants and NullLiterals in Equality and Inequality.
7043
7044 2004-04-28  Jackson Harper  <jackson@ximian.com>
7045
7046         * driver.cs: Attempt to load referenced assemblies from the
7047         GAC. This is the quick and dirty version of this method that
7048         doesnt take into account versions and just takes the first
7049         canidate found. Will be good enough for now as we will not have more
7050         then one version installed into the GAC until I update this method.
7051
7052 2004-04-28  Martin Baulig  <martin@ximian.com>
7053
7054         * typemanager.cs (TypeManager.CheckStructCycles): New public
7055         static method to check for cycles in the struct layout.
7056
7057         * rootcontext.cs (RootContext.PopulateTypes): Call
7058         TypeManager.CheckStructCycles() for each TypeContainer.
7059         [Note: We only need to visit each type once.]
7060
7061 2004-04-28  Martin Baulig  <martin@ximian.com>
7062
7063         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7064
7065         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7066         success and added `out object value'.  Use a `bool resolved' field
7067         to check whether we've already been called rather than
7068         `ConstantValue != null' since this breaks for NullLiterals.
7069
7070 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7071
7072         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7073         setting of this flag, since the 'set' method may be non-public.
7074
7075 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7076
7077         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7078         check on current_vector.Block.
7079
7080 2004-04-27  Martin Baulig  <martin@ximian.com>
7081
7082         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7083         a field initializer.  Fixes #56459.
7084
7085 2004-04-27  Martin Baulig  <martin@ximian.com>
7086
7087         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7088         we're not attempting to use an indexer.  Fixes #52154.
7089
7090 2004-04-27  Martin Baulig  <martin@ximian.com>
7091
7092         * statement.cs (Return): Don't create a return label if we don't
7093         need it; reverts my change from January 20th.  Thanks to Ben
7094         Maurer for this.
7095
7096 2004-04-27  Martin Baulig  <martin@ximian.com>
7097
7098         According to the spec, `goto' can only leave a nested scope, but
7099         never enter it.
7100
7101         * statement.cs (Block.LookupLabel): Only lookup in the current
7102         block, don't recurse into parent or child blocks.
7103         (Block.AddLabel): Check in parent and child blocks, report
7104         CS0140/CS0158 if we find a duplicate.
7105         (Block): Removed this indexer for label lookups.
7106         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7107         this already does the error reporting for us.
7108
7109         * flowanalysis.cs
7110         (FlowBranching.UsageVector.Block): New public variable; may be null.
7111         (FlowBranching.CreateSibling): Added `Block' argument.
7112         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7113         label for the target of a `goto' and check whether we're not
7114         leaving a `finally'.
7115
7116 2004-04-27  Martin Baulig  <martin@ximian.com>
7117
7118         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7119         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7120         just for returns).
7121
7122 2004-04-27  Martin Baulig  <martin@ximian.com>
7123
7124         * statement.cs (Block.AddLabel): Also check for implicit blocks
7125         and added a CS0158 check.
7126
7127 2004-04-27  Martin Baulig  <martin@ximian.com>
7128
7129         * flowanalysis.cs (FlowBranchingLoop): New class.
7130         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7131         UsageVector's instead of an ArrayList.
7132         (FlowBranching.Label): Likewise.
7133         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7134         (FlowBranching.AddBreakVector): New method.
7135
7136 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7137
7138         * attribute.cs: Small regression fix: only convert the type if we
7139         the type is different, fixes System.Drawing build.
7140
7141 2004-04-27  Martin Baulig  <martin@ximian.com>
7142
7143         * attribute.cs (Attribute.Resolve): If we have a constant value
7144         for a named field or property, implicity convert it to the correct
7145         type.
7146
7147 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7148
7149         * statement.cs (Block.Block): Implicit blocks share
7150         'child_variable_names' fields with parent blocks.
7151         (Block.AddChildVariableNames): Remove.
7152         (Block.AddVariable): Mark variable as "used by a child block" in
7153         every surrounding block.
7154         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7155         been used in a child block, complain about violation of "Invariant
7156         meaning in blocks" rule.
7157         * cs-parser.jay (declare_local_variables): Don't use
7158         AddChildVariableNames.
7159         (foreach_statement): Don't create an implicit block: 'foreach'
7160         introduces a scope.
7161
7162 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7163
7164         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7165         converting from 0L to ulong.  Fixes 57522.
7166
7167 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7168
7169         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7170         derived class hides via 'new' keyword field from base class (test-242.cs).
7171         TODO: Handle this in the more general way.
7172         
7173         * class.cs (CheckBase): Ditto.
7174
7175 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7176
7177         * decl.cs (caching_flags): New member for storing cached values
7178         as bit flags.
7179         (MemberCore.Flags): New enum where bit flags for caching_flags
7180         are defined.
7181         (MemberCore.cls_compliance): Moved to caching_flags.
7182         (DeclSpace.Created): Moved to caching_flags.
7183
7184         * class.cs: Use caching_flags instead of DeclSpace.Created
7185         
7186 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7187
7188         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7189         if we are only a derived class, not a nested class.
7190
7191         * typemanager.cs: Same as above, but do this at the MemberLookup
7192         level (used by field and methods, properties are handled in
7193         PropertyExpr).   Allow for the qualified access if we are a nested
7194         method. 
7195
7196 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7197
7198         * class.cs: Refactoring.
7199         (IMethodData): New inteface; Holds links to parent members
7200         to avoid member duplication (reduced memory allocation).
7201         (Method): Implemented IMethodData interface.
7202         (PropertyBase): New inner classes for get/set methods.
7203         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7204         (Event): New inner classes for add/remove methods.
7205         (Event.DelegateMethod): Implemented IMethodData interface.
7206
7207         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7208         EmitContext (related to class.cs refactoring).
7209
7210 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7211
7212         * delegate.cs (Delegate.VerifyApplicability): If the number of
7213         arguments are the same as the number of parameters, first try to
7214         verify applicability ignoring  any 'params' modifier on the last
7215         parameter.
7216         Fixes #56442.
7217
7218 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7219
7220         * class.cs (TypeContainer.AddIndexer): Use
7221         'ExplicitInterfaceName' to determine if interface name was
7222         explicitly specified.  'InterfaceType' is not initialized at this time.
7223         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7224         Indexers array is already in the required order.  Initialize
7225         'IndexerName' only if there are normal indexers.
7226         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7227         (TypeContainer.Emit): Emit DefaultMember attribute only if
7228         IndexerName is initialized.
7229         Fixes #56300.
7230
7231 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7232
7233         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7234         Fixes #57007
7235
7236 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7237
7238         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7239         attributes.
7240         Fix for #56456.
7241
7242         * attribute.cs (Attribute.Resolve): Check for duplicate named
7243         attributes.
7244         Fix for #56463.
7245
7246 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7247
7248         * iterators.cs (MarkYield): track whether we are in an exception,
7249         and generate code accordingly.  Use a temporary value to store the
7250         result for our state.
7251
7252         I had ignored a bit the interaction of try/catch with iterators
7253         since their behavior was not entirely obvious, but now it is
7254         possible to verify that our behavior is the same as MS .NET 2.0
7255
7256         Fixes 54814
7257
7258 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7259
7260         * iterators.cs: Avoid creating temporaries if there is no work to
7261         do. 
7262
7263         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7264         Enumerations, use TypeManager.EnumToUnderlying and call
7265         recursively. 
7266
7267         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7268         bug #57013
7269
7270         (This.Emit): Use EmitContext.EmitThis to emit our
7271         instance variable.
7272
7273         (This.EmitAssign): Ditto.
7274
7275         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7276         codepaths, we will move all the functionality into
7277         Mono.CSharp.This 
7278
7279         (FieldExpr.EmitAssign): Ditto.
7280
7281         This fixes several hidden bugs that I uncovered while doing a code
7282         review of this today.
7283
7284         * codegen.cs (EmitThis): reworked so the semantics are more clear
7285         and also support value types "this" instances.
7286
7287         * iterators.cs: Changed so that for iterators in value types, we
7288         do not pass the value type as a parameter.  
7289
7290         Initialization of the enumerator helpers is now done in the caller
7291         instead of passing the parameters to the constructors and having
7292         the constructor set the fields.
7293
7294         The fields have now `assembly' visibility instead of private.
7295
7296 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7297
7298         * expression.cs (Argument.Resolve): Check if fields passed as ref
7299         or out are contained in a MarshalByRefObject.
7300
7301         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7302         another compiler type.
7303
7304 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7305
7306         * class.cs (Indexer.Define): use the new name checking method.
7307         Also, return false on an error.
7308         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7309         (is_identifier_[start/part]_character): make static.
7310
7311 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * expression.cs (Binary.ResolveOperator): Do no append strings
7314         twice: since we can be invoked more than once (array evaluation)
7315         on the same concatenation, take care of this here.  Based on a fix
7316         from Ben (bug #56454)
7317
7318 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7319
7320         * codegen.cs: Fix another case where CS1548 must be reported (when 
7321         delay-sign isn't specified and no private is available #56564). Fix
7322         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7323         error when MCS is used on the MS runtime and we need to delay-sign 
7324         (which seems unsupported by AssemblyBuilder - see #56621).
7325
7326 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7327
7328         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7329         (TypeManager.ComputeNamespaces): Faster implementation for
7330         Microsoft runtime.
7331
7332         * compiler.csproj: Updated AssemblyName to mcs.
7333
7334 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7335
7336         * rootcontext.cs: Add new types to the boot resolution.
7337
7338         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7339         MulticastDelegate is not allowed.
7340
7341         * typemanager.cs: Add new types to lookup: System.TypedReference
7342         and ArgIterator.
7343
7344         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7345         check for TypedReference or ArgIterator, they are not allowed. 
7346
7347         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7348         makes us properly catch 1510 in some conditions (see bug 56016 for
7349         details). 
7350
7351 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7352
7353         * CryptoConvert.cs: update from corlib version
7354         with endian fixes.
7355
7356 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * class.cs (Indexer.Define): Check indexername declaration
7359
7360 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7361
7362         * attribute.cs (IsClsCompliant): Fixed problem with handling
7363         all three states (compliant, not-compliant, undetected).
7364
7365 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7366
7367         * attribute.cs (Attribute): Location is now public.
7368         (Resolve): Store resolved arguments (pos_values) in attribute class.
7369         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7370         (GetClsCompliantAttributeValue): New method that gets
7371         CLSCompliantAttribute value.
7372         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7373         if exists else null.
7374         (AttributeTester): New class for CLS-Compliant verification routines.
7375
7376         * class.cs (Emit): Add CLS-Compliant verification.
7377         (Method.GetSignatureForError): Implemented.
7378         (Constructor.GetSignatureForError): Implemented
7379         (Constructor.HasCompliantArgs): Returns if constructor has
7380         CLS-Compliant arguments.
7381         (Constructor.Emit): Override.
7382         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7383         is needed to test only parameters.
7384         (FieldBase.GetSignatureForError): Implemented.
7385         (TypeContainer): New member for storing base interfaces.
7386         (TypeContainer.FindMembers): Search in base interfaces too.
7387
7388         * codegen.cs (GetClsComplianceAttribute): New method that gets
7389         assembly or module CLSCompliantAttribute value.
7390         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7391         for assembly.
7392         (ModuleClass.Emit): Add error 3012 test.
7393
7394         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7395
7396         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7397         state for all decl types.
7398         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7399         if CLS-Compliant tests are required.
7400         (IsClsCompliaceRequired): New method. Analyze whether code
7401         must be CLS-Compliant.
7402         (IsExposedFromAssembly): New method. Returns true when MemberCore
7403         is exposed from assembly.
7404         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7405         value or gets cached value.
7406         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7407         is explicitly marked with CLSCompliantAttribute.
7408         (IsIdentifierClsCompliant): New abstract method. This method is
7409         used to testing error 3005.
7410         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7411         for identifier and parameters CLS-Compliant testing.
7412         (VerifyClsCompliance): New method. The main virtual method for
7413         CLS-Compliant verifications.
7414         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7415         null. I don't know why is null (too many public members !).
7416         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7417         and get value of first CLSCompliantAttribute that found.
7418
7419         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7420         (VerifyClsCompliance): Override and add extra tests.
7421
7422         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7423         clscheck- disable CLS-Compliant verification event if assembly is has
7424         CLSCompliantAttribute(true).
7425
7426         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7427         ApllyAttribute is now called in emit section as in the other cases.
7428         Possible future Emit integration.
7429         (IsIdentifierClsCompliant): New override.
7430         (VerifyClsCompliance): New override.
7431         (GetEnumeratorName): Returns full enum name.
7432
7433         * parameter.cs (GetSignatureForError): Implemented.
7434
7435         * report.cs (WarningData): New struct for Warning message information.
7436         (LocationOfPreviousError): New method.
7437         (Warning): New method. Reports warning based on the warning table.
7438         (Error_T): New method. Reports error based on the error table.
7439
7440         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7441         verifications are done here.
7442
7443         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7444
7445         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7446         CLSCompliantAttribute.
7447         (all_imported_types): New member holds all imported types from other
7448         assemblies.
7449         (LoadAllImportedTypes): New method fills static table with exported types
7450         from all referenced assemblies.
7451         (Modules): New property returns all assembly modules.
7452
7453 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7454
7455         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7456         throwing a parser error.
7457
7458         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7459         which removes the hardcoded get_/set_ prefixes for properties, as
7460         IL allows for the properties to be named something else.  
7461
7462         Bug #56013
7463
7464         * expression.cs: Do not override operand before we know if it is
7465         non-null.  Fix 56207
7466
7467 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7468
7469         * typemanager.cs: support for pinned variables.
7470
7471 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7472
7473         * decl.cs, typemanager.cs: Avoid using an arraylist
7474         as a buffer if there is only one result set.
7475
7476 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7477
7478         * expression.cs: Make sure you cant call a static method
7479         with an instance expression, bug #56174.
7480
7481 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7482
7483         * class.cs (IsDuplicateImplementation): Improve error reporting to
7484         flag 663 (method only differs in parameter modifier).
7485
7486         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7487         in preprocessor directives.
7488
7489         * location.cs (LookupFile): Allow for the empty path.
7490
7491         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7492         better approach for some of that patch, but its failing with the
7493         CharSet enumeration.  For now try/catch will do.
7494
7495         * typemanager.cs: Do not crash if a struct does not have fields.
7496         Fixes 56150.
7497
7498 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7499
7500         * expression.cs: cs0213, cant fix a fixed expression.
7501         fixes 50231.
7502
7503 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7504
7505         * cs-parser.jay: detect invalid embeded statements gracefully.
7506         bug #51113.
7507
7508 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7509
7510         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7511         As a regex:
7512         s/
7513         the invocation type may not be a subclass of the tye of the item/
7514         The type of the item must be a subclass of the invocation item.
7515         /g
7516
7517         Fixes bug #50820.
7518
7519 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7520
7521         * attribute.cs: Added methods to get a string and a bool from an
7522         attribute. Required to information from AssemblyKeyFileAttribute,
7523         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7524         * codegen.cs: Modified AssemblyName creation to include support for
7525         strongnames. Catch additional exceptions to report them as CS1548.
7526         * compiler.csproj: Updated include CryptoConvert.cs.
7527         * compiler.csproj.user: Removed file - user specific configuration.
7528         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7529         Mono.Security assembly. The original class is maintained and tested in
7530         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7531         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7532         like CSC 8.0 (C# v2) supports.
7533         * Makefile: Added CryptoConvert.cs to mcs sources.
7534         * rootcontext.cs: Added new options for strongnames.
7535
7536 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7537
7538         * driver.cs: For --expect-error, report error code `2'
7539         if the program compiled with no errors, error code `1' if
7540         it compiled with an error other than the one expected.
7541
7542 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7543
7544         * compiler.csproj: Updated for Visual Studio .NET 2003.
7545         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7546         * compiler.sln: Updated for Visual Studio .NET 2003.
7547
7548 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7549
7550         * expression.cs: Fix bug #47234. We basically need to apply the
7551         rule that we prefer the conversion of null to a reference type
7552         when faced with a conversion to 'object' (csc behaviour).
7553
7554 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7555
7556         * statement.cs: Shorter form for foreach, eliminates
7557         a local variable. r=Martin.
7558
7559 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7560
7561         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7562         checks if we can use brtrue/brfalse to test for 0.
7563         * expression.cs: use the above in the test for using brtrue/brfalse.
7564         cleanup code a bit.
7565
7566 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7567
7568         * expression.cs: Rewrite string concat stuff. Benefits:
7569
7570         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7571         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7572         rather than a concat chain.
7573
7574         * typemanager.cs: Add lookups for more concat overloads.
7575
7576 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7577
7578         * expression.cs: Emit shorter il code for array init.
7579
7580         newarr
7581         dup
7582         // set 1
7583
7584         // set 2
7585
7586         newarr
7587         stloc.x
7588
7589         ldloc.x
7590         // set 1
7591
7592         ldloc.x
7593         // set 2
7594
7595 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7596
7597         * statement.cs: Before, two switch blocks would be merged if the
7598         total size of the blocks (end_item - begin_item + 1) was less than
7599         two times the combined sizes of the blocks.
7600
7601         Now, it will only merge if after the merge at least half of the
7602         slots are filled.
7603
7604         fixes 55885.
7605
7606 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7607
7608         * class.cs : csc build fix for GetMethods(). See bug #52503.
7609
7610 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7611
7612         * expression.cs: Make sure fp comparisons work with NaN.
7613         This fixes bug #54303. Mig approved this patch a long
7614         time ago, but we were not able to test b/c the runtime
7615         had a related bug.
7616
7617 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7620
7621 2004-03-19  Martin Baulig  <martin@ximian.com>
7622
7623         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7624         error here and not in our caller.
7625
7626 2004-03-19  Martin Baulig  <martin@ximian.com>
7627
7628         * interface.cs: Completely killed this file.
7629         (Interface): We're now a TypeContainer and live in class.cs.
7630
7631         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7632         argument; we're now also called for interfaces.
7633         (TypeContainer.DefineMembers): Allow this method being called
7634         multiple times.
7635         (TypeContainer.GetMethods): New public method; formerly known as
7636         Interface.GetMethod().  This is used by PendingImplementation.
7637         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7638         it's now private and non-static.
7639         (Interface): Moved this here; it's now implemented similar to
7640         Class and Struct.
7641         (Method, Property, Event, Indexer): Added `bool is_interface'
7642         argument to their .ctor's.
7643         (MemberBase.IsInterface): New public field.
7644
7645         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7646         instances instead of InterfaceMethod, InterfaceProperty, etc.
7647         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7648         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7649
7650 2004-03-19  Martin Baulig  <martin@ximian.com>
7651
7652         * class.cs (MethodCore.IsDuplicateImplementation): New private
7653         method which does the CS0111 checking.
7654         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7655         Use IsDuplicateImplementation().
7656
7657 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7658
7659         * decl.cs (FindMemberToOverride): New method to find the correct
7660         method or property to override in the base class.
7661         * class.cs
7662             - Make Method/Property use the above method to find the
7663               version in the base class.
7664             - Remove the InheritableMemberSignatureCompare as it is now
7665               dead code.
7666
7667         This patch makes large code bases much faster to compile, as it is
7668         O(n) rather than O(n^2) to do this validation.
7669
7670         Also, it fixes bug 52458 which is that nested classes are not
7671         taken into account when finding the base class member.
7672
7673         Reviewed/Approved by Martin.
7674
7675 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7676
7677         * interface.cs: In all interface classes removed redundant
7678         member initialization.
7679
7680 2004-03-16  Martin Baulig  <martin@ximian.com>
7681
7682         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7683
7684 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7685
7686         * decl.cs (DefineTypeAndParents): New helper method to define a
7687         type's containers before the type itself is defined;  This is a
7688         bug exposed by the recent changes to Windows.Forms when an
7689         implemented interface was defined inside a class that had not been
7690         built yet.   
7691
7692         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7693
7694         (Check): Loop correctly to report errors modifiers
7695         (UNSAFE was not in the loop, since it was the same as TOP).
7696
7697         * interface.cs: Every interface member now takes a ModFlags,
7698         instead of a "is_new" bool, which we set on the base MemberCore. 
7699
7700         Every place where we called "UnsafeOk" in the interface, now we
7701         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7702         the unsafe settings from the member declaration instead of the
7703         container interface. 
7704
7705         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7706
7707         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7708         `set_indexer_name' to the pending bits (one per type).
7709
7710         We fixed a bug today that was picking the wrong method to
7711         override, since for properties the existing InterfaceMethod code
7712         basically ignored the method name.  Now we make sure that the
7713         method name is one of the valid indexer names.
7714
7715 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7716  
7717         * support.cs (SeekableStreamReader): Keep track of stream byte
7718         positions and don't mix them with character offsets to the buffer.
7719
7720         Patch from Gustavo Giráldez
7721
7722 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7723
7724         * interface.cs (InterfaceSetGetBase): Removed double member
7725         initialization, base class does it as well.
7726
7727 2004-03-13  Martin Baulig  <martin@ximian.com>
7728
7729         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7730         when compiling corlib.
7731
7732 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7733
7734         * convert.cs (ExplicitConversion): We were reporting an error on
7735         certain conversions (object_type source to a value type, when the
7736         expression was `null') before we had a chance to pass it through
7737         the user defined conversions.
7738
7739         * driver.cs: Replace / and \ in resource specifications to dots.
7740         Fixes 50752
7741
7742         * class.cs: Add check for duplicate operators.  Fixes 52477
7743
7744 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7745
7746         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7747         that are in the middle of the statements, not only at the end.
7748         Fixes #54987
7749
7750         * class.cs (TypeContainer.AddField): No longer set the
7751         `HaveStaticConstructor' flag, now we call it
7752         `UserDefineStaticConstructor' to diferentiate the slightly
7753         semantic difference.
7754
7755         The situation is that we were not adding BeforeFieldInit (from
7756         Modifiers.TypeAttr) to classes that could have it.
7757         BeforeFieldInit should be set to classes that have no static
7758         constructor. 
7759
7760         See:
7761
7762         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7763
7764         And most importantly Zoltan's comment:
7765
7766         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7767
7768         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7769          before its static fields are used', i.e. initialization does not need
7770          to be triggered by the first access to the type. Setting this flag
7771          helps the JIT to compile better code, since it can run the static
7772          constructor at JIT time, and does not need to generate code to call it
7773          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7774          this flag for lots of classes like String. 
7775          
7776          csc sets this flag if the type does not have an explicit static 
7777          constructor. The reasoning seems to be that if there are only static
7778          initalizers for a type, and no static constructor, then the programmer
7779          does not care when this initialization happens, so beforefieldinit
7780          can be used.
7781          
7782          This bug prevents the AOT compiler from being usable, since it 
7783          generates so many calls to mono_runtime_class_init that the AOT code
7784          is much slower than the JITted code. The JITted code is faster, 
7785          because it does not generate these calls if the vtable is type is
7786          already initialized, which is true in the majority of cases. But the
7787          AOT compiler can't do this."
7788
7789 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7790
7791         * class.cs (MethodData.Emit): Refactor the code so symbolic
7792         information is generated for destructors;  For some reasons we
7793         were taking a code path that did not generate symbolic information
7794         before. 
7795
7796 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7797
7798         * class.cs: Create a Constructor.CheckBase method that
7799         takes care of all validation type code. The method
7800         contains some code that was moved from Define.
7801
7802         It also includes new code that checks for duplicate ctors.
7803         This fixes bug #55148.
7804
7805 2004-03-09  Joshua Tauberer <tauberer@for.net>
7806
7807         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7808         a { ... }-style array creation invokes EmitStaticInitializers
7809         which is not good for reference-type arrays.  String, decimal
7810         and now null constants (NullCast) are not counted toward
7811         static initializers.
7812
7813 2004-03-05  Martin Baulig  <martin@ximian.com>
7814
7815         * location.cs (SourceFile.HasLineDirective): New public field;
7816         specifies whether the file contains or is referenced by a "#line"
7817         directive.
7818         (Location.DefineSymbolDocuments): Ignore source files which
7819         either contain or are referenced by a "#line" directive.        
7820
7821 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7822
7823         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7824         direct access to our parent, so check the method inline there.
7825
7826 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7827
7828         * expression.cs (Invocation.EmitCall): Miguel's last commit
7829         caused a regression. If you had:
7830
7831             T t = null;
7832             t.Foo ();
7833
7834         In Foo the implict this would be null.
7835
7836 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7837
7838         * expression.cs (Invocation.EmitCall): If the method is not
7839         virtual, do not emit a CallVirt to it, use Call.
7840
7841         * typemanager.cs (GetFullNameSignature): Improve the method to
7842         cope with ".ctor" and replace it with the type name.
7843
7844         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7845         as an argument the ConstructorBuilder where it is being defined,
7846         to catch the recursive constructor invocations.
7847
7848 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7849
7850         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7851         routines to check if a type is an enumerable/enumerator allow
7852         classes that implement the IEnumerable or IEnumerator interfaces.
7853
7854         * class.cs (Property, Operator): Implement IIteratorContainer, and
7855         implement SetYields.
7856
7857         (Property.Define): Do the block swapping for get_methods in the
7858         context of iterators.   We need to check if Properties also
7859         include indexers or not.
7860
7861         (Operator): Assign the Block before invoking the
7862         OperatorMethod.Define, so we can trigger the Iterator code
7863         replacement. 
7864
7865         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7866         Property and Operator classes are not created when we parse the
7867         declarator but until we have the block completed, so we use a
7868         singleton SimpleIteratorContainer.Simple to flag whether the
7869         SetYields has been invoked.
7870
7871         We propagate this setting then to the Property or the Operator to
7872         allow the `yield' to function.
7873
7874 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7875
7876         * codegen.cs: Implemented attribute support for modules.
7877         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7878         Assembly/Module functionality.
7879
7880         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7881         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7882         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7883
7884 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7885
7886         * interface.cs (FindMembers): The operation is performed on all base
7887         interfaces and not only on the first. It is required for future CLS Compliance patch.
7888
7889 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7890
7891         * statement.cs, codegen.cs:
7892         This patch deals with patterns such as:
7893
7894         public class List : IEnumerable {
7895
7896                 public MyEnumerator GetEnumerator () {
7897                         return new MyEnumerator(this);
7898                 }
7899
7900                 IEnumerator IEnumerable.GetEnumerator () {
7901                         ...
7902                 }
7903                 
7904                 public struct MyEnumerator : IEnumerator {
7905                         ...
7906                 }
7907         }
7908
7909         Before, there were a few things we did wrong:
7910         1) we would emit callvirt on a struct, which is illegal
7911         2) we emited ldarg when we needed to emit ldarga
7912         3) we would mistakenly call the interface methods on an enumerator
7913         type that derived from IEnumerator and was in another assembly. For example:
7914
7915         public class MyEnumerator : IEnumerator
7916
7917         Would have the interface methods called, even if there were public impls of the
7918         method. In a struct, this lead to invalid IL code.
7919
7920 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7921
7922         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7923           renamed to Emit.
7924
7925         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7926
7927 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7928
7929         * cs-parser.jay: Fix small regression: we were not testing V2
7930         compiler features correctly.
7931
7932         * interface.cs: If the emit context is null, then create one
7933
7934 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7935
7936         * decl.cs (GetSignatureForError): New virtual method to get full name
7937           for error messages.
7938
7939         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7940           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7941
7942         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7943           Duplicated members and code in these classes has been removed.
7944           Better encapsulation in these classes.
7945
7946 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7947
7948         * assign.cs (Assign.DoResolve): When dealing with compound
7949         assignments, there is a new rule in ECMA C# 2.4 (might have been
7950         there before, but it is documented here) that states that in:
7951
7952         a op= b;
7953
7954         If b is of type int, and the `op' is a shift-operator, then the
7955         above is evaluated as:
7956
7957         a = (int) a op b 
7958
7959         * expression.cs (Binary.ResolveOperator): Instead of testing for
7960         int/uint/long/ulong, try to implicitly convert to any of those
7961         types and use that in pointer arithmetic.
7962
7963         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7964         method to print information for from the type, not from the
7965         null-method we were given.
7966
7967 2004-02-01  Duncan Mak  <duncan@ximian.com>
7968
7969         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7970         parsing for cmd, fixes bug #53694.
7971
7972 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7973
7974         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7975         in the member name duplication tests. Property and operator name duplication
7976         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7977
7978 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7979
7980         * interface.cs (PopulateMethod): Fixed crash when interface method
7981         returns not existing type (error test cs0246-3.cs).
7982
7983 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7984
7985         * cs-parser.jay (interface_accessors): Re-write actions to also
7986         store attributes attached to get and set methods. Fix spelling
7987         while at it.
7988
7989         (inteface_property_declaration): Modify accordingly.
7990
7991         (InterfaceAccessorInfo): New helper class to store information to pass
7992         around between rules that use interface_accessors.
7993
7994         * interface.cs (Emit): Apply attributes on the get and set
7995         accessors of properties and indexers too.
7996
7997         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7998         right MethodBuilder when applying attributes to the get and set accessors.
7999
8000 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8003
8004 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8005
8006         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8007
8008 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8009
8010         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8011         changes that treat `yield' specially when present before `break'
8012         or `return' tokens.
8013
8014         * cs-tokenizer.cs: yield is no longer a keyword.
8015
8016 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8017
8018         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8019         setting for default constructors.
8020         For default constructors are almost every time set wrong Modifier. The
8021         generated IL code has been alright. But inside mcs this values was
8022         wrong and this was reason why several of my CLS Compliance tests
8023         failed.
8024
8025 2004-01-22  Martin Baulig  <martin@ximian.com>
8026
8027         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8028         not a QualifiedIdentifier.  This is what `type_name_expression'
8029         was previously doing.
8030         (type_name_expression): Removed; the code is now in
8031         `namespace_or_type_name'.
8032         (qualified_identifier): Removed, use `namespace_or_type_name'
8033         instead.
8034         (QualifiedIdentifier): Removed this class.      
8035
8036 2004-01-22  Martin Baulig  <martin@ximian.com>
8037
8038         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8039         not a string as alias name.
8040
8041 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8042
8043         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8044         #52730 bug, and instead compute correctly the need to use a
8045         temporary variable when requesting an address based on the
8046         static/instace modified of the field and the constructor.
8047  
8048 2004-01-21  Martin Baulig  <martin@ximian.com>
8049
8050         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8051         class and namespace before looking up aliases.  Fixes #52517.
8052
8053 2004-01-21  Martin Baulig  <martin@ximian.com>
8054
8055         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8056         assinged in a 'try'; fixes exception4.cs.
8057
8058 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8059         * class.cs : Implemented parameter-less constructor for TypeContainer
8060
8061         * decl.cs: Attributes are now stored here. New property OptAttributes
8062
8063         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8064
8065         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8066
8067 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8068
8069         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8070           (CSharpSignature): New method for indexer and property signature.
8071
8072 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8073
8074         * pending.cs (IsVirtualFilter): Faster implementation.
8075
8076 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8077
8078         * typemanager.cs: Avoid inclusion of same assembly more than once.
8079
8080 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8081
8082         * cs-parser.jay: Fixed problem where the last assembly attribute
8083           has been applied also to following declaration (class, struct, etc.)
8084           
8085 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8086
8087         * class.cs: Added error CS0538, CS0539 reporting.
8088         Fixed crash on Microsoft runtime when field type is void.
8089
8090         * cs-parser.jay: Added error CS0537 reporting.
8091
8092         * pending.cs: Added error CS0535 reporting.
8093         Improved error report for errors CS0536, CS0534.
8094
8095 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8096
8097         Merge a few bits from the Anonymous Method MCS tree.
8098
8099         * statement.cs (ToplevelBlock): New class for toplevel methods,
8100         will hold anonymous methods, lifted variables.
8101
8102         * cs-parser.jay: Create toplevel blocks for delegates and for
8103         regular blocks of code. 
8104
8105 2004-01-20  Martin Baulig  <martin@ximian.com>
8106
8107         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8108         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8109         and `NeedExplicitReturn'; added `IsLastStatement'.
8110         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8111         have a `ReturnLabel' or we're not unreachable.
8112
8113         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8114         child's reachability; don't just override ours with it.  Fixes
8115         #58058 (lluis's example).
8116         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8117         InFinally(), InLoop(), InSwitch() and
8118         BreakCrossesTryCatchBoundary() methods.
8119
8120         * statement.cs (Return): Do all error checking in Resolve().
8121         Unless we are the last statement in a top-level block, always
8122         create a return label and jump to it.
8123         (Break, Continue): Do all error checking in Resolve(); also make
8124         sure we aren't leaving a `finally'.
8125         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8126         statement in a top-level block.
8127         (Block.Flags): Added `IsDestructor'.
8128         (Block.IsDestructor): New public property.
8129
8130 2004-01-20  Martin Baulig  <martin@ximian.com>
8131
8132         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8133
8134 2004-01-20  Martin Baulig  <martin@ximian.com>
8135
8136         * statement.cs (Statement.ResolveUnreachable): New public method.
8137         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8138         (Block.Resolve): Resolve unreachable statements.
8139
8140 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8141
8142         * expression.cs: We need to fix the case where we do
8143         not have a temp variable here.
8144
8145         * assign.cs: Only expression compound assignments need
8146         temporary variables.
8147
8148 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8149
8150         * flowanalysis.cs: Reduce memory allocation in a few ways:
8151           - A block with no variables should not allocate a bit
8152             vector for itself.
8153           - A method with no out parameters does not need any tracking
8154             for assignment of the parameters, so we need not allocate
8155             any data for it.
8156           - The arrays:
8157                 public readonly Type[] VariableTypes;
8158                 public readonly string[] VariableNames;
8159             Are redundant. The data is already stored in the variable
8160             map, so we need not allocate another array for it.
8161           - We need to add alot of checks for if (params | locals) == null
8162             due to the first two changes.
8163
8164 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8165
8166         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8167         implement IMemoryLocation, we store a copy on a local variable and
8168         take the address of it.  Patch from Benjamin Jemlich
8169
8170         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8171         to use a special "type_name_expression" rule which reduces the
8172         number of "QualifiedIdentifier" classes created, and instead
8173         directly creates MemberAccess expressions.
8174
8175 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8178         that fixes #52853.  Null literal assignment to ValueType
8179
8180         * class.cs (MethodData.Emit): Instead of checking the name of the
8181         method to determine if its a destructor, create a new derived
8182         class from Method called Destructor, and test for that.  
8183
8184         * cs-parser.jay: Create a Destructor object instead of a Method.  
8185
8186         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8187
8188         Fixes: 52933
8189
8190 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8191
8192         * expression.cs (Binary.ResolveOperator): Perform an implicit
8193         conversion from MethodGroups to their delegate types on the
8194         Addition operation.
8195
8196         * delegate.cs: Introduce a new class DelegateCreation that is the
8197         base class for `NewDelegate' and `ImplicitDelegateCreation',
8198         factor some code in here.
8199
8200         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8201         conversion from MethodGroups to compatible delegate types. 
8202
8203         * ecore.cs (Expression.Resolve): Do not flag error 654
8204         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8205         we allow conversions from MethodGroups to delegate types now.
8206
8207         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8208         assignments in v2 either.
8209
8210 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8211
8212         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8213         static read-only fields in ctors.
8214
8215         Applied patch from Benjamin Jemlich 
8216
8217         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8218
8219 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8220
8221         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8222         here to return true, as they can be used like this:
8223
8224                 (XXX) int.MEMBER ()
8225
8226         Fixed 49836 and all the other dups
8227
8228 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8229
8230         * driver.cs: Implement /win32res and /win32icon.
8231
8232 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8233
8234         * cs-parser.jay: Add a rule to improve error handling for the
8235         common mistake of placing modifiers after the type.
8236
8237 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8238
8239         * cs-parser.jay (interface_event_declaration): Catch
8240         initialization of events on interfaces, and report cs0068
8241
8242         * cs-parser.jay (interface_event_declaration): Catch
8243         initialization of events. 
8244
8245         * ecore.cs: Better report missing constructors.
8246
8247         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8248         the error reporting done in the wrong place.  Fix.
8249
8250         * expression.cs (Binary.ResolveOperator): Catch the 
8251         operator + (E x, E y) error earlier, and later allow for implicit
8252         conversions in operator +/- (E e, U x) from U to the underlying
8253         type of E.
8254
8255         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8256         52596, if the container class is abstract, the default constructor
8257         is protected otherwise its public (before, we were always public).
8258
8259         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8260         fixed statement.
8261
8262         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8263         Jemlich that fixes bug #52597, MCS was generating invalid code for
8264         idisposable structs.   Thanks to Ben for following up with this
8265         bug as well.
8266
8267 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8268
8269         * driver.cs: Allow assemblies without code to be generated, fixes
8270         52230.
8271
8272 2004-01-07  Nick Drochak <ndrochak@gol.com>
8273
8274         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8275
8276 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8277
8278         * cs-parser.jay: Add rules to improve error reporting if fields or
8279         methods are declared at the namespace level (error 116)
8280
8281         * Add rules to catch event add/remove
8282
8283 2004-01-04  David Sheldon <dave-mono@earth.li>
8284
8285   * expression.cs: Added matching ")" to error message for 
8286   CS0077
8287
8288 2004-01-03 Todd Berman <tberman@gentoo.org>
8289
8290         * ecore.cs, attribute.cs:
8291         Applying fix from #52429.
8292
8293 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8294
8295         * ecore.cs, expression.cs, statement.cs:
8296         Total rewrite of how we handle branching. We
8297         now handle complex boolean expressions with fewer
8298         jumps. As well if (x == 0) no longer emits a ceq.
8299
8300         if (x is Foo) is much faster now, because we generate
8301         better code.
8302
8303         Overall, we get a pretty big improvement on our benchmark
8304         tests. The code we generate is smaller and more readable.
8305
8306         I did a full two-stage bootstrap. The patch was reviewed
8307         by Martin and Miguel.
8308
8309 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8310
8311         * cs-parser.jay: Make primary_expression not take a QI.
8312         we dont need this because the member_access rule covers
8313         us here. So we replace the rule with just IDENTIFIER.
8314
8315         This has two good effects. First, we remove a s/r conflict.
8316         Second, we allocate many fewer QualifiedIdentifier objects.
8317
8318 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8319
8320         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8321         set the correct information via SRE. This prevents
8322         hanging on the MS runtime. Fixes #29374.
8323
8324 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8325
8326         * convert.cs: correctly handle conversions to value types
8327         from Enum and ValueType as unboxing conversions.
8328
8329         Fixes bug #52569. Patch by Benjamin Jemlich.
8330
8331 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8332
8333         * expression.cs (BetterConversion): Prefer int -> uint
8334         over int -> ulong (csc's behaviour). This fixed bug #52046.
8335
8336 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8337
8338         * decl.cs (MemberCache.FindMembers): now returns a
8339         MemberInfo [].
8340
8341         * typemanager.cs: In general, go with with ^^.
8342         (CopyNewMethods): take an IList.
8343         (RealMemberLookup): Only allocate an arraylist
8344         if we copy from two sets of methods.
8345
8346         This change basically does two things:
8347         1) Fewer array lists allocated due to CopyNewMethods.
8348         2) the explicit cast in MemberList costed ALOT.
8349
8350 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8351
8352         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8353         a hashtable to avoid needless string allocations when an identifier is
8354         used more than once (the common case).
8355
8356 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8357
8358         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8359         is broken, it will not return anything. So, we
8360         have to use the information we have in mcs to
8361         do the task.
8362
8363         * typemanager.cs: Add a cache for GetInterfaces,
8364         since this will now be used more often (due to ^^)
8365
8366         (GetExplicitInterfaces) New method that gets the
8367         declared, not effective, interfaces on a type
8368         builder (eg, if you have interface IFoo, interface
8369         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8370         { IBar }.
8371
8372         This patch makes MCS able to bootstrap itself on
8373         Windows again.
8374
8375 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8376
8377         * expression.cs: Remove the Nop's that Miguel put
8378         in by mistake.
8379
8380 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8381
8382         * report.cs, codegen.cs: Give the real stack trace to
8383         the error when an exception is thrown.
8384
8385 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8386
8387         * decl.cs: only allocate hashtables for ifaces if 
8388         it is an iface!
8389
8390 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8391
8392         * expression.cs: fix the error from cs0121-2.cs
8393         (a parent interface has two child interfaces that
8394         have a function with the same name and 0 params
8395         and the function is called through the parent).
8396
8397 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8398
8399         * class.cs, rootcontext.cs, typmanager.cs: do not
8400         leak pointers.
8401
8402 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8403
8404         * codegen.cs: remove stack for the ec flow branching.
8405         It is already a linked list, so no need.
8406
8407 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8408
8409         * Makefile: Allow custom profiler here.
8410
8411 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8412
8413         * typemanager.cs (LookupType):
8414           - Use a static char [], because split takes
8415             a param array for args, so it was allocating
8416             every time.
8417           - Do not store true in a hashtable, it boxes.
8418
8419 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8420
8421         * flowanalysis.cs: bytify common enums.
8422
8423 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8424
8425         * modifiers.cs: Add a new set of flags for the
8426         flags allowed on explicit interface impls.
8427         * cs-parser.jay: catch the use of modifiers in
8428         interfaces correctly.
8429         * class.cs: catch private void IFoo.Blah ().
8430
8431         All related to bug #50572.
8432
8433 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8434
8435         * decl.cs: Rewrite the consistant accessability checking.
8436         Accessability is not linear, it must be implemented in
8437         a tableish way. Fixes #49704.
8438
8439 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8440
8441         * expression.cs: Handle negation in a checked context.
8442         We must use subtraction from zero. Fixes #38674.
8443
8444 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8445
8446         * class.cs: Ignore static void main in DLLs.
8447         * rootcontext.cs: Handle the target type here,
8448         since we are have to access it from class.cs
8449         * driver.cs: account for the above.
8450
8451 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8452
8453         * report.cs: Give line numbers and files if available.
8454
8455 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8456
8457         * driver.cs: Implement /addmodule.
8458
8459         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8460         ModuleBuilders.
8461
8462 2003-12-20  Martin Baulig  <martin@ximian.com>
8463
8464         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8465         (FieldBase.IsAssigned): Removed this field.
8466         (FieldBase.SetAssigned): New public method.
8467         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8468
8469 2003-12-20  Martin Baulig  <martin@ximian.com>
8470
8471         * expression.cs (LocalVariableReference.DoResolve): Don't set
8472         `vi.Used' if we're called from DoResolveLValue().
8473
8474         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8475         returns the usage vector it just merged into the current one -
8476         pass this one to UsageWarning().
8477         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8478         of the `EmitContext', don't call this recursively on our children.
8479
8480 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8481
8482         * driver.cs: Implement /target:module.
8483
8484 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8485
8486         * support.cs (CharArrayHashtable): New helper class.
8487
8488         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8489         char arrays, not strings, so we can avoid creating a string in
8490         consume_identifier if the identifier is a keyword.
8491
8492 2003-12-16  Martin Baulig  <martin@ximian.com>
8493
8494         * statement.cs (LocalInfo.Assigned): Removed this property.
8495         (LocalInfo.Flags): Removed `Assigned'.
8496         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8497         and uses flow analysis.
8498         (Block.UsageWarning): Made this method private.
8499         (Block.Resolve): Call UsageWarning() if appropriate.
8500
8501         * expression.cs (LocalVariableReference.DoResolve): Always set
8502         LocalInfo.Used here.
8503
8504 2003-12-13  Martin Baulig  <martin@ximian.com>
8505
8506         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8507         any value here; we're now using flow analysis to figure out
8508         whether a statement/block returns a value.
8509
8510 2003-12-13  Martin Baulig  <martin@ximian.com>
8511
8512         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8513         working again.
8514         (FlowBranching.MergeFinally): Don't call
8515         `branching.CheckOutParameters()' here, this is called in
8516         MergeTopBlock().
8517         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8518         when adding the `finally' vector.       
8519
8520 2003-12-13  Martin Baulig  <martin@ximian.com>
8521
8522         * flowanalysis.cs
8523         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8524         actually work and also fix #48962.
8525
8526 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8527
8528         * decl.cs: Do not check System.Object for nested types,
8529         since we know it does not have any. Big bang for buck:
8530
8531         BEFORE:
8532            Run 1:   8.35 seconds
8533            Run 2:   8.32 seconds
8534            corlib:  17.99 seconds
8535         AFTER:
8536            Run 1:   8.17 seconds
8537            Run 2:   8.17 seconds
8538            corlib:  17.39 seconds
8539
8540 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8541
8542         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8543         time we are returning 0 members, so we save alot here.
8544
8545 2003-12-11  Martin Baulig  <martin@ximian.com>
8546
8547         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8548         `MergeChild()', also just take the `FlowBranching' as argument;
8549         call Merge() on it and return the result.
8550         (FlowBranching.Merge): We don't need to do anything if we just
8551         have one sibling.
8552
8553 2003-12-11  Martin Baulig  <martin@ximian.com>
8554
8555         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8556         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8557         Maurer for this idea.
8558
8559 2003-12-11  Martin Baulig  <martin@ximian.com>
8560
8561         * flowanalysis.cs (MergeResult): This class is now gone; we now
8562         use the `UsageVector' for this.  The reason for this is that if a
8563         branching just has one sibling, we don't need to "merge" them at
8564         all - that's the next step to do.
8565         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8566         `MergeResult'.
8567
8568 2003-12-11  Martin Baulig  <martin@ximian.com>
8569
8570         Reworked flow analyis and made it more precise and bug-free.  The
8571         most important change is that we're now using a special `Reachability'
8572         class instead of having "magic" meanings of `FlowReturns'.  I'll
8573         do some more cleanups and optimizations and also add some more
8574         documentation this week.
8575
8576         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8577         largely reworked this class.
8578         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8579         the new `Reachability' class instead of having "magic" values here.
8580         (FlowBranching): We're now using an instance of `Reachability'
8581         instead of having separate `Returns', `Breaks' etc. fields.
8582
8583         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8584         based on flow analysis; ignore the return value of block.Emit ().
8585
8586 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8587
8588         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8589         if they are private.
8590
8591 2003-12-09  Martin Baulig  <martin@ximian.com>
8592
8593         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8594         call them directly on the UsageVector.
8595
8596 2003-12-09  Martin Baulig  <martin@ximian.com>
8597
8598         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8599         Changed return type from `FlowReturns' to `Reachability'.
8600
8601 2003-12-09  Martin Baulig  <martin@ximian.com>
8602
8603         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8604         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8605         `Reachable' fields with a single `Reachability' one.
8606
8607 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8608
8609         * class.cs (FindMembers): Remove foreach's.
8610
8611         Bootstrap times:
8612
8613         BEFORE
8614                 Run 1:   8.74 seconds
8615                 Run 2:   8.71 seconds
8616
8617         AFTER
8618                 Run 1:   8.64 seconds
8619                 Run 2:   8.58 seconds
8620
8621
8622 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8623
8624         * cs-parser.jay:
8625         * gen-treedump.cs:
8626         * statement.cs:
8627         This patch does a few things:
8628                 1. EmptyStatement is now a singleton, so it is never reallocated.
8629                 2. All blah is EmptyStatement constructs have been changed to
8630                    blah == EmptyStatement.Value, which is much faster and valid
8631                    now that EmptyStatement is a singleton.
8632                 3. When resolving a block, rather than allocating a new array for
8633                    the non-empty statements, empty statements are replaced with
8634                    EmptyStatement.Value
8635                 4. Some recursive functions have been made non-recursive.
8636         Mainly the performance impact is from (3), however (1) and (2) are needed for
8637         this to work. (4) does not make a big difference in normal situations, however
8638         it makes the profile look saner.
8639
8640         Bootstrap times:
8641
8642         BEFORE
8643         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8644         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8645         Total memory allocated: 56397 KB
8646
8647         AFTER
8648         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8649         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8650         Total memory allocated: 55666 KB
8651
8652 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8653
8654         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8655         than the hashtable in a hashtable version
8656
8657         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8658         we always end up concating a string. This results in a huge perf
8659         loss, because many strings have to be tracked by the GC. In this
8660         patch, we first use a hashtable that works with two keys, so that
8661         the strings do not need to be concat'ed.
8662
8663         Bootstrap times:
8664         BEFORE
8665                 Run 1:   8.74 seconds
8666                 Run 2:   8.71 seconds
8667
8668         AFTER
8669                 Run 1:   8.65 seconds
8670                 Run 2:   8.56 seconds
8671
8672 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8673
8674         * Makefile: Add a new target `do-time' that does a quick and simple
8675         profile, leaving easy to parse output.
8676
8677 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8678
8679         * codegen.cs (Init): Create the dynamic assembly with 
8680         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8681
8682 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8683
8684         * support.cs: Make the PtrHashtable use only one
8685         instance of its comparer.
8686
8687 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8688
8689         * typemanager.cs: Fix lookup of GetNamespaces.
8690
8691 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * expression.cs: Removed redundant line.
8694
8695         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8696         ArrayLists, use for loops with bounds.  
8697
8698         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8699         arraylist.
8700
8701         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8702         arraylists, use for loop with bounds.
8703
8704         The above three changes give us a 0.071 second performance
8705         improvement out of 3.294 seconds down to 3.223.  On my machine
8706         the above changes reduced the memory usage by 1,387 KB during
8707         compiler bootstrap.
8708
8709         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8710         QualifiedIdentifiers.  Before we created a new string through
8711         concatenation, and mostly later on, the result would be
8712         manipulated by DecomposeQI through string manipulation.
8713
8714         This reduced the compiler memory usage for bootstrapping from
8715         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8716         compile times in 0.05 seconds.
8717
8718 2003-11-28  Dick Porter  <dick@ximian.com>
8719
8720         * support.cs: Do string compares with the Invariant culture.
8721
8722         * rootcontext.cs: 
8723         * gen-treedump.cs: 
8724         * expression.cs: 
8725         * driver.cs: 
8726         * decl.cs: 
8727         * codegen.cs: 
8728         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8729         the comparison is done with the Invariant culture.
8730
8731 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8732
8733         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8734         GetEnumerator method.
8735
8736         (ProbeCollectionType): Iterate starting at the most specific type
8737         upwards looking for a GetEnumerator
8738
8739         * expression.cs: Shift count can be up to 31 for int/uint and 63
8740         for long/ulong.
8741
8742 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8743
8744         * statement.cs (Block.LookupLabel): Also look for the label on the
8745         children blocks.  Use a hash table to keep track of visited
8746         nodes. 
8747
8748         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8749         we actually did transform the other operand, otherwise fall back
8750         to the common codepath that casts to long.
8751
8752         * cs-tokenizer.cs: Use the same code pattern as the int case.
8753         Maybe I should do the parsing myself, and avoid depending on the
8754         Parse routines to get this done.
8755
8756 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8757
8758         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8759         which fixes bug 51347.  This time test it.
8760
8761         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8762         attributes for example can not tell the difference between these.
8763         The difference was only a syntax feature of the language. 
8764
8765         * attribute.cs: Apply attributes to delegates.
8766
8767         * delegate.cs: Call the apply attributes method.
8768
8769 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8770
8771         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8772         comparing 0 vs Byte.MinValue, not the value
8773
8774         (ImplicitConversionRequired): When reporting a conversion error,
8775         use error 31 to print out the constant error instead of the
8776         simpler 29.
8777
8778         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8779         which fixes bug 51347.
8780
8781 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8782
8783         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8784         which fixes the -warnaserror command line option.
8785
8786 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8787
8788         * cfold.cs (DoNumericPromotions): During constant folding of
8789         additions on UIntConstant, special case intconstants with
8790         IntConstants like we do on the expression binary operator. 
8791
8792 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8793
8794         * convert.cs (ImplicitReferenceConversion): We were missing a case
8795         (System.Enum are not value types or class types, so we need to
8796         classify them separatedly).
8797
8798         * driver.cs: We do not support error 2007.
8799
8800 2003-11-12 Jackson Harper <jackson@ximian.com>
8801
8802         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8803         system directory. Also use the full file name so users can
8804         libraries names mscorlib-o-tron.dll in a non system dir.
8805
8806 2003-11-10  Martin Baulig  <martin@ximian.com>
8807
8808         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8809         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8810         calling `ResolveType()' on them, directly assign their `Type'.
8811
8812 2003-11-08  Martin Baulig  <martin@ximian.com>
8813
8814         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8815         return value and the `out parent' parameter.
8816         (TypeContainer.DefineType): Moved the CS0644 check into
8817         GetClassBases().  Don't pass the interface types to the
8818         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8819         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8820
8821         * ecore.cs (TypeExpr.IsAttribute): New property.
8822         (TypeExpr.GetInterfaces): New method.
8823
8824         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8825         TypeExpr instead of a Type.
8826         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8827         (Interface.DefineType): Don't pass the interface types to the
8828         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8829         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8830
8831         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8832         instead of a `Type[]'.
8833         (TypeManager.RegisterBuilder): Likewise.
8834         (TypeManager.AddUserInterface): Likewise.
8835         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8836         `Type[]' and also return a `TypeExpr[]'.
8837         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8838
8839 2003-11-08  Martin Baulig  <martin@ximian.com>
8840
8841         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8842         Expression.     
8843
8844 2003-11-08  Martin Baulig  <martin@ximian.com>
8845
8846         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8847         TypeManager.ResolveExpressionTypes().
8848
8849         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8850         instead of an Expression.
8851         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8852         (TypeExpression): New public class; formerly known as `TypeExpr'.
8853
8854         * expression.cs (ComposedCast): Derive from TypeExpr.
8855
8856         * typemanager.cs (TypeManager.system_*_expr): These are now
8857         TypExpr's instead of Expression's.
8858         (TypeManager.ResolveExpressionTypes): New public static function;
8859         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8860         of them.        
8861
8862 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8863
8864         * expression.cs (New.DoResolve): Do not dereference value that
8865         might be a null return.
8866
8867         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8868         sure that the constant value has the right type.  Fixes an
8869         unreported bug, similar to 50425.
8870
8871         * const.cs (Const.LookupConstantValue): Call
8872         ImplicitStandardConversionExists before doing a conversion to
8873         avoid havng the TypeManager.ChangeType do conversions.
8874
8875         Reduced the number of casts used
8876
8877         (Const.ChangeType): New routine to enable reuse of the constant
8878         type changing code from statement.
8879
8880         * typemanager.cs (ChangeType): Move common initialization to
8881         static global variables.
8882
8883         Fixes #50425.
8884
8885         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8886         every value type to go through, even if it was void.  Fix that. 
8887
8888         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8889         character of the define, and the is_identifier_part_character for
8890         the rest of the string.
8891
8892 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * expression.cs (UnaryMutator.EmitCode): When I updated
8895         LocalVariableReference.DoResolve, I overdid it, and dropped an
8896         optimization done on local variable references.
8897
8898 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8899
8900         * ecore.cs: Convert the return from Ldlen into an int.
8901
8902 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8903
8904         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8905         the accessibility, this is a special case for toplevel non-public
8906         classes (internal for instance).
8907
8908 2003-10-20  Nick Drochak <ndrochak@gol.com>
8909
8910         * ecore.cs: Fix typo and build.  Needed another right paren.
8911
8912 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8913
8914         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8915         `internal' case regular and protected, but not allowing protected
8916         to be evaluated later.  Bug 49840
8917
8918 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8919
8920         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8921         to kb.Nlast, and not the kb.nFirst to isolate the switch
8922         statement.
8923
8924         Extract the underlying type, so enumerations of long/ulong are
8925         treated like long/ulong.
8926
8927 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * expression.cs (New): Overload the meaning of RequestedType to
8930         track the possible creation of the NewDelegate type, since
8931         DoResolve is invoked more than once for new constructors on field
8932         initialization.
8933
8934         See bugs: #48800 and #37014
8935
8936         * cs-parser.jay (declare_local_constants): Take an arraylist
8937         instead of a single constant.
8938
8939         (local_constant_declaration): It should take a
8940         constant_declarators, not a constant_declarator.  Fixes 49487
8941
8942         * convert.cs: Fix error report.
8943
8944 2003-10-13 Jackson Harper <jackson@ximian.com>
8945
8946         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8947         bug #49611
8948
8949 2003-10-09  Martin Baulig  <martin@ximian.com>
8950
8951         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8952         to the .ctor.
8953         (MethodCore.DoDefineParameters): Removed the TypeContainer
8954         argument; use the DeclSpace which was passed to the .ctor instead.
8955         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8956         TypeContainer; we only need a DeclSpace here.
8957
8958 2003-10-09  Martin Baulig  <martin@ximian.com>
8959
8960         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8961         to the .ctor.
8962         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8963         EmitContext's .ctor.    
8964
8965 2003-10-09  Martin Baulig  <martin@ximian.com>
8966
8967         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8968         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8969         AsAccessible(), moved them as well.
8970
8971         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8972
8973 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8974
8975         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8976
8977 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8980         generation for >=, as spotted by Paolo, bug 48679.  
8981         Patch from David Waite.
8982
8983         * cs-tokenizer.cs: Add handling for #pragma.
8984
8985         * cs-parser.jay: Allow for both yield and yield return in the
8986         syntax.  The anti-cobolization of C# fight will go on!
8987
8988         * class.cs (TypeBuilder.DefineType): Catch error condition here
8989         (Parent.DefineType erroring out and returning null).
8990
8991         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8992         coping with enumerations variables, we were mistakenly processing
8993         them as a regular value type instead of built-in types.  Fixes the
8994         bug #48063
8995
8996         * typemanager.cs (IsBuiltinOrEnum): New method.
8997
8998 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8999
9000         * cs-parser.jay: Upgrade: yield now needs the return clause.
9001
9002 2003-09-19  Martin Baulig  <martin@ximian.com>
9003
9004         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9005         `MemberCache parent' argument.  Normally, an interface doesn't
9006         have a parent type except System.Object, but we use this in gmcs
9007         for generic type parameters.
9008
9009 2003-09-18  Martin Baulig  <martin@ximian.com>
9010
9011         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9012         on `type.IsInterface'; don't check whether the type has a parent
9013         to determine whether it's an interface.
9014
9015 2003-09-15  Martin Baulig  <martin@ximian.com>
9016
9017         * class.cs (TypeContainer.DefineType): Added an error flag to
9018         avoid reporting duplicate CS0146's ("class definition is
9019         circular.").
9020
9021         * driver.cs (Driver.MainDriver): Abort if
9022         RootContext.ResolveTree() reported any errors.
9023
9024 2003-09-07  Martin Baulig  <martin@ximian.com>
9025
9026         * report.cs (Error, Warning): Added overloaded versions which take
9027         a `params object[] args' and call String.Format().
9028
9029 2003-09-07  Martin Baulig  <martin@ximian.com>
9030
9031         * decl.cs (DeclSpace..ctor): Don't call
9032         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9033         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9034         (DeclSpace.RecordDecl): New method.
9035
9036         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9037
9038 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9039
9040         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9041         value attributes to be applied to ParameterBuilders.
9042
9043         * class.cs (MethodCore.LabelParameters): Make static and more
9044         generic so that it can be used from other places - like interface
9045         methods, for instance.
9046
9047         * interface.cs (Interface.Emit): Call LabelParameters before
9048         emitting attributes on the InterfaceMethod.
9049
9050 2003-08-26  Martin Baulig  <martin@ximian.com>
9051
9052         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9053         resolving aliases; fixes #47927.
9054
9055 2003-08-26  Martin Baulig  <martin@ximian.com>
9056
9057         * statement.cs (Using.DoResolve): This is internally emitting a
9058         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9059         do not always return.  Fixes #47681.
9060
9061 2003-08-26  Martin Baulig  <martin@ximian.com>
9062
9063         * decl.cs (MemberCore): Moved WarningNotHiding(),
9064         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9065         into MemberBase.
9066         (AdditionResult): Make this nested in DeclSpace.
9067         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9068         argument; call NamespaceEntry.Define() unless we're nested in a
9069         class or struct.
9070
9071         * namespace.cs (Namespace.DefineName): New public function.  This
9072         is called from DeclSpace's .ctor to add 
9073         (Namespace.Lookup): Include DeclSpaces in the lookup.
9074
9075         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9076
9077         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9078
9079 2003-08-25  Martin Baulig  <martin@ximian.com>
9080
9081         * convert.cs (Convert.ExplicitReferenceConversion): When
9082         converting from an interface type to a class, unbox if the target
9083         type is a struct type.  Fixes #47822.
9084
9085 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9086
9087         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9088         #47854.
9089
9090 2003-08-22  Martin Baulig  <martin@ximian.com>
9091
9092         * class.cs (TypeManager.DefineType): When defining a nested type,
9093         call DefineType() on our parent; fixes #47801.
9094
9095 2003-08-22  Martin Baulig  <martin@ximian.com>
9096
9097         * class.cs (MethodData.Define): While checking if a method is an
9098         interface implementation, improve the test a bit more to fix #47654.
9099
9100 2003-08-22  Martin Baulig  <martin@ximian.com>
9101
9102         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9103         correctly; fixes #47722.
9104
9105 2003-08-22  Martin Baulig  <martin@ximian.com>
9106
9107         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9108         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9109
9110         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9111
9112 2003-08-22  Martin Baulig  <martin@ximian.com>
9113
9114         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9115         can only be assigned in static constructors.  Fixes #47161.
9116
9117 2003-08-22  Martin Baulig  <martin@ximian.com>
9118
9119         Rewrote and improved the flow analysis code.
9120
9121         * flowbranching.cs (FlowBranching): Make this class abstract.
9122         (FlowBranching.CreateBranching): New static function to create a
9123         new flow branching.
9124         (FlowBranchingBlock, FlowBranchingException): New classes.
9125         (FlowBranching.UsageVector.Type): New public readonly field.
9126         (FlowBranching.UsageVector.Breaks): Removed the setter.
9127         (FlowBranching.UsageVector.Returns): Removed the setter.
9128         (FlowBranching.UsageVector): Added Break(), Return(),
9129         NeverReachable() and Throw() methods to modify the reachability.
9130         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9131         done by FlowBranching.Merge().
9132         (FlowBranching.UsageVector.MergeChild): New method; merges the
9133         merge result into the current vector.
9134         (FlowBranching.Merge): New abstract method to merge a branching.
9135
9136 2003-08-12  Martin Baulig  <martin@ximian.com>
9137
9138         * expression.cs (Indirection.CacheTemporaries): Create the
9139         LocalTemporary with the pointer type, not its element type.
9140
9141 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9142
9143         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9144         token was a keyword or not.
9145
9146         Add `error' options where an IDENTIFIER was expected;  Provide
9147         CheckToken and CheckIdentifierToken convenience error reporting
9148         functions. 
9149
9150         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9151
9152         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9153         NameSpaceEntry NameSpaceEntry.
9154
9155         (LookupInterfaceOrClass): Avoid creating a full qualified name
9156         from namespace and name: avoid doing lookups when we know the
9157         namespace is non-existant.   Use new Tree.LookupByNamespace which
9158         looks up DeclSpaces based on their namespace, name pair.
9159
9160         * driver.cs: Provide a new `parser verbose' to display the
9161         exception thrown during parsing.  This is turned off by default
9162         now, so the output of a failure from mcs is more graceful.
9163
9164         * namespace.cs: Track all the namespaces defined in a hashtable
9165         for quick lookup.
9166
9167         (IsNamespace): New method
9168
9169 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9170
9171         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9172         we know that we need to concatenate (full typename can never be
9173         null). 
9174
9175         * class.cs: ditto.
9176
9177         * statement.cs: Use a bitfield;  Do not initialize to null things
9178         which are done by the constructor by default.
9179
9180         * cs-parser.jay: bug fix, parameter was 4, not 3.
9181
9182         * expression.cs: Just use the property;
9183
9184         * statement.cs: No need for GetVariableInfo method.
9185
9186 2003-08-08  Martin Baulig  <martin@ximian.com>
9187
9188         * flowanalysis.cs (FlowReturns): This is now nested in the
9189         `FlowBranching' class.
9190         (MyBitVector): Moved this here from statement.cs.
9191         (FlowBranching.SiblingType): New enum type.
9192         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9193
9194 2003-08-07  Martin Baulig  <martin@ximian.com>
9195
9196         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9197         `FlowBranching' class and called `BranchingType'.
9198
9199 2003-08-07  Martin Baulig  <martin@ximian.com>
9200
9201         * flowanalysis.cs: Moved all the control flow analysis code into
9202         its own file.
9203
9204 2003-08-07  Martin Baulig  <martin@ximian.com>
9205
9206         * assign.cs (Assign.DoResolve): `target' must either be an
9207         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9208         #37319.
9209
9210 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9211
9212         * expression.cs (BinaryMethod): This kind of expression is created by the
9213         Binary class if it determines that the operator has to be handled
9214         by a method.
9215
9216         (BinaryDelegate): This kind of expression is created if we are
9217         dealing with a + or - operator on delegates.
9218
9219         (Binary): remove method, argumetns, and DelegateOperator: when
9220         dealing with methods, 
9221
9222         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9223
9224         * statement.cs (Block): use bitfields for the three extra booleans
9225         we had in use.   Remove unused topblock parameter.
9226
9227         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9228
9229         * assign.cs: Drop extra unneeded tests.
9230
9231 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9232
9233         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9234
9235         * statement.cs (Foreach): Use VariableStorage instead of
9236         LocalBuilders.   
9237
9238         * codegen.cs (VariableStorage): New class used by clients that
9239         require a variable stored: locals or fields for variables that
9240         need to live across yield.
9241
9242         Maybe provide a convenience api for EmitThis+EmitLoad?
9243
9244         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9245         these bad boys.
9246
9247 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9248
9249         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9250         RemapParameterLValue): New methods that are used to turn a
9251         precomputed FieldInfo into an expression like this:
9252
9253                 instance.FieldInfo
9254
9255         The idea is to use this instead of making LocalVariableReference
9256         have more than one meaning.
9257
9258         * cs-parser.jay: Add error production to BASE.
9259
9260         * ecore.cs: Deal with TypeManager.GetField returning null, which
9261         is now a valid return value.
9262
9263         (FieldExprNoAddress): New expression for Fields whose address can
9264         not be taken.
9265
9266         * expression.cs (LocalVariableReference): During the resolve
9267         phases, create new expressions if we are in a remapping context.
9268         Remove code that dealt with remapping here.
9269
9270         (ParameterReference): same.
9271
9272         (ProxyInstance): New expression, like the `This' expression, but
9273         it is born fully resolved.  We know what we are doing, so remove
9274         the errors that are targeted to user-provided uses of `this'.
9275
9276         * statement.cs (Foreach): our variable is now stored as an
9277         Expression;  During resolution, follow the protocol, dont just
9278         assume it will return this.
9279
9280 2003-08-06  Martin Baulig  <martin@ximian.com>
9281
9282         * support.cs (SeekableStreamReader.cs): New public class.
9283
9284         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9285         SeekableStreamReader instead of the normal StreamReader.
9286
9287 2003-08-04  Martin Baulig  <martin@ximian.com>
9288
9289         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9290         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9291         deambiguate casts and delegate invocations.
9292         (parenthesized_expression): Use the new tokens to ensure this is
9293         not a cast of method invocation.
9294
9295         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9296         when reading a `)' and Deambiguate_CloseParens () was previously
9297         called.
9298
9299         * expression.cs (ParenthesizedExpression): New class.  This is
9300         just used for the CS0075 test.
9301         (Binary.DoResolve): Check for CS0075.   
9302
9303 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9304
9305         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9306         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9307         reference comparison.
9308
9309         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9310         examine the ReturnType for equality - this is necessary in the
9311         cases of implicit and explicit operators whose signature also
9312         includes the return type.
9313
9314 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9315
9316         * namespace.cs: Cache the result of the namespace computation,
9317         instead of computing it every time.
9318
9319 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9320
9321         * decl.cs: Use a global arraylist that we reuse over invocations
9322         to avoid excesive memory consumption.  Reduces memory usage on an
9323         mcs compile by one meg (45 average).
9324
9325         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9326         private, work around that.
9327
9328 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9329
9330         * literal.cs (IntLiteral): Define Zero and One static literals. 
9331
9332         * cs-parser.jay (integer_literal): use static literals to reduce
9333         memory usage for the most used literals (0, 1 and -1).  211kb
9334         reduced in memory usage.
9335
9336         Replace all calls to `new ArrayList' with `new
9337         ArrayList(4)' which is a good average number for most allocations,
9338         and also requires only 16 bytes of memory for its buffer by
9339         default. 
9340
9341         This reduced MCS memory usage in seven megabytes for the RSS after
9342         bootstrapping.
9343
9344 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9345
9346         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9347         handle params methods the correct way by forming only one
9348         applicable set with params and normal methods in them. Earlier we
9349         were looking at params methods only if we found no normal methods
9350         which was not the correct thing to do.
9351
9352         (Invocation.BetterFunction): Take separate arguments indicating
9353         when candidate and the best method are params methods in their
9354         expanded form.
9355
9356         This fixes bugs #43367 and #46199.
9357
9358         * attribute.cs: Documentation updates.
9359
9360         (CheckAttribute): Rename to CheckAttributeTarget.
9361         (GetValidPlaces): Rename to GetValidTargets.
9362
9363         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9364         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9365
9366         Fixes bug #44468.
9367
9368 2003-07-28  Martin Baulig  <martin@ximian.com>
9369
9370         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9371         name when looking up the base class of a nested class.  Fixes #46977.
9372
9373 2003-07-26  Martin Baulig  <martin@ximian.com>
9374
9375         * expression.cs (Indexers.Indexer): New nested struct; contains
9376         getter, setter and the indexer's type.
9377         (Indexers.Properties): This is now an ArrayList of
9378         Indexers.Indexer's.
9379         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9380         indexer doesn't have any getters.
9381
9382         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9383         for embedded property and indexer assignments.
9384
9385 2003-07-26  Martin Baulig  <martin@ximian.com>
9386
9387         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9388         preprocessor directive is not the first non-whitespace character
9389         on a line.
9390
9391 2003-07-26  Martin Baulig  <martin@ximian.com>
9392
9393         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9394         namespace parsing, follow the spec more closely.
9395
9396         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9397         NamespaceEntry.Lookup().
9398
9399 2003-07-25  Martin Baulig  <martin@ximian.com>
9400
9401         * MethodCore.cs (OverridesSomething): New public field; it's set
9402         from TypeContainer.DefineMembers if this method overrides
9403         something (which doesn't need to be a method).  Fix #39462.
9404
9405 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9406
9407         * typemanager.cs (GetMembers): Ensure that the list of members is
9408         reversed. This keeps things in sync.
9409
9410         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9411         find an AttributeUsage attribute.
9412
9413         * expression.cs (Invocation.OverloadResolve): Perform the check
9414         which disallows Invoke to be directly called on a Delegate.
9415
9416         (Error_InvokeOnDelegate): Report error cs1533.
9417
9418 2003-07-25  Martin Baulig  <martin@ximian.com>
9419
9420         * expression.cs (Indexers.GetIndexersForType): Only look in the
9421         interface hierarchy if the requested type is already an
9422         interface.  Fixes #46788 while keeping #46502 fixed.
9423
9424 2003-07-25  Martin Baulig  <martin@ximian.com>
9425
9426         * class.cs (TypeContainer.DefineMembers): Check whether all
9427         readonly fields have been assigned and report warning CS0649 if
9428         not.
9429
9430         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9431         a valuetype.
9432
9433 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9434
9435         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9436         returned from GetMethods to make things consistent with the
9437         assumptions MCS makes about ordering of methods.
9438
9439         This should comprehensively fix bug #45127 and it does :-)
9440
9441         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9442         ordering is actually reverse.
9443
9444         * Clean up some debug messages I left lying around.
9445
9446         * interface.cs (Populate*): Get rid of code which emits attributes
9447         since the stage in which we emit attributes is the 'Emit' stage,
9448         not the define stage.
9449
9450         (Emit): Move attribute emission for interface members here.
9451
9452 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9453
9454         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9455         closely: we eliminate methods in base types when we have an
9456         applicable method in a top-level type.
9457
9458         Please see section 14.5.5.1 for an exact description of what goes
9459         on. 
9460
9461         This fixes bug #45127 and a host of other related to corlib compilation.
9462
9463         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9464         array is the method corresponding to the top-level type (this is
9465         because of the changes made to icall.c) so we change this
9466         accordingly.
9467
9468         (MethodGroupExpr.Name): This too.
9469
9470         * typemanager.cs (GetElementType): New method which does the right
9471         thing when compiling corlib. 
9472
9473         * everywhere: Make use of the above in the relevant places.
9474
9475 2003-07-22  Martin Baulig  <martin@ximian.com>
9476
9477         * cs-parser.jay (invocation_expression): Moved
9478         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9479         `cast_expression', but create a InvocationOrCast which later
9480         resolves to either an Invocation or a Cast.
9481
9482         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9483         method; call this before EmitStatement() to make sure that this
9484         expression can be used as a statement.
9485
9486         * expression.cs (InvocationOrCast): New class; resolves to either
9487         an Invocation or a Cast.
9488
9489         * statement.cs (StatementExpression): Call ResolveStatement() on
9490         the ExpressionStatement before emitting it.
9491
9492 2003-07-21  Martin Baulig  <martin@ximian.com>
9493
9494         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9495         `ref' and `out' attributes match; fixes #46220.
9496         (MemberAccess.ResolveMemberAccess): You can't reference a type
9497         through an expression; fixes #33180.
9498         (Indexers.GetIndexersForType): Don't return the indexers from
9499         interfaces the class implements; fixes #46502.
9500
9501 2003-07-21  Martin Baulig  <martin@ximian.com>
9502
9503         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9504         CS0661 checks; fixes bug #30442.
9505
9506 2003-07-21  Martin Baulig  <martin@ximian.com>
9507
9508         * decl.cs (AdditionResult): Added `Error'.
9509
9510         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9511
9512         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9513         makes cs0031.cs actually work.
9514
9515 2003-07-20  Martin Baulig  <martin@ximian.com>
9516
9517         * namespace.cs: Fixed that bug which caused a crash when compiling
9518         the debugger's GUI.
9519
9520 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * typemanager.cs (LookupTypeReflection): Never expose types which
9523         are NotPublic, NestedPrivate, NestedAssembly, or
9524         NestedFamANDAssem.  We used to return these, and later do a check
9525         that would report a meaningful error, but the problem is that we
9526         would not get the real match, if there was a name override.
9527
9528 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * namespace.cs (Namespace, Name): Do not compute the namespace
9531         name dynamically, compute it in the constructor.  This reduced
9532         memory usage by 1697 KB.
9533
9534         * driver.cs: Use --pause to pause at the end.
9535
9536 2003-07-17  Peter Williams  <peter@newton.cx>
9537
9538         * Makefile: Change the name of the test target so that it doesn't
9539         conflict with the recursive test target.
9540
9541 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9542
9543         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9544         AddressOf): Do not use EmitThis, that was wrong, use the actual
9545         this pointer.
9546
9547 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9548
9549         * class.cs (MethodData.Define): While checking if a method is an
9550         interface implementation, improve the test: If we are not public
9551         (use new test here: use the computed MethodAttributes directly,
9552         instead of the parsed modifier flags) check if the `implementing'
9553         method comes from an interface or not.
9554
9555         * pending.cs (VerifyPendingMethods): Slightly better error
9556         message.
9557
9558         * makefile: add test target that does the mcs bootstrap.
9559
9560 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9561
9562         * interface.cs (Define): Do nothing here since there are no
9563         members to populate etc. Move the attribute emission out of here
9564         since this was just totally the wrong place to put it. Attribute
9565         application happens during the 'Emit' phase, not in the 'Define'
9566         phase.
9567
9568         (Emit): Add this method and move the attribute emission here
9569
9570         * rootcontext.cs (EmitCode): Call the Emit method on interface
9571         types too.
9572
9573 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9574
9575         * expression.cs (OverloadResolve): Report error only if Location
9576         is not 'Null' which means that there was a probe going on.
9577
9578 2003-07-14  Martin Baulig  <martin@ximian.com>
9579
9580         * expression.cs (ConditionalLogicalOperator): New public class to
9581         implement user defined conditional logical operators.
9582         This is section 14.11.2 in the spec and bug #40505.
9583
9584 2003-07-14  Martin Baulig  <martin@ximian.com>
9585
9586         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9587
9588 2003-07-14  Martin Baulig  <martin@ximian.com>
9589
9590         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9591
9592         * ecore.cs (IVariable.VerifyFixed): New interface method.
9593
9594         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9595         operator, check whether the variable is actually fixed.  Fixes bug
9596         #36055.  Set a variable definitely assigned when taking its
9597         address as required by the spec.
9598
9599         * statement.cs (LocalInfo.IsFixed): New field.
9600         (LocalInfo.MakePinned): Set `IsFixed' to true.
9601
9602 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9603
9604         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9605         for .ctors, ensure that we only ask for members declared in the
9606         attribute type (BindingFlags.DeclaredOnly).
9607
9608         Fixes bug #43632.
9609
9610         * expression.cs (Error_WrongNumArguments): Report error 1501
9611         correctly the way CSC does.
9612
9613 2003-07-13  Martin Baulig  <martin@ximian.com>
9614
9615         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9616         lookup on the fully qualified name, to make things like "X.X" work
9617         where "X.X" is a fully qualified type name, but we also have a
9618         namespace "X" in the using list.  Fixes #41975.
9619
9620 2003-07-13  Martin Baulig  <martin@ximian.com>
9621
9622         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9623         function. If we're a CompoundAssign, we need to create an embedded
9624         CompoundAssign, not an embedded Assign.
9625         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9626         Fixes #45854.
9627
9628 2003-07-13  Martin Baulig  <martin@ximian.com>
9629
9630         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9631         work to fix bug #46088.
9632
9633 2003-07-13  Ravi Pratap <ravi@ximian.com>
9634
9635         * class.cs (Operator.Emit): Do not emit attributes here - it is
9636         taken care of by the Method class that we delegate too. This takes
9637         care of bug #45876.
9638
9639 2003-07-10  Martin Baulig  <martin@ximian.com>
9640
9641         * expression.cs (TypeOfVoid): New class.
9642         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9643
9644 2003-07-10  Martin Baulig  <martin@ximian.com>
9645
9646         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9647         bug #35957.
9648
9649 2003-07-10  Martin Baulig  <martin@ximian.com>
9650
9651         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9652         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9653
9654         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9655
9656         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9657
9658 2003-07-10  Martin Baulig  <martin@ximian.com>
9659
9660         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9661         of decimal.  Fixes #42850.
9662
9663         NOTE: I also fixed the created byte blob, but this doesn't work on
9664         the MS runtime and csc never produces any byte blobs for decimal
9665         arrays.
9666
9667 2003-07-10  Martin Baulig  <martin@ximian.com>
9668
9669         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9670         structs; fixes #32068.
9671         (Block.AddChildVariableNames): Fixed #44302.
9672
9673 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9674
9675         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9676
9677 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9678
9679         * attribute.cs: And this test is onger needed.
9680
9681 2003-07-08  Martin Baulig  <martin@ximian.com>
9682
9683         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9684         inaccessible types.  Fixes #36313.
9685
9686         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9687
9688         * namespace.cs (NamespaceEntry): Create implicit entries for all
9689         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9690         implicit entries for N1.N2 and N1.
9691
9692 2003-07-08  Martin Baulig  <martin@ximian.com>
9693
9694         Rewrote the handling of namespaces to fix a lot of the issues
9695         wrt. `using' aliases etc.
9696
9697         * namespace.cs (Namespace): Splitted this class into a
9698         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9699
9700         * typemanager.cs (TypeManager.IsNamespace): Removed.
9701         (TypeManager.ComputeNamespaces): Only compute namespaces from
9702         loaded assemblies here, not the namespaces from the assembly we're
9703         currently compiling.
9704
9705 2003-07-08  Martin Baulig  <martin@ximian.com>
9706
9707         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9708
9709 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9710
9711         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9712         already fixed it.  
9713
9714         I thought about the memory savings here, but LookupTypeReflection
9715         is used under already very constrained scenarios.  Compiling
9716         corlib or mcs only exposes one hit, so it would not really reduce
9717         any memory consumption.
9718
9719 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9720
9721         * typemanager.cs: fixes bug #45889 by only adding public types from
9722         other assemblies to the list of known types.
9723
9724 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9725
9726         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9727         on the type we resolved.
9728
9729 2003-07-05  Martin Baulig  <martin@ximian.com>
9730
9731         * pending.cs (PendingImplementation.ParentImplements): Don't
9732         create the proxy if the parent is abstract.
9733
9734         * class.cs (TypeContainer.DefineIndexers): Process explicit
9735         interface implementations first.  Fixes #37714.
9736
9737 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9738
9739         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9740         defined recursively;  but since we modify the input parameters
9741         (left is set to `this' temporarily), we reset this value if the
9742         left_is_explicit is false, which gives the original semantics to
9743         the code.  
9744
9745         * literal.cs (NullPointer): new class used to represent a null
9746         literal in a pointer context.
9747
9748         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9749         type is a pointer, use a NullPointer object instead of a
9750         NullLiteral.   Closes 43687
9751
9752         (ExplicitConversion): Convert pointer values using
9753         the conv opcode to the proper type.
9754
9755         * ecore.cs (New): change ValueTypeVariable property into a method,
9756         that returns whether the valuetype is suitable for being used.
9757
9758         * expression.cs (Binary.DoNumericPromotions): Only return if we
9759         the int constant was a valid uint, and we can return both left and
9760         right as uints.  If not, we continue processing, to trigger the
9761         type conversion.  This fixes 39018.
9762
9763         * statement.cs (Block.EmitMeta): During constant resolution, set
9764         the CurrentBlock property on the emitcontext, so that we resolve
9765         constants propertly.
9766
9767 2003-07-02  Martin Baulig  <martin@ximian.com>
9768
9769         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9770         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9771
9772         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9773         than emitting it here.
9774
9775         * statement.cs: Fixed some more flow analysis bugs.
9776
9777 2003-07-02  Martin Baulig  <martin@ximian.com>
9778
9779         * class.cs (MethodData.Define): When implementing interface
9780         methods, set Final unless we're Virtual.
9781
9782         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9783         check work for interface methods.
9784
9785 2003-07-01  Martin Baulig  <martin@ximian.com>
9786
9787         * ecore.cs (EmitContext.This): Replaced this property with a
9788         GetThis() method which takes a Location argument.  This ensures
9789         that we get the correct error location for a CS0188.
9790
9791 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9792
9793         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9794         ImplicitStandardConversion.
9795
9796         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9797
9798 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9799
9800         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9801         optimization.
9802
9803 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9804
9805         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9806         constructors.
9807
9808         (MethodData.Define): Turn off initlocals for unsafe methods.
9809
9810 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9811
9812         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9813         complete;  Fixes #37521.
9814
9815         * delegate.cs: Use Modifiers.TypeAttr to compute the
9816         TypeAttributes, instead of rolling our own.  This makes the flags
9817         correct for the delegates.
9818
9819 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * class.cs (Constructor.Define): Set the private flag for static
9822         constructors as well.
9823
9824         * cs-parser.jay (statement_expression): Set the return value to
9825         null, to avoid a crash when we catch an error.
9826
9827 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cs-parser.jay: Applied patch from Jackson that adds support for
9830         extern and unsafe modifiers to destructor declarations.
9831
9832         * expression.cs: Report error 21 if the user is trying to index a
9833         System.Array.
9834
9835         * driver.cs: Add an error message, suggested by the bug report.
9836
9837         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9838         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9839
9840 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9841
9842         * namespace.cs: Add some information to reduce FAQs.
9843
9844 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9847         underlying enumeration types.  Fixes #43915.
9848
9849         * expression.cs: Treat ushort/short as legal values to be used in
9850         bitwise operations.
9851
9852 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9853
9854         * delegate.cs: transfer custom attributes for paramenters from
9855         the delegate declaration to Invoke and BeginInvoke.
9856
9857 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9858
9859         * attribute.cs: handle custom marshalers and emit marshal info
9860         for fields, too.
9861
9862 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9863
9864         * makefile.gnu: Added anonymous.cs to the compiler sources.
9865
9866 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * iterators.cs: Change the name of the proxy class to include two
9869         underscores.
9870
9871         * cs-parser.jay: Update grammar to include anonymous methods.
9872
9873         * anonymous.cs: new file.
9874
9875 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9876
9877         * class.cs (Field.Define): Add missing test for pointers and
9878         safety. 
9879
9880 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9881
9882         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9883         we use the stobj opcode.
9884
9885         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9886         since it wasn't the correct fix. 
9887
9888         It still is puzzling that we are required to use stobj for IntPtr
9889         which seems to be a ValueType.
9890
9891 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9892
9893         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9894         during regular simple name resolution.   Now, the trick is that
9895         instead of returning for processing the simplename, we do a
9896         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9897         contextual lookup type).   If a match is found, return that, if
9898         not, return for further composition.
9899
9900         This fixes long-standing 30485.
9901
9902         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9903         using the address to initialize an object, do an Stobj instead of
9904         using the regular Stelem.
9905
9906         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9907         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9908         Because if we are a BaseIndexerAccess that value will be true.
9909         Fixes 43643.
9910
9911         * statement.cs (GotoCase.Resolve): Return after reporting an
9912         error, do not attempt to continue. 
9913
9914         * expression.cs (PointerArithmetic.Emit): If our operand is a
9915         long, convert our constants to match the operand before
9916         multiplying.  Convert to I type before adding.   Fixes 43670.
9917
9918 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9919
9920         * enum.cs (ImplicitConversionExists) : Rename to
9921         ImplicitEnumConversionExists to remove ambiguity. 
9922
9923         * ecore.cs (NullCast): New type of cast expression class which
9924         basically is very similar to EmptyCast with the difference being
9925         it still is a constant since it is used only to cast a null to
9926         something else
9927         (eg. (string) null)
9928
9929         * convert.cs (ImplicitReferenceConversion): When casting a null
9930         literal, we return a NullCast.
9931
9932         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9933         should be around anymore.
9934
9935         The renaming (reported was slightly wrong). Corrections:
9936
9937         ConvertImplicitStandard -> ImplicitConversionStandard
9938         ConvertExplicitStandard -> ExplicitConversionStandard
9939
9940         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9941         before passing them in !
9942
9943         * convert.cs (ImplicitConversionStandard): When comparing for
9944         equal expr and target types, ensure that expr is not a
9945         NullLiteral.
9946
9947         In general, we must not be checking (expr_type ==
9948         target_type) in the top level conversion methods
9949         (ImplicitConversion, ExplicitConversion etc). This checking is
9950         done in the methods that they delegate to.
9951
9952 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9953
9954         * convert.cs: Move Error_CannotConvertType,
9955         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9956         ImplicitNumericConversion, ImplicitConversionExists,
9957         ImplicitUserConversionExists, StandardConversionExists,
9958         FindMostEncompassedType, FindMostSpecificSource,
9959         FindMostSpecificTarget, ImplicitUserConversion,
9960         ExplicitUserConversion, GetConversionOperators,
9961         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9962         TryImplicitIntConversion, Error_CannotConvertImplicit,
9963         ConvertImplicitRequired, ConvertNumericExplicit,
9964         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9965         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9966         its own file.
9967
9968         Perform the following renames:
9969
9970         StandardConversionExists -> ImplicitStandardConversionExists
9971         ConvertImplicit -> ImplicitConversion
9972         ConvertImplicitStandard -> ImplicitStandardConversion
9973         TryImplicitIntConversion -> ImplicitIntConversion
9974         ConvertImplicitRequired -> ImplicitConversionRequired
9975         ConvertNumericExplicit -> ExplicitNumericConversion
9976         ConvertReferenceExplicit -> ExplicitReferenceConversion
9977         ConvertExplicit -> ExplicitConversion
9978         ConvertExplicitStandard -> ExplicitStandardConversion
9979
9980 2003-05-19  Martin Baulig  <martin@ximian.com>
9981
9982         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9983         (TypeInfo): Added support for structs having structs as fields.
9984
9985         * ecore.cs (FieldExpr): Implement IVariable.
9986         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9987         VariableInfo for the field.
9988
9989 2003-05-18  Martin Baulig  <martin@ximian.com>
9990
9991         * expression.cs (This.DoResolve): Report a CS0027 if we're
9992         emitting a field initializer.
9993
9994 2003-05-18  Martin Baulig  <martin@ximian.com>
9995
9996         * expression.cs (This.ResolveBase): New public function.
9997         (This.DoResolve): Check for CS0188.
9998
9999         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10000         This.Resolve().
10001
10002         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10003         `instance_expression' to null if we don't have any non-static
10004         methods.
10005
10006 2003-05-18  Martin Baulig  <martin@ximian.com>
10007
10008         Reworked the way how local variables and parameters are handled by
10009         the flow analysis code.
10010
10011         * statement.cs (TypeInfo, VariableMap): New public classes.
10012         (VariableInfo): New public class.  This is now responsible for
10013         checking whether a variable has been assigned.  It is used for
10014         parameters and local variables.
10015         (Block.EmitMeta): Take the InternalParameters as argument; compute
10016         the layout of the flow vectors here.
10017         (Block.LocalMap, Block.ParameterMap): New public properties.
10018         (FlowBranching): The .ctor doesn't get the InternalParameters
10019         anymore since Block.EmitMeta() now computes the layout of the flow
10020         vector.
10021         (MyStructInfo): This class is now known as `StructInfo' and nested
10022         in `TypeInfo'; we don't access this directly anymore.
10023
10024         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10025         property and removed IsAssigned(), IsFieldAssigned(),
10026         SetAssigned() and SetFieldAssigned(); we now call them on the
10027         VariableInfo so we don't need to duplicate this code everywhere.
10028
10029         * expression.cs (ParameterReference): Added `Block block' argument
10030         to the .ctor.
10031         (LocalVariableReference, ParameterReference, This): The new
10032         VariableInfo class is now responsible for all the definite
10033         assignment stuff.
10034
10035         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10036         IsParameterAssigned, SetParameterAssigned): Removed.
10037
10038 2003-05-18  Martin Baulig  <martin@ximian.com>
10039
10040         * typemanager.cs (InitCoreTypes): Try calling
10041         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10042         the 3-args-version.  Corlib now also needs our `void_type'.
10043         (GetMethod): Added overloaded version which takes an optional
10044         `bool report_errors' to allow lookups of optional methods.
10045
10046 2003-05-12  Martin Baulig  <martin@ximian.com>
10047
10048         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10049         only used for locals and not for parameters.
10050
10051 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10052
10053         * support.cs (InternalParameters.ParameterType): Return the
10054         ExternalType of the parameter.
10055
10056         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10057         they were unused.
10058
10059 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * class.cs (MethodData.Define): Do not set the `newslot' on
10062         interface members, if they are also flagged as "override".
10063
10064         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10065         better code for ++i and i++.  This only works for static fields
10066         and local variables.
10067
10068         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10069         want to pull the DeclSpace out of the builder_to_declspace instead
10070         of the TypeBuilder (like in TypeContainer.FindMembers).
10071
10072         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10073         instead of LookupTypeContainer.  Fixes the crash on .NET for
10074         looking up interface members.
10075
10076         * const.cs: Create our own emit context during the Definition
10077         stage, so that constants are evaluated in the proper context, when
10078         a recursive definition happens.
10079
10080 2003-05-11  Martin Baulig  <martin@ximian.com>
10081
10082         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10083         new block for a switch section.
10084         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10085         the adding/lookup in the switch block.  Fixes #39828.
10086
10087 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10090         functionality: I needed to convert the data after I had performed
10091         the add/sub operation into the operands type size.
10092
10093         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10094         pass the type for the box operation, otherwise the resulting
10095         object would have been of type object.
10096
10097         (BoxedCast): Add constructor to specify the type to box as.
10098
10099 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * iterators.cs: I was reusing the `count' variable inadvertently,
10102         take steps to not allow this to happen.
10103
10104 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10107         by creating an array at the point where the params starts and
10108         putting all those arguments there, then adjusting the size of the
10109         array.
10110
10111 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10112
10113         * expression.cs (New.AddressOf): Implement interface
10114         IMemoryLocation.  This is used when the `new' operator is used in
10115         the context of an invocation to a method on a value type.
10116
10117         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10118         example. 
10119
10120         * namespace.cs: Also check the using aliases here.
10121
10122         * driver.cs: Move the test for using validity after the types have
10123         been entered, so we do a single pass that also includes the using
10124         aliases. 
10125
10126         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10127         in the regular case.   CreateSiblingForFinally is doing extra
10128         error checking.
10129
10130         * attribute.cs (GetAttributeArgumentExpression): Store the result
10131         on an out value, and use the return value to indicate failure
10132         instead of using null (which is a valid return for Constant.GetValue).
10133
10134         * statement.cs: Perform the analysis flow for the increment
10135         portion after the statement, because this will be the real flow of
10136         execution.  Fixes #42385
10137
10138         * codegen.cs (EmitContext.EmitArgument,
10139         EmitContext.EmitStoreArgument): New helper functions when the
10140         RemapToProxy flag is set.
10141
10142         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10143         function.
10144
10145         Add support for remapping parameters. 
10146
10147         * iterators.cs: Propagate parameter values;  Store parameter
10148         values in the proxy classes.
10149
10150 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10151
10152         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10153         need a proxy reference;  I do not know what I was thinking
10154
10155         * cs-parser.jay (constructor_initializer): catch another error,
10156         and display nice message.
10157
10158         (field_declaration): catch void field declaration
10159         to flag a better error. 
10160
10161         * class.cs (MemberBase.CheckBase): Report an error instead of a
10162         warning if a new protected member is declared in a struct. 
10163         (Field.Define): catch the error of readonly/volatile.
10164
10165         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10166
10167         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10168         volatile variable is taken
10169
10170 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10171
10172         * statement.cs (Fixed.Resolve): Report an error if we are not in
10173         an unsafe context.
10174
10175 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10176
10177         * typemanager.cs: reuse the code that handles type clashes for
10178         delegates and enumerations.
10179
10180         * class.cs (Report28): Always report.
10181
10182         * expression.cs (EncodeAsAttribute): Allow nulls here.
10183
10184 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10185
10186         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10187         the functionality for testing whether an expression is valid for
10188         an attribute here.  Also handle the case of arrays of elements
10189         being stored. 
10190
10191         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10192         encoding a linear array into an array of objects that are suitable
10193         to be passed to an CustomAttributeBuilder.
10194
10195         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10196
10197         * ecore.cs: (FieldExpr): Handle field remapping here.
10198
10199         * iteratators.cs: Pass the instance variable (if the method is an
10200         instance method) to the constructors, so we can access the field
10201         variables on the class.
10202
10203         TODO: Test this with structs.  I think the THIS variable on
10204         structs might have to be a pointer, and not a refenrece
10205
10206 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10207
10208         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10209         local variables to fields in a proxy class.
10210
10211         * iterators.cs (PopulateProxy): Rename our internal fields to
10212         <XXX>.  
10213         Create a <THIS> field if we are an instance method, so we can
10214         reference our parent container variables.
10215         (MapVariable): Called back from the EmitContext code to enter a
10216         new variable to field mapping into the proxy class (we just create
10217         a FieldBuilder).
10218
10219         * expression.cs
10220         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10221         for using the remapped locals to fields.
10222
10223         I placed the code here, because that gives the same semantics to
10224         local variables, and only changes the Emit code.
10225
10226         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10227         statements inside iterators.
10228         (VariableInfo): Add a FieldBuilder for the cases when we are
10229         remapping local variables to fields in a proxy class
10230
10231         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10232         current_block != null.
10233
10234         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10235         not cope with strings, as it has been moved to the
10236         TableSwitchEmit.  Fixed bug in switch generation.
10237
10238         * expression.cs (New.DoResolve): Provide more context for the user
10239         when reporting an error.
10240
10241         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10242         pointers. 
10243
10244         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10245         check the permissions for it.  Note than in a type-resolution
10246         context the check was already present in DeclSpace.ResolveType,
10247         but was missing from the MemberAccess.
10248
10249         (ArrayCreation.CheckIndices): warn if the user has
10250         more nested levels of expressions, but there are no more
10251         dimensions specified.  Avoids crash on bug 41906.
10252
10253 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10254
10255         * statement.cs (Block): replace Implicit bool, for a generic
10256         flags.   
10257         New flag: `Unchecked'.  This is used during the EmitMeta phase
10258         (which is out-of-line with the regular Resolve/Emit process for a
10259         statement, as this is done ahead of time, but still gets a chance
10260         to call constant resolve).
10261
10262         (Block.Flags): new enum for adding a new flag.
10263
10264         (Block.EmitMeta): track the state of unchecked.
10265
10266         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10267         to enable constant resolution to work there as well.
10268
10269 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10270
10271         * typemanager.cs (ienumerable_type): Also look up
10272         System.Collections.IEnumerable. 
10273
10274 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10275
10276         TODO: Test more than one conditional per method.
10277
10278         * class.cs (Indexer.Define): Report the location where the user is
10279         referencing the unsupported feature.
10280
10281         (MethodData): Overload the use of `conditionals' to
10282         minimize the creation of needless ArrayLists.   This saves roughly
10283         212kb on my machine.
10284
10285         (Method): Implement the new IIteratorContainer interface.
10286         (Method.SetYields): Implement the method by setting the ModFlags
10287         to contain METHOD_YIELDS.
10288
10289         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10290         which just got set to null.
10291
10292         * iterators.cs: New file.
10293
10294         (Yield, YieldBreak): New statements.
10295
10296         * statement.cs (Return.Resolve): Flag an error if we are used in
10297         an iterator method.
10298
10299         * codegen.cs (InIterator): New flag set if the code is being
10300         compiled in an iterator method.
10301
10302         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10303         internal modifier, and we just use it to avoid adding extra
10304         fields, as this is seldom used.  
10305
10306         * cs-parser.jay: Add yield_statement (yield and yield break).
10307
10308         * driver.cs: New flag -v2 to turn on version 2 features. 
10309
10310         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10311         hashtable when v2 is enabled.
10312
10313 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10314
10315         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10316         there is already a namespace defined with this name.
10317
10318         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10319         people upgraded their corlibs.
10320
10321         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10322         always use fully qualified types, no need to use the compiler
10323         front end.
10324
10325         (TypeManager.IsNamespace): Use binarysearch.
10326
10327         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10328         AddDelegate): I did not quite use the new IsValid API properly: I
10329         have to pass the short-name and the fullname.  I was passing only
10330         the basename instead of the fullname sometimes. 
10331
10332         (TypeContainer.DefineType): call NamespaceClash.
10333
10334         * interface.cs (Interface.DefineType): use NamespaceClash before
10335         defining the type.
10336
10337         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10338         defining the type.
10339
10340         * enum.cs: (Enum.DefineType): use NamespaceClash before
10341         defining the type.
10342
10343         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10344         speed increase.  First, use the negative_hits cache when we get a
10345         negative.  Second, add the type with its full original name
10346         instead of the new . and + encoded name (reflection uses + to
10347         separate type from a nested type).  Use LookupTypeReflection
10348         directly which bypasses the type->name hashtable (that we already
10349         know does not contain the type.
10350
10351         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10352         location/container type. 
10353
10354         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10355
10356 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10357
10358         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10359
10360         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10361         method is being referenced in the method group from a static
10362         context, and report error 120 if so.
10363
10364         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10365         Error118. 
10366
10367         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10368         is created, we create the A namespace).
10369
10370         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10371         Fixes #41591
10372
10373 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10374
10375         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10376         invocation to ModuleBuilder.GetType with the same values will
10377         return a new type instance, so we need to cache its return
10378         values. 
10379
10380         * expression.cs (Binary.ResolveOperator): Only allow the compare
10381         operators on enums if they are of the same type.
10382
10383         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10384         types of ValueType on their own case.  Before we were giving them
10385         the same treatment as objects.
10386
10387         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10388         fullname.  Short name is used to compare against container name.
10389         Fullname is used to check against defined namespace names.
10390
10391         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10392         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10393
10394         (Method.CheckBase): Call parent.
10395         (MemberBase.CheckBase): Check for protected members on sealed
10396         classes.
10397         (PropertyBase.CheckBase): Call parent.
10398         (Field.Define): Call parent.
10399
10400         * report.cs: Negative error codes are now mapped to 8000 - code,
10401         so that the display is render more nicely.
10402
10403         * typemanager.cs: Do not use try/catch, instead report a regular
10404         error. 
10405
10406         (GetPointerType, GetReferenceType): These methods provide
10407         mechanisms to obtain the T* and T& from a T.  We had the code
10408         previously scattered around the code base, and it also used
10409         TypeManager.LookupType that would go through plenty of caches.
10410         This one goes directly to the type source.
10411
10412         In some places we did the Type.GetType followed by
10413         ModuleBuilder.GetType, but not in others, so this unifies the
10414         processing as well.
10415
10416         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10417         statements now that we have namespace information.
10418
10419         * typemanager.cs (IsNamespace): New method, returns whether the
10420         string presented is a namespace or not.
10421
10422         (ComputeNamespaces): New public entry point, computes the list of
10423         available namespaces, using the GetNamespaces API call in Mono, or
10424         the slower version in MS.NET.   
10425
10426         Now before we start the semantic analysis phase, we have a
10427         complete list of namespaces including everything that the user has
10428         provided.
10429
10430         Deleted old code to cache namespaces in .nsc files.
10431
10432 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10435         class/struct location definition Location for the implicit
10436         constructor location.
10437
10438         (Operator.Define): Use the location of the operator for the
10439         implicit Method definition.
10440
10441         (Constructor.Emit): use the constructor location for the implicit
10442         base initializer constructor.
10443
10444         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10445         and the Expression class now contains two new methods:
10446
10447         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10448         isolate type lookup from the rest of the resolution process.
10449
10450         Since we use Expressions to hold type definitions due to the way
10451         we parse the input we have historically overloaded Resolve to
10452         perform the Type lookups if a special flag is passed.  Now this is
10453         eliminated and two methods take their place. 
10454
10455         The differences in the two methods between xStep and xTerminal is
10456         that xStep is involved in our current lookup system that uses
10457         SimpleNames to compose a name, while xTerminal is used just to
10458         catch the case where the simplename lookup failed.
10459
10460 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10461
10462         * expression.cs (ResolveMemberAccess): Remove redundant code.
10463         TypeExpr expressions are always born fully resolved.
10464
10465         * interface.cs (PopulateMethod): Do not lookup the types twice.
10466         We were doing it once during SemanticAnalysis and once during
10467         PopulateMethod.
10468
10469         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10470         in local variable type definitions, were being returned as a
10471         SimpleName (we decomposed everything into a string), that is
10472         because primary_expression was being used instead of a type in the
10473         grammar (reduce/reduce conflicts).
10474
10475         The part that was wrong is that we converted the expression into a
10476         string (an oversimplification in one hand, compounded with primary
10477         expressions doing string concatenation).
10478
10479         So things like:
10480
10481         A.B.C [] x;
10482
10483         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10484         using clauses from working on this particular context.  And a type
10485         was being matched directly against "A.B.C[]".
10486
10487         We now use the correct approach, and allow for ComposedCast to be
10488         part of the unary expression.  So the "A.B.C []" become a composed
10489         cast of "A.B.C" (as a nested group of MemberAccess with a
10490         SimpleName at the end) plus the rank composition "[]". 
10491
10492         Also fixes 35567
10493
10494 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10497         for the access level checking.
10498
10499         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10500         `TypeContainer container', because I kept getting confused when I
10501         was debugging this code.
10502
10503         * expression.cs (Indexers): Instead of tracking getters/setters,
10504         we now track them in parallel.  We create one arraylist less, but
10505         most importantly it is possible now for the LValue code to find a
10506         matching get for a set.
10507
10508         (IndexerAccess.DoResolveLValue): Update the code.
10509         GetIndexersForType has been modified already to extract all the
10510         indexers from a type.  The code assumed it did not.
10511
10512         Also make the code set the correct return type for the indexer.
10513         This was fixed a long time ago for properties, but was missing for
10514         indexers.  It used to be void_type.
10515
10516         (Binary.Emit): Test first for doubles instead of
10517         floats, as they are more common.
10518
10519         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10520         when dealing with floats and the <=, >= operators.  This fixes bug
10521         #39314 
10522
10523         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10524         to load the array value by emitting a load on the foreach variable
10525         type.  This was incorrect.  
10526
10527         We now emit the code to load an element using the the array
10528         variable type, and then we emit the conversion operator.
10529
10530         Fixed #40176
10531
10532 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10533
10534         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10535
10536 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10537
10538         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10539         test for protection before we test for signatures. 
10540
10541         (MethodSignature.ToString): implement.
10542
10543         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10544         to the case where we reduced into a LongConstant.
10545
10546         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10547         depend on whether the information is acurrate, because the
10548         Microsoft runtime will always claim that the array type is public,
10549         regardless of the real state.
10550
10551         If the type is a pointer, another problem happens: the type is
10552         reported as non-public in Microsoft.  
10553
10554         In both cases we have to call CheckAccessLevel recursively with
10555         the underlying type as the argument to be tested.
10556
10557 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10558
10559         * assign.cs (Assign.Emit): If we are dealing with a compound
10560         assignment expression, we should use the code path that stores the
10561         intermediate result in a temporary value.  This fixes #40903.
10562
10563         *expression.cs (Indirection.ToString): Provide ToString method for
10564         debugging. 
10565
10566 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10567
10568         * class.cs: Null out fields holding references to Block objects so
10569         they can be garbage collected.
10570
10571         * expression.cs (OverloadResolve): Remove unused local.
10572
10573 2003-04-07  Martin Baulig  <martin@ximian.com>
10574
10575         * codegen.cs (EmitContext.CurrentFile): New public field.
10576         (EmitContext.Mark): Use the CurrentFile to check whether the
10577         location is in the correct file.
10578         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10579
10580 2003-04-07  Martin Baulig  <martin@ximian.com>
10581
10582         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10583
10584         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10585         location.  [FIXME: The location argument which gets passed to this
10586         method is sometimes wrong!]
10587
10588 2003-04-07  Nick Drochak <ndrochak@gol.com>
10589
10590         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10591
10592 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * expression.cs (Indirection.EmitAssign): We were using the
10595         temporary, but returning immediately instead of continuing the
10596         EmitAssing flow.
10597
10598 2003-04-06  Martin Baulig  <martin@ximian.com>
10599
10600         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10601         if it's a nested child, but also deriving from the outer class.
10602         See test 190.cs.
10603
10604         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10605         nested child, but also deriving from the outer class.  See
10606         test-190.cs.
10607         (FilterWithClosure): We may access private members of the outer
10608         class if we're a nested child and deriving from the outer class.
10609         (RealMemberLookup): Only set `closure_private_ok' if the
10610         `original_bf' contained BindingFlags.NonPublic.
10611
10612 2003-04-05  Martin Baulig  <martin@ximian.com>
10613
10614         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10615
10616 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10617
10618         * class.cs (Event.Define): Do not allow abstract events to have
10619         initializers. 
10620
10621 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10622
10623         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10624         block in event declarations.
10625
10626         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10627         value type, get its address.
10628
10629         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10630         leaving a class on the stack instead of a boolean value (int
10631         0/1).  Change the code so we compare against null, and then the
10632         result against zero.
10633
10634         * class.cs (TypeContainer.GetClassBases): We were checking for the
10635         parent class being sealed too late.
10636
10637         * expression.cs (Binary.Emit): For <= and >= when dealing with
10638         floating point values, use cgt.un and clt.un instead of cgt and
10639         clt alone.
10640
10641 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10642
10643         * statement.cs: Apply the same optimization as MS: skip the 
10644         GetEnumerator returning an IEnumerator, and use the one returning a 
10645         CharEnumerator instead. This allows us to avoid the try-finally block 
10646         and the boxing.
10647
10648 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10649
10650         * cs-parser.jay: Attributes cannot be applied to
10651                          namespaces. Fixes #40473
10652
10653 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10654
10655         * class.cs:
10656         (Add*): check if the name is valid using the full name for constants,
10657         fields, properties and events.
10658
10659 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10660
10661         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10662         char constants to be part of the enumeration.
10663
10664         * expression.cs (Conditional.DoResolve): Add support for operator
10665         true. Implements the missing functionality from 14.12
10666
10667         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10668         operator true/false as required by the spec.
10669
10670         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10671         implicit conversion to boolean.
10672
10673         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10674         also one where the type implements `operator true'. 
10675
10676         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10677         get an expression that will invoke operator true based on an
10678         expression.  
10679
10680         (GetConversionOperators): Removed the hack that called op_True
10681         here.  
10682
10683         (Expression.ResolveBoolean): Move this from Statement.
10684
10685 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10686
10687         * ecore.cs (FieldExpr): do not allow initialization of initonly
10688         fields on derived classes
10689
10690 2003-03-13  Martin Baulig  <martin@ximian.com>
10691
10692         * statement.cs (Block.Emit): Call ig.BeginScope() and
10693         ig.EndScope() when compiling with debugging info; call
10694         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10695
10696 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10697
10698         * expression.cs (Indexers): Do not construct immediately, allow
10699         for new members to be appended as we go.  Fixes 38143
10700
10701 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10702
10703         * expression.cs: save/restore context when resolving an unchecked
10704         expression.
10705
10706 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10707
10708         * cfold.cs: Catch division by zero in modulus operator during
10709         constant folding.
10710
10711 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10712
10713         * interface.cs (Interface.DefineMembers): Avoid defining members
10714         twice. 
10715
10716 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10717
10718         * driver.cs: handle the +/- options for -noconfig
10719
10720         * statement.cs (Unckeched.Resolve): Also track the state of
10721         unchecked in the Resolve phase.
10722
10723 2003-02-27  Martin Baulig  <martin@ximian.com>
10724
10725         * ecore.cs (Expression.MemberLookup): Don't create a
10726         MethodGroupExpr for something which is not a method.  Fixes #38291.
10727
10728 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * class.cs (MemberBase.CheckParameters): Also check that the type
10731         is unmanaged if it is a pointer.
10732
10733         * expression.cs (SizeOf.Resolve): Add location information.
10734
10735         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10736         a managed type is declared.
10737
10738         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10739         parameter modifiers as well.  Fixes bug 38606
10740
10741         * class.cs: Very sad.  Am backing out the speed up changes
10742         introduced by the ArrayList -> Array in the TypeContainer, as they
10743         were not actually that much faster, and introduced a bug (no error
10744         reports on duplicated methods).
10745
10746         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10747         source first, this will guarantee that we have a valid expression
10748         before calling in lower levels functions that will require a
10749         resolved object.  Then use this original_source in the
10750         target.ResolveLValue instead of the original source that was
10751         passed to us.
10752
10753         Another change.  Use target.Resolve instead of LValueResolve.
10754         Although we are resolving for LValues, we will let the Assign code
10755         take care of that (it will be called again from Resolve).  This
10756         basically allows code like this:
10757
10758         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10759         class Y { void A (X x) { x [0] += o; }
10760
10761         The problem was that the indexer was trying to resolve for
10762         set_Item (idx, object o) and never finding one.  The real set_Item
10763         was set_Item (idx, X).  By delaying the process we get the right
10764         semantics. 
10765
10766         Fixes bug 36505
10767
10768 2003-02-23  Martin Baulig  <martin@ximian.com>
10769
10770         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10771         while calling DoEmit ().
10772
10773         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10774         source files; if you use the #line directive inside a method, the
10775         compiler stops emitting line numbers for the debugger until it
10776         reaches the end of the method or another #line directive which
10777         restores the original file.
10778
10779 2003-02-23  Martin Baulig  <martin@ximian.com>
10780
10781         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10782
10783 2003-02-23  Martin Baulig  <martin@ximian.com>
10784
10785         * statement.cs (Block.AddChildVariableNames): We need to call this
10786         recursively, not just for our immediate children.
10787
10788 2003-02-23  Martin Baulig  <martin@ximian.com>
10789
10790         * class.cs (Event.Define): Always make the field private, like csc does.
10791
10792         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10793         actually work, fixes bug #37521.
10794
10795 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * delegate.cs: When creating the various temporary "Parameters"
10798         classes, make sure that we call the ComputeAndDefineParameterTypes
10799         on those new parameters (just like we do with the formal ones), to
10800         allow them to be resolved in the context of the DeclSpace.
10801
10802         This fixes the bug that Dick observed in Bugzilla #38530.
10803
10804 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10805
10806         * expression.cs (ResolveMemberAccess): When resolving a constant,
10807         do not attempt to pull a constant if the value was not able to
10808         generate a valid constant.
10809
10810         * const.cs (LookupConstantValue): Do not report more errors than required.
10811
10812 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10813
10814         * expression.cs: fixes bug #38328.
10815
10816 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * class.cs: Changed all the various members that can be part of a
10819         class from being an ArrayList to be an Array of the right type.
10820         During the DefineType type_list, interface_list, delegate_list and
10821         enum_list are turned into types, interfaces, delegates and enums
10822         arrays.  
10823
10824         And during the member population, indexer_list, event_list,
10825         constant_list, field_list, instance_constructor_list, method_list,
10826         operator_list and property_list are turned into their real arrays.
10827
10828         Although we could probably perform this operation earlier, for
10829         good error reporting we need to keep the lists and remove the
10830         lists for longer than required.
10831
10832         This optimization was triggered by Paolo profiling the compiler
10833         speed on the output of `gen-sample-program.pl' perl script. 
10834
10835         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10836         not crash in methods like MemberLookupFailed that use this field.  
10837
10838         This problem arises when the compiler fails to resolve a type
10839         during interface type definition for example.
10840
10841 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10842
10843         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10844         inherit from System.Object, so we have to stop at null, not only
10845         when reaching System.Object.
10846
10847 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10848
10849         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10850         DeclaredOnly because the parent indexer might have had a different
10851         name, but did not loop until the top of the hierarchy was reached.
10852
10853         The problem this one fixes is 35492: when a class implemented an
10854         indexer from an interface, we were getting the interface method
10855         (which was abstract) and we were flagging an error (can not invoke
10856         abstract method).
10857
10858         This also keeps bug 33089 functioning, and test-148 functioning.
10859
10860         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10861         out if a method is special is to see if it is declared in a
10862         property or event, or whether it is one of the predefined operator
10863         names.   This should fix correctly #36804.
10864
10865 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10866
10867         The goal here is to remove the dependency on EmptyCast.Peel ().
10868         Killing it completely.
10869
10870         The problem is that currently in a number of places where
10871         constants are expected, we have to "probe" for an EmptyCast, and
10872         Peel, which is not the correct thing to do, as this will be
10873         repetitive and will likely lead to errors. 
10874
10875         The idea is to remove any EmptyCasts that are used in casts that
10876         can be reduced to constants, so we only have to cope with
10877         constants. 
10878
10879         This bug hunt was triggered by Bug 37363 and the desire to remove
10880         the duplicate pattern where we were "peeling" emptycasts to check
10881         whether they were constants.  Now constants will always be
10882         constants.
10883
10884         * ecore.cs: Use an enumconstant here instead of wrapping with
10885         EmptyCast.  
10886
10887         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10888         throwing me off.  By handling this we can get rid of a few hacks.
10889
10890         * statement.cs (Switch): Removed Peel() code.
10891
10892 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * class.cs: Location information for error 508
10895
10896         * expression.cs (New.DoResolve): Add a guard against double
10897         resolution of an expression.  
10898
10899         The New DoResolve might be called twice when initializing field
10900         expressions (see EmitFieldInitializers, the call to
10901         GetInitializerExpression will perform a resolve on the expression,
10902         and later the assign will trigger another resolution
10903
10904         This leads to bugs (#37014)
10905
10906         * delegate.cs: The signature for EndInvoke should contain any ref
10907         or out parameters as well.  We were not doing this in the past. 
10908
10909         * class.cs (Field.Define): Do not overwrite the type definition
10910         inside the `volatile' group.  Turns out that volatile enumerations
10911         were changing the type here to perform a validity test, which
10912         broke conversions. 
10913
10914 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10917         and structs, we do not want to load the instance variable
10918
10919         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10920         enum_type has to be handled like an object reference (implicit
10921         conversions exists from this to object), but the regular IsClass
10922         and IsValueType tests will never return true for this one.
10923
10924         Also we use TypeManager.IsValueType instead of type.IsValueType,
10925         just for consistency with the rest of the code (this is only
10926         needed if we ever use the construct exposed by test-180.cs inside
10927         corlib, which we dont today).
10928
10929 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10930
10931         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10932         just InternalCall.
10933
10934 2003-02-09  Martin Baulig  <martin@ximian.com>
10935
10936         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10937         (Namespace.DefineNamespaces): New static public method; this is
10938         called when we're compiling with debugging to add all namespaces
10939         to the symbol file.
10940
10941         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10942         pass it to the Namespace's .ctor.
10943
10944         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10945         and MethodBase arguments; pass the namespace ID to the symwriter;
10946         pass the MethodBase instead of the token to the symwriter.
10947         (SymbolWriter.DefineNamespace): New method to add a namespace to
10948         the symbol file.
10949
10950 2003-02-09  Martin Baulig  <martin@ximian.com>
10951
10952         * symbolwriter.cs: New file.  This is a wrapper around
10953         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10954         methods here in near future.
10955
10956 2003-02-09  Martin Baulig  <martin@ximian.com>
10957
10958         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10959         ILGenerator.MarkSequencePoint() which are actually used by the
10960         symbol writer.
10961
10962 2003-02-09  Martin Baulig  <martin@ximian.com>
10963
10964         * location.cs (SourceFile): New public sealed class.  This
10965         contains the name and an index which is used in the location's token.
10966         (Location): Reserve an appropriate number of bits in the token for
10967         the source file instead of walking over that list, this gives us a
10968         really huge performance improvement when compiling with debugging.
10969
10970         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10971         `SourceFile' argument instead of a string.
10972         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10973         but don't parse/tokenize here, we need to generate the list of all
10974         source files before we do that.
10975         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10976         the files.
10977
10978         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10979         instead of a string.
10980
10981         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10982         of a string.
10983
10984 2003-02-09  Martin Baulig  <martin@ximian.com>
10985
10986         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10987         filename on `#line default'.
10988
10989 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10990
10991         * statement.cs: don't clear the pinned var when the fixed statement
10992         returns from the method (fixes bug#37752).
10993
10994 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10995
10996         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10997         to IsValueType.
10998
10999 2003-02-07  Martin Baulig  <martin@ximian.com>
11000
11001         * driver.cs: Removed the `--debug-args' command line argument.
11002
11003         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11004         automatically by the AsssemblyBuilder.
11005         (CodeGen.InitializeSymbolWriter): We don't need to call any
11006         initialization function on the symbol writer anymore.  This method
11007         doesn't take any arguments.
11008
11009 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11010
11011         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11012         from referenced assemblies as well.
11013
11014 2003-02-02  Martin Baulig  <martin@ximian.com>
11015
11016         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11017
11018 2003-02-02  Martin Baulig  <martin@ximian.com>
11019
11020         * class.cs (Constructor.Emit): Open the symbol writer before
11021         emitting the constructor initializer.
11022         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11023         single-stepping through constructor initializers.
11024
11025 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11026
11027         * class.cs: Handle error 549: do not allow virtual methods in
11028         sealed classes. 
11029
11030 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11031
11032         * decl.cs: Check access levels when resolving types
11033
11034 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11035
11036         * statement.cs: Add parameters and locals set in catch blocks that might 
11037         return to set vector
11038
11039 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11040
11041         * class.cs (Operator): Set the SpecialName flags for operators.
11042
11043         * expression.cs (Invocation.DoResolve): Only block calls to
11044         accessors and operators on SpecialName methods.
11045
11046         (Cast.TryReduce): Handle conversions from char constants.
11047
11048
11049 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11050
11051         * statement.cs: small memory and time optimization in FlowBranching.
11052
11053 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11054
11055         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11056         problem that the last fix but in the other sid (Set).
11057
11058         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11059         access when there is no indexer in the hierarchy.
11060
11061 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11062
11063         * class.cs: Combine some if statements.
11064
11065 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11066
11067         * driver.cs: fixed bug #37187.
11068
11069 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11070
11071         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11072         any indexer, it's needed to build a list with all the indexers in the
11073         hierarchy (AllGetters), else we have problems. Fixes #35653.
11074
11075 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * class.cs (MethodData.Define): It is wrong for an interface
11078         implementation to be static in both cases: explicit and implicit.
11079         We were only handling this in one case.
11080
11081         Improve the if situation there to not have negations.
11082
11083         * class.cs (Field.Define): Turns out that we do not need to check
11084         the unsafe bit on field definition, only on usage.  Remove the test.
11085
11086 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11087
11088         * driver.cs: use assembly.Location instead of Codebase (the latest
11089         patch made mcs fail when using MS assemblies).
11090
11091 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11092
11093         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11094         get the path to *corlib.dll.
11095
11096 2003-01-21  Nick Drochak <ndrochak@gol.com>
11097
11098         * cs-tokenizer.cs:
11099         * pending.cs:
11100         * typemanager.cs: Remove compiler warnings
11101
11102 2003-01-20  Duncan Mak  <duncan@ximian.com>
11103
11104         * AssemblyInfo.cs: Bump the version number to 0.19.
11105
11106 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11107
11108         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11109
11110 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11111
11112         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11113
11114 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11115
11116         * cs-parser.jay: Small fix: we were not comparing the constructor
11117         name correctly.   Thanks to Zoltan for the initial pointer.
11118
11119 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11120
11121         * cs-tokenizer.cs: Set file name when specified with #line
11122
11123 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11124
11125         * cs-parser.jay: Only perform the constructor checks here if we
11126         are named like the class;  This will help provider a better
11127         error.  The constructor path is taken when a type definition is
11128         not found, but most likely the user forgot to add the type, so
11129         report that rather than the constructor error.
11130
11131 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11132
11133         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11134         allocations.
11135
11136 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11137
11138         * cs-parser.jay: Add cleanup call.
11139
11140 2003-01-13  Duncan Mak  <duncan@ximian.com>
11141
11142         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11143         consistent with other methods.
11144
11145 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11146
11147         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11148
11149 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11150
11151         * attribute.cs: only set GuidAttr to true when we have a
11152         GuidAttribute.
11153
11154 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11155
11156         * ecore.cs:
11157         * expression.cs:
11158         * typemanager.cs: fixes to allow mcs compile corlib with the new
11159         Type.IsSubclassOf fix.
11160
11161 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11162
11163         * expression.cs (LocalVariableReference.DoResolve): Classify a
11164         constant as a value, not as a variable.   Also, set the type for
11165         the variable.
11166
11167         * cs-parser.jay (fixed_statement): take a type instead of a
11168         pointer_type, so we can produce a better error message later.
11169
11170         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11171         as an error.  
11172
11173         (For.DoEmit): Make inifinite loops have a
11174         non-conditional branch back.
11175
11176         (Fixed.DoEmit): First populate the pinned variables, then emit the
11177         statement, then clear the variables.  Before I was emitting the
11178         code once for each fixed piece.
11179
11180
11181 2003-01-08  Martin Baulig  <martin@ximian.com>
11182
11183         * statement.cs (FlowBranching.MergeChild): A break in a
11184         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11185
11186 2003-01-08  Martin Baulig  <martin@ximian.com>
11187
11188         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11189         lives in the same number space than `param_map'.  Fixes #36154.
11190
11191 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11192
11193         * cs-parser.jay (constructor_declaration): Set the
11194         Constructor.ModFlags before probing for it.  This makes the
11195         compiler report 514, 515 and 132 (the code was there, but got
11196         broken). 
11197
11198         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11199         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11200         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11201
11202 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11203
11204         * enum.cs: create the enum static fields using the enum type.
11205
11206 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11207
11208         * class.cs: don't try to create the ParamBuilder for the return
11209         type if it's not needed (and handle it breaking for the ms runtime
11210         anyway).
11211
11212 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11213
11214         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11215
11216 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11217
11218         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11219         the command.   This showed up while compiling the JANET source
11220         code, which used \r as its only newline separator.
11221
11222 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11223
11224         * class.cs (Method.Define): If we are an operator (because it
11225         reuses our code), then set the SpecialName and HideBySig.  #36128
11226
11227 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11230         exception, report error 120 `object reference required'.
11231
11232         * driver.cs: Add --pause option, used during to measure the size
11233         of the process as it goes with --timestamp.
11234
11235         * expression.cs (Invocation.DoResolve): Do not allow methods with
11236         SpecialName to be invoked.
11237
11238 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11239
11240         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11241         number before adding it.
11242
11243 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11244
11245         * ecore.cs (StandardImplicitConversion): When in an unsafe
11246         context, we allow conversion between void * to any other pointer
11247         type. This fixes bug #35973.
11248
11249 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11250
11251         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11252         is not thrown when extensionless outputs are used 
11253
11254 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11255
11256         * rootcontext.cs: fixed compilation of corlib.
11257
11258 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11259
11260         * attribute.cs (Attributes.Contains): Add new method.
11261
11262         * class.cs (MethodCore.LabelParameters): if the parameter is an
11263         `out' parameter, check that no attribute `[In]' has been passed.
11264
11265         * enum.cs: Handle the `value__' name in an enumeration.
11266
11267 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11268
11269         * decl.cs: Added special case to allow overrides on "protected
11270         internal" methods
11271
11272 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11273
11274         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11275         since it makes much more sense.
11276
11277         (Attributes.ctor): Don't require a Location parameter.
11278
11279         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11280
11281         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11282         since we already have that information per attribute.
11283
11284         * everywhere : make appropriate changes.
11285
11286         * class.cs (LabelParameters): Write the code which actually
11287         applies attributes to the return type. We can't do this on the MS
11288         .NET runtime so we flag a warning in the case an exception is
11289         thrown.
11290
11291 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * const.cs: Handle implicit null conversions here too.
11294
11295 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11296
11297         * class.cs (MethodCore.LabelParameters): Remove the extra
11298         Type [] parameter since it is completely unnecessary. Instead
11299         pass in the method's attributes so that we can extract
11300         the "return" attribute.
11301
11302 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11303
11304         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11305         of ignoring it and letting the compile continue.
11306
11307         * typemanager.cs (ChangeType): use an extra argument to return an
11308         error condition instead of throwing an exception.
11309
11310 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * expression.cs (Unary.TryReduce): mimic the code for the regular
11313         code path.  Perform an implicit cast in the cases where we can
11314         implicitly convert to one of the integral types, and then reduce
11315         based on that constant.   This fixes bug #35483.
11316
11317 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11318
11319         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11320
11321 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11322
11323         * namespace.cs: fixed bug #35489.
11324
11325 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * class.cs: Remove some dead code.
11328
11329         * cs-parser.jay: Estimate the number of methods needed
11330         (RootContext.MethodCount);
11331
11332         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11333         numbers instead of StringBuilders.
11334
11335         * support.cs (PtrHashtable): Add constructor with initial size;
11336         We can now reduce reallocations of the method table.
11337
11338 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11339
11340         * attribute.cs (ApplyAttributes): Keep track of the emitted
11341         attributes on a per-target basis. This fixes bug #35413.
11342
11343 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11344
11345         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11346         default to the Windows 1252 encoding.
11347
11348         (UnixParseOption): Support version, thanks to Alp for the missing
11349         pointer. 
11350
11351         * AssemblyInfo.cs: Add nice assembly information.
11352
11353         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11354         (bug 35169).
11355
11356         * cs-parser.jay: Allow a trailing comma before the close bracked
11357         in the attribute_section production.
11358
11359         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11360         address of the instance was being taken, I will take this out,
11361         because we take the address of the object immediately here.
11362
11363 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11364
11365         * typemanager.cs (AreMultipleAllowed): Take care of the most
11366         obvious case where attribute type is not in the current assembly -
11367         stupid me ;-)
11368
11369 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11370
11371         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11372         definitions, instead of doing that afterwards.  
11373
11374         Also we use a nice little hack, depending on the constructor, we
11375         know if we are a "composed" name or a simple name.  Hence, we
11376         avoid the IndexOf test, and we avoid 
11377
11378         * codegen.cs: Add code to assist in a bug reporter to track down
11379         the source of a compiler crash. 
11380
11381 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11382
11383         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11384         types have been emitted for a given element and flag an error
11385         if something which does not have AllowMultiple set is used more
11386         than once.
11387
11388         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11389         attribute types and their corresponding AllowMultiple properties
11390
11391         (AreMultipleAllowed): Check the property for a given type.
11392
11393         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11394         property in the case we have a TypeContainer.
11395
11396         (Attributes.AddAttribute): Detect duplicates and just skip on
11397         adding them. This trivial fix catches a pretty gross error in our
11398         attribute emission - global attributes were being emitted twice!
11399
11400         Bugzilla bug #33187 is now fixed.
11401
11402 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11403
11404         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11405         instead of pp_and).
11406
11407         * expression.cs (Binary.ResolveOperator): I can only use the
11408         Concat (string, string, string) and Concat (string, string,
11409         string, string) if the child is actually a concatenation of
11410         strings. 
11411
11412 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11413
11414         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11415         context where we need a 2-character lookahead.
11416
11417         * pending.cs (PendingImplementation): Rework so we can keep track
11418         of interface types all the time, and flag those which were
11419         implemented by parents as optional.
11420
11421 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11422
11423         * expression.cs (Binary.ResolveOperator): Use
11424         String.Concat(string,string,string) or
11425         String.Concat(string,string,string,string) when possible. 
11426
11427         * typemanager: More helper methods.
11428
11429
11430 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11431
11432         * pending.cs: remove the bogus return from GetMissingInterfaces()
11433         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11434
11435 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11436
11437         * namespace.cs: avoid duplicated 'using xxx' being added to
11438         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11439         when we get more than one 'using' statement for the same namespace.
11440         Report a CS0105 warning for it.
11441
11442 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11443
11444         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11445         of calling getChar/putback, uses internal knowledge of it.    
11446
11447         (xtoken): Reorder tokenizer so most common patterns are checked
11448         first.  This reduces the compilation time in another 5% (from 8.11s
11449         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11450
11451         The parsing time is 22% of the compilation in mcs, and from that
11452         64% is spent on the tokenization process.  
11453
11454         I tried using a binary search for keywords, but this is slower
11455         than the hashtable.  Another option would be to do a couple of
11456         things:
11457
11458                 * Not use a StringBuilder, instead use an array of chars,
11459                   with a set value.  Notice that this way we could catch
11460                   the 645 error without having to do it *afterwards*.
11461
11462                 * We could write a hand-parser to avoid the hashtable
11463                   compares altogether.
11464
11465         The identifier consumption process takes 37% of the tokenization
11466         time.  Another 15% is spent on is_number.  56% of the time spent
11467         on is_number is spent on Int64.Parse:
11468
11469                 * We could probably choose based on the string length to
11470                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11471                   computations. 
11472
11473         Another 3% is spend on wrapping `xtoken' in the `token' function.
11474
11475         Handle 0xa0 as whitespace (#34752)
11476
11477 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11478
11479         * typemanager.cs (IsCLRType): New routine to tell whether a type
11480         is one of the builtin types.  
11481
11482         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11483         typecode in more places instead of doing pointer comparissions.
11484         We could leverage some knowledge about the way the typecodes are
11485         laid out.
11486
11487         New code to cache namespaces in assemblies, it is currently not
11488         invoked, to be used soon.
11489
11490         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11491
11492         * expression.cs (Binary.ResolveOperator): specially handle
11493         strings, and do not perform user-defined operator overloading for
11494         built-in types.
11495
11496 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11497
11498         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11499         internalcall as it is a pretty simple operation;  Avoid whenever
11500         possible to call Char.IsLetter.
11501
11502         (consume_identifier): Cut by half the number of
11503         hashtable calls by merging the is_keyword and GetKeyword behavior.
11504
11505         Do not short-circuit, because if we do, we
11506         report errors (ie, #if false && true would produce an invalid
11507         directive error);
11508
11509
11510 2002-11-24  Martin Baulig  <martin@ximian.com>
11511
11512         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11513         check constant ranges and report a CS0221.  Fixes #33186.
11514
11515 2002-11-24  Martin Baulig  <martin@ximian.com>
11516
11517         * cs-parser.jay: Make this work for uninitialized variable
11518         declarations in the `for' initializer.  Fixes #32416.
11519
11520 2002-11-24  Martin Baulig  <martin@ximian.com>
11521
11522         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11523         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11524
11525 2002-11-24  Martin Baulig  <martin@ximian.com>
11526
11527         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11528         argument; if true, we also check for user-defined conversions.
11529         This is only needed if both arguments are of a user-defined type.
11530         Fixes #30443, added test-175.cs.
11531         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11532
11533         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11534
11535 2002-11-24  Martin Baulig  <martin@ximian.com>
11536
11537         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11538         function to get the store opcode.
11539         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11540         only emit the Ldelema if the store opcode is Stobj.  You must run
11541         both test-34 and test-167 to test this.  Fixes #34529.
11542
11543 2002-11-23  Martin Baulig  <martin@ximian.com>
11544
11545         * ecore.cs (Expression.MemberLookup): Added additional
11546         `qualifier_type' argument which is used when we're being called
11547         from MemberAccess.DoResolve() and null if we're called from a
11548         SimpleName lookup.
11549         (Expression.MemberLookupFailed): New method to report errors; this
11550         does the CS1540 check and reports the correct error message.
11551
11552         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11553         argument for the CS1540 check and redone the way how we're dealing
11554         with private members.  See the comment in the source code for details.
11555         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11556         `closure_start_type' to `closure_qualifier_type' and check whether
11557         it's not null.  It was not this filter being broken, it was just
11558         being called with the wrong arguments.
11559
11560         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11561         and pass it the correct `qualifier_type'; this also does the error
11562         handling for us.
11563
11564 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11565
11566         * expression.cs (Invocation.EmitParams): If the we are dealing
11567         with a non-built-in value type, load its address as well.
11568
11569         (ArrayCreation): Use a a pretty constant instead
11570         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11571         static initializers.  
11572
11573         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11574         because they are not really value types, just glorified integers. 
11575
11576         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11577
11578         * ecore.cs: Remove redundant code for enumerations, make them use
11579         the same code path as everything else, fixes the casting issue
11580         with enumerations in Windows.Forms.
11581
11582         * attribute.cs: Do only cast to string if it is a string, the
11583         validation happens later.
11584
11585         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11586         people upgrade their corlibs.
11587
11588         * ecore.cs: Oops, enumerations were not following the entire code path
11589
11590 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11591
11592         * typemanager.cs (FilterWithClosure): Commented out the test for
11593         1540 in typemanager.cs, as it has problems when accessing
11594         protected methods from a parent class (see test-174.cs). 
11595
11596         * attribute.cs (Attribute.ValidateGuid): new method.
11597         (Attribute.Resolve): Use above.
11598
11599 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11600
11601         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11602
11603         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11604         handling for enumerations, as we only needed the TypeContainer
11605         functionality to begin with (this is required for the fix below to
11606         work for enums that reference constants in a container class for
11607         example). 
11608
11609         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11610
11611         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11612         a valid TypeBuilder to perform lookups on.o
11613
11614         * class.cs (InheritableMemberSignatureCompare): Use true in the
11615         call to GetGetMethod and GetSetMethod, because we are comparing
11616         the signature, and we need to get the methods *even* if they are
11617         private. 
11618
11619         (PropertyBase.CheckBase): ditto.
11620
11621         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11622         GotoCase.Resolve): Use Peel on EmpytCasts.
11623
11624         * ecore.cs (EmptyCast): drop child, add Peel method.
11625
11626 2002-11-17  Martin Baulig  <martin@ximian.com>
11627
11628         * ecore.cs (EmptyCast.Child): New public property.
11629
11630         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11631         label resolved to an EmptyCast.  Fixes #34162.
11632         (GotoCase.Resolve): Likewise.
11633         (Block.EmitMeta): Likewise.
11634
11635 2002-11-17  Martin Baulig  <martin@ximian.com>
11636
11637         * expression.cs (Invocation.BetterConversion): Prefer int over
11638         uint; short over ushort; long over ulong for integer literals.
11639         Use ImplicitConversionExists instead of StandardConversionExists
11640         since we also need to check for user-defined implicit conversions.
11641         Fixes #34165.  Added test-173.cs.
11642
11643 2002-11-16  Martin Baulig  <martin@ximian.com>
11644
11645         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11646         with the `true' and `false' literals.  Fixes #33151.
11647
11648 2002-11-16  Martin Baulig  <martin@ximian.com>
11649
11650         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11651         October 22nd; don't do the cs1540 check for static members.
11652
11653         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11654         now using our own filter here and doing the cs1540 check again.
11655
11656 2002-11-16  Martin Baulig  <martin@ximian.com>
11657
11658         * support.cs (InternalParameters): Don't crash if we don't have
11659         any fixed parameters.  Fixes #33532.
11660
11661 2002-11-16  Martin Baulig  <martin@ximian.com>
11662
11663         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11664         when looking up static methods to make this work on Windows.
11665         Fixes #33773.
11666
11667 2002-11-16  Martin Baulig  <martin@ximian.com>
11668
11669         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11670         a setter rather than using PropertyInfo.CanWrite.
11671
11672 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11673
11674         * class.cs: Allow acces to block member by subclasses. Fixes build
11675         breaker.
11676
11677 2002-11-14  Martin Baulig  <martin@ximian.com>
11678
11679         * class.cs (Constructor.Emit): Added the extern/block check.
11680         Fixes bug #33678.
11681
11682 2002-11-14  Martin Baulig  <martin@ximian.com>
11683
11684         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11685         iteration while looking for indexers, this is needed because the
11686         indexer may have a different name in our base classes.  Fixed the
11687         error reporting (no indexers at all, not get accessor, no
11688         overloaded match).  Fixes bug #33089.
11689         (IndexerAccess.DoResolveLValue): Likewise.
11690
11691 2002-11-14  Martin Baulig  <martin@ximian.com>
11692
11693         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11694         indexers.  Fixes the first part of bug #33089.
11695         (MethodSignature.InheritableMemberSignatureCompare): Added support
11696         for properties.
11697
11698 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11699
11700         * attribute.cs (Attribute.Resolve): Catch the
11701         NullReferenceException and report it since it isn't supposed to
11702         happen. 
11703
11704 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11705
11706         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11707         LogicalOr and LogicalAnd that can benefit from recursively
11708         handling EmitBranchable.  The code now should be nice for Paolo.
11709
11710 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11713         the Type lookups, as we perform quite a number of lookups on
11714         non-Types.  This can be removed once we can deterministically tell
11715         whether we have a type or a namespace in advance.
11716
11717         But this might require special hacks from our corlib.
11718
11719         * TODO: updated.
11720
11721         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11722         and double which avoids a conversion from an integer to a double.
11723
11724         * expression.cs: tiny optimization, avoid calling IsConstant,
11725         because it effectively performs the lookup twice.
11726
11727 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11728
11729         But a bogus return here to keep the semantics of the old code
11730         until the Mono runtime is fixed.
11731
11732         * pending.cs (GetMissingInterfaces): New method used to remove all
11733         the interfaces that are already implemented by our parent
11734         classes from the list of pending methods. 
11735
11736         * interface.cs: Add checks for calls after ResolveTypeExpr.
11737
11738 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11739
11740         * class.cs (Class.Emit): Report warning 67: event not used if the
11741         warning level is beyond 3.
11742
11743         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11744         being a NullLiteral.
11745
11746         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11747         specifiers. 
11748
11749         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11750         path that might fail if a type can not be resolved.
11751
11752         * expression.cs (Binary.Emit): Emit unsigned versions of the
11753         operators. 
11754
11755         * driver.cs: use error 5.
11756
11757 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11758
11759         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11760
11761 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11762
11763         * cs-parser.jay (switch_section): A beautiful patch from Martin
11764         Baulig that fixed 33094.
11765
11766 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11767
11768         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11769         Check whether the base is abstract and report an error if so.
11770
11771         * expression.cs (IndexerAccess.DoResolveLValue,
11772         IndexerAccess.DoResolve): ditto. 
11773
11774         (Invocation.DoResolve): ditto.
11775
11776         (Invocation.FullMethodDesc): Improve the report string.
11777
11778         * statement.cs (Block): Eliminate IsVariableDefined as it is
11779         basically just a wrapper for GetVariableInfo.
11780
11781         * ecore.cs (SimpleName): Use new 
11782
11783         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11784         type, as we return the actual parameter ref/unref state on a
11785         different call.
11786
11787 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11788
11789         * support.cs: Return proper flags REF/OUT fixing the previous
11790         commit.  
11791
11792         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11793         not used to mean `ref' but `ref or out' in ParameterReference
11794
11795         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11796         full type signature instead of calling TypeManger.CSharpName
11797         ourselves. 
11798
11799         * support.cs (InternalParameters.ParameterDesc): Do not compare
11800         directly to the modflags, because REF/OUT will actually be bitsets
11801         if set. 
11802
11803         * delegate.cs (VerifyMethod): Check also the modifiers.
11804
11805         * cs-tokenizer.cs: Fix bug where floating point values with an
11806         exponent where a sign was missing was ignored.
11807
11808         * driver.cs: Allow multiple assemblies to be specified in a single
11809         /r: argument
11810
11811 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11814         because identifiers after a parenthesis would end up in this kind
11815         of production, and we needed to desamiguate it for having casts
11816         like:
11817
11818                 (UserDefinedType *) xxx
11819
11820 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11821
11822         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11823         we should set on the Bindingflags.NonPublic, but not turn on
11824         private_ok.  private_ok controls whether a Private member is
11825         returned (this is chekced on the filter routine), while the
11826         BindingFlags.NonPublic just controls whether private/protected
11827         will be allowed.   This fixes the problem part of the problem of
11828         private properties being allowed to be used in derived classes.
11829
11830         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11831         so we can call the children DoResolveLValue method (this will
11832         properly signal errors on lvalue assignments to base properties)
11833
11834         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11835         getter are null, and we have a property info, we know that this
11836         happened because the lookup failed, so we report an error 122 for
11837         protection level violation.
11838
11839         We also silently return if setter and getter are null in the
11840         resolve functions, this condition only happens if we have flagged
11841         the error before.  This is the other half of the problem. 
11842
11843         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11844         not have accessibility information, that is why we were returning
11845         true in the filter function in typemanager.cs.
11846
11847         To properly report 122 (property is inaccessible because of its
11848         protection level) correctly, we report this error in ResolveAccess
11849         by failing if both the setter and the getter are lacking (ie, the
11850         lookup failed). 
11851
11852         DoResolve and DoLResolve have been modified to check for both
11853         setter/getter being null and returning silently, the reason being
11854         that I did not want to put the knowledge about this error in upper
11855         layers, like:
11856
11857         int old = Report.Errors;
11858         x = new PropertyExpr (...);
11859         if (old != Report.Errors)
11860                 return null;
11861         else
11862                 return x;
11863
11864         So the property expr is returned, but it is invalid, so the error
11865         will be flagged during the resolve process. 
11866
11867         * class.cs: Remove InheritablePropertySignatureCompare from the
11868         class, as we no longer depend on the property signature to compute
11869         whether it is possible to implement a method or not.
11870
11871         The reason is that calling PropertyInfo.GetGetMethod will return
11872         null (in .NET, in Mono it works, and we should change this), in
11873         cases where the Get Method does not exist in that particular
11874         class.
11875
11876         So this code:
11877
11878         class X { public virtual int A { get { return 1; } } }
11879         class Y : X { }
11880         class Z : Y { public override int A { get { return 2; } } }
11881
11882         Would fail in Z because the parent (Y) would not have the property
11883         defined.  So we avoid this completely now (because the alternative
11884         fix was ugly and slow), and we now depend exclusively on the
11885         method names.
11886
11887         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11888         reference method, instead of using the property.
11889
11890         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11891         routines are gone now.
11892
11893         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11894         names, they were incorrectly named.
11895
11896         * cs-tokenizer.cs: Return are more gentle token on failure. 
11897
11898         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11899         had an out-of-sync index variable, which caused it to remove from
11900         the list of pending methods the wrong method sometimes.
11901
11902 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11903
11904         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11905         CanWrite, because those refer to this particular instance of the
11906         property, and do not take into account the fact that we can
11907         override single members of a property.
11908
11909         Constructor requires an EmitContext.  The resolution process does
11910         not happen here, but we need to compute the accessors before,
11911         because the resolution does not always happen for properties.
11912
11913         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11914         subclass, before we did not update this flag, but we did update
11915         bindingflags. 
11916
11917         (GetAccessors): Drop this routine, as it did not work in the
11918         presence of partially overwritten set/get methods. 
11919
11920         Notice that this broke the cs1540 detection, but that will require
11921         more thinking. 
11922
11923 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11924
11925         * class.cs:
11926         * codegen.cs:
11927         * driver.cs: issue a warning instead of an error if we don't support
11928         debugging for the platform. Also ignore a couple of errors that may
11929         arise when trying to write the symbols. Undo my previous patch.
11930
11931 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11932
11933         * driver.cs: ignore /debug switch except for Unix platforms.
11934
11935 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11936
11937         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11938
11939 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11940
11941         * driver.cs: Do not make mcs-debug conditional, so we do not break
11942         builds that use it.
11943
11944         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11945         review this patch.  But basically after all the children variables
11946         have been merged, the value of "Breaks" was not being set to
11947         new_breaks for Switch blocks.  I think that it should be set after
11948         it has executed.  Currently I set this to the value of new_breaks,
11949         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11950         conservative, but I do not understand this code very well.
11951
11952         I did not break anything in the build, so that is good ;-)
11953
11954         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11955
11956 2002-10-20  Mark Crichton  <crichton@gimp.org>
11957
11958         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11959
11960 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11961
11962         * cfold.cs: Fixed compile blocker.
11963
11964 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * driver.cs: I was chekcing the key, not the file.
11967
11968 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11969
11970         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11971         message that we were generating - we just need to silently return
11972         a null.
11973
11974 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11975
11976         * class.cs (Event.Define): Change my previous commit, as this
11977         breaks the debugger.  This is a temporary hack, as it seems like
11978         the compiler is generating events incorrectly to begin with.
11979
11980         * expression.cs (Binary.ResolveOperator): Added support for 
11981         "U operator - (E x, E y)"
11982
11983         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11984         y)".
11985
11986         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11987         init-only variables, but this path did not take into account that
11988         there might be also instance readonly variables.  Correct this
11989         problem. 
11990
11991         This fixes bug 32253
11992
11993         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11994         delegates as well.
11995
11996         * driver.cs: Change the extension for modules to `netmodule'
11997
11998         * cs-parser.jay: Improved slightly the location tracking for
11999         the debugger symbols.
12000
12001         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12002         modifiers that were specified instead of the hardcoded value
12003         (FamAndAssem).  This was basically ignoring the static modifier,
12004         and others.  Fixes 32429.
12005
12006         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12007         fixed a bug in the process (32476)
12008
12009         * expression.cs (ArrayAccess.EmitAssign): Patch from
12010         hwang_rob@yahoo.ca that fixes bug 31834.3
12011
12012 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12013
12014         * driver.cs: Make the module extension .netmodule.
12015
12016 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12017
12018         * driver.cs: Report an error if the resource file is not found
12019         instead of crashing.
12020
12021         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12022         false, like Emit does.
12023
12024 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12025
12026         * typemanager.cs: Remove unused private member.  Also reported mcs
12027         bug to report this as a warning like csc.
12028
12029 2002-10-15  Martin Baulig  <martin@gnome.org>
12030
12031         * statement.cs (Statement.Emit): Made this a virtual method; emits
12032         the line number info and calls DoEmit().
12033         (Statement.DoEmit): New protected abstract method, formerly knows
12034         as Statement.Emit().
12035
12036         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12037
12038 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12039
12040         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12041         have fixed a remaining problem: not every AddXXXX was adding a
12042         fully qualified name.  
12043
12044         Now everyone registers a fully qualified name in the DeclSpace as
12045         being defined instead of the partial name.  
12046
12047         Downsides: we are slower than we need to be due to the excess
12048         copies and the names being registered this way.  
12049
12050         The reason for this is that we currently depend (on the corlib
12051         bootstrap for instance) that types are fully qualified, because
12052         we dump all the types in the namespace, and we should really have
12053         types inserted into the proper namespace, so we can only store the
12054         basenames in the defined_names array.
12055
12056 2002-10-10  Martin Baulig  <martin@gnome.org>
12057
12058         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12059         from bug #31834, see the bug report for a testcase which is
12060         miscompiled.
12061
12062 2002-10-10  Martin Baulig  <martin@gnome.org>
12063
12064         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12065         flow analysis code for this.
12066
12067         * statement.cs (Do, While, For): Tell the flow analysis code about
12068         infinite loops.
12069         (FlowBranching.UsageVector): Added support for infinite loops.
12070         (Block.Resolve): Moved the dead code elimination here and use flow
12071         analysis to do it.
12072
12073 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12074
12075         * class.cs (Field.Define): Catch cycles on struct type
12076         definitions. 
12077
12078         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12079         fields if the fields are static.  We only need to check instance
12080         fields. 
12081
12082         * expression.cs (As.DoResolve): Test for reference type.
12083
12084         * statement.cs (Using.ResolveExpression): Use
12085         ConvertImplicitRequired, not ConvertImplicit which reports an
12086         error on failture
12087         (Using.ResolveLocalVariableDecls): ditto.
12088
12089         * expression.cs (Binary.ResolveOperator): Report errors in a few
12090         places where we had to.
12091
12092         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12093
12094 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12095
12096         * expression.cs: Use StoreFromPtr instead of extracting the type
12097         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12098
12099         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12100         an enumeration value to a System.Enum, but System.Enum is not a
12101         value type, but an class type, so we need to box.
12102
12103         (Expression.ConvertExplicit): One codepath could return
12104         errors but not flag them.  Fix this.  Fixes #31853
12105
12106         * parameter.cs (Resolve): Do not allow void as a parameter type.
12107
12108 2002-10-06  Martin Baulig  <martin@gnome.org>
12109
12110         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12111         if it's a class type and not a struct.  Fixes #31815.
12112
12113 2002-10-06  Martin Baulig  <martin@gnome.org>
12114
12115         * statement.cs: Reworked the flow analysis code a bit to make it
12116         usable for dead code elimination.
12117
12118 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12119
12120         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12121
12122 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12123
12124         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12125         to fix the test 165, will investigate deeper.
12126
12127 2002-10-04  Martin Baulig  <martin@gnome.org>
12128
12129         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12130         finally blocks actually work.
12131         (Try.Resolve): We don't need to create a sibling for `finally' if
12132         there is no finally block.
12133
12134 2002-10-04  Martin Baulig  <martin@gnome.org>
12135
12136         * class.cs (Constructor.Define): The default accessibility for a
12137         non-default constructor is private, not public.
12138
12139 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12140
12141         * class.cs (Constructor): Make AllowedModifiers public, add
12142         EXTERN.
12143
12144         * cs-parser.jay: Perform the modifiers test here, as the
12145         constructor for the Constructor class usually receives a zero
12146         because of the way we create it (first we create, later we
12147         customize, and we were never checking the modifiers).
12148
12149         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12150         is a version of LookupTypeReflection that includes the type-name
12151         cache.  This can be used as a fast path for functions that know
12152         the fully qualified name and are only calling into *.GetType() to
12153         obtain a composed type.
12154
12155         This is also used by TypeManager.LookupType during its type
12156         composition.
12157
12158         (LookupType): We now also track the real type name, as sometimes
12159         we can get a quey for the real type name from things like
12160         ComposedCast.  This fixes bug 31422.
12161
12162         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12163         complete type fullname, it does not have to go through the type
12164         resolution system to obtain the composed version of the type (for
12165         obtaining arrays or pointers).
12166
12167         (Conditional.Emit): Use the EmitBoolExpression to
12168         generate nicer code, as requested by Paolo.
12169
12170         (ArrayCreation.CheckIndices): Use the patch from
12171         hwang_rob@yahoo.ca to validate the array initializers. 
12172
12173 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12174
12175         * class.cs (ConstructorInitializer.Emit): simplify code by using
12176         Invocation.EmitCall, and at the same time, fix the bugs in calling
12177         parent constructors that took variable arguments. 
12178
12179         * ecore.cs (Expression.ConvertNumericExplicit,
12180         Expression.ImplicitNumericConversion): Remove the code that
12181         manually wrapped decimal (InternalTypeConstructor call is now gone
12182         as well).
12183
12184         * expression.cs (Cast.TryReduce): Also handle decimal types when
12185         trying to perform a constant fold on the type.
12186
12187         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12188
12189         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12190         that only turned off an error report, and did nothing else. 
12191
12192 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12193
12194         * driver.cs: Handle and ignore /fullpaths
12195
12196 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12197
12198         * expression.cs (Binary.ResolveOperator): Catch the case where
12199         DoNumericPromotions returns true, 
12200
12201         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12202
12203 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12206         report error 70.
12207
12208 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12209
12210         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12211         conversion exists, but it is also required that the conversion be
12212         performed.  This manifested in "(Type64Enum) 2".  
12213
12214         * class.cs (TypeManager.AddMethod): The fix is not to change
12215         AddEnum, because that one was using a fully qualified name (every
12216         DeclSpace derivative does), but to change the AddMethod routine
12217         that was using an un-namespaced name.  This now correctly reports
12218         the duplicated name.
12219
12220         Revert patch until I can properly fix it.  The issue
12221         is that we have a shared Type space across all namespaces
12222         currently, which is wrong.
12223
12224         Options include making the Namespace a DeclSpace, and merge
12225         current_namespace/current_container in the parser.
12226
12227 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12228
12229         * cs-parser.jay: Improve error reporting when we get a different
12230         kind of expression in local_variable_type and
12231         local_variable_pointer_type. 
12232
12233         Propagate this to avoid missleading errors being reported.
12234
12235         * ecore.cs (ImplicitReferenceConversion): treat
12236         TypeManager.value_type as a target just like object_type.   As
12237         code like this:
12238
12239         ValueType v = 1;
12240
12241         Is valid, and needs to result in the int 1 being boxed before it
12242         is assigned to the value type v.
12243
12244         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12245         to validate the enumeration name.
12246
12247         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12248         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12249         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12250
12251         * ecore.cs (TryImplicitIntConversion): When doing an
12252         implicit-enumeration-conversion, check if the type is 64-bits and
12253         perform a conversion before passing to EnumConstant.
12254
12255 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12258         report ambiguous type references.  Unlike the MS version, we
12259         report what the ambiguity is.   Innovation at work ;-)
12260
12261         (DeclSpace.FindType): Require a location argument to
12262         display when we display an ambiguous error.
12263
12264         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12265
12266         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12267
12268         * expression.cs (EmitDynamicInitializers): Apply patch from
12269         hwang_rob@yahoo.ca that fixes the order in which we emit our
12270         initializers. 
12271
12272 2002-09-21  Martin Baulig  <martin@gnome.org>
12273
12274         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12275         delegate takes no arguments.
12276
12277 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12280         from integers.
12281
12282         * expression.cs: Extract the underlying type.
12283
12284         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12285
12286         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12287
12288 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12289
12290         * class.cs (TypeContainer.DefineType): We can not use the nice
12291         PackingSize with the size set to 1 DefineType method, because it
12292         will not allow us to define the interfaces that the struct
12293         implements.
12294
12295         This completes the fixing of bug 27287
12296
12297         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12298         means also structs.  This fixes part of the problem. 
12299         (Expresion.ImplicitReferenceConversionExists): ditto.
12300
12301         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12302         error if there were no errors reported during the type lookup
12303         process, to avoid duplicates or redundant errors.  Without this
12304         you would get an ambiguous errors plus a type not found.  We have
12305         beaten the user enough with the first error.  
12306
12307         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12308         reference. 
12309
12310         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12311         during the resolution process, stop the lookup, this avoids
12312         repeated error reports (same error twice).
12313
12314         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12315
12316         * typemanager.cs (LookupType): Redo the type lookup code to match
12317         the needs of System.Reflection.  
12318
12319         The issue is that System.Reflection requires references to nested
12320         types to begin with a "+" sign instead of a dot.  So toplevel
12321         types look like: "NameSpace.TopLevelClass", and nested ones look
12322         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12323         levels. 
12324
12325 2002-09-19  Martin Baulig  <martin@gnome.org>
12326
12327         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12328         says that a method always returns or always throws an exception,
12329         don't report the CS0161.
12330
12331         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12332         set `Returns = new_returns'.
12333
12334 2002-09-19  Martin Baulig  <martin@gnome.org>
12335
12336         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12337         to an enum constant, check for a CS0176.
12338
12339 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12340
12341         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12342         for operators that must be in pairs and report errors.
12343
12344         * ecore.cs (SimpleName.DoResolveType): During the initial type
12345         resolution process, when we define types recursively, we must
12346         check first for types in our current scope before we perform
12347         lookups in the enclosing scopes.
12348
12349         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12350
12351         (Invocation.VerifyArgumentsCompat): Call
12352         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12353         I thought we were supposed to always call this, but there are a
12354         few places in the code where we dont do it.
12355
12356 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * driver.cs: Add support in -linkres and -resource to specify the
12359         name of the identifier.
12360
12361 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * ecore.cs (StandardConversionExists): Sync with the conversion
12364         code: allow anything-* to void* conversions.
12365
12366         (FindMostSpecificSource): Use an Expression argument
12367         instead of a Type, because we might be handed over a Literal which
12368         gets a few more implicit conversions that plain types do not.  So
12369         this information was being lost.
12370
12371         Also, we drop the temporary type-holder expression when not
12372         required.
12373
12374 2002-09-17  Martin Baulig  <martin@gnome.org>
12375
12376         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12377         this is an explicit interface implementation.
12378
12379 2002-09-17  Martin Baulig  <martin@gnome.org>
12380
12381         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12382         different `IndexerName' attributes.
12383
12384         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12385         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12386         virtual CommonResolve().
12387
12388 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12391         and convert that to the UnderlyingType.
12392
12393         * statement.cs (Foreach.Resolve): Indexers are just like variables
12394         or PropertyAccesses.
12395
12396         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12397         inside quoted strings, we were not doing this before.
12398
12399 2002-09-16  Martin Baulig  <martin@gnome.org>
12400
12401         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12402         resolve it.  This is needed for the definite assignment check of the
12403         instance expression, fixes bug #29846.
12404         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12405
12406 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12407
12408         * parameter.cs: Fix compile error.  Cannot reference static member
12409         from an instance object.  Is this an mcs bug?
12410
12411 2002-09-14  Martin Baulig  <martin@gnome.org>
12412
12413         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12414         multiple times.  Fixes bug #30295, added test-166.cs.
12415
12416 2002-09-14  Martin Baulig  <martin@gnome.org>
12417
12418         * statement.cs (Block.Emit): Don't emit unreachable code.
12419         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12420         `break' statements.
12421         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12422
12423 2002-09-14  Martin Baulig  <martin@gnome.org>
12424
12425         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12426         is set.
12427
12428 2002-09-14  Martin Baulig  <martin@gnome.org>
12429
12430         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12431         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12432         be false on the ms runtime.
12433
12434 2002-09-13  Martin Baulig  <martin@gnome.org>
12435
12436         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12437         the CS0038 error message.
12438
12439 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12442         constant inside, return it.
12443
12444 2002-09-12  Martin Baulig  <martin@gnome.org>
12445
12446         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12447         implicit conversion can be done between enum types.
12448
12449         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12450         check whether an implicit conversion to the current enum's UnderlyingType
12451         exists and report an error if not.
12452
12453         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12454         without debugging support.
12455
12456         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12457         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12458
12459 2002-09-12  Martin Baulig  <martin@gnome.org>
12460
12461         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12462
12463         * ecore.cs (IMemberExpr.DeclaringType): New property.
12464         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12465         nonstatic member of an outer type (CS0038).
12466
12467 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12468
12469         * driver.cs: Activate the using-error detector at warning level
12470         4 (at least for MS-compatible APIs).
12471
12472         * namespace.cs (VerifyUsing): Small buglett fix.
12473
12474         * pending.cs (PendingImplementation): pass the container pointer. 
12475
12476         * interface.cs (GetMethods): Allow for recursive definition.  Long
12477         term, I would like to move every type to support recursive
12478         definitions, not the current ordering mechanism that we have right
12479         now.
12480
12481         The situation is this: Attributes are handled before interfaces,
12482         so we can apply attributes to interfaces.  But some attributes
12483         implement interfaces, we will now handle the simple cases
12484         (recursive definitions will just get an error).  
12485
12486         * parameter.cs: Only invalidate types at the end if we fail to
12487         lookup all types.  
12488
12489 2002-09-09  Martin Baulig  <martin@gnome.org>
12490
12491         * ecore.cs (PropertyExpr.Emit): Also check for
12492         TypeManager.system_int_array_get_length so this'll also work when
12493         compiling corlib.  Fixes #30003.
12494
12495 2002-09-09  Martin Baulig  <martin@gnome.org>
12496
12497         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12498         and throw an exception if we can't get the type's size.  Fixed #30040,
12499         added test-165.cs.
12500
12501 2002-09-09  Martin Baulig  <martin@gnome.org>
12502
12503         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12504
12505         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12506         context.  Fixes bug #30027.
12507
12508         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12509         virtual functions.  Fixes bug #30043, added test-164.cs.
12510
12511 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12512
12513         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12514
12515 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12516
12517         * driver.cs: Use an object to get the windows codepage since it's not a
12518         static property.
12519
12520 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * statement.cs (For.Emit): for infinite loops (test == null)
12523         return whether there is a break inside, not always "true".
12524
12525         * namespace.cs (UsingEntry): New struct to hold the name of the
12526         using definition, the location where it is defined, and whether it
12527         has been used in a successful type lookup.
12528
12529         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12530         strings.
12531
12532         * decl.cs: ditto.
12533
12534 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12535
12536         * attribute.cs : Fix incorrect code which relied on catching
12537         a NullReferenceException to detect a null being passed in
12538         where an object was expected.
12539
12540 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12541
12542         * statement.cs (Try): flag the catch variable as assigned
12543
12544         * expression.cs (Cast): Simplified by using ResolveType instead of
12545         manually resolving.
12546
12547         * statement.cs (Catch): Fix bug by using ResolveType.
12548
12549 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12550
12551         * expression.cs (BetterConversion): Special case for when we have
12552         a NullLiteral as the argument and we have to choose between string
12553         and object types - we choose string the way csc does.
12554
12555         * attribute.cs (Attribute.Resolve): Catch the
12556         NullReferenceException and report error #182 since the Mono
12557         runtime no more has the bug and having this exception raised means
12558         we tried to select a constructor which takes an object and is
12559         passed a null.
12560
12561 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12562
12563         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12564         message (1502, 1503) when we can't locate a method after overload
12565         resolution. This is much more informative and closes the bug
12566         Miguel reported.
12567
12568         * interface.cs (PopulateMethod): Return if there are no argument
12569         types. Fixes a NullReferenceException bug.
12570
12571         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12572         expressions too. Previously we were checking only in one place for
12573         positional arguments leaving out named arguments.
12574
12575         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12576         type to the enum type is not allowed. Remove code corresponding to
12577         that.
12578
12579         (ConvertNumericExplicit): Allow explicit conversions from
12580         the underlying type to enum type. This precisely follows the spec
12581         and closes a bug filed by Gonzalo.
12582
12583 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12584
12585         * compiler.csproj:
12586         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12587
12588 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12591         it was important that we stored the right value after the
12592         reduction in `converted'.
12593
12594 2002-09-04  Martin Baulig  <martin@gnome.org>
12595
12596         * location.cs (Location.SymbolDocument): Use full pathnames for the
12597         source files.
12598
12599 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12600
12601         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12602         of the expression resolve mechanism, because that will catch the
12603         SimpleName error failures.
12604
12605         (Conditional): If we can not resolve the
12606         expression, return, do not crash.
12607
12608 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12609
12610         * cs-tokenizer.cs:
12611         (location): display token name instead of its number.
12612
12613 2002-08-28  Martin Baulig  <martin@gnome.org>
12614
12615         * expression.cs (Binary.ResolveOperator): Don't silently return
12616         but return an error if an operator cannot be applied between two
12617         enum types.
12618
12619 2002-08-28  Martin Baulig  <martin@gnome.org>
12620
12621         * class.cs (Constructor.Define): Set the permission attributes
12622         correctly instead of making all constructors public.
12623
12624 2002-08-28  Martin Baulig  <martin@gnome.org>
12625
12626         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12627         for private members before reporting a CS0103; if we find anything,
12628         it's a CS0122.
12629
12630 2002-08-28  Martin Baulig  <martin@gnome.org>
12631
12632         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12633         to check whether `closure_start_type == closure_invocation_type',
12634         we also need to check whether `m.DeclaringType == closure_invocation_type'
12635         before bypassing the permission checks.  We might be accessing
12636         protected/private members from the base class.
12637         (TypeManager.RealMemberLookup): Only set private_ok if private
12638         members were requested via BindingFlags.NonPublic.
12639
12640         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12641
12642         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12643         MethodGroupExpr.IsExplicitImpl if appropriate.
12644         (Invocation.DoResolve): Don't report the CS0120 for explicit
12645         interface implementations.
12646
12647 2002-08-27  Martin Baulig  <martin@gnome.org>
12648
12649         * expression.cs (Invocation.DoResolve): If this is a static
12650         method and we don't have an InstanceExpression, we must report
12651         a CS0120.
12652
12653 2002-08-25  Martin Baulig  <martin@gnome.org>
12654
12655         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12656         `==' between a valuetype and an object.
12657
12658 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12659
12660         * ecore.cs (TypeExpr): Provide a ToString method.
12661
12662 2002-08-24  Martin Baulig  <martin@gnome.org>
12663
12664         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12665         now called proggie.dbg and it's a binary file.
12666
12667 2002-08-23  Martin Baulig  <martin@gnome.org>
12668
12669         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12670
12671 2002-08-23  Martin Baulig  <martin@gnome.org>
12672
12673         * struct.cs (MyStructInfo.ctor): Make this work with empty
12674         structs; it's not allowed to use foreach() on null.
12675
12676 2002-08-23  Martin Baulig  <martin@gnome.org>
12677
12678         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12679         writer the full pathname of the generated assembly.
12680
12681 2002-08-23  Martin Baulig  <martin@gnome.org>
12682
12683         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12684         A `finally' block never returns or breaks; improved handling of
12685         unreachable code.
12686
12687 2002-08-23  Martin Baulig  <martin@gnome.org>
12688
12689         * statement.cs (Throw.Resolve): Allow `throw null'.
12690
12691 2002-08-23  Martin Baulig  <martin@gnome.org>
12692
12693         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12694         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12695         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12696         MemberLookup would return a wrong event if this is an explicit
12697         interface implementation and the class has an event with the same
12698         name.
12699
12700 2002-08-23  Martin Baulig  <martin@gnome.org>
12701
12702         * statement.cs (Block.AddChildVariableNames): New public method.
12703         (Block.AddChildVariableName): Likewise.
12704         (Block.IsVariableNameUsedInChildBlock): Likewise.
12705         (Block.AddVariable): Check whether a variable name has already
12706         been used in a child block.
12707
12708         * cs-parser.jay (declare_local_variables): Mark all variable names
12709         from the current block as being used in a child block in the
12710         implicit block.
12711
12712 2002-08-23  Martin Baulig  <martin@gnome.org>
12713
12714         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12715         find the symbol writer.
12716
12717         * driver.cs: csc also allows the arguments to /define being
12718         separated by commas, not only by semicolons.
12719
12720 2002-08-23  Martin Baulig  <martin@gnome.org>
12721
12722         * interface.cs (Interface.GetMembers): Added static check for events.
12723
12724 2002-08-15  Martin Baulig  <martin@gnome.org>
12725
12726         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12727         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12728
12729         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12730         why the MethodData.EmitDestructor() change was necessary.
12731
12732 2002-08-20  Martin Baulig  <martin@gnome.org>
12733
12734         * class.cs (TypeContainer.FindMembers): Added static check for events.
12735
12736         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12737
12738         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12739         use Type.GetEvents(), not Type.FindMembers().
12740
12741 2002-08-20  Martin Baulig  <martin@gnome.org>
12742
12743         * decl.cs (MemberCache): Added a special method cache which will
12744         be used for method-only searched.  This ensures that a method
12745         search will return a MethodInfo with the correct ReflectedType for
12746         inherited methods.      
12747
12748 2002-08-20  Martin Baulig  <martin@gnome.org>
12749
12750         * decl.cs (DeclSpace.FindMembers): Made this public.
12751
12752 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12753
12754         * delegate.cs: fixed build on windows.
12755         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12756
12757 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12758
12759         * ecore.cs (StandardConversionExists): Return a false
12760         if we are trying to convert the void type to anything else
12761         since that is not allowed.
12762
12763         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12764         we flag error 70 in the event an event is trying to be accessed
12765         directly from outside the declaring type.
12766
12767 2002-08-20  Martin Baulig  <martin@gnome.org>
12768
12769         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12770         MemberCache from typemanager.cs to decl.cs.
12771
12772 2002-08-19  Martin Baulig  <martin@gnome.org>
12773
12774         * class.cs (TypeContainer): Implement IMemberContainer.
12775         (TypeContainer.DefineMembers): Create the MemberCache.
12776         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12777         return public members if BindingFlags.Public was given, check
12778         whether members are static.
12779
12780 2002-08-16  Martin Baulig  <martin@gnome.org>
12781
12782         * decl.cs (DeclSpace.Define): Splitted this in Define and
12783         DefineMembers.  DefineMembers is called first and initializes the
12784         MemberCache.
12785
12786         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12787         DefineMembers() on all our DeclSpaces.
12788
12789         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12790         but call DefineMembers() on all nested interfaces.  We call their
12791         Define() in our new Define() function.
12792
12793         * interface.cs (Interface): Implement IMemberContainer.
12794         (Interface.Define): Moved all code except the attribute stuf to
12795         DefineMembers().
12796         (Interface.DefineMembers): Initialize the member cache.
12797
12798         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12799         need this anymore since we can use MemberCache.FindMembers directly.
12800
12801 2002-08-19  Martin Baulig  <martin@gnome.org>
12802
12803         * typemanager.cs (MemberCache): When creating the cache for an
12804         interface type, add all inherited members.
12805         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12806         to `out bool used_cache' and documented it.
12807         (TypeManager.MemberLookup): If we already used the cache in the first
12808         iteration, we don't need to do the interfaces check.
12809
12810 2002-08-19  Martin Baulig  <martin@gnome.org>
12811
12812         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12813         here from IMemberFinder and don't implement this interface anymore.
12814         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12815
12816         * typemanager.cs (IMemberFinder): This interface is now only used by
12817         classes which actually support the member cache.
12818         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12819         since we only put DeclSpaces into this Hashtable.
12820         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12821         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12822
12823 2002-08-16  Martin Baulig  <martin@gnome.org>
12824
12825         * typemanager.cs (ICachingMemberFinder): Removed.
12826         (IMemberFinder.MemberCache): New property.
12827         (TypeManager.FindMembers): Merged this with RealFindMembers().
12828         This function will never be called from TypeManager.MemberLookup()
12829         so we can't use the cache here, just the IMemberFinder.
12830         (TypeManager.MemberLookup_FindMembers): Check whether the
12831         IMemberFinder has a MemberCache and call the cache's FindMembers
12832         function.
12833         (MemberCache): Rewrote larger parts of this yet another time and
12834         cleaned it up a bit.
12835
12836 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12837
12838         * driver.cs (LoadArgs): Support quoting.
12839
12840         (Usage): Show the CSC-like command line arguments.
12841
12842         Improved a few error messages.
12843
12844 2002-08-15  Martin Baulig  <martin@gnome.org>
12845
12846         * typemanager.cs (IMemberContainer.Type): New property.
12847         (IMemberContainer.IsInterface): New property.
12848
12849         The following changes are conditional to BROKEN_RUNTIME, which is
12850         defined at the top of the file.
12851
12852         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12853         class'es members, but add all members from TypeHandle.ObjectType
12854         if we're an interface.
12855         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12856         is the current type.
12857         (MemberCache.CacheEntry.Container): Removed this field.
12858         (TypeHandle.GetMembers): Include inherited members.
12859
12860 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12861
12862         * typemanager.cs: fixed compilation and added a comment on a field that
12863         is never used.
12864
12865 2002-08-15  Martin Baulig  <martin@gnome.org>
12866
12867         * class.cs (ConstructorInitializer.Resolve): In the
12868         Expression.MemberLookup call, use the queried_type as
12869         invocation_type.
12870
12871         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12872         declared' attribute, it's always true.
12873         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12874         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12875         temporary wrapper for FindMembers which tells MemberLookup whether
12876         members from the base classes are included in the return value.
12877         This will go away soon.
12878         (TypeManager.MemberLookup): Use this temporary hack here; once the
12879         new MemberCache is completed, we don't need to do the DeclaredOnly
12880         looping here anymore since the MemberCache will take care of this.
12881         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12882         (MemberCache): When creating the MemberCache for a class, get
12883         members from the current class and all its base classes.
12884         (MemberCache.CacheEntry.Container): New field.  This is a
12885         temporary hack until the Mono runtime is fixed to distinguish
12886         between ReflectedType and DeclaringType.  It allows us to use MCS
12887         with both the MS runtime and the unfixed Mono runtime without
12888         problems and without accecting performance.
12889         (MemberCache.SearchMembers): The DeclaredOnly looping from
12890         TypeManager.MemberLookup is now done here.      
12891
12892 2002-08-14  Martin Baulig  <martin@gnome.org>
12893
12894         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12895         Type.GetFields on dynamic types but get the fields from the
12896         corresponding TypeContainer.
12897         (MyStructInfo.GetStructInfo): Added check for enum types.
12898
12899         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12900         (MemberList.SyncRoot): Implemented.
12901         (TypeManager.FilterWithClosure): No need to check permissions if
12902         closure_start_type == closure_invocation_type, don't crash if
12903         closure_invocation_type is null.
12904
12905 2002-08-13  Martin Baulig  <martin@gnome.org>
12906
12907         Rewrote TypeContainer.FindMembers to use a member cache.  This
12908         gives us a speed increase of about 35% for the self-hosting MCS
12909         build and of about 15-20% for the class libs (both on GNU/Linux).
12910
12911         * report.cs (Timer): New class to get enhanced profiling.  This
12912         whole class is "TIMER" conditional since it remarkably slows down
12913         compilation speed.
12914
12915         * class.cs (MemberList): New class.  This is an IList wrapper
12916         which we're now using instead of passing MemberInfo[]'s around to
12917         avoid copying this array unnecessarily.
12918         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12919         (ICachingMemberFinder, IMemberContainer): New interface.
12920         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12921         has already been checked, otherwise use it for the name comparision.
12922         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12923         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12924         if possible.  Returns a MemberList, not a MemberInfo [].
12925         (TypeHandle): New class, implements IMemberContainer.  We create
12926         one instance of this class per type, it contains a MemberCache
12927         which is used to do the member lookups.
12928         (MemberCache): New class.  Each instance of this class contains
12929         all members of a type and a name-based hash table.
12930         (MemberCache.FindMembers): This is our new member lookup
12931         function.  First, it looks up all members of the requested name in
12932         the hash table.  Then, it walks this list and sorts out all
12933         applicable members and returns them.
12934
12935 2002-08-13  Martin Baulig  <martin@gnome.org>
12936
12937         In addition to a nice code cleanup, this gives us a performance
12938         increase of about 1.4% on GNU/Linux - not much, but it's already
12939         half a second for the self-hosting MCS compilation.
12940
12941         * typemanager.cs (IMemberFinder): New interface.  It is used by
12942         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12943         Enum, Delegate or Interface.
12944         (TypeManager.finder_to_member_finder): New PtrHashtable.
12945         (TypeManager.finder_to_container): Removed.
12946         (TypeManager.finder_to_delegate): Removed.
12947         (TypeManager.finder_to_interface): Removed.
12948         (TypeManager.finder_to_enum): Removed.
12949
12950         * interface.cs (Interface): Implement IMemberFinder.
12951
12952         * delegate.cs (Delegate): Implement IMemberFinder.
12953
12954         * enum.cs (Enum): Implement IMemberFinder.
12955
12956         * class.cs (TypeContainer): Implement IMemberFinder.
12957
12958 2002-08-12  Martin Baulig  <martin@gnome.org>
12959
12960         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12961
12962 2002-08-12  Martin Baulig  <martin@gnome.org>
12963
12964         * ecore.cs (ITypeExpression): New interface for expressions which
12965         resolve to a type.
12966         (TypeExpression): Renamed to TypeLookupExpression.
12967         (Expression.DoResolve): If we're doing a types-only lookup, the
12968         expression must implement the ITypeExpression interface and we
12969         call DoResolveType() on it.
12970         (SimpleName): Implement the new ITypeExpression interface.
12971         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12972         hack, the situation that we're only looking up types can't happen
12973         anymore when this method is called.  Moved the type lookup code to
12974         DoResolveType() and call it.
12975         (SimpleName.DoResolveType): This ITypeExpression interface method
12976         is now doing the types-only lookup.
12977         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12978         (ResolveFlags): Added MaskExprClass.
12979
12980         * expression.cs (MemberAccess): Implement the ITypeExpression
12981         interface.
12982         (MemberAccess.DoResolve): Added support for a types-only lookup
12983         when we're called via ITypeExpression.DoResolveType().
12984         (ComposedCast): Implement the ITypeExpression interface.
12985
12986         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12987         Expression.Resolve() with ResolveFlags.Type instead.
12988
12989 2002-08-12  Martin Baulig  <martin@gnome.org>
12990
12991         * interface.cs (Interface.Define): Apply attributes.
12992
12993         * attribute.cs (Attribute.ApplyAttributes): Added support for
12994         interface attributes.
12995
12996 2002-08-11  Martin Baulig  <martin@gnome.org>
12997
12998         * statement.cs (Block.Emit): Only check the "this" variable if we
12999         do not always throw an exception.
13000
13001         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13002         whether the property has a set accessor.
13003
13004 2002-08-11  Martin Baulig  <martin@gnome.org>
13005
13006         Added control flow analysis support for structs.
13007
13008         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13009         with control flow analysis turned off.
13010         (IVariable): New interface.
13011         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13012         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13013         (FieldExpr.DoResolve): Resolve the instance expression with flow
13014         analysis turned off and do the definite assignment check after the
13015         resolving when we know what the expression will resolve to.
13016
13017         * expression.cs (LocalVariableReference, ParameterReference):
13018         Implement the new IVariable interface, only call the flow analysis
13019         code if ec.DoFlowAnalysis is true.
13020         (This): Added constructor which takes a Block argument.  Implement
13021         the new IVariable interface.
13022         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13023         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13024         This does the definite assignment checks for struct members.
13025
13026         * class.cs (Constructor.Emit): If this is a non-static `struct'
13027         constructor which doesn't have any initializer, call
13028         Block.AddThisVariable() to tell the flow analysis code that all
13029         struct elements must be initialized before control returns from
13030         the constructor.
13031
13032         * statement.cs (MyStructInfo): New public class.
13033         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13034         argument to this indexer.  If non-zero, check an individual struct
13035         member, not the whole struct.
13036         (FlowBranching.CheckOutParameters): Check struct members.
13037         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13038         overloaded versions of these methods which take an additional
13039         `int field_idx' argument to check struct members.
13040         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13041         overloaded versions of these methods which take an additional
13042         `string field_name' argument to check struct member.s
13043         (VariableInfo): Implement the IVariable interface.
13044         (VariableInfo.StructInfo): New public property.  Returns the
13045         MyStructInfo instance of the variable if it's a struct or null.
13046         (Block.AddThisVariable): New public method.  This is called from
13047         Constructor.Emit() for non-static `struct' constructor which do
13048         not have any initializer.  It creates a special variable for the
13049         "this" instance variable which will be checked by the flow
13050         analysis code to ensure that all of the struct's fields are
13051         initialized before control returns from the constructor.
13052         (UsageVector): Added support for struct members.  If a
13053         variable/parameter is a struct with N members, we reserve a slot
13054         in the usage vector for each member.  A struct is considered fully
13055         initialized if either the struct itself (slot 0) or all its
13056         members are initialized.
13057
13058 2002-08-08  Martin Baulig  <martin@gnome.org>
13059
13060         * driver.cs (Driver.MainDriver): Only report an error CS5001
13061         if there were no compilation errors.
13062
13063         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13064         `UnsafeContext' property to determine whether the parent is in
13065         unsafe context rather than checking the parent's ModFlags:
13066         classes nested in an unsafe class are unsafe as well.
13067
13068 2002-08-08  Martin Baulig  <martin@gnome.org>
13069
13070         * statement.cs (UsageVector.MergeChildren): Distinguish between
13071         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13072         we return.  Added test17() and test18() to test-154.cs.
13073
13074 2002-08-08  Martin Baulig  <martin@gnome.org>
13075
13076         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13077         Family access, make sure the invoking type isn't a subclass of the
13078         queried type (that'd be a CS1540).
13079
13080         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13081         this method which takes an additional `Type invocation_type'.
13082
13083         * expression.cs (BaseAccess.DoResolve): Use the base type as
13084         invocation and query type.
13085         (MemberAccess.DoResolve): If the lookup failed and we're about to
13086         report a CS0122, try a lookup with the ec.ContainerType - if this
13087         succeeds, we must report a CS1540.
13088
13089 2002-08-08  Martin Baulig  <martin@gnome.org>
13090
13091         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13092         (MethodGroupExpr): Implement the IMemberExpr interface.
13093
13094         * expression (MemberAccess.ResolveMemberAccess): No need to have
13095         any special code for MethodGroupExprs anymore, they're now
13096         IMemberExprs.   
13097
13098 2002-08-08  Martin Baulig  <martin@gnome.org>
13099
13100         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13101         Family, FamANDAssem and FamORAssem permissions.
13102         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13103
13104 2002-08-08  Martin Baulig  <martin@gnome.org>
13105
13106         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13107         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13108         or loop block.
13109
13110 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13111
13112         * driver.cs: implemented /resource option to embed managed resources.
13113
13114 2002-08-07  Martin Baulig  <martin@gnome.org>
13115
13116         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13117         (FieldBase.HasFieldInitializer): New public property.
13118         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13119         returns the field initializer and makes sure it is only resolved once.
13120         (TypeContainer.EmitFieldInitializers): Call
13121         FieldBase.GetInitializerExpression to get the initializer, this ensures
13122         that it isn't resolved multiple times.
13123
13124         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13125         the resolving process (SimpleName/MemberLookup) that we're currently
13126         emitting a field initializer (which must not access any instance members,
13127         this is an error CS0236).
13128
13129         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13130         argument, if the `IsFieldInitializer' flag is set, we must report and
13131         error CS0236 and not an error CS0120.   
13132
13133 2002-08-07  Martin Baulig  <martin@gnome.org>
13134
13135         * ecore.cs (IMemberExpr): New public interface.
13136         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13137         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13138         if the expression is an IMemberExpr.
13139
13140         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13141         to be null, implicitly default to `this' if we're non-static in
13142         this case.  Simplified the code a lot by using the new IMemberExpr
13143         interface.  Also fixed bug #28176 here.
13144
13145 2002-08-06  Martin Baulig  <martin@gnome.org>
13146
13147         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13148         ParameterReferences during semantic analysis so that we can do a
13149         type-only search when resolving Cast, TypeOf and SizeOf.
13150         (block): Pass the `current_local_parameters' to the Block's
13151         constructor.
13152
13153         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13154         argument to the constructor.
13155         (ConstructorInitializer.Resolve): Create a temporary implicit
13156         block with the parameters.
13157
13158         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13159         references here if we aren't doing a type-only search.
13160
13161         * statement.cs (Block): Added constructor which takes a
13162         `Parameters parameters' argument.
13163         (Block.Parameters): New public property.
13164
13165         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13166         to `Parameters' and made it public readonly.
13167
13168 2002-08-06  Martin Baulig  <martin@gnome.org>
13169
13170         * ecore.cs (Expression.Warning): Made this public as well.
13171
13172         * report.cs (Report.Debug): Print the contents of collections.
13173
13174 2002-08-06  Martin Baulig  <martin@gnome.org>
13175
13176         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13177         used to tell Resolve() which kinds of expressions it may return.
13178         (Expression.Resolve): Added overloaded version of this method which
13179         takes a `ResolveFlags flags' argument.  This can be used to tell
13180         Resolve() which kinds of expressions it may return.  Reports a
13181         CS0118 on error.
13182         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13183         ResolveFlags.SimpleName.
13184         (Expression.Error118): Added overloaded version of this method which
13185         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13186         which kinds of expressions are allowed.
13187
13188         * expression.cs (Argument.ResolveMethodGroup): New public method.
13189         Resolves an argument, but allows a MethodGroup to be returned.
13190         This is used when invoking a delegate.
13191
13192         * TODO: Updated a bit.
13193
13194 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13195
13196         Fixed compilation with csc.
13197
13198         * ecore.cs: Expression.Error made public. Is this correct? Should
13199         Warning be made public too?
13200
13201         * expression.cs: use ea.Location instead of ea.loc.
13202         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13203
13204 2002-08-06  Martin Baulig  <martin@gnome.org>
13205
13206         * ecore.cs (Expression.loc): Moved the location here instead of
13207         duplicating it in all derived classes.
13208         (Expression.Location): New public property.
13209         (Expression.Error, Expression.Warning): Made them non-static and
13210         removed the location argument.
13211         (Expression.Warning): Added overloaded version which takes an
13212         `int level' argument.
13213         (Expression.Error118): Make this non-static and removed the
13214         expression and location arguments.
13215         (TypeExpr): Added location argument to the constructor.
13216
13217         * expression.cs (StaticCallExpr): Added location argument to
13218         the constructor.
13219         (Indirection, PointerArithmetic): Likewise.
13220         (CheckedExpr, UnCheckedExpr): Likewise.
13221         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13222         (StringPtr): Likewise.
13223
13224
13225 2002-08-05  Martin Baulig  <martin@gnome.org>
13226
13227         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13228
13229         * assign.cs (Assign.DoResolve): Check whether the source
13230         expression is a value or variable.
13231
13232         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13233         while resolving the corresponding blocks.
13234
13235         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13236         an error, don't silently return null.
13237
13238         * statement.cs (Block.AddVariable): Do the error reporting here
13239         and distinguish between CS0128 and CS0136.
13240         (Block.DoResolve): Report all unused labels (warning CS0164).
13241         (LabeledStatement): Pass the location to the constructor.
13242         (LabeledStatement.HasBeenReferenced): New property.
13243         (LabeledStatement.Resolve): Set it to true here.
13244
13245         * statement.cs (Return.Emit): Return success even after reporting
13246         a type mismatch error (CS0126 or CS0127), this is what csc does and
13247         it avoids confusing the users with any consecutive errors.
13248
13249 2002-08-05  Martin Baulig  <martin@gnome.org>
13250
13251         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13252
13253         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13254
13255         * expression.cs (MemberAccess.DoResolve): Silently return if an
13256         error has already been reported.
13257
13258         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13259         error has already been reported.
13260
13261 2002-08-05  Martin Baulig  <martin@gnome.org>
13262
13263         * statement.cs (UsageVector): Only initialize the `parameters'
13264         vector if we actually have any "out" parameters.
13265
13266 2002-08-05  Martin Baulig  <martin@gnome.org>
13267
13268         * expression.cs (Binary.ResolveOperator): When combining delegates,
13269         they must have the same type.
13270
13271 2002-08-05  Martin Baulig  <martin@gnome.org>
13272
13273         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13274         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13275         work with the ms runtime and we also don't need it: if we're a
13276         PropertyBuilder and not in the `indexer_arguments' hash, then we
13277         are a property and not an indexer.
13278
13279         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13280         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13281         since the latter one doesn't work with the ms runtime.
13282
13283 2002-08-03  Martin Baulig  <martin@gnome.org>
13284
13285         Fixed bugs #27998 and #22735.
13286
13287         * class.cs (Method.IsOperator): New public field.
13288         (Method.CheckBase): Report CS0111 if there's already a method
13289         with the same parameters in the current class.  Report CS0508 when
13290         attempting to change the return type of an inherited method.
13291         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13292         and it's not marked abstract or extern.
13293         (PropertyBase): New abstract base class for Property and Indexer.
13294         (PropertyBase.CheckBase): Moved here from Property and made it work
13295         for indexers.
13296         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13297         the same so we can reuse it there.
13298         (Property, Indexer): Derive from PropertyBase.
13299         (MethodSignature.inheritable_property_signature_filter): New delegate
13300         to find properties and indexers.
13301
13302         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13303         argument and improved error reporting.
13304
13305         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13306         EmptyReadOnlyParameters and made it a property.
13307
13308         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13309         version of this method which takes a `PropertyInfo indexer'.
13310         (TypeManager.RegisterIndexer): New method.
13311
13312         * class.cs: Added myself as author of this file :-)
13313
13314 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13315
13316         * class.cs: fixed compilation on windoze.
13317
13318 2002-08-03  Martin Baulig  <martin@gnome.org>
13319
13320         * interface.cs (Interface.GetInterfaceBases): Check whether all
13321         base interfaces are at least as accessible than the current one.
13322
13323         * class.cs (TypeContainer.GetClassBases): Check whether base types
13324         are at least as accessible than the current type.
13325         (TypeContainer.AsAccessible): Implemented and made non-static.
13326         (MemberBase.CheckParameters): Report errors if the accessibility
13327         checks fail.
13328
13329         * delegate.cs (Delegate.Delegate): The default visibility is
13330         internal for top-level types and private for nested types.
13331         (Delegate.Define): Report errors if the accessibility checks fail.
13332
13333         * enum.cs (Enum.Enum): The default visibility is internal for
13334         top-level types and private for nested types.
13335         (Enum.DefineType): Compute the correct visibility.
13336
13337         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13338         function which takes a `bool is_toplevel' instead of a TypeContainer.
13339
13340         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13341         builtin type.
13342
13343 2002-08-02  Martin Baulig  <martin@gnome.org>
13344
13345         * expression.cs (LocalVariableReferenc): Added constructor which
13346         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13347         (LocalVariableReference.IsReadOnly): New property.
13348         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13349         variable is readonly, use our own readonly flag to do this; you can
13350         use the new constructor to get a writable reference to a read-only
13351         variable.
13352
13353         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13354         reference to the local variable.
13355
13356 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * rootcontext.cs (ResolveCore): Also include System.Exception
13359
13360         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13361         we reach an EmptyStatement.
13362
13363         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13364         is also fine.
13365
13366         * expression.cs (Binary.ResolveOperator): Check error result in
13367         two places.
13368
13369         use brtrue/brfalse directly and avoid compares to null.
13370
13371 2002-08-02  Martin Baulig  <martin@gnome.org>
13372
13373         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13374         Fixes bug #28407, added test-155.cs.
13375
13376 2002-08-01  Martin Baulig  <martin@gnome.org>
13377
13378         * class.cs (Event.EmitDefaultMethod): Make this work with static
13379         events.  Fixes #28311, added verify-3.cs.
13380
13381 2002-08-01  Martin Baulig  <martin@gnome.org>
13382
13383         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13384         `is_disposable' fields.
13385         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13386         `hm.is_disposable' if we're using the collection pattern.
13387         (Foreach.EmitCollectionForeach): Use the correct type for the
13388         enumerator's local variable, only emit the try/finally block if
13389         necessary (fixes #27713).
13390
13391 2002-08-01  Martin Baulig  <martin@gnome.org>
13392
13393         * ecore.cs (Expression.report118): Renamed to Error118 and made
13394         it public static.
13395
13396         * statement.cs (Throw.Resolve): Check whether the expression is of
13397         the correct type (CS0118) and whether the type derives from
13398         System.Exception (CS0155).
13399         (Catch.Resolve): New method.  Do the type lookup here and check
13400         whether it derives from System.Exception (CS0155).
13401         (Catch.CatchType, Catch.IsGeneral): New public properties.
13402
13403         * typemanager.cs (TypeManager.exception_type): Added.
13404
13405 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13406
13407         * driver.cs: Updated About function.
13408
13409 2002-07-31  Martin Baulig  <martin@gnome.org>
13410
13411         Implemented Control Flow Analysis.
13412
13413         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13414         (EmitContext.CurrentBranching): Added.
13415         (EmitContext.StartFlowBranching): Added.
13416         (EmitContext.EndFlowBranching): Added.
13417         (EmitContext.KillFlowBranching): Added.
13418         (EmitContext.IsVariableAssigned): Added.
13419         (EmitContext.SetVariableAssigned): Added.
13420         (EmitContext.IsParameterAssigned): Added.
13421         (EmitContext.SetParameterAssigned): Added.
13422         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13423         Added control flow analysis stuff here.
13424
13425         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13426         resolve the expression as lvalue.
13427         (LocalVariableReference.DoResolve): Check whether the variable has
13428         already been assigned.
13429         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13430         the parameter as assigned here.
13431         (ParameterReference.DoResolve): Check whether the parameter has already
13432         been assigned.
13433         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13434         expression as lvalue.
13435
13436         * statement.cs (FlowBranching): New class for the flow analysis code.
13437         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13438         (LabeledStatement.IsDefined): New public property.
13439         (LabeledStatement.AddUsageVector): New public method to tell flow
13440         analyis that the label may be reached via a forward jump.
13441         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13442         flow analysis.
13443         (VariableInfo.Number): New public field.  This is used by flow analysis
13444         to number all locals of a block.
13445         (Block.CountVariables): New public property.  This is the number of
13446         local variables in this block (including the locals from all parent
13447         blocks).
13448         (Block.EmitMeta): Number all the variables.
13449
13450         * statement.cs: Added flow analysis support to all classes.
13451
13452 2002-07-31  Martin Baulig  <martin@gnome.org>
13453
13454         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13455         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13456         then use this argument.
13457
13458         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13459
13460         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13461         use this to specify /define options.
13462
13463 2002-07-29  Martin Baulig  <martin@gnome.org>
13464
13465         * statement.cs (Fixed): Moved all code that does variable lookups
13466         and resolvings from Emit to Resolve.
13467
13468         * statement.cs (For): Moved all code that does variable lookups
13469         and resolvings from Emit to Resolve.
13470
13471         * statement.cs (Using): Moved all code that does variable lookups
13472         and resolvings from Emit to Resolve.
13473
13474 2002-07-29  Martin Baulig  <martin@gnome.org>
13475
13476         * attribute.cs (Attribute.Resolve): Explicitly catch a
13477         System.NullReferenceException when creating the
13478         CustromAttributeBuilder and report a different warning message.
13479
13480 2002-07-29  Martin Baulig  <martin@gnome.org>
13481
13482         * support.cs (ParameterData.ParameterName): Added method to
13483         get the name of a parameter.
13484
13485         * typemanager.cs (TypeManager.IsValueType): New public method.
13486
13487 2002-07-29  Martin Baulig  <martin@gnome.org>
13488
13489         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13490         is a flag which specifies that it's either ref or out.
13491         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13492         the out parameter to `out Parameter.Modifier mod', also set the
13493         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13494
13495         * support.cs (InternalParameters.ParameterModifier): Distinguish
13496         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13497         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13498
13499         * expression.cs (Argument.GetParameterModifier): Distinguish
13500         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13501         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13502
13503 2002-07-29  Martin Baulig  <martin@gnome.org>
13504
13505         * expression.cs (ParameterReference.ParameterReference): Added
13506         `Location loc' argument to the constructor.
13507
13508         * cs-parser.jay: Pass location to ParameterReference.
13509
13510 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13511
13512         * statement.cs (Try): Initialize the location.
13513
13514         * cs-parser.jay: pass location to Try.
13515
13516         * expression.cs (Unary.Reduce): Change the prototype to return
13517         whether a constant fold could be performed or not.  The result is
13518         returned in an out parameters.  In the case of Indirection and
13519         AddressOf, we want to perform the full tests.
13520
13521 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13522
13523         * statement.cs (Statement.Emit): Flag dead code.
13524
13525 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13526
13527         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13528
13529 2002-07-27  Martin Baulig  <martin@gnome.org>
13530
13531         * class.cs (MethodData.Define): Put back call to
13532         TypeManager.AddMethod(), accidentally commented this out.
13533
13534         * report.cs (Debug): New public method to print debugging information,
13535         this is `[Conditional ("DEBUG")]'.
13536
13537 2002-07-26  Martin Baulig  <martin@gnome.org>
13538
13539         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13540         (switch_statement): Push the current_block to the switch_stack and
13541         pop it again when we're done with the switch.
13542         (switch_section): The new block is a child of the current_block.
13543         Fixes bug #24007, added test-152.cs.
13544
13545 2002-07-27  Martin Baulig  <martin@gnome.org>
13546
13547         * expression.cs (Invocation.EmitArguments): When calling a varargs
13548         function with only its fixed arguments, we need to pass an empty
13549         array.
13550
13551 2002-07-27  Martin Baulig  <martin@gnome.org>
13552
13553         Mono 0.13 has been released.
13554
13555 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13556
13557         * driver.cs: Rename --resource to --linkres, because that is what
13558         we do currently, we dont support --resource yet.
13559
13560         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13561
13562 2002-07-25  Martin Baulig  <martin@gnome.org>
13563
13564         * class.cs (MethodData): New public class.  This is a `method builder'
13565         class for a method or one accessor of a Property/Indexer/Event.
13566         (MethodData.GetMethodFlags): Moved here from MemberBase.
13567         (MethodData.ApplyAttributes): Likewise.
13568         (MethodData.ApplyObsoleteAttribute): Likewise.
13569         (MethodData.ApplyConditionalAttribute): Likewise.
13570         (MethodData.ApplyDllImportAttribute): Likewise.
13571         (MethodData.CheckAbstractAndExternal): Likewise.
13572         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13573         (MethodData.Emit): Formerly known as Method.Emit().
13574         (MemberBase): Moved everything which was specific to a single
13575         accessor/method to MethodData.
13576         (Method): Create a new MethodData and call Define() and Emit() on it.
13577         (Property, Indexer, Event): Create a new MethodData objects for each
13578         accessor and call Define() and Emit() on them.
13579
13580 2002-07-25  Martin Baulig  <martin@gnome.org>
13581
13582         Made MethodCore derive from MemberBase to reuse the code from there.
13583         MemberBase now also checks for attributes.
13584
13585         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13586         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13587         as virtual.
13588         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13589         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13590         (MemberBase.ApplyAttributes): New virtual method; applies the
13591         attributes to a method or accessor.
13592         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13593         (MemberBase.ApplyConditionalAttribute): Likewise.
13594         (MemberBase.ApplyDllImportAttribute): Likewise.
13595         (MemberBase.CheckAbstractAndExternal): Likewise.
13596         (MethodCore.ParameterTypes): This is now a property instead of a
13597         method, it's initialized from DoDefineParameters().
13598         (MethodCore.ParameterInfo): Removed the set accessor.
13599         (MethodCore.DoDefineParameters): New protected virtual method to
13600         initialize ParameterTypes and ParameterInfo.
13601         (Method.GetReturnType): We can now simply return the MemberType.
13602         (Method.GetMethodFlags): Override the MemberBase version and add
13603         the conditional flags.
13604         (Method.CheckBase): Moved some code from Define() here, call
13605         DoDefineParameters() here.
13606         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13607         here to avoid some larger code duplication.
13608         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13609         ensure that abstract and external accessors don't declare a body.
13610
13611         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13612         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13613         lookup in the attribute's parent classes, so we need to abort as soon
13614         as we found the first match.
13615         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13616         the attribute has no arguments.
13617
13618         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13619         of a Method.
13620
13621 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13622
13623         * cs-parser.jay: reverted previous patch.
13624
13625 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13626
13627         * cs-parser.jay: fixed bug #22119.
13628
13629 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13630
13631         * attribute.cs: fixed compilation. The error was:
13632         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13633         be assigned to before control leaves the current method."
13634         [FIXME:  Filed as bug #28186: MCS must report this error.]
13635
13636 2002-07-25  Martin Baulig  <martin@gnome.org>
13637
13638         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13639         method to pull the condition name ouf of a Conditional attribute.
13640         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13641         the obsolete message and error flag out of an Obsolete attribute.
13642
13643         * class.cs (Method.GetMethodFlags): New public method to get the
13644         TypeManager.MethodFlags for this method.
13645         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13646         private methods.
13647         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13648         if we're overriding a virtual function, set the new private variable
13649         `parent_method'; call the new TypeManager.AddMethod().
13650
13651         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13652         the MethodBuilder and the Method in a PtrHashtable.
13653         (TypeManager.builder_to_method): Added for this purpose.
13654         (TypeManager.MethodFlags): Added IsObsoleteError.
13655         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13656         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13657         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13658         the message from the attribute.
13659
13660 2002-07-24  Martin Baulig  <martin@gnome.org>
13661
13662         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13663         preprocessor directives, ensure that the argument to #define/#undef is
13664         exactly one identifier and that it's actually an identifier.
13665
13666         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13667         did not work ....
13668
13669 2002-07-24  Martin Baulig  <martin@gnome.org>
13670
13671         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13672         initialize it to TypeManager.object_type in the constructor.
13673         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13674         of the `hm.get_current' method if we're using the collection pattern.
13675         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13676         for the explicit conversion to make it work when we're using the collection
13677         pattern and the `Current' property has a different return type than `object'.
13678         Fixes #27713.
13679
13680 2002-07-24  Martin Baulig  <martin@gnome.org>
13681
13682         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13683         does not match, but don't report any errors.  This method is called in
13684         order for all methods in a MethodGroupExpr until a matching method is
13685         found, so we don't want to bail out if the first method doesn't match.
13686         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13687         matches, report the 123.  Fixes #28070.
13688
13689 2002-07-24  Martin Baulig  <martin@gnome.org>
13690
13691         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13692         TypeManager.TypeToCoreType() to the top of the method so the
13693         following equality checks will work.  Fixes #28107.
13694
13695 2002-07-24  Martin Baulig  <martin@gnome.org>
13696
13697         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13698         operand is of type uint, and the other operand is of type sbyte,
13699         short or int, the operands are converted to type long." -
13700         Actually do what this comment already told us.  Fixes bug #28106,
13701         added test-150.cs.
13702
13703 2002-07-24  Martin Baulig  <martin@gnome.org>
13704
13705         * class.cs (MethodBase): New abstract class.  This is now a base
13706         class for Property, Indexer and Event to avoid some code duplication
13707         in their Define() and DefineMethods() methods.
13708         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13709         generic methods for Define() and DefineMethods().
13710         (FieldBase): Derive from MemberBase, not MemberCore.
13711         (Property): Derive from MemberBase, not MemberCore.
13712         (Property.DefineMethod): Moved all the code from this method to the
13713         new MethodBase.DefineAccessor(), just call it with appropriate
13714         argumetnts.
13715         (Property.Define): Call the new Property.DoDefine(), this does some
13716         sanity checks and we don't need to duplicate the code everywhere.
13717         (Event): Derive from MemberBase, not MemberCore.
13718         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13719         accessors, this will also make them work with interface events.
13720         (Indexer): Derive from MemberBase, not MemberCore.
13721         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13722         (Indexer.Define): Use the new MethodBase functions.
13723
13724         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13725         argument to the constructor.
13726         (Interface.FindMembers): Added support for interface events.
13727         (Interface.PopluateEvent): Implemented.
13728
13729         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13730
13731 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13732
13733         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13734         but this is required to check for a method name being the same as
13735         the containing class.  
13736
13737         Handle this now.
13738
13739 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13740
13741         * interface.cs: initialize variable.
13742
13743 2002-07-23  Martin Baulig  <martin@gnome.org>
13744
13745         Implemented the IndexerName attribute in interfaces.
13746
13747         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13748         name if this is an explicit interface implementation.
13749         (Indexer.InterfaceIndexerName): New public variable.  If we're
13750         implementing an interface indexer, this is the IndexerName in that
13751         interface.  Otherwise, it's the IndexerName.
13752         (Indexer.DefineMethod): If we're implementing interface indexer,
13753         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13754         and Pending.ImplementIndexer methods.
13755         (Indexer.Define): Also define the PropertyBuilder if we're
13756         implementing an interface indexer and this is neither an explicit
13757         interface implementation nor do the IndexerName match the one in
13758         the interface.
13759
13760         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13761         If a method is defined here, then we always need to create a proxy
13762         for it.  This is used when implementing interface indexers.
13763         (Pending.IsInterfaceIndexer): New public method.
13764         (Pending.ImplementIndexer): New public method.
13765         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13766         This is used when implementing interface indexers to define a proxy
13767         if necessary.
13768         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13769         define a proxy if necessary.
13770
13771         * interface.cs (Interface.IndexerName): New public variable.
13772         (Interface.PopulateIndexer): Set the IndexerName.
13773         (Interface.DefineIndexers): New private method.  Populate all the
13774         indexers and make sure their IndexerNames match.
13775
13776         * typemanager.cs (IndexerPropertyName): Added support for interface
13777         indexers.
13778
13779 2002-07-22  Martin Baulig  <martin@gnome.org>
13780
13781         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13782         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13783         ret if HasReturnLabel.
13784         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13785         variables.
13786
13787         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13788         and set the ec.LoopBeginTryCatchLevel.
13789         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13790         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13791         the current ec.TryCatchLevel, the branch goes out of an exception
13792         block.  In this case, we need to use Leave and not Br.
13793
13794 2002-07-22  Martin Baulig  <martin@gnome.org>
13795
13796         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13797         block unless the block does not always return or it is contained in
13798         another try { ... } catch { ... } block.  Fixes bug #26506.
13799         Added verify-1.cs to the test suite.
13800
13801 2002-07-22  Martin Baulig  <martin@gnome.org>
13802
13803         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13804         then we do not always return.  Fixes bug #24985.
13805
13806 2002-07-22  Martin Baulig  <martin@gnome.org>
13807
13808         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13809         lookup on a per-class level; ie. walk up the class hierarchy until we
13810         found at least one applicable method, then choose the best among them.
13811         Fixes bug #24463 and test-29.cs.
13812
13813 2002-07-22  Martin Baulig  <martin@gnome.org>
13814
13815         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13816         return types of the methods.  The return type is not part of the
13817         signature and we must not check it to make the `new' modifier work.
13818         Fixes bug #27999, also added test-147.cs.
13819         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13820
13821         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13822         on the method's return type.
13823
13824 2002-07-21  Martin Baulig  <martin@gnome.org>
13825
13826         * assign.cs: Make this work if the rightmost source is a constant and
13827         we need to do an implicit type conversion.  Also adding a few more tests
13828         to test-38.cs which should have caught this.
13829
13830         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13831         target in the makefile for this.  The makefile.gnu is primarily intended
13832         for end-users who don't want to debug the compiler.
13833
13834 2002-07-21  Martin Baulig  <martin@gnome.org>
13835
13836         * assign.cs: Improved the Assign class so it can now handle embedded
13837         assignments (X = Y = Z = something).  As a side-effect this'll now also
13838         consume less local variables.  test-38.cs now passes with MCS, added
13839         a few new test cases to that test.
13840
13841 2002-07-20  Martin Baulig  <martin@gnome.org>
13842
13843         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13844         instructions.  Fixes bug #27977, also added test-146.cs.
13845
13846 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13847
13848         * cs-tokenizer.cs: fixed getHex ().
13849
13850 2002-07-19  Martin Baulig  <martin@gnome.org>
13851
13852         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13853         not Type.GetType() to lookup the array type.  This is needed when
13854         we're constructing an array of a user-defined type.
13855         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13856         single-dimensional arrays, but also for single-dimensial arrays of
13857         type decimal.
13858
13859 2002-07-19  Martin Baulig  <martin@gnome.org>
13860
13861         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13862         this function is called, it's not allowed to share LocalBuilders
13863         among ILGenerators.
13864
13865 2002-07-19  Martin Baulig  <martin@gnome.org>
13866
13867         * expression.cs (Argument.Resolve): Report an error 118 when trying
13868         to pass a type as argument.
13869
13870 2002-07-18  Martin Baulig  <martin@gnome.org>
13871
13872         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13873         Conv_R_Un for the signed `long' type.
13874
13875 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13876
13877         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13878         `expr' for the temporary result, as that will fail if we do
13879         multiple resolves on the same expression.
13880
13881 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13882
13883         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13884         ec.TypeContainer for looking up aliases. 
13885
13886         * class.cs (TypeContainer): Remove LookupAlias from here.
13887
13888         * decl.cs (DeclSpace); Move here.
13889
13890 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13891
13892         * class.cs (FindMembers): Only call filter if the constructor
13893         bulider is not null.
13894
13895         Also handle delegates in `NestedTypes' now.  Now we will perform
13896         type lookups using the standard resolution process.  This also
13897         fixes a bug.
13898
13899         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13900         This uses Expressions (the limited kind that can be parsed by the
13901         tree) instead of strings.
13902
13903         * expression.cs (ComposedCast.ToString): Implement, used to flag
13904         errors since now we have to render expressions.
13905
13906         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13907         FormArrayType. 
13908
13909         * ecore.cs (SimpleName.ToString): ditto.
13910
13911         * cs-parser.jay: Instead of using strings to assemble types, use
13912         Expressions to assemble the type (using SimpleName, ComposedCast,
13913         MemberAccess).  This should fix the type lookups in declarations,
13914         because we were using a different code path for this.
13915
13916         * statement.cs (Block.Resolve): Continue processing statements
13917         even when there is an error.
13918
13919 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13920
13921         * class.cs (Event.Define): Also remove the `remove' method from
13922         the list of pending items.
13923
13924         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13925         generate more compact code. 
13926
13927 2002-07-17  Martin Baulig  <martin@gnome.org>
13928
13929         * const.cs (Const.LookupConstantValue): Add support for constant
13930         `unchecked' and `checked' expressions.
13931         Also adding test case test-140.cs for this.
13932
13933 2002-07-17  Martin Baulig  <martin@gnome.org>
13934
13935         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13936         check whether mi.ReturnType implements the IEnumerator interface; the
13937         `==' and the IsAssignableFrom() will fail in this situation.
13938
13939 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13940
13941         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13942         here too.
13943
13944 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13945
13946         * expression.cs: fixed bug #27811.
13947
13948 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13951         Molaro: when we are a ref, the value already contains a pointer
13952         value, do not take the address of it.
13953
13954 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13955         * removed mb-parser.jay and mb-tokenizer.cs
13956
13957 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13958
13959         * expression.cs: check against the building corlib void type.
13960
13961 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13962
13963         * ecore.cs: fix for valuetype static readonly fields: when 
13964         initializing them, we need their address, not the address of a copy.
13965
13966 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13967
13968         * typemanager.cs: register also enum_type in corlib.
13969
13970 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13971
13972         * class.cs: allow calling this (but not base) initializers in structs.
13973
13974 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13975
13976         * ecore.cs: make sure we compare against the building base types
13977         in GetTypeSize ().
13978
13979 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13980
13981         * typemanager.cs: fix TypeToCoreType() to handle void and object
13982         (corlib gets no more typerefs after this change).
13983
13984 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * expression.cs (ArrayCreation.EmitArrayArguments): use
13987         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13988
13989         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13990         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13991         array indexes, the runtime actually forbids them.
13992
13993         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13994         for array arguments here.
13995
13996         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13997         instead of the default for ValueTypes.
13998
13999         (New.DoEmit): Use IsValueType instead of
14000         IsSubclassOf (value_type)
14001         (New.DoResolve): ditto.
14002         (Invocation.EmitCall): ditto.
14003
14004         * assign.cs (Assign): ditto.
14005
14006         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14007         Statements *are* currently doing part of their resolution during
14008         Emit.  
14009
14010         Expressions do always resolve during resolve, but statements are
14011         only required to propagate resolution to their children.
14012
14013 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14016
14017         (LoadAssembly): Do not add the dll if it is already specified
14018
14019         (MainDriver): Add the System directory to the link path at the end,
14020         after all the other -L arguments. 
14021
14022         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14023         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14024         ldelem.u1) and using the opposite for sbytes.
14025
14026         This fixes Digger, and we can finally run it.
14027
14028         * driver.cs (UnixParseOption): Move the option parsing here.  
14029         (CSCParseOption): Implement CSC-like parsing of options.
14030
14031         We now support both modes of operation, the old Unix way, and the
14032         new CSC-like way.  This should help those who wanted to make cross
14033         platform makefiles.
14034
14035         The only thing broken is that /r:, /reference: and /lib: are not
14036         implemented, because I want to make those have the same semantics
14037         as the CSC compiler has, and kill once and for all the confussion
14038         around this.   Will be doing this tomorrow.
14039
14040         * statement.cs (Unsafe.Resolve): The state is checked during
14041         resolve, not emit, so we have to set the flags for IsUnsfe here.
14042
14043 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14044
14045         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14046         not catch the Error_ObjectRefRequired in SimpleName (as it is
14047         possible to have a class/instance variable name that later gets
14048         deambiguated), we have to check this here.      
14049
14050 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14051
14052         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14053         make static and put into Expression.
14054
14055         (Event.Define): Register the private field of the event with the 
14056         TypeManager so that GetFieldFromEvent can get at it.
14057
14058         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14059         keep track of the private field associated with an event which
14060         has no accessors.
14061
14062         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14063         private field.
14064
14065         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14066
14067 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14068
14069         * expression.cs (Binary.EmitBranchable): this routine emits the
14070         Binary expression in a branchable context.  This basically means:
14071         we need to branch somewhere, not just get the value on the stack.
14072
14073         This works together with Statement.EmitBoolExpression.
14074
14075         * statement.cs (Statement.EmitBoolExpression): Use
14076         EmitBranchable. 
14077
14078 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14079
14080         * statement.cs (For): Reduce the number of jumps in loops.
14081
14082         (For): Implement loop inversion for the For statement.
14083
14084         (Break): We can be breaking out of a Try/Catch controlled section
14085         (foreach might have an implicit try/catch clause), so we need to
14086         use Leave instead of Br.
14087
14088         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14089         now).  If the instace expression supports IMemoryLocation, we use
14090         the AddressOf method from the IMemoryLocation to extract the
14091         address instead of emitting the instance.
14092
14093         This showed up with `This', as we were emitting the instance
14094         always (Emit) instead of the Address of This.  Particularly
14095         interesting when This is a value type, as we dont want the Emit
14096         effect (which was to load the object).
14097
14098 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14101
14102         * statement.cs (Checked): Set the CheckedState during the resolve
14103         process too, as the ConvCast operations track the checked state on
14104         the resolve process, and not emit.
14105
14106         * cs-parser.jay (namespace_member_declaration): Flag that we have
14107         found a declaration when we do.  This is used to flag error 1529
14108
14109         * driver.cs: Report ok when we display the help only.
14110
14111 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14112
14113         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14114
14115 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * cs-tokenizer.cs (define): We also have to track locally the
14118         defines.  AllDefines is just used for the Conditional Attribute,
14119         but we also need the local defines for the current source code. 
14120
14121 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * statement.cs (While, For, Do): These loops can exit through a
14124         Break statement, use this information to tell whether the
14125         statement is the last piece of code.
14126
14127         (Break): Flag that we break.
14128
14129         * codegen.cs (EmitContexts): New `Breaks' state variable.
14130
14131 2002-07-03  Martin Baulig  <martin@gnome.org>
14132
14133         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14134         modifiers in method declarations in structs.  Otherwise, you won't
14135         be able to override things like Object.Equals().
14136
14137 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * class.cs (Method, Property, Indexer): Do not allow the public
14140         modifier to be used in explicit interface implementations.
14141
14142         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14143         override modifiers in method declarations in structs
14144
14145 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14146
14147         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14148         integer or real overflow, report an error
14149
14150 2002-07-02  Martin Baulig  <martin@gnome.org>
14151
14152         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14153         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14154         to tell the runtime about our newly created System.Object and
14155         System.ValueType types.
14156
14157 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14158
14159         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14160         struct instead of Ldarg/Starg.
14161
14162 2002-07-02  Martin Baulig  <martin@gnome.org>
14163
14164         * expression.cs (Indirection.Indirection): Call
14165         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14166
14167 2002-07-02  Martin Baulig  <martin@gnome.org>
14168
14169         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14170         ValueType, call TypeManager.TypeToCoreType() on it.
14171         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14172         the OpCodes.Newarr argument.
14173
14174 2002-07-02  Martin Baulig  <martin@gnome.org>
14175
14176         * expression.cs (Invocation.EmitCall): When compiling corlib,
14177         replace all calls to the system's System.Array type to calls to
14178         the newly created one.
14179
14180         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14181         System.Array methods.
14182         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14183         from the system's System.Array type which must be replaced.
14184
14185 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14186
14187         * typemanager.cs: load unverifiable_code_ctor so we can build
14188         corlib using the correct type. Avoid using GetTypeCode() with
14189         TypeBuilders.
14190         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14191         TypeManager.object_type to allow building corlib.
14192
14193 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14194
14195         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14196
14197 2002-07-01  Martin Baulig  <martin@gnome.org>
14198
14199         * class.cs: Make the last change actually work, we need to check
14200         whether `ifaces != null' to avoid a crash.
14201
14202 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14203
14204         * class.cs: when we build structs without fields that implement
14205         interfaces, we need to add the interfaces separately, since there is
14206         no API to both set the size and add the interfaces at type creation
14207         time.
14208
14209 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14210
14211         * expression.cs: the dimension arguments to the array constructors
14212         need to be converted if they are a long.
14213
14214 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14215
14216         * class.cs: don't emit ldarg.0 if there is no parent constructor
14217         (fixes showstopper for corlib).
14218
14219 2002-06-29  Martin Baulig  <martin@gnome.org>
14220
14221         MCS now compiles corlib on GNU/Linux :-)
14222
14223         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14224         ie. check for MethodImplOptions.InternalCall.
14225
14226         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14227         and TypeManager.attribute_type are null, so we must explicitly check
14228         whether parent is not null to find out whether it's an attribute type.
14229         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14230         and SetBuilder, not only if the property is neither abstract nor external.
14231         This is necessary to set the MethodImplOptions on the accessor methods.
14232         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14233         SetBuilder, see Property.Emit().
14234
14235         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14236         populate "System.Object", "System.ValueType" and "System.Attribute" since
14237         they've already been populated from BootCorlib_PopulateCoreTypes().
14238
14239 2002-06-29  Martin Baulig  <martin@gnome.org>
14240
14241         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14242         is the NullLiteral, we also need to make sure that target_type is not
14243         an enum type.   
14244
14245 2002-06-29  Martin Baulig  <martin@gnome.org>
14246
14247         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14248         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14249         before calling BootstrapCorlib_ResolveDelegate ().
14250
14251 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14252
14253         * statement.cs: fixed build-breaker. All tests passed ok.
14254
14255 2002-06-27  Martin Baulig  <martin@gnome.org>
14256
14257         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14258         for System.Decimal when compiling corlib.
14259
14260 2002-06-27  Martin Baulig  <martin@gnome.org>
14261
14262         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14263         switch blocks which contain nothing but a default clause.
14264
14265 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14266
14267        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14268
14269 2002-06-27  Martin Baulig  <martin@gnome.org>
14270
14271         * ecore.cs (PropertyExpr.PropertyExpr): Call
14272         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14273
14274         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14275         is already a TypeBuilder.
14276
14277 2002-06-27  Martin Baulig  <martin@gnome.org>
14278
14279         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14280         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14281         the "from an array-type to System.Array" case.  This makes it work
14282         when compiling corlib.
14283
14284 2002-06-27  Martin Baulig  <martin@gnome.org>
14285
14286         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14287         non-static PropertyExpr, set its InstanceExpression.  This makes
14288         the `ICollection.Count' property work in System/Array.cs.
14289
14290 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14291
14292         * driver.cs: Made error handling more consistent.  Errors now
14293         tracked by Report class, so many methods which used to return int
14294         now return void.  Main() now prints success/failure and 
14295         errors/warnings message.
14296
14297         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14298         the magic number return values (123 and 124).  Now, if the
14299         expected error occurs, the compiler exits with success (exit value
14300         0).  If the compilation completes without seeing that particular
14301         error, the compiler exits with failure (exit value 1).  The
14302         makefile in mcs/errors has been changed to handle the new behaviour.
14303
14304         * report.cs: Made 'expected error' number a property and renamed
14305         it from 'Probe' to 'ExpectedError'.
14306
14307         * genericparser.cs: Removed error handling support, since it is
14308         now all done by Report class.
14309
14310         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14311         class, so parse() no longer returns an int.
14312
14313         * namespace.cs: Use Report.Error instead of GenericParser.error
14314
14315 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14316
14317         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14318         TypeContainer.AddOperator): At the front of the list put the
14319         explicit implementations, so they get resolved/defined first. 
14320
14321 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14322
14323         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14324         interface type is implemented by this TypeContainer.  Used during
14325         explicit interface implementation.
14326
14327         (Property.Define, Indexer.Define, Method.Define): Validate that
14328         the given interface in the explicit implementation is one of the
14329         base classes for the containing type.
14330
14331         Also if we are explicitly implementing an interface, but there is
14332         no match in the pending implementation table, report an error.
14333
14334         (Property.Define): Only define the property if we are
14335         not explicitly implementing a property from an interface.  Use the
14336         correct name also for those properties (the same CSC uses,
14337         although that is really not needed).
14338
14339         (Property.Emit): Do not emit attributes for explicitly implemented
14340         properties, as there is no TypeBuilder.
14341
14342         (Indexer.Emit): ditto.
14343
14344         Hiding then means that we do not really *implement* a pending
14345         implementation, which makes code fail.
14346
14347 2002-06-22  Martin Baulig  <martin@gnome.org>
14348
14349         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14350         the return value of Object.GetType().  [FIXME: we need to do this whenever
14351         we get a type back from the reflection library].
14352
14353 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14354
14355         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14356
14357 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * attribute.cs: Return null if we can not look up the type.
14360
14361         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14362         the interface types found.
14363
14364         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14365         interface types found.
14366
14367         * typemanager.cs (GetInterfaces): Make this routine returns alll
14368         the interfaces and work around the lame differences between
14369         System.Type and System.Reflection.Emit.TypeBuilder in the results
14370         result for GetInterfaces.
14371
14372         (ExpandInterfaces): Given an array of interface types, expand and
14373         eliminate repeated ocurrences of an interface.  This expands in
14374         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14375         be IA, IB, IC.
14376
14377 2002-06-21  Martin Baulig  <martin@gnome.org>
14378
14379         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14380         on System.Enum.
14381
14382 2002-06-21  Martin Baulig  <martin@gnome.org>
14383
14384         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14385         and called with one of the core types, return the corresponding typebuilder for
14386         that type.
14387
14388         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14389         element type.
14390
14391 2002-06-21  Martin Baulig  <martin@gnome.org>
14392
14393         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14394         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14395         (Expression.ConvertReferenceExplicit): Likewise.
14396
14397         * expression.cs (ElementAccess.DoResolve): Likewise.
14398         (ElementAccess.DoResolveLValue): Likewise.
14399
14400 2002-06-10  Martin Baulig  <martin@gnome.org>
14401
14402         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14403         add the "value" parameter to the parameter list.
14404
14405         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14406         to our caller.
14407
14408 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14411         the argument to an int, uint, long or ulong, per the spec.  Also
14412         catch negative constants in array creation.
14413
14414 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14415
14416         * class.cs: do not allow the same interface to appear twice in
14417         the definition list.
14418
14419 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14420
14421         * ecore.cs: don't use ldlen with System.Array.
14422
14423 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14424
14425         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14426
14427 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14428
14429         * modifiers.cs: produce correct field attributes for protected
14430         internal. Easy fix so miguel can work on ther harder stuff:-)
14431
14432 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * pending.cs: New file.  Move the code from class.cs here.
14435         Support clearning the pending flag for all methods (when not doing
14436         explicit interface implementation).
14437
14438 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14439
14440         * rootcontext.cs: added a couple more types needed to bootstrap.
14441
14442 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14443
14444         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14445         constructor in the type, instead of any constructor in the type
14446         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14447         a bug in the Mono runtime when applying the params attribute). 
14448
14449 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14450         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14451
14452 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14453
14454         * expression.cs (Unary.ResolveOperator): Use TypeManager
14455         to resolve the type.
14456
14457 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14458
14459         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14460         attached.
14461
14462         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14463         with each member too.
14464
14465         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14466         field builders too - this takes care of the enum member case.
14467
14468 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14469
14470         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14471         address-of operator on both value types and pointers.
14472
14473 2002-06-10  Martin Baulig  <martin@gnome.org>
14474
14475         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14476         PropertyBuilder to the `property_builders' list.
14477
14478         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14479         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14480         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14481         find any indexers which are inherited from an interface.
14482
14483 2002-06-09  Martin Baulig  <martin@gnome.org>
14484
14485         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14486         the same type as the constant if necessary.  There's also a test-130.cs
14487         for this.
14488
14489         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14490
14491         * typemanager.cs (TypeManager.ChangeType): Previously known as
14492         Enum.ChangeEnumType().
14493
14494 2002-06-09  Martin Baulig  <martin@gnome.org>
14495
14496         * expression.cs (Cast.TryReduce): Added support for consts.
14497
14498 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14499
14500         * class.cs (Accessor): Hold attributes information so we can pass
14501         it along.
14502
14503         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14504         Modify to pass in attributes attached to the methods.
14505
14506         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14507
14508         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14509         to handle the Accessor kind :-)
14510
14511         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14512
14513 2002-06-08  Martin Baulig  <martin@gnome.org>
14514
14515         * expression.cs (Unary.TryReduceNegative): Added support for
14516         ULongConstants.
14517
14518 2002-06-08  Martin Baulig  <martin@gnome.org>
14519
14520         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14521         name can't be found in the `defined_names' - the caller will do a
14522         MemberLookup in this case and thus find methods in System.Enum
14523         such as Enum.IsDefined().
14524
14525 2002-06-08  Martin Baulig  <martin@gnome.org>
14526
14527         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14528         Convert.ChangeType() which works with TypeBuilder created types.
14529         (Enum.LookupEnumValue, Enum.Define): Use it here.
14530
14531         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14532         `TypeBuilder.BaseType != null' check.
14533         (TypeContainer.FindMembers): Only lookup parent members if we
14534         actually have a parent.
14535         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14536         (ConstructorInitializer.Resolve): Likewise.
14537
14538         * interface.cs (Interface.FindMembers): Added
14539         `TypeBuilder.BaseType != null' check.
14540
14541         * rootcontext.cs (RootContext.ResolveCore): Added
14542         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14543         classes_second_stage.
14544
14545         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14546         debug_type and trace_type when compiling with --nostdlib.       
14547
14548 2002-06-07  Martin Baulig  <martin@gnome.org>
14549
14550         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14551         (AddField): Set it to true when adding a non-static field.
14552         (DefineType): Use `have_nonstatic_fields' to find out whether we
14553         have non-static fields, not `Fields != null'.
14554
14555 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14558         dereferencing a null on the static-field code path)
14559
14560 2002-05-30  Martin Baulig  <martin@gnome.org>
14561
14562         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14563         to take command line arguments.  Use reflection to call the new
14564         custom `Initialize' function on the symbol writer and pass it the
14565         command line arguments.
14566
14567         * driver.cs (--debug-args): New command line argument to pass command
14568         line arguments to the symbol writer.
14569
14570 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14571
14572         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14573         the target type for indexers and properties.  Thanks to Joe for
14574         catching this.
14575
14576 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * typemanager.cs (MethodFlags): returns the method flags
14579         (Obsolete/ShouldIgnore) that control warning emission and whether
14580         the invocation should be made, or ignored. 
14581
14582         * expression.cs (Invocation.Emit): Remove previous hack, we should
14583         not do this on matching a base type, we should do this based on an attribute
14584
14585         Only emit calls to System.Diagnostics.Debug and
14586         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14587         on the command line.
14588
14589         * rootcontext.cs: Global settings for tracing and debugging.
14590
14591         * cs-tokenizer.cs (define): New utility function to track
14592         defines.   Set the global settings for TRACE and DEBUG if found.
14593
14594 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14595
14596         * interface.cs (Populate*): Pass in the TypeContainer as well as
14597         the DeclSpace as parameters so that we can create EmitContexts and
14598         then use that to apply attributes etc.
14599
14600         (PopulateMethod, PopulateEvent, PopulateProperty)
14601         (PopulateIndexer): Apply attributes everywhere.
14602
14603         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14604         etc.
14605
14606         (ApplyAttributes): Update accordingly.
14607
14608         We now apply interface attributes for all members too.
14609
14610 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14611
14612         * class.cs (Indexer.Define); Correctly check if we are explicit
14613         implementation (instead of checking the Name for a ".", we
14614         directly look up if the InterfaceType was specified).
14615
14616         Delay the creation of the PropertyBuilder.
14617
14618         Only create the PropertyBuilder if we are not an explicit
14619         interface implementation.   This means that explicit interface
14620         implementation members do not participate in regular function
14621         lookups, and hence fixes another major ambiguity problem in
14622         overload resolution (that was the visible effect).
14623
14624         (DefineMethod): Return whether we are doing an interface
14625         implementation. 
14626
14627         * typemanager.cs: Temporary hack until we get attributes in
14628         interfaces (Ravi is working on that) and we get IndexerName
14629         support in interfaces.
14630
14631         * interface.cs: Register the indexers as properties.
14632
14633         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14634         warning, I have verified that this is a bug in the .NET runtime
14635         (JavaScript suffers of the same problem).
14636
14637         * typemanager.cs (MemberLookup): When looking up members for
14638         interfaces, the parent of an interface is the implicit
14639         System.Object (so we succeed in searches of Object methods in an
14640         interface method invocation.  Example:  IEnumerable x;  x.ToString
14641         ()) 
14642
14643 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14644
14645         * class.cs (Event): Events should also register if they do
14646         implement the methods that an interface requires.
14647
14648         * typemanager.cs (MemberLookup); use the new GetInterfaces
14649         method. 
14650
14651         (GetInterfaces): The code used to lookup interfaces for a type is
14652         used in more than one place, factor it here. 
14653
14654         * driver.cs: Track the errors at the bottom of the file, we kept
14655         on going.
14656
14657         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14658         instance if the method we are calling is static!
14659
14660 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * attribute.cs (ApplyAttributes): Make this function filter out
14663         the IndexerName attribute (as that attribute in reality is never
14664         applied) and return the string constant for the IndexerName
14665         attribute. 
14666
14667         * class.cs (TypeContainer.Emit): Validate that all the indexers
14668         have the same IndexerName attribute, and if so, set the
14669         DefaultName attribute on the class. 
14670
14671         * typemanager.cs: The return value might contain other stuff (not
14672         only methods).  For instance, consider a method with an "Item"
14673         property and an Item method.
14674
14675         * class.cs: If there is a problem with the parameter types,
14676         return. 
14677
14678 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14679
14680         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14681         looks at user defined conversion after making a call to 
14682         StandardConversionExists - we need this for overload resolution.
14683
14684         * expression.cs : Update accordingly the various method calls.
14685
14686         This fixes 2 bugs filed against implicit user defined conversions 
14687
14688 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * statement.cs: Track the result of the assignment.
14691
14692 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14693
14694         * expression.cs (MemberAccess): Improved error reporting for
14695         inaccessible members.
14696
14697 2002-05-22  Martin Baulig  <martin@gnome.org>
14698
14699         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14700         itself with debugging support.
14701
14702 2002-05-22  Martin Baulig  <martin@gnome.org>
14703
14704         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14705         Removed, this isn't needed anymore.
14706
14707 2002-05-20  Martin Baulig  <martin@gnome.org>
14708
14709         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14710         be underlying type for an enum.
14711
14712 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14713
14714         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14715         that splits out the loading of just the core types.
14716
14717         * rootcontext.cs (ResolveCore): Split the struct resolution in
14718         two, so we can load the enumeration underlying types before any
14719         enums are used.
14720
14721         * expression.cs (Is): Bandaid until we fix properly Switch (see
14722         bug #24985 for details).
14723
14724         * typemanager.cs (ImplementsInterface): The hashtable will contain
14725         a null if there are no interfaces implemented.
14726
14727 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * cs-parser.jay (indexer_declarator): It is fine to have array
14730         parameters
14731
14732 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14733
14734         * typemanager.cs: (RegisterBuilder): New function used to register
14735         TypeBuilders that implement interfaces.  Since
14736         TypeBuilder.GetInterfaces (as usual) does not work with lame
14737         Reflection.Emit. 
14738         (AddUserType): register interfaces.
14739
14740         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14741         dealing with TypeBuilder.  Also, arrays are showing up as
14742         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14743         methods can not be invoked on them!
14744
14745         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14746         (ImplicitReferenceConversionExists): Split out from
14747         StandardConversionExists. 
14748
14749         * expression.cs (As): We were only implementing one of the three
14750         cases for the as operator.  We now implement them all.
14751         (Is): Implement the various other cases for Is as well.
14752
14753         * typemanager.cs (CACHE): New define used to control if we want or
14754         not the FindMembers cache.  Seems to have a negative impact on
14755         performance currently
14756
14757         (MemberLookup): Nested types have full acess to
14758         enclosing type members
14759
14760         Remove code that coped with instance/static returns for events, we
14761         now catch this in RealFindMembers.
14762
14763         (RealFindMembers): only perform static lookup if the instance
14764         lookup did not return a type or an event.  
14765
14766 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * assign.cs (CompoundAssign): We pass more semantic information
14769         now to Compound Assignments than we did before: now we have all
14770         the information at hand, and now we resolve the target *before* we
14771         do the expression expansion, which allows the "CacheValue" method
14772         to have the effect we intended (before, a [x] += 1 would generate
14773         two differen ArrayAccess expressions from the ElementAccess,
14774         during the resolution process).
14775
14776         (CompoundAssign.DoResolve): Resolve target and original_source here.
14777
14778 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14779
14780         * expression.cs (ArrayAccess): dropped debugging information. 
14781
14782         * typemanager.cs: Small bug fix: I was always returning i_members,
14783         instead of one of i_members or s_members (depending on which had
14784         the content).
14785
14786         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14787         method is invoked before any code generation takes place, and it
14788         is a mechanism to inform that the expression will be invoked more
14789         than once, and that the method should use temporary values to
14790         avoid having side effects
14791
14792         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14793
14794         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14795         implementation.
14796
14797         * expression.cs (Indirection, ArrayAccess): Add support for
14798         CacheTemporaries in these two bad boys. 
14799
14800         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14801         ldobj or ldind_ref.  
14802         (StoreFromPtr): Handle stobj as well.
14803
14804         * expression.cs (UnaryMutator): Share more code.
14805
14806         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14807         down: I was not tracking the Filter function as well, which
14808         was affecting the results of the cache.
14809
14810 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14811
14812         * attribute.cs: Remove the hack to handle the CharSet property on
14813         StructLayouts. 
14814
14815 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * attribute.cs (DoResolve): More uglyness, we now only try to
14818         resolve the attribute partially, to extract the CharSet
14819         information (only if we are a StructLayout attribute).  Otherwise 
14820
14821         (GetExtraTypeInfo): Add some code to conditionally kill in the
14822         future this.   I am more and more convinced that the .NET
14823         framework has special code to handle the attribute setting on
14824         certain elements.
14825
14826         * expression.cs (IsParamsMethodApplicable): Revert my previous
14827         foreach change here, it was wrong.
14828
14829 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14830
14831         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14832         (pp_expr): do not abort on unknown input, just return.
14833         (eval): abort if there are pending chars.
14834
14835         * attribute.cs (Attribute.Resolve): Positional parameters are
14836         optional.  Deal with that case.
14837
14838         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14839         the Ansi/Unicode/Auto information for the type.
14840
14841         (TypeContainer.DefineType): instantiate the EmitContext here, as
14842         we will be using it during the type definition (to resolve
14843         attributes) and during the emit phase.
14844
14845         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14846         to pull type information out of the attributes
14847
14848         (Attribute.Resolve): track the constructor builder, and allow for
14849         multiple invocations (structs and classes will use this).
14850
14851         * ecore.cs (MemberLookupFinal): new version with all the
14852         parameters customizable.
14853
14854         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14855         constructors.  Return if the result value is null (as the error
14856         would have been flagged already by MemberLookupFinal)
14857
14858         Do not allow instances of abstract classes or interfaces to be
14859         created.
14860
14861         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14862         We have to compare the assembly property here when dealing with
14863         FamANDAssem and Assembly access modifiers, because we might be
14864         creating an assembly from *modules* (that means that we are not
14865         getting TypeBuilders for types defined in other modules that are
14866         part of this assembly).
14867
14868         (Method.Emit): If the method is marked abstract and has a body,
14869         emit an error. 
14870
14871         (TypeContainer.DefineMembers): If both the defined member and the
14872         parent name match are methods, then do not emit any warnings: let
14873         the Method.Define routine take care of flagging warnings.  But if
14874         there is a mismatch (method overrides something else, or method is
14875         overriwritten by something, then emit warning).
14876
14877         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14878         set to null, this means `do not check for the return type on the
14879         signature'. 
14880
14881         (Method.Define): set the return type for the method signature to
14882         null, so that we get methods with the same name and parameters and
14883         different return types.  This is used to flag warning 114 (you are
14884         hiding a method, and you probably want to use the new/override
14885         keywords instead).
14886
14887         * typemanager.cs (MemberLookup): Implemented proper access
14888         control, closing a long standing set of bug reports.  The problem
14889         was that the Framework only has two bits: Public and NonPublic,
14890         and NonPublic includes private and protected methods, but we need
14891         to enforce the FamANDAssem, FamOrAssem and Family. 
14892
14893 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14894
14895         * statement.cs (GotoCase): Return true: Ammounts to giving up
14896         knowledge on whether we return or not, and letting the other case
14897         be responsible for it.
14898
14899 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * driver.cs: Do not load directories for each file processed, only
14902         do it if there is a pattern.
14903
14904         * ecore.cs: Report readonly assigns here as well, as we might have
14905         been resolved only by MemberAccess.
14906
14907         (SimpleName.SimpleNameResolve): Also be useful for LValue
14908         resolution.   We need this to propagate assign to local readonly variables
14909
14910         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14911         do not want to reuse potential criteria memory.
14912
14913         * class.cs (MyEventBuilder): Set reflected_type;
14914
14915         * ecore.cs (Constantify): Added support for constifying bools.
14916
14917         (RootContext.LookupType): Added a cache for values looked up in
14918         the declaration space.
14919
14920         * typemanager.cs (FindMembers): Now is a front-end to
14921         RealFindMembers, and provides a two-level hashtable-based cache to
14922         the request.  
14923
14924         15% performance improvement: from 22.5 to 19.2 seconds.
14925
14926         * expression.cs (IsParamsMethodApplicable): use foreach.
14927         (Invocation.DoResolve): ditto.
14928         (New.DoResolve): ditto.
14929         (ArrayCreation.DoResolve): ditto.
14930
14931         * ecore.cs (FindMostEncompassingType): use foreach.
14932
14933         * delegate.cs (NewDelegate.DoResolve): Use foreach
14934
14935         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14936         (RemoveMethods): use foreach.
14937
14938         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14939         nested foreach statements instead of for, and also break out of
14940         the inner loop once a match is found.
14941
14942         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14943
14944 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14945
14946         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14947         we actually unwrap the expression to allow for extra information
14948         to be extracted. 
14949
14950         * expression.cs: Use Shr_Un on unsigned operations. 
14951
14952 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14953
14954         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14955         applicable operators was not being considered correctly. This closes
14956         the bug Miguel reported.
14957
14958 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14959
14960         * attribute.cs: check that the type derives from System.Attribute
14961         and report the correct error in that case (moved the duplicate code to
14962         its own method, too).
14963
14964 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14965
14966         * attribute.cs: lookup attribute type name as the spec says: first the
14967         bare attribute name and then name + "Attribute" (nant compiles with
14968         mcs after this fix).
14969
14970 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14973         Because of the way we parse things, we should try to see if a
14974         UIntConstant can fit in an integer.
14975
14976 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14977
14978         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14979         when we are in an explicit context.
14980
14981         (ConvertReferenceExplicit): When converting from Iface type S to Class
14982         T make sure the rules are implemented as an OR.
14983
14984         * parameter.cs (ParameterType): Make it a property for now although the
14985         purpose really isn't anything immediate.
14986
14987         * expression.cs (Is*Applicable): Do better checking on the parameter type
14988         of a ref/out parameter. The ones from the system assemblies are already 
14989         marked with the correct type so we don't need to do any correction.
14990
14991         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14992         the object type is standard too so include that.
14993
14994 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14995
14996         * ecore.cs (StandardConversionExists): Augment with missing code:
14997         deal with IntConstant, LongConstants and Enumerations.
14998
14999         * assign.cs: Report the error, instead of failing silently
15000
15001         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15002         typecontainer that they are declared, because the
15003         typecontainer/namespace will have the list of using clauses that
15004         need to be applied.
15005
15006         Assembly Attributes were escaping the normal registration
15007         mechanism. 
15008
15009         (EmitCode): Apply attributes within an EmitContext that represents
15010         the container they were declared on.
15011
15012         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15013
15014 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15015
15016         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15017         Revamp completely - make much cleaner as we now operate only
15018         on a set of Types.
15019
15020         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15021         to implement the logic detailed in the spec more correctly.
15022
15023         (UserDefinedConversion): Update accordingly.
15024
15025 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15026
15027         * statement.cs: Return flow analysis information up.
15028
15029         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15030         and the default.
15031
15032         (token): Do not consume an extra character before calling
15033         decimal_digits.
15034
15035 2002-05-06  Piers Haken <piersh@friskit.com>
15036
15037         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15038
15039 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15042         EmitContext during the instance constructor initializer
15043         resolution, to stop access to instance variables.
15044
15045         This is mandated by the spec, last paragraph of the `constructor
15046         initializers' section. 
15047
15048 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * cs-parser.jay, class.cs (Accessor): new class used to represent
15051         an accessor (get or set).  In the past we used `null' to represent
15052         a missing accessor.  But this is ambiguous because there was no
15053         way to tell in abstract indexers/properties if one of them was
15054         specified.
15055
15056         Now there is a way of addressing that.
15057
15058         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15059         instead of FindMembers.
15060
15061         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15062         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15063
15064         * attribute.cs: Treat indexers and properties as the same in terms
15065         of applying attributes
15066
15067         * ecore.cs (FindMostEncompassedType): Use statically initialized
15068         EmptyExpressions()s like we do elsewhere to avoid creating useless
15069         objects (and we take this out of the tight loop).
15070
15071         (GetConversionOperators): Move the code to extract the actual
15072         operators to a separate routine to clean things up.
15073
15074 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15077         events are always registered FieldBuilders.
15078
15079         * class.cs (FieldBase): New class shared by Fields 
15080
15081         * delegate.cs: If we are a toplevel delegate, use our full name.
15082         If we are a nested delegate, then only use our tail name.
15083
15084 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15085
15086         * expression.cs (IsApplicable): Ensure that we add the "&" to
15087         ref/out types before comparing it with the type of the argument.
15088
15089         (IsParamsMethodApplicable): Ditto.
15090
15091         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15092         silly me ;-)
15093
15094         * delegate.cs : Handle the case when we have more than one applicable
15095         method. Flag an error only when we finish checking all.
15096
15097 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * expression.cs: Add support for boolean static initializers.
15100
15101 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15102
15103         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15104
15105         * parameter.cs (ComputeParameterTypes,
15106         ComputeAndDefineParameterTypes): Better error handling: now we
15107         clear the `types' cache if we fail during any of the type lookups.
15108         We also return the status code correctly to our caller
15109
15110         * delegate.cs: If we fail to define a delegate, abort the extra
15111         steps. 
15112
15113         * expression.cs (Binary.ResolveOperator): for
15114         operator==(object,object) and operator !=(object, object) we also
15115         have to verify that there is an implicit conversion from one to
15116         the other.
15117
15118         (ArrayAccess.DoResolve): Array Access can operate on
15119         non-variables. 
15120
15121 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * assign.cs (CompoundAssign): A new class used as a "flag" that
15124         the assignment actually is happening as part of a compound
15125         assignment operator.
15126
15127         During compound assignment, a few new rules exist to enable things
15128         like:
15129
15130         byte b |= 1 + 2
15131
15132         From the spec:
15133
15134         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15135         to the type of x) if y is implicitly convertible to the type of x,
15136         and the operator is a builtin operator and the return type of the
15137         operator is explicitly convertible to the type of x. 
15138
15139         * rootcontext.cs: Reset warning level to 2.  4 catches various
15140         "interesting" features in mcs, we must clean this up at some
15141         point, but currently am trying to kill other bugs ;-)
15142
15143         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15144         in container classes as well.  
15145
15146         * expression.cs (Binary.ResolveOperator): Handle string case
15147         before anything else (as operator overloading does emit an error
15148         before doing anything else).
15149
15150         This code could go away when we move to a table driven model, but
15151         i could not come up with a good plan last night.
15152
15153 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15154
15155         * typemanager.cs (CSharpName): reimplementation using regex.
15156         * class.cs: added null check for fields in Emit
15157         * rootcontext.cs: set warninglevel to 4
15158
15159 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15160
15161         * typemanager.cs (CSharpName): reimplemented with Lupus
15162         suggestion.
15163
15164 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15165
15166         * statement.cs (If): correclty implement Resolve, because we were
15167         not catching sem errors in there.  The same process is needed
15168         everywhere else. 
15169         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15170
15171
15172         (Statement.Warning_DeadCodeFound): Factorize code.
15173         (While): Report dead code here too.
15174
15175         (Statement): Added Resolve virtual method to allow
15176         for resolution split from the emit code.
15177
15178 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15179
15180         * statement.cs (EmitBoolExpression): No longer try to resolve the
15181         expression here.    
15182         (MakeBoolean): New utility function that resolve, implicitly
15183         converts to boolean and tags the expression. 
15184
15185
15186         (If, Do): Implement dead code elimination.
15187         (While): Implement loop inversion
15188
15189         (Do, While, For, If): Resolve the expression prior to calling our
15190         code generation.
15191
15192 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15193
15194         * class.cs:
15195           - added method Report28 (warning: program has more than one entry point)
15196           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15197           - modified method Method.Define, the part at the end of the method
15198
15199         * rootcontext.cs: added static public Location EntryPointLocation;
15200           
15201         * ../errors/cs0028.cs : Add test case for the above warning.              
15202
15203         * typemanager.cs:
15204           - modified method CSharpName to allow arrays of primitive type to
15205             be printed nicely (e.g. instead of System.Int32[][] it now prints
15206             int[][])
15207           - added method CSharpSignature: returns the signature of a method
15208             in string format to be used in reporting errors, warnings, etc.
15209
15210         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15211         with String.Empty.
15212
15213 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15214
15215         * delegate.cs (Define): Fix extremely silly bug where I was
15216         setting the type of the 'object' parameter of the BeginInvoke
15217         method to System.IAsyncResult instead of System.Object ;-)
15218
15219 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15222         here. 
15223
15224         (Constructor.Emit): return if we fail to initialize the
15225         constructor.  Another door closed!  
15226
15227         * expression.cs (New.DoResolve): Improve error message (from -6 to
15228         1501).  Use DeclaredOnly lookup to find the exact constructor.
15229
15230         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15231         loop.  This is useful.
15232
15233         * cs-parser.jay: Adjust the default parameters so that destructors
15234         have the proper signature.
15235
15236 2002-04-26  Martin Baulig  <martin@gnome.org>
15237
15238         * driver.cs (LoadAssembly): If `assembly' contains any characters
15239         which are only valid in path names and not in assembly names
15240         (currently slash, backslash and point), use Assembly.LoadFrom ()
15241         instead of Assembly.Load () on the `assembly' (before iteration
15242         over the link_paths).
15243
15244 2002-04-26  Martin Baulig  <martin@gnome.org>
15245
15246         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15247
15248 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15249
15250         * class.cs (Property): use the new typemanager.MemberLookup
15251
15252         (TypeContainer.MemberLookup): Implement using the
15253         TypeManager.MemberLookup now. 
15254
15255         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15256         and return MemberInfos, so that these can be used without an
15257         EmitContext (what we had before).
15258
15259 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * expression.cs: Fix the case where the argument to params if the
15262         type of the params.  I omitted handling this before.   Fixed
15263
15264 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * driver.cs: Call BootCorlib_PopulateCoreType
15267
15268         * class.cs (Property.CheckBase): Check for properties only, not
15269         for all members. 
15270
15271         * interface.cs: Temporary hack: try/catch around the
15272         CustomAttributeBuilder, because I am getting an exception that I
15273         do not understand.
15274
15275         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15276         types whose definitions are required to be there (attributes are
15277         defined before standard types).
15278
15279         Compute definitions as we boot the various types, as they are used
15280         immediately (value_type class will need object_type, but if we do
15281         not initialize object_type, we will pass a null, which will let
15282         the runtime pick the System.Object from the existing corlib, which
15283         is not what we want).
15284
15285 2002-04-22  Patrik Torstensson <totte@labs2.com>
15286
15287         * cs-tokenizer.cs: fixed a number of trim() issues.
15288
15289 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15290
15291         * expression.cs (Argument.Type): Ensure that we return the correct
15292         type when we have out or ref parameters [in which case we 
15293         append a "&"].
15294
15295 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * class.cs (Property, Indexer): Allow extern modifier in there. 
15298
15299         * typemanager.cs (InitBaseTypes): Initializes object_type and
15300         value_type, since those will be used early on during the bootstrap
15301         process to compile corlib.
15302
15303         (InitCoreTypes): Move code from here to InitBaseTypes.
15304
15305 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15308         single-dimension arrays as using the ldlen opcode.  
15309
15310         Daniel Lewis discovered this optimization.  
15311
15312         * typemanager.cs: Add signature for System.Array::get_Length
15313
15314 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15315
15316         * statement.cs: report the error when the foreach does not apply to an
15317         array nor a collection.
15318
15319 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * expression.cs: Add implicit conversions to the operator ~.
15322
15323         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15324
15325         * typemanager.cs: Locate the decimal constructor.
15326
15327 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15328
15329         * attribute.cs: use the new property of TypeOf.
15330         * expression.cs: added 'get' property around typearg.
15331
15332         These changes fix a build breaker reported by NickD. Is this the
15333         correct way to fix?  If not, please, revert my changes and make it
15334         work :-).
15335
15336 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15337
15338         * attribute.cs: Add support for typeof in attribute invocations.
15339         I am not sure that this is right though.
15340
15341 2002-04-14  Duncan Mak  <duncan@ximian.com>
15342
15343         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15344         Binary.Operator.Division case.
15345
15346 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15347
15348         * class.cs (DefineType): Ensure that we do a proper check on
15349         attribute types and also register it with the TypeManager.
15350
15351         (TypeContainer.Targets): The default for attribute types is
15352         AttributeTargets.All.
15353
15354         * attribute.cs (ApplyAttributes): Registering the attribute type
15355         is done elsewhere, not when we discover we have a Usage attribute.
15356
15357 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15358
15359         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15360         and get rid of is_delegate parameter.
15361
15362         * everywhere : update.
15363
15364 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15365
15366         * cs-parser.jay (compilation_unit): Revamp completely to use
15367         some new ideas that I got from Rhys' grammar to solve the problems
15368         with assembly level attributes.
15369
15370         (outer_declaration): New grammar production.
15371
15372         (attribute_sections): Add.
15373
15374         (opt_attributes): Base on attribute_sections
15375
15376         (namespace_declaration): Allow opt_attributes to tackle the case
15377         when we have assembly level attributes - we are clever in this
15378         regard now ;-)
15379
15380         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15381         attributes in the non-global context.
15382
15383         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15384         instead of SetGlobalAttributes.
15385
15386         * class.cs, rootcontext.cs : Ensure we define and generate 
15387         attribute types before anything else.
15388
15389         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15390         and flag the new error -20 for the case when the attribute type
15391         does not have valid targets specified. csc does not catch this.
15392
15393         * ../errors/errors.txt : update for error # -20
15394
15395 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15396
15397         * support.cs (InternalParameters.ParameterModifier): Do some null
15398         checking and return sane values.
15399
15400         * class.cs (Method.Define): If we are a PInvoke method, ensure
15401         that we are static and extern. Report error # 601
15402
15403         * ../errors/cs0601.cs : Add test case for the above error.
15404
15405 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15406
15407         * rootcontext.cs (attribute_types): We need to keep type of
15408         all attribute types separately and emit code for them first.
15409
15410         (RegisterAttribute) : Implement.
15411
15412         * class.cs (DefineType): Check if the current Type is a custom
15413         attribute type and register it accordingly.
15414
15415         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15416         adding the first attribute twice and rename to
15417
15418         (SetGlobalAttributes): this.
15419
15420         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15421         lookups.
15422
15423         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15424         if we are processing global arguments. Hmm, I am unsure of this.
15425
15426 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15427
15428         * expression.cs: added static array of strings to avoid calling
15429         Enum.ToString () for Operator in Binary. Significant recover of
15430         performance.
15431
15432 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * class.cs (FindMembers): Allow the Builders of the various
15435         members to be null.  If they are skip them.  This only happens
15436         during the PInvoke declaration.
15437
15438 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15441         failure, so we do not keep going afterwards.
15442
15443         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15444         wanted to pass `false' as the `is_delegate' argument.  If this is
15445         the case, why not use delegate_type == null to mean `is_delegate =
15446         false' and anything else as is_delegate = true.
15447
15448 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15449
15450         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15451         code for the section, not the beginning of the tests.
15452
15453 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15456
15457         * expression.cs (Binary): same.  Warn about errors where we have
15458         Enum/Enum in operator + as well.
15459
15460 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15461
15462         * statement.cs:
15463                 - added support for switch(bool)
15464                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15465                 - add TableSwitchEmit() to handle table-based switch statements
15466
15467 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15468
15469         * expression.cs (Invocation.OverloadResolve): Factor out code which
15470         does parameter compatibility checking with arguments so that we can 
15471         re-use the code even from Delegate.VerifyApplicability
15472
15473         (VerifyArgumentsCompat): Move above code here.
15474
15475         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15476         and instead make a call to the above method.
15477
15478 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15479
15480         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15481         We use it to keep track of classes which are attribute types.
15482
15483 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * delegate.cs (Delegate.Define): Correctly define the types in the
15486         presence of fixed and array parameters.
15487
15488         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15489         doing FindMembers.
15490
15491         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15492         include NonPublic after the first iteration.
15493
15494         * class.cs (Indexer.CheckBase): Only check if both parents are
15495         non-null. 
15496
15497         * cs-parser.jay (accessor_body): If empty, set to null.
15498
15499         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15500         same code path here to resolve constants names that we did have in
15501         MemberAccess.DoResolve.  There is too much code duplicated here.
15502
15503 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15506
15507         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15508         to MakeUnionSet.
15509
15510         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15511         tokens, numbers and strings.
15512
15513         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15514         parenthesis.
15515
15516         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15517         asyncronous parameters and the regular parameters.  
15518
15519         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15520         specify the target directory.
15521
15522         * expression.cs: (This.DoResolve): Simplify
15523         (As.Emit): Optimize, do not generate IsInst if the expression is
15524         always of the given type.
15525
15526         (Is.DoResolve): Bug fix, we were reporting both always/never for
15527         the is expression.
15528
15529         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15530         creating too many unnecessary arrays.
15531
15532 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15533
15534         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15535         fields instead of rolling our own initializer.   Takes care of all
15536         implicit conversions, and drops unnecessary static checks/argument.
15537
15538 2002-03-31  Dick Porter  <dick@ximian.com>
15539
15540         * driver.cs: use the GetDirectories() return values properly, and
15541         use "/" as path separator.
15542
15543 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15544
15545         * expression.cs (Unary): Optimize - - expr into expr.
15546         (Binary): Optimize a + (-b) into a -b.
15547
15548         * codegen.cs (CodeGen): Made all methods static.
15549
15550 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15551
15552         * rootcontext.cs: 
15553
15554         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15555         TypeBuilder property.
15556
15557         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15558         instead. 
15559
15560         * tree.cs: Removed the various RecordXXXX, and replaced with a
15561         single RecordDecl.  Removed all the accessor methods, and just
15562         left a single access point Type 
15563
15564         * enum.cs: Rename DefineEnum to DefineType.
15565
15566         * decl.cs: New abstract method `DefineType' used to unify the
15567         Defines for Enumerations, Interfaces, TypeContainers and
15568         Delegates.
15569
15570         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15571         LookupBaseClasses method that used to live in class.cs and
15572         interface.cs here, and renamed to FindType.
15573
15574         * delegate.cs: Implement DefineType.  Take advantage of the
15575         refactored pattern for locating the parent builder without taking
15576         the parent_builder argument (which we know does not work if we are
15577         nested, and triggering a toplevel definition).
15578
15579 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15580
15581         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15582         accessibility of a member has changed during override and report
15583         an error if so.
15584
15585         * class.cs (Method.Define, Property.Define): Only complain on
15586         overrides if the method is private, any other accessibility is
15587         fine (and since we just checked the permission is the same, we are
15588         good to go).
15589
15590         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15591         and elif are processed always.  The other pre-processing
15592         directives are only processed if we are "taking" the path
15593
15594 2002-03-29  Martin Baulig  <martin@gnome.org>
15595
15596         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15597         current location is not Null.
15598
15599         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15600         a separate method so we can profile it.
15601
15602         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15603         `span.Seconds' are just seconds, but no minutes or hours.
15604         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15605
15606 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15609         Remove the gratuitous set of Final:
15610
15611                                 // If an interface implementation, then we can set Final.
15612                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15613                                     implementing.DeclaringType.IsInterface)
15614                                         flags |= MethodAttributes.Final;
15615
15616         I do not know what I was smoking when I used that.
15617
15618
15619         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15620         step into fixing the name resolution issues for delegates and
15621         unifying the toplevel name resolution.
15622
15623 2002-03-28  Martin Baulig  <martin@gnome.org>
15624
15625         * class.cs (Method.Emit): If we have a symbol writer, call its
15626         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15627         tell it about the current method.
15628
15629         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15630         writer that we're going to emit the first byte of IL code for a new
15631         statement (a new source line).
15632         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15633         EmitContext.Mark() before emitting any code.
15634
15635         * location.cs (SymbolDocument): Return null when we're Null.
15636
15637         * statement.cs (Statement): Moved the `Location loc' variable here.
15638         (Statement.EmitBoolExpression): If we have a symbol writer, call
15639         ec.Mark() before emitting any code to tell it that we're at the
15640         beginning of a new statement.
15641         (StatementExpression): Added `Location' argument to the constructor.
15642         (Block): Added public readonly variable `StartLocation' and public
15643         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15644         (Block): Added constructor which takes a start and end location.
15645         (Block.SetEndLocation): New method. This sets the end location.
15646         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15647         local variables we create.
15648         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15649         each statement and do also mark the begin and end of the block.
15650
15651         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15652         tell it the current lexer.Location, use Location.Null for the end of the
15653         block.
15654         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15655         current block, set its end location using SetEndLocation().
15656         (statement_expression): StatementExpression constructor now takes the
15657         lexer.Location as additional argument.
15658         (for_statement, declare_local_variables): Likewise.
15659         (declare_local_variables): When creating a new implicit block, use the
15660         new Block constructor and pass it the lexer.Location.
15661
15662 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15663
15664         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15665         members also on the parent interfaces recursively.
15666
15667 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15668
15669         * report.cs: Use new formats, since Gonzalo finished the missing
15670         bits. 
15671
15672         * expression.cs (Binary.ResolveOperator): added missing operator|
15673         operator& and operator^ for bool/bool.
15674
15675         * cs-parser.jay: CheckDef now takes a Location argument that is
15676         used to report errors more precisly (instead of reporting the end
15677         of a definition, we try to track something which is a lot closer
15678         to the source of the problem).
15679
15680         * cs-tokenizer.cs: Track global token use, so we can properly flag
15681         the use of #define/#undef after the first token has been seen.
15682
15683         Also, rename the reportXXXX to Error_DescriptiveName
15684
15685         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15686         TypeContainer, so that Enum and Interface can use this too.
15687
15688         * class.cs (TypeContainer.LookupInterfaceOrClass,
15689         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15690         `builder' argument.  Typically this was used to pass the parent
15691         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15692         the definition).  
15693
15694         The problem is that a nested class could trigger the definition of
15695         a toplevel class, and the builder would be obviously wrong in that
15696         case. 
15697
15698         So we drop this argument, and we compute dynamically the
15699         TypeBuilder/ModuleBuilder (the correct information was available
15700         to us anyways from DeclSpace.Parent)
15701
15702         * interface.cs (Interface.DefineInterface): Drop builder
15703         parameter cleanup like class.cs
15704
15705         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15706         like class.cs
15707
15708         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15709         values. 
15710
15711         (Try.Emit): Propagate the returns value from the statement.
15712
15713         (Return.Emit): Even if we are leavning 
15714
15715         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15716
15717         * modifiers.cs: Fix the computation of MethodAttributes flags.
15718
15719 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15720
15721         * driver.cs: allow compilation of files that start with '/'.
15722         Add a default case when checking the argument of --target.
15723
15724 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15725
15726         * interface.cs: Implement the same search algorithm for types in
15727         the interface code.
15728
15729         * delegate.cs: Do not allow multiple definition.
15730
15731         * Recovered ChangeLog that got accidentally amputated
15732
15733         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15734
15735         * rootcontext.cs: Load manually enum to allow core classes to
15736         contain enumerations.
15737
15738         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15739         Update to new static methods in TypeManager.
15740
15741         * typemanager.cs (GetMethod, GetConstructor): Use our
15742         implementation of FindMembers to find the members, since during
15743         corlib compilation, the types are TypeBuilders and GetMethod and
15744         GetConstructor do not work.
15745
15746         Make all methods in TypeManager static.
15747
15748         (InitCodeHelpers): Split the functionality from
15749         the InitCodeTypes function.
15750
15751         * driver.cs: Call InitCodeHelpers after we have populated the
15752         types. 
15753
15754         * cs-parser.jay (delegate_declaration): we did not used to compute
15755         the delegate name correctly for void delegates.
15756
15757 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15758
15759         * rootcontext.cs (RootContext): Init the interface_resolve_order
15760         and type_container_resolve_order always.
15761
15762         (ResolveCore, BootstrapCorlib_ResolveClass,
15763         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15764         compiler when compiling with --nostdlib
15765
15766         * class.cs (TypeContainer.DefineType): Check that our parent is
15767         not null.  This test is most important when we are bootstraping
15768         the core types.
15769
15770         * codegen.cs: Split out the symbol writing code.
15771
15772 2002-03-25  Martin Baulig  <martin@gnome.org>
15773
15774         * driver.cs (-g): Made -g an alias for --debug.
15775
15776 2002-03-24  Martin Baulig  <martin@gnome.org>
15777
15778         * codegen.cs (SymbolWriter): New public variable. Returns the
15779         current symbol writer.
15780         (CodeGen): Added `bool want_debugging_support' argument to the
15781          constructor. If true, tell the ModuleBuild that we want debugging
15782         support and ask it for the ISymbolWriter.
15783         (Save): If we have a symbol writer, call it's Close() method after
15784         saving the assembly.
15785
15786         * driver.c (--debug): New command line argument to create a
15787         debugger information file.
15788
15789         * location.cs (SymbolDocument): New public property. Returns an
15790         ISymbolDocumentWriter object for the current source file or null
15791         if we don't have a symbol writer.
15792
15793 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * driver.cs (LoadAssembly): Correctly return when all the paths
15796         have been tried and not before.
15797
15798         * statement.cs (Switch.Emit): return the actual coverage for this
15799         statement (returns/not-returns)
15800
15801         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15802         switch of the statement if we are the last switch section.  That
15803         kills two problems: try/catch problems (we used to emit an empty
15804         nop at the end) and switch statements where all branches would
15805         return. 
15806
15807 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * driver.cs: Add default assemblies (the equivalent to the
15810         Microsoft CSC.RSP file)
15811
15812         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15813         also update tokens_seen and set it to false.
15814
15815         * driver.cs: Implement --recurse for Mike.
15816
15817         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15818         correctly splitting out the paths.
15819
15820 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15821
15822         * interface.cs (Interface.PopulateProperty): Instead of using
15823         `parent' as the declaration space for the set parameters, use
15824         `this' 
15825
15826         * support.cs (InternalParameters): InternalParameters constructor
15827         takes a DeclSpace instead of a TypeContainer.
15828
15829         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15830         types are being initialized, load the address of it before calling
15831         the function.  
15832
15833         (New): Provide a mechanism to disable the generation of local
15834         value type temporaries when the caller will be providing us with
15835         an address to store it.
15836
15837         (ArrayCreation.EmitDynamicInitializers): Use it.
15838
15839 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * expression.cs (Invocation.EmitArguments): Only probe for array
15842         property if there is more than one argument.  Sorry about that.
15843
15844         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15845         empty param arrays.
15846
15847         * class.cs (Method.LabelParameters): Fix incorrect code path that
15848         prevented the `ParamArrayAttribute' from being applied to the
15849         params attribute.
15850
15851 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * support.cs (ReflectionParameters): Correctly compute whether the
15854         last argument is a params array.  Fixes the problem with
15855         string.Split ('a')
15856
15857         * typemanager.cs: Make the assemblies array always be non-null
15858         (empty, but non-null)
15859
15860         * tree.cs (RecordDecl): New function that abstracts the recording
15861         of names.  This reports error 101, and provides a pointer to the
15862         previous declaration.  Fixes a crash in the compiler.
15863
15864         * cs-parser.jay (constructor_declaration): Update to new grammar,
15865         and provide a constructor_body that can be empty.
15866
15867 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * driver.cs: Add support for --resources.
15870
15871         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15872         Make all types for the various array helper methods be integer.
15873
15874         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15875         CheckState to ConvCast.
15876
15877         (ConvCast): Now it takes a `checked' state argument, to avoid
15878         depending on the emit context for the conversion, and just using
15879         the resolve time setting.
15880
15881         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15882         instead of Invocation.EmitArguments.  We do not emit the original
15883         arguments, instead we emit those which have been converted to
15884         unsigned int expressions.
15885
15886         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15887
15888         * codegen.cs: ditto.
15889
15890         * expression.cs (LocalVariableReference): Drop the use of the
15891         Store function that depended on the variable index.
15892
15893         * statement.cs (VariableInfo): Drop the `Idx' property from this
15894         class, as this is not taking into account the indexes for
15895         temporaries tat we generate during the execution, getting the
15896         indexes wrong.
15897
15898         * class.cs: First emit class initializers, then call the parent
15899         constructor. 
15900
15901         * expression.cs (Binary): Fix opcode emision.
15902         (UnaryMutator.EmitCode): Support checked code generation
15903
15904         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15905         matches for events for both the Static and Instance scans,
15906         pointing to the same element.   Fix that.
15907
15908 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * rootcontext.cs (ResolveTree): Always set the
15911         interface_resolve_order, because nested interfaces will be calling
15912         into us.
15913
15914         * class.cs (GetInterfaceOrClass): Track the same resolution
15915         process used by TypeManager.LookupType.  This fixes the nested
15916         type lookups in class declarations (separate path from
15917         LookupType). 
15918
15919         (TypeContainer.DefineType): Also define nested interfaces.
15920         (TypeContainer.RegisterOrder): New public function used to
15921         register the order in which child interfaces need to be closed.
15922
15923         Nested interfaces need to be closed after their parents have been
15924         created. 
15925
15926         * interface.cs (InterfaceAttr): Put all the logic for computing
15927         the interface attribute here. 
15928
15929         (DefineInterface): Register our interface order with the
15930         RootContext or with the TypeContainer depending on the case.
15931
15932 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * cs-parser.jay: rework foreach statement to work with the new
15935         changes to the policy on SimpleNames.
15936
15937         * report.cs: support Stacktrace on warnings as well.
15938
15939         * makefile: drop --unsafe and /unsafe from the compile.
15940
15941 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15942
15943         * ecore.cs (StandardConversionExists): Modify to take an Expression
15944         as the first parameter. Ensure we do null -> reference type conversion
15945         checking.
15946
15947         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15948         temporary Expression objects.
15949
15950 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15951
15952         * interface.cs: workaround bug in method overloading resolution
15953         (there is already a bugzilla bug for it).
15954
15955 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15956
15957         We could also solve this problem by having a separate path for
15958         performing type lookups, instead of DoResolve, we could have a
15959         ResolveType entry point, and only participating pieces of the
15960         production (simplename, deref, array) would implement this. 
15961
15962         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15963         signal SimpleName to only resolve type names and not attempt to
15964         resolve anything else.
15965
15966         * expression.cs (Cast): Set the flag.
15967
15968         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15969
15970         * class.cs: Only report 108 if there is no `new' modifier.
15971
15972         * cs-parser.jay: rework foreach statement to work with the new
15973         changes to the policy on SimpleNames.
15974
15975         * report.cs: support Stacktrace on warnings as well.
15976
15977         * makefile: drop --unsafe and /unsafe from the compile.
15978
15979 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15980
15981         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15982         lookups here, instead of doing that at parse time.  This means
15983         that our grammar will not introduce `LocalVariableReferences' as
15984         expressions at this point.  That solves the problem of code like
15985         this:
15986
15987         class X {
15988            static void Main ()
15989            { int X = 1;
15990             { X x = null }}}
15991
15992         This is only half the fix.  The full fix requires parameters to
15993         also be handled in this way.
15994
15995         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15996         makes the use more obvious of the DeclSpace.  The
15997         ec.TypeContainer.TypeBuilder is now only used to pull the
15998         TypeBuilder for it.
15999
16000         My theory is that I can get rid of the TypeBuilder completely from
16001         the EmitContext, and have typecasts where it is used (from
16002         DeclSpace to where it matters).  
16003
16004         The only pending problem is that the code that implements Aliases
16005         is on TypeContainer, and probably should go in DeclSpace.
16006
16007         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16008         lookups here, instead of doing that at parse time.  This means
16009         that our grammar will not introduce `LocalVariableReferences' as
16010         expressions at this point.  That solves the problem of code like
16011         this:
16012
16013         class X {
16014            static void Main ()
16015            { int X = 1;
16016             { X x = null }}}
16017
16018         This is only half the fix.  The full fix requires parameters to
16019         also be handled in this way.
16020
16021         * class.cs (Property.DefineMethod): When implementing an interface
16022         method, set newslot, when implementing an abstract method, do not
16023         set the flag (before we tried never setting it, or always setting
16024         it, which is the difference).
16025         (Indexer.DefineMethod): same.
16026         (Method.DefineMethod): same.
16027
16028         * ecore.cs: Only set the status used flag if we get back a Field.
16029
16030         * attribute.cs: Temporary hack, so Paolo can keep working.
16031
16032 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16033
16034         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16035         the unmanaged type in the case we have a MarshalAs attribute.
16036
16037         (Resolve): Handle the case when we are parsing the special MarshalAs
16038         attribute [we need to store the unmanaged type to use later]
16039
16040         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16041         MarshalAs Attribute.
16042
16043         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16044         on parameters and accordingly set the marshalling info.
16045
16046 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16047
16048         * class.cs: Optimizing slightly by removing redundant code after
16049         we switched to the `NoTypes' return value.
16050         (Property.DefineMethod): use NoTypes here too.
16051
16052         This fixes the bug I introduced in my last batch of changes.
16053
16054 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16055
16056         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16057
16058         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16059         Enums since those are types too. 
16060
16061         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16062
16063         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16064         thanks to a call during the lookup process.
16065
16066 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * statement.cs (Foreach): Lots of work to accomodate a particular
16069         kind of foreach statement that I had not kept in mind.  It is
16070         possible to have foreachs on classes that provide a GetEnumerator
16071         method that return objects that implement the "pattern" for using
16072         a foreach, there is no need to support GetEnumerator
16073         specifically. 
16074
16075         This is needed to compile nant.
16076
16077         * decl.cs: Only report 114 if the member is not `Finalize' and if
16078         the warning level is at least 2.
16079
16080         * class.cs: Moved the compare function from Method to
16081         MethodSignature. 
16082
16083         (MethodSignature.InheritableMemberSignatureCompare): Add new
16084         filter function that is used to extract inheritable methods from a
16085         class. 
16086
16087         (Method.Define): Use the new `inheritable_method_signature_filter'
16088         delegate
16089
16090         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16091         command. 
16092
16093 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16096
16097         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16098
16099         * expression.cs: Pass location information to
16100         ConvertImplicitStandard. 
16101
16102         * class.cs: Added debugging code to track return values from
16103         interfaces. 
16104
16105 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * expression.cs (Is.DoResolve): If either side of the `is' is an
16108         interface, do not flag the warning.
16109
16110         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16111         for interfaces
16112
16113         * report.cs: Allow for --fatal to be used with --probe.
16114
16115         * typemanager.cs (NoTypes): Move the definition for the empty Type
16116         array here. 
16117
16118         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16119         properties. 
16120         (TypeContainer.DefineProxy): New function used to proxy to parent
16121         implementations when implementing interfaces.
16122         (TypeContainer.ParentImplements): used to lookup if our parent
16123         implements a public function that is required by an interface.
16124         (TypeContainer.VerifyPendingMethods): Hook this up.
16125
16126         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16127         `modules' and `assemblies' arraylists into arrays.  We only grow
16128         these are the very early start up of the program, so this improves
16129         the speedof LookupType (nicely measured).
16130
16131         * expression.cs (MakeByteBlob): Replaced unsafe code with
16132         BitConverter, as suggested by Paolo.
16133
16134         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16135         folding of string concatenation, but if either side is a string,
16136         and the other is not, then return null, and let the runtime use
16137         the concatenation on the string plus the object (using
16138         `Object.ToString'). 
16139
16140 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16141
16142         Constant Folding has been implemented now.
16143
16144         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16145         the error instead on types that are not supported in one's
16146         complement. 
16147
16148         * constant.cs (Constant and all children): New set of functions to
16149         perform implict and explicit conversions.
16150
16151         * ecore.cs (EnumConstant): Implement the new functions to perform
16152         conversion by proxying to the child expression.
16153
16154         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16155         own separate setting that can not be turned off from the command
16156         line using --unchecked or --checked and is only controlled using
16157         the checked/unchecked statements and expressions.  This setting is
16158         used by the constant folder to flag errors.
16159
16160         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16161         ConstantCheckState as well.   
16162
16163         During Resolve, they also have to flag the state, because the
16164         constant folder runs completely in the Resolve phase.
16165
16166         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16167         well.
16168
16169 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16170
16171         * cfold.cs: New file, this file contains the constant folder.
16172
16173         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16174         argument to track whether we are using the resulting address to
16175         load or store a value and provide better error messages. 
16176
16177         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16178         new AddressOf arguments.
16179
16180         * statement.cs (Foreach.EmitCollectionForeach): Update
16181
16182         * expression.cs (Argument.Emit): Call AddressOf with proper
16183         arguments to track usage.
16184
16185         (New.DoEmit): Call AddressOf with new arguments.
16186
16187         (Unary.Emit): Adjust AddressOf call.
16188
16189 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16190
16191         * cs-parser.jay (member_access): Change the case for pre-defined types
16192         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16193         this suggestion.
16194
16195         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16196         a method body.
16197
16198         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16199         essentially like methods and apply attributes like MethodImplOptions to them too.
16200
16201         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16202         not being null.
16203
16204         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16205         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16206         is the DeclSpace.
16207
16208         * Update code everywhere accordingly.
16209
16210         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16211
16212         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16213
16214 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16215
16216         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16217         try performing lookups against those instead of jumping straight into using
16218         the 'using' clauses.
16219
16220         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16221
16222         (LookupType): Perform lookups in implicit parents too.
16223
16224         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16225         sequence as RootContext.LookupType. 
16226
16227         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16228         the various cases of namespace lookups into this method.
16229
16230 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16233         in positional arguments)
16234
16235         * class.cs (Operator): Update the AllowedModifiers to contain
16236         extern. 
16237
16238         * cs-parser.jay: Update operator declaration to allow for the
16239         operator body to be empty.
16240
16241         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16242         values. 
16243
16244 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * class.cs (Method.Emit): Label parameters.
16247
16248         * driver.cs: Return 1 or 0 as the program exit code.
16249
16250 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16251
16252         * expression.cs: Special case the `null' object when trying to
16253         auto-compute the type, as anything can be explicitly converted to
16254         that. 
16255
16256         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16257         spotting this Paolo.
16258
16259         (Expression.ImplicitNumericConversion): Perform comparissions of
16260         the type using the underlying type in the case of an enumeration
16261         rather than using the enumeration type for the compare.
16262
16263         Cope with the underlying == type case, which is not possible to
16264         catch before. 
16265
16266         (Expression.ConvertNumericExplicit): Perform comparissions of
16267         the type using the underlying type in the case of an enumeration
16268         rather than using the enumeration type for the compare.
16269
16270         * driver.cs: If the user does not supply an extension, assume .exe
16271
16272         * cs-parser.jay (if_statement): Rewrote so that we can track the
16273         location for the if statement.
16274
16275         * expression.cs (Binary.ConstantFold): Only concat strings when
16276         the operation is "+", not everything ;-)
16277
16278         * statement.cs (Statement.EmitBoolExpression): Take a location
16279         argument. 
16280         (If, While, Do): Track location.
16281
16282         * expression.cs (Binary.ResolveOperator): In the object + string
16283         case, I was missing a call to ConvertImplicit
16284
16285 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16286
16287         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16288         Location arguments. Ensure we use RootContext.LookupType to do our work
16289         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16290
16291         * interface.cs (PopulateMethod): Handle the type of the parameter being
16292         null gracefully.
16293
16294         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16295         have a params method with no fixed arguments and a call is made with no
16296         arguments.
16297
16298 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16301         the verbatim-string-literal
16302
16303         * support.cs (InternalParameters.ParameterModifier): handle null
16304         fixed parameters.
16305         (InternalParameters.ParameterType): ditto.
16306
16307         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16308         duplicating the name of the variable parameter.
16309         (GetParameterByName): Fix bug where we were not looking up array
16310         paramters if they were the only present (thanks Paolo!).
16311         (GetParameterInfo): We only have an empty set of types if both
16312         fixed and array are set to null.
16313         (GetParameterInfo-idx): Handle FixedParameter == null
16314
16315         * cs-parser.jay: Handle the case where there is no catch
16316         statements (missing null test).
16317
16318 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16319
16320         * driver.cs (MainDriver): Be conservative on our command line
16321         handling.
16322
16323         Catch DirectoryNotFoundException when calling GetFiles.
16324
16325         (SplitPathAndPattern): Used to split the input specification into
16326         a path and a pattern that we can feed to Directory.GetFiles.
16327
16328 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16329
16330         * statement.cs (Fixed): Implement the last case of the Fixed
16331         statement (string handling).
16332
16333         * expression.cs (StringPtr): New class used to return a char * to
16334         a string;  Used by the Fixed statement.
16335
16336         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16337
16338         * expression.cs (Binary.ResolveOperator): Remove redundant
16339         MemberLookup pn parent type.
16340         Optimize union call, we do not need a union if the types are the same.
16341         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16342         type.
16343
16344         Specialize the use of MemberLookup everywhere, instead of using
16345         the default settings. 
16346
16347         (StackAlloc): Implement stackalloc keyword.
16348
16349         * cs-parser.jay: Add rule to parse stackalloc.
16350
16351         * driver.cs: Handle /h, /help, /?
16352
16353         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16354         before we supported unsafe code.
16355
16356         * makefile: add --unsafe to the self compilation of mcs.
16357
16358 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16359
16360         * expression.cs (PointerArithmetic): New class that is used to
16361         perform pointer arithmetic.
16362         (Binary.Resolve): Handle pointer arithmetic
16363         Handle pointer comparission.
16364         (ArrayPtr): Utility expression class that is used to take the
16365         address of an array.
16366
16367         (ElementAccess): Implement array access for pointers
16368
16369         * statement.cs (Fixed): Implement fixed statement for arrays, we
16370         are missing one more case before we are done.
16371
16372         * expression.cs (Indirection): Implement EmitAssign and set the
16373         ExprClass to Variable.  This allows pointer dereferences to be
16374         treated as variables, and to have values assigned to them.
16375
16376         * ecore.cs (Expression.StoreFromPtr): New utility function to
16377         store values dereferencing.
16378
16379 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16380
16381         * expression.cs (Binary.ResolveOperator): Ensure that we are
16382         not trying to operate on a void type - this fixes the reported
16383         bug.
16384
16385         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16386         the parent implementation is sealed.
16387
16388         * ../errors/cs0239.cs : Add.
16389
16390         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16391
16392         * typemanager.cs (unverifiable_code_type): Corresponds to 
16393         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16394         which have unsafe code in them.
16395
16396         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16397         unsafe context.
16398
16399 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16400
16401         * cs-tokenizer.cs: Add support for @"litreal strings"
16402
16403         Make tokenizer accept pre-processor directives
16404         on any column (remove the old C-like limitation). 
16405
16406         * rootcontext.cs (EmitCode): Emit any global attributes.
16407         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16408
16409         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16410
16411         * cs-parser.jay: Add support for global attributes.  
16412
16413 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * expression.cs (Indirection): New helper class.  Unary will
16416         create Indirection classes to be able to implement the
16417         IMemoryLocation interface on it.
16418
16419 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16420
16421         * cs-parser.jay (fixed_statement): reference the right statement.
16422
16423         * statement.cs (Fixed.Emit): Finish implementing the fixed
16424         statement for the &x case.
16425
16426 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * class.cs (Property.Define, Method.Define): Remove newslot when
16429         `implementing'.  
16430
16431         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16432         wrong.  NewSlot should only be used if the `new' keyword is present.
16433
16434         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16435         locating our system dir.  Sorry about this.
16436
16437 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * driver.cs (GetSystemDir): Compute correctly the location of our
16440         system assemblies.  I was using the compiler directory instead of
16441         the library directory.
16442
16443 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16444
16445         * expression.cs (BetterFunction): Put back in what Miguel commented out
16446         since it is the correct fix. The problem is elsewhere ;-)
16447
16448         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16449         parameters of the parms method are themselves compatible or not !
16450
16451         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16452         to check that a class implements an interface before saying that an implicit
16453         conversion was allowed. Use ImplementsInterface to do the checking.
16454
16455 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16456
16457         * class.cs (Method.Define): Track whether we are an explicit
16458         implementation or not.  And only call DefineMethodOverride if we
16459         are an explicit implementation.
16460
16461         (Property.DefineMethod): Ditto.
16462
16463 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16464
16465         * expression.cs (BetterFunction): Catch hideous bug which was
16466          preventing us from detecting ambiguous calls due to implicit casts i.e
16467         cs0121.
16468
16469 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * support.cs (Pair): Remove un-needed method.  I figured why I was
16472         getting the error in cs-parser.jay, the variable in a foreach loop
16473         is readonly, and the compiler does not really treat this as a variable.
16474
16475         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16476         instead of EQUALS in grammar.  
16477
16478         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16479
16480         * expression.cs (Unary.DoResolve): Check whether the argument is
16481         managed or not.
16482
16483 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16484
16485         * support.cs: Api for Pair to set a value.  Despite the fact that
16486         the variables are public the MS C# compiler refuses to compile
16487         code that accesses the field if the variable is part of a foreach
16488         statement. 
16489
16490         * statement.cs (Fixed): Begin implementation of the fixed
16491         statement.
16492
16493         (Block.AddVariable): Return the VariableInfo on success and null
16494         on failure instead of true/false. 
16495
16496         * cs-parser.jay (foreach): Catch errors on variables already
16497         defined (we were ignoring this value before) and properly unwind
16498         the block hierarchy
16499
16500         (fixed_statement): grammar for the fixed statement.
16501
16502 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16503
16504         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16505         pointer types to be incretemented.
16506
16507         (SizeOf): Implement.
16508
16509         * cs-parser.jay (pointer_member_access): Implement
16510         expr->IDENTIFIER production.
16511
16512         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16513         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16514         on safe contexts.
16515
16516         (Unary): Implement indirection.
16517
16518         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16519         use in non-unsafe context).
16520
16521         (SimpleName.DoResolve): Check for pointers in field access on safe
16522         contexts. 
16523
16524         (Expression.LoadFromPtr): Factor the load-indirect code in this
16525         function.  This was duplicated in UnboxCast and ParameterReference
16526
16527 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16528
16529         * expression.cs (ComposedCast): report an error if a pointer cast
16530         is used in a safe region.
16531
16532         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16533         pointer type casts in unsafe context.
16534
16535         * codegen.cs (EmitContext): Set up IsUnsafe.
16536
16537         * cs-parser.jay (non_expression_type): Add productions for pointer
16538         casts. 
16539
16540         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16541         code.  We should not use force into static mode if the method is
16542         not virtual.  Fixes bug in MIS
16543
16544         * statement.cs (Do.Emit, While.Emit, For.Emit,
16545         Statement.EmitBoolExpression): Add support to Do and While to
16546         propagate infinite loop as `I do return' semantics.
16547
16548         Improve the For case to also test for boolean constants.
16549
16550         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16551         to the list of attributes we can add.
16552
16553         Remove `EmitContext' argument.
16554
16555         * class.cs (Method.Define): Apply parameter attributes.
16556         (Constructor.Define): Apply parameter attributes.
16557         (MethodCore.LabelParameters): Move here the core of labeling
16558         parameters. 
16559
16560         * support.cs (ReflectionParameters.ParameterModifier,
16561         InternalParameters.ParameterModifier): Use IsByRef on the type and
16562         only return the OUT bit for these parameters instead of in/out/ref
16563         flags.
16564
16565         This is because I miss-understood things.  The ParameterInfo.IsIn
16566         and IsOut represent whether the parameter has the [In] and [Out]
16567         attributes set.  
16568
16569 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16570
16571         * ecore.cs (FieldExpr.Emit): Release temporaries.
16572
16573         * assign.cs (LocalTemporary.Release): new function.
16574
16575         * codegen.cs (EmitContext.GetTemporaryStorage,
16576         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16577         temporary storage.  Now we can "put back" localbuilders when we
16578         are done with them
16579
16580 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16581
16582         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16583         need to make a copy of the variable to generate verifiable code.
16584
16585 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16586
16587         * driver.cs: Compute dynamically the system directory.
16588
16589         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16590         Slower, but more generally useful.  Used by the abstract
16591         registering implementation. 
16592
16593         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16594         the rules for the special rule on Type/instances.  First check if
16595         we have the same name, and if so, try that special static path
16596         rather than the instance path.
16597
16598 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16599
16600         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16601         for, while and if.
16602
16603         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16604         Enum, ValueType, Delegate or Array for non-corlib compiles.
16605
16606         * cs-tokenizer.cs: Catch long identifiers (645)
16607
16608         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16609         piece of code.
16610
16611         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16612         fix, we were returning too early, so we were not registering
16613         pending methods from abstract classes.
16614
16615         Do not register pending methods if the class is abstract.
16616
16617         * expression.cs (Conditional.DoResolve): Report circular implicit
16618         conversions when we neecd to compute it for conditional
16619         expressions. 
16620
16621         (Is.DoResolve): If the expression is always of the provided type,
16622         flag warning 183.  If the expression can not ever be of the
16623         provided type flag warning 184.
16624
16625         * class.cs: Catch 169 as well.
16626
16627         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16628         read. 
16629
16630 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16631
16632         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16633
16634 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16635
16636         * interface.cs: (PopulateMethod): Check for pointers being defined
16637         only if the unsafe context is active.
16638         (PopulateProperty): ditto.
16639         (PopulateIndexer): ditto.
16640
16641         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16642         specified.  If pointers are present, make sure that they are
16643         present in an unsafe context.
16644         (Constructor, Constructor.Define): ditto.
16645         (Field, Field.Define): ditto.
16646         (Property, Property.Define): ditto.
16647         (Event, Event.Define): ditto.
16648
16649         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16650         hashtable if there are classes or structs defined.
16651
16652         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16653         code, as the constant resolution moved.
16654
16655         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16656         the metadata, so we can flag error 133. 
16657
16658         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16659         pointer is being declared in an unsafe context.
16660
16661 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16662
16663         * modifiers.cs (Modifiers.Check): Require a Location argument.
16664         Report error 227 for Unsafe use.
16665
16666         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16667
16668         * statement.cs (For.Emit): If the test is null, then report that
16669         we do `return', as we wont reach anything afterwards.
16670
16671         (Switch.SwitchGoverningType): Track the expression that matched
16672         the conversion.
16673
16674         * driver.cs: Allow negative numbers as an error code to flag.
16675
16676         * cs-parser.jay: Handle 1551.
16677
16678         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16679
16680 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16681
16682         * cs-parser.jay: Report 1518 (type declaration can only contain
16683         class, struct, interface, enum or delegate)
16684
16685         (switch_label): Report 1523 (keywords `case' or `default' must
16686         preced code)
16687
16688         (opt_switch_sections): Report 1522 (empty switch)
16689
16690         * driver.cs: Report 1515 (response file specified multiple times)
16691         Report 1516 (Source file specified multiple times).
16692
16693         * expression.cs (Argument.Resolve): Signal 1510
16694
16695         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16696         access not allowed in static code)
16697
16698 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16699
16700         * typemanager.cs (IsPointerType): Utility method which we are going
16701         to need a lot.
16702
16703         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16704         the object type, so we take care of that.
16705
16706         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16707
16708         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16709         added to non-params parameters :-)
16710
16711         * typemanager.cs (CSharpName): Include 'void' type too. 
16712
16713         (void_ptr_type): Include in the set of core types.
16714
16715         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16716         duplicating code.
16717
16718         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16719         an unsafe context.
16720
16721         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16722         completely forgotten about it.
16723
16724 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16725
16726         * cs-parser.jay (pointer_type): Add. This begins our implementation
16727         of parsing rules for unsafe code.
16728
16729         (unsafe_statement): Implement.
16730
16731         (embedded_statement): Modify to include the above.
16732
16733         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16734
16735         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16736         if the current context is an unsafe one.
16737
16738         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16739         are handled differently, we need separate rules for them.
16740
16741         (local_variable_declaration): Update to use local_variable_pointer_type
16742         to allow variable declarations of unmanaged pointer types.
16743
16744         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16745         in unsafe contexts.
16746
16747         * ../errors/cs0214.cs : Add.
16748
16749 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16750
16751         * makefile: remove 'response' file when cleaning.
16752
16753 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16754
16755         * cs-parser.jay: Report 1524.
16756
16757 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16758
16759         * typemanager.cs (RegisterMethod): drop checking if we have
16760         registered this from here
16761
16762 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16763
16764         * class.cs (Method.EmitDestructor): Implement calling our base
16765         destructor. 
16766
16767         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16768         value of InFinally.
16769
16770         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16771         this routine and will wrap the call in a try/catch block.  Deal
16772         with the case.
16773
16774 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16775
16776         * ecore.cs (Expression.MemberLookup): instead of taking a
16777         parameter `same_type' that was used to tell whether we could
16778         access private members we compute our containing type from the
16779         EmitContext.
16780
16781         (FieldExpr): Added partial support for volatile fields.  This does
16782         not work for volatile fields exposed from assemblies, as I can not
16783         figure out how to extract the modreq from it.
16784
16785         Updated all the source files to use this.
16786
16787         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16788         because it is referenced by MemberLookup very often. 
16789
16790 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16791
16792         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16793         TypeBuilder.GetCustomAttributes to retrieve what we need.
16794
16795         Get rid of redundant default_member_attr_type as this is the same as
16796         default_member_type which already exists.
16797
16798         * interface.cs, attribute.cs : Update accordingly.
16799
16800 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16801
16802         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16803         work for TYpeBuilders though.  Ravi, can you please fix this?
16804
16805         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16806
16807         * expression.cs (Argument.Emit): Handle the case of ref objects
16808         being passed to ref functions;  
16809
16810         (ParameterReference.EmitLoad): Loads the content of the pointer
16811         without dereferencing.
16812
16813 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16814
16815         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16816
16817 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16818
16819         * class.cs (Indexer.DefineMethod): Incorporate the interface
16820         type in the name of the method if we are doing explicit interface
16821         implementation.
16822
16823         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16824
16825         (BetterConversion): Fix extremely trivial bug where we were referring to
16826         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16827         again !
16828
16829         * ../errors/bug16.cs : Add although we have fixed it.
16830
16831 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16832
16833         * expression.cs (BaseIndexer): Begin implementation.
16834
16835         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16836
16837         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16838         production directly to remove a shift/reduce, and implement
16839         explicit interface implementation.
16840
16841         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16842         after a floating point suffix.
16843
16844         * expression.cs (DoNumericPromotions): Improved the conversion for
16845         uint/uint.  If we have a constant, we avoid doing a typecast to a
16846         larger type.
16847
16848         * class.cs (Indexer): Implement explicit interface implementation
16849         for indexers.
16850
16851 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16852
16853         * class.cs: make the default instance constructor public and hidebysig.
16854
16855 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16856
16857         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16858         so we can call it from elsewhere.
16859
16860         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16861         we emit it internally if the class has a defined indexer; otherwise the user
16862         emits it by decorating the class definition with the DefaultMemberAttribute.
16863
16864         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16865         attribute is not used on a type which defines an indexer.
16866
16867         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16868         character when we skip whitespace.
16869
16870         * ../errors/cs0646.cs : Add.
16871
16872 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16875         again. 
16876
16877         * makefile: Add practical target `mcs3.exe' which builds the third
16878         generation compiler. 
16879
16880         * expression.cs (New): Fix structures constructor calling.
16881
16882         * class.cs (Property, Method, Indexer): Emit Final flag on the
16883         method if we are an interface implementation and we are not
16884         abstract. 
16885
16886         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16887         whether this property is referencing a `base' method.
16888
16889         * expression.cs (Invocation.EmitCall): take an extra argument:
16890         is_base, this is used to determine whether the `call' or
16891         `callvirt' opcode should be used.
16892
16893
16894         * delegate.cs: update EmitCall.
16895
16896         * class.cs (Method.Define): Set NewSlot for the cases where we are
16897         not implementing an interface method.
16898
16899         (Property.Define): ditto.
16900
16901 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16902
16903         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16904         'r'.  Allows mcs to parse itself fully.
16905
16906 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16907
16908         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16909         of the number of initializers that require the InitializeArray method.
16910
16911         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16912         update the above field where necessary.
16913
16914         (MakeByteBlob): Update accordingly.
16915
16916         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16917         greater than 2.
16918
16919         (EmitDynamicInitializers): Update in accordance with the new optimization.
16920
16921         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16922         same OpCode applies.
16923
16924         * cs-parser.jay : Fix some glaring errors I introduced.
16925
16926 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16927
16928         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16929         so that we can check for name clashes there too.
16930
16931         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16932         for interface indexers.
16933
16934         * interfaces.cs (Define): Emit the default member attribute.
16935
16936         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16937         variable was being referred to while setting the value ;-)
16938
16939 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16940
16941         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16942         byte-by-byte information when we know the data is zero.
16943
16944         Make the block always a multiple of 4, because
16945         DefineInitializedData has a bug.
16946
16947         * assign.cs: Fix, we should assign from the temporary, not from
16948         the source. 
16949
16950         * expression.cs (MakeByteBlob): Fix my incorrect code.
16951
16952 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16953
16954         * typemanager.cs (EnumToUnderlying): This function is used to get
16955         the underlying type from an enumeration, because it does not
16956         always work. 
16957
16958         * constant.cs: Use the I4_S form for values between -128 and 127.
16959
16960         * statement.cs (Block.LookupLabel): Looks up a label.
16961         (Block): Drop support for labeled blocks.
16962
16963         (LabeledStatement): New kind of statement that represents a label
16964         only.
16965
16966         (Goto): Finally implement this bad boy.
16967
16968         * cs-parser.jay: Update to reflect new mechanism to implement
16969         labels.
16970
16971 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16972
16973         * codegen.cs (EmitContext.This): a codegen property that keeps the
16974         a single instance of this instead of creating many different this
16975         instances. 
16976
16977         * delegate.cs (Delegate.DoResolve): Update to use the property;
16978
16979         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16980
16981         * expression.cs (BaseAccess.DoResolve): Ditto.
16982
16983 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16984
16985         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16986         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16987
16988         (InitCoreTypes): Update accordingly.
16989
16990         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16991         so we can quickly store the state.
16992
16993         (ApplyAttributes): Set the correct implementation flags
16994         for InternalCall methods.
16995
16996 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16997
16998         * expression.cs (EmitCall): if a method is not virtual, then do
16999         not use callvirt on it.
17000
17001         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17002         user defined stuff) requires the use of stobj, which takes an
17003         address on the stack instead of an array and an index.  So emit
17004         the Ldelema operation for it.
17005
17006         (EmitStoreOpcode): Use stobj for valuetypes.
17007
17008         (UnaryMutator.EmitCode): Use the right 1 value depending on
17009         whether we are dealing with int64/uint64, float or doubles.
17010
17011         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17012         constructors that I implemented last night.
17013
17014         (Constructor.IsDefault): Fix to work properly for static
17015         constructors.
17016
17017         * cs-parser.jay (CheckDef): report method signature errors.
17018         Update error number 103 to be 132.
17019
17020         * decl.cs: New AdditionResult enumeration value: MethodExists.
17021         Although we do this check for methods later on in the semantic
17022         analysis, catching repeated default constructors is so easy that
17023         we catch these here. 
17024
17025         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17026         promotions code.
17027
17028         (ParameterReference.EmitAssign, Emit): handle
17029         bools as bytes.
17030
17031         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17032         (ArrayAccess.EmitStoreOpcode): ditto.
17033
17034         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17035
17036         * expression.cs (MakeByteBlob): Complete all the missing types
17037         (uint, short, ushort, byte, sbyte)
17038
17039         * class.cs: Only init instance field initializers on instance
17040         constructors. 
17041
17042         Rename `constructors' to instance_constructors. 
17043
17044         (TypeContainer.AddConstructor): Only add constructors to the list
17045         if it is not static.
17046
17047         Make sure that we handle default_static_constructor independently
17048         everywhere where we handle instance_constructors
17049
17050 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17051
17052         * class.cs: Do not lookup or create a base initializer for a
17053         static constructor.
17054
17055         (ConstructorInitializer.Resolve): use the proper type to lookup
17056         for constructors.
17057
17058         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17059
17060         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17061         in DeclSpace. 
17062
17063         * decl.cs: CloseType is now an virtual method, the default
17064         implementation just closes this type.
17065
17066 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17067
17068         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17069         to PreserveSig by default. Also emit HideBySig on such methods.
17070
17071         Basically, set the defaults to standard values.
17072
17073         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17074         argument, if candidate is better, it can't be worse than the best !
17075
17076         (Invocation): Re-write bits to differentiate between methods being
17077         applicable in their expanded form and their normal form - for params
17078         methods of course.
17079
17080         Get rid of use_standard everywhere as only standard conversions are allowed
17081         in overload resolution. 
17082
17083         More spec conformance.
17084
17085 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * driver.cs: Add --timestamp, to see where the compiler spends
17088         most of its time.
17089
17090         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17091         `this' in static code.
17092
17093         (SimpleName.DoResolve): Implement in terms of a helper function
17094         that allows static-references to be passed upstream to
17095         MemberAccess.
17096
17097         (Expression.ResolveWithSimpleName): Resolve specially simple
17098         names when called by MemberAccess to implement the special
17099         semantics. 
17100
17101         (Expression.ImplicitReferenceConversion): Handle conversions from
17102         Null to reference types before others, as Null's type is
17103         System.Object. 
17104
17105         * expression.cs (Invocation.EmitCall): Handle the special case of
17106         calling methods declared on a reference type from a ValueType
17107         (Base classes System.Object and System.Enum)
17108
17109         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17110         the left hand side is a TypeExpr, not on every enumeration. 
17111
17112         (Binary.Resolve): If types are reference types, then do a cast to
17113         object on operators != and == of both arguments.
17114
17115         * typemanager.cs (FindMembers): Extract instance and static
17116         members if requested.
17117
17118         * interface.cs (PopulateProperty): Use void_type instead of null
17119         as the return type for the setter method.
17120
17121         (PopulateIndexer): ditto.
17122
17123 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17124
17125         * support.cs (ReflectionParameters): Fix minor bug where we
17126         were examining the wrong parameter for the ParamArray attribute.
17127
17128         Cope with requests for the type of the parameter at position
17129         greater than the params parameter's. We now return the element
17130         type of the params array as that makes more sense.
17131
17132         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17133         accordingly as we no longer have to extract the element type
17134         ourselves.
17135
17136         (Invocation.OverloadResolve): Update.
17137
17138 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17139
17140         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17141         against IEnumerator, test whether the return value is a descendant
17142         of the IEnumerator interface.
17143
17144         * class.cs (Indexer.Define): Use an auxiliary method to implement
17145         the other bits of the method definition.  Begin support for
17146         explicit interface implementation.
17147
17148         (Property.DefineMethod): Use TypeManager.void_type instead of null
17149         for an empty return value.
17150
17151 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17154         dealing with a FieldExpr which is composed of a FieldBuilder, in
17155         the code path we did extract the constant, but we should have
17156         obtained the underlying value to be able to cast it (otherwise we
17157         end up in an infinite loop, this is what Ravi was running into).
17158
17159         (ArrayCreation.UpdateIndices): Arrays might be empty.
17160
17161         (MemberAccess.ResolveMemberAccess): Add support for section
17162         14.5.4.1 that deals with the special case of E.I when E is a type
17163         and something else, that I can be a reference to a static member.
17164
17165         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17166         handle a particular array type to create byte blobs, it is just
17167         something we dont generate byteblobs for.
17168
17169         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17170         arguments. 
17171
17172         * location.cs (Push): remove the key from the hashtable that we
17173         are about to add.   This happens for empty files.
17174
17175         * driver.cs: Dispose files after we have parsed them.
17176
17177         (tokenize): new function that only runs the tokenizer on its
17178         input, for speed testing.
17179
17180 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17181
17182         * class.cs (Event.Define): Define the private field only if there
17183         are no accessors defined.
17184
17185         * expression.cs (ResolveMemberAccess): If there is no associated
17186         field with the event, that means we have an event defined with its
17187         own accessors and we should flag error cs0070 since transforming
17188         ourselves into a field is not valid in that case.
17189
17190         * ecore.cs (SimpleName.DoResolve): Same as above.
17191
17192         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17193         and charset to sane values.
17194
17195 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17196
17197         * assign.cs (DoResolve): Perform check on events only if they 
17198         are being accessed outside the declaring type.
17199
17200         * cs-parser.jay (event_declarations): Update rules to correctly
17201         set the type of the implicit parameter etc.
17202
17203         (add_accessor, remove_accessor): Set current local parameters.
17204
17205         * expression.cs (Binary): For delegate addition and subtraction,
17206         cast the return value from the method into the appropriate delegate
17207         type.
17208
17209 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17210
17211         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17212         of these as the workaround is unnecessary.
17213
17214         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17215         delegate data - none of that is needed at all.
17216
17217         Re-write bits to extract the instance expression and the delegate method
17218         correctly.
17219
17220         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17221         on delegates too.
17222
17223         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17224         of attaching attributes instead of duplicating code everywhere.
17225
17226         * everywhere : Update code to do attribute emission using the above method.
17227
17228 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * expression.cs (IsParamsMethodApplicable): if there are not
17231         parameters, return immediately.
17232
17233         * ecore.cs: The 0 literal can be implicity converted to an enum
17234         type. 
17235
17236         (SimpleName.DoResolve): First lookup the type, then lookup the
17237         members. 
17238
17239         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17240         want to get its address.  If the InstanceExpression is not
17241         addressable, store the result in a temporary variable, then get
17242         the address of it.
17243
17244         * codegen.cs: Only display 219 errors on warning level or above. 
17245
17246         * expression.cs (ArrayAccess): Make it implement the
17247         IMemoryLocation interface.
17248
17249         (Binary.DoResolve): handle the operator == (object a, object b)
17250         and operator != (object a, object b) without incurring into a
17251         BoxedCast (because 5 != o should never be performed).
17252
17253         Handle binary enumerator operators.
17254
17255         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17256         value type, otherwise use Ldelem_ref.
17257
17258         Use precomputed names;
17259
17260         (AddressOf): Implement address of
17261
17262         * cs-parser.jay (labeled_statement): Fix recursive block
17263         addition by reworking the production.
17264
17265         * expression.cs (New.DoEmit): New has a special case:
17266                 
17267                  If we are dealing with a ValueType, we have a few
17268                  situations to deal with:
17269                 
17270                     * The target of New is a ValueType variable, that is
17271                       easy, we just pass this as the variable reference
17272                 
17273                     * The target of New is being passed as an argument,
17274                       to a boxing operation or a function that takes a
17275                       ValueType.
17276                 
17277                       In this case, we need to create a temporary variable
17278                       that is the argument of New.
17279
17280
17281 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17282
17283         * rootcontext.cs (LookupType): Check that current_type is not null before
17284         going about looking at nested types.
17285
17286         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17287         not implement the IAssignMethod interface any more.
17288
17289         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17290         where we tranform them into FieldExprs if they are being resolved from within
17291         the declaring type.
17292
17293         * ecore.cs (SimpleName.DoResolve): Do the same here.
17294
17295         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17296
17297         * ../errors/bug10.cs : Add.
17298
17299         * ../errors/cs0070.cs : Add.
17300
17301         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17302
17303         * assign.cs : Get rid of EventIsLocal everywhere.
17304
17305 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * ecore.cs (ConvertIntLiteral): finished the implementation.
17308
17309         * statement.cs (SwitchLabel): Convert the value we are using as a
17310         key before looking up the table.
17311
17312 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17313
17314         * codegen.cs (EmitTopBlock): Require a Location argument now.
17315
17316         * cs-parser.jay (constructor_declarator): We need to setup
17317         current_local_parameters before we parse the
17318         opt_constructor_initializer, to allow the variables to be bound
17319         to the constructor arguments.
17320
17321         * rootcontext.cs (LookupType): First lookup nested classes in our
17322         class and our parents before we go looking outside our class.
17323
17324         * expression.cs (ConstantFold): Extract/debox the values at the
17325         beginnning. 
17326
17327         * rootcontext.cs (EmitCode): Resolve the constants first before we
17328         resolve the types.  This is not really needed, but it helps debugging.
17329
17330         * statement.cs: report location.
17331
17332         * cs-parser.jay: pass location to throw statement.
17333
17334         * driver.cs: Small bug fix.
17335
17336         * report.cs: Updated format to be 4-zero filled digits.
17337
17338 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17339
17340         * expression.cs (CheckIndices): Fix minor bug where the wrong
17341         variable was being referred to ;-)
17342
17343         (DoEmit): Do not call EmitStaticInitializers when the 
17344         underlying type is System.Object.
17345
17346 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17347
17348         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17349         and do the usual workaround for SRE.
17350
17351         * class.cs (MyEventBuilder.EventType): New member to get at the type
17352         of the event, quickly.
17353
17354         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17355
17356         * assign.cs (Assign.DoResolve): Handle the case when the target
17357         is an EventExpr and perform the necessary checks.
17358
17359         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17360         interface.
17361
17362         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17363
17364         (EventExpr): Set the type in the constructor itself since we 
17365         are meant to be born fully resolved.
17366
17367         (EventExpr.Define): Revert code I wrote earlier.
17368                 
17369         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17370         instance expression is null. The instance expression is a This in that case
17371         or a null, depending on whether it is a static method or not.
17372
17373         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17374         refers to more than one method.
17375
17376         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17377         and accordingly flag errors.
17378
17379 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17380
17381         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17382
17383 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17384
17385         * location.cs (ToString): Provide useful rutine.
17386
17387 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17390         objects, return the actual integral boxed.
17391
17392         * statement.cs (SwitchLabel): define an ILLabel for each
17393         SwitchLabel. 
17394
17395         (Switch.CheckSwitch): If the value is a Literal, extract
17396         the underlying literal.
17397
17398         Also in the unused hashtable we had, add the SwitchLabel so we can
17399         quickly look this value up.
17400
17401         * constant.cs: Implement a bunch of new constants.  Rewrite
17402         Literal based on this.  Made changes everywhere to adapt to this.
17403
17404         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17405         dereferencing array only once, and also copes with enumrations.
17406
17407         bytes are two bytes wide, not one.
17408
17409         (Cast): Perform constant conversions.
17410
17411         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17412         wrappers to the literals here.
17413
17414         * expression.cs (DoNumericPromotions): long literals can converted
17415         to ulong implicity (this is taken care of elsewhere, but I was
17416         missing this spot).
17417
17418         * ecore.cs (Expression.Literalize): Make the return type Literal,
17419         to improve type checking.
17420
17421         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17422
17423 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17424
17425         * literal.cs: Revert code from ravi that checked the bounds.  The
17426         bounds are sane by the definition of the type itself. 
17427
17428         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17429         need to actually look up in our parent hierarchy for interfaces
17430         implemented. 
17431
17432         * const.cs: Use the underlying type for enumerations
17433
17434         * delegate.cs: Compute the basename for the delegate creation,
17435         that should fix the delegate test case, and restore the correct
17436         Type Lookup semantics in rootcontext
17437
17438         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17439         referencing a nested type with the Reflection API is using the "+"
17440         sign. 
17441
17442         * cs-parser.jay: Do not require EOF token at the end.
17443
17444 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17445
17446         * rootcontext.cs (LookupType): Concatenate type names with
17447         a '.' instead of a '+' The test suite passes again.
17448
17449         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17450         field of the enumeration.
17451
17452         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17453         the case when the member is an EventExpr.
17454
17455         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17456         static has an associated instance expression.
17457
17458         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17459
17460         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17461
17462         * class.cs (Event.Define): Register event and perform appropriate checks
17463         for error #111.
17464
17465         We define the Add and Remove methods even if the use provides none because
17466         in that case, we provide default implementations ourselves.
17467
17468         Define a private field of the type of the event. This is done by the CSC compiler
17469         and we should be doing it too ;-)
17470
17471         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17472         More methods we use in code we generate.
17473
17474         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17475         is important.
17476
17477         (InitCoreTypes): Update accordingly for the above.
17478
17479         * class.cs (Event.Emit): Generate code for default accessors that we provide
17480
17481         (EmitDefaultMethod): Do the job in the above.
17482
17483         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17484         appropriate place.
17485
17486 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17487
17488         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17489         builders even if we were missing one.
17490
17491         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17492         pass the Basename as our class name instead of the Name.  The
17493         basename will be correctly composed for us.
17494
17495         * parameter.cs (Paramters): Now takes a Location argument.
17496
17497         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17498         make all the code call directly LookupType in RootContext and take
17499         this chance to pass the Location information everywhere.
17500
17501         * Everywhere: pass Location information.
17502
17503 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17504
17505         * class.cs (Constructor.Define): Updated way of detecting the
17506         length of the parameters.
17507
17508         (TypeContainer.DefineType): Use basename as the type name for
17509         nested types.
17510
17511         (TypeContainer.Define): Do not recursively define types here, as
17512         definition is taken care in order by the RootContext.
17513
17514         * tree.cs: Keep track of namespaces in a per-file basis.
17515
17516         * parameter.cs (Parameter.ComputeSignature): Update to use
17517         DeclSpace. 
17518
17519         (Parameters.GetSignature): ditto.
17520
17521         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17522         instead of a TypeContainer.
17523
17524         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17525         resolve names.  Because we need to be resolve in our context, not
17526         our parents.
17527
17528         * driver.cs: Implement response files.
17529
17530         * class.cs (TypeContainer.DefineType): If we are defined, do not
17531         redefine ourselves.
17532
17533         (Event.Emit): Emit the code for add/remove handlers.
17534         (Event.Define): Save the MethodBuilders for add/remove.
17535
17536         * typemanager.cs: Use pair here too.
17537
17538         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17539         DictionaryEntry requires the first argument to be non-null.  
17540
17541         (enum_declaration): Compute full name for registering the
17542         enumeration.
17543
17544         (delegate_declaration): Instead of using
17545         formal_parameter_list, use opt_formal_parameter_list as the list
17546         can be empty.
17547
17548         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17549         (EventParsing): New property that controls whether `add' and
17550         `remove' are returned as tokens or identifiers (for events);
17551
17552 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17553
17554         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17555         use MyEventBuilder only and let it wrap the real builder for us.
17556
17557         (MyEventBuilder): Revamp constructor etc.
17558
17559         Implement all operations that we perform on EventBuilder in precisely the same
17560         way here too.
17561
17562         (FindMembers): Update to use the EventBuilder member.
17563
17564         (Event.Emit): Update accordingly.
17565
17566 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17567
17568         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17569         by calling the appropriate methods.
17570
17571         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17572         useful.
17573
17574         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17575
17576 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17577
17578         * delegate.cs (Delegate.Populate): Check that the return type
17579         and various parameters types are indeed accessible.
17580
17581         * class.cs (Constructor.Define): Same here.
17582
17583         (Field.Define): Ditto.
17584
17585         (Event.Define): Ditto.
17586
17587         (Operator.Define): Check that the underlying Method defined itself
17588         correctly - so it's MethodBuilder should not be null.
17589
17590         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17591         expression happens to be null.
17592
17593         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17594         members but as of now we don't seem to be able to do anything really useful with it.
17595
17596         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17597         not the EventBuilder.
17598
17599 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17600
17601         * cs-tokenizer.cs: Add support for defines.
17602         Add support for #if, #elif, #else, #endif
17603
17604         (eval_var): evaluates a variable.
17605         (eval): stubbed for evaluating functions.
17606
17607         * cs-parser.jay: Pass the defines information
17608
17609         * driver.cs: Add --define command line option.
17610
17611         * decl.cs: Move MemberCore here.
17612
17613         Make it the base class for DeclSpace.  This allows us to catch and
17614         report 108 and 109 for everything now.
17615
17616         * class.cs (TypeContainer.Define): Extract all the members
17617         before populating and emit the warning 108 (new keyword required
17618         to override) instead of having each member implement this.
17619
17620         (MemberCore.Define): New abstract method, we will be using this in
17621         the warning reporting engine in Populate.
17622
17623         (Operator.Define): Adjust to new MemberCore protocol. 
17624
17625         * const.cs (Const): This does not derive from Expression, it is a
17626         temporary object we use to create fields, it is a MemberCore. 
17627
17628         * class.cs (Method.Define): Allow the entry point to be in a
17629         specific class.
17630
17631         * driver.cs: Rewrite the argument handler to clean it up a bit.
17632
17633         * rootcontext.cs: Made it just an auxiliary namespace feature by
17634         making everything static.
17635
17636         * driver.cs: Adapt code to use RootContext type name instead of
17637         instance variable.
17638
17639         * delegate.cs: Remove RootContext argument.
17640
17641         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17642         argument. 
17643
17644         * class.cs (Event.Define): The lookup can fail.
17645
17646         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17647
17648         * expression.cs: Resolve the this instance before invoking the code.
17649
17650 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17651
17652         * cs-parser.jay: Add a production in element_access that allows
17653         the thing to become a "type" reference.  This way we can parse
17654         things like "(string [])" as a type.
17655
17656         Note that this still does not handle the more complex rules of
17657         casts. 
17658
17659
17660         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17661
17662         * ecore.cs: (CopyNewMethods): new utility function used to
17663         assemble the list of methods from running FindMembers.
17664
17665         (MemberLookup): Rework FindMembers so that 
17666
17667 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * class.cs (TypeContainer): Remove Delegates who fail to be
17670         defined.
17671
17672         * delegate.cs (Populate): Verify that we dont get null return
17673         values.   TODO: Check for AsAccessible.
17674
17675         * cs-parser.jay: Use basename to emit error 574 (destructor should
17676         have the same name as container class), not the full name.
17677
17678         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17679         possible representation.  
17680
17681         Also implements integer type suffixes U and L.
17682
17683 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17684
17685         * expression.cs (ArrayCreation.DoResolve): We need to do the
17686         argument resolution *always*.
17687
17688         * decl.cs: Make this hold the namespace.  Hold the root context as
17689         well.
17690         (LookupType): Move here.
17691
17692         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17693
17694         * location.cs (Row, Name): Fixed the code, it was always returning
17695         references to the first file.
17696
17697         * interface.cs: Register properties defined through interfaces.
17698
17699         * driver.cs: Add support for globbing on the command line
17700
17701         * class.cs (Field): Make it derive from MemberCore as well.
17702         (Event): ditto.
17703
17704 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17705
17706         * class.cs (Event::Define): Check that the type of the event is a delegate
17707         type else flag error #66.
17708
17709         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17710         same.
17711
17712         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17713         values of EntryPoint, CharSet etc etc.
17714
17715         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17716
17717         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17718         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17719         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17720         which needs this to do its work.
17721
17722         * ../errors/cs0066.cs : Add.
17723
17724 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17727         helper functions.
17728
17729         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17730         clears out the parameters field.
17731         (MemberSignatureCompare): Cleanup
17732
17733         (MemberCore): New base class used to share code between MethodCore
17734         and Property.
17735
17736         (RegisterRequiredImplementations) BindingFlags.Public requires
17737         either BindingFlags.Instace or Static.  Use instance here.
17738
17739         (Property): Refactored code to cope better with the full spec.
17740
17741         * parameter.cs (GetParameterInfo): Return an empty array instead
17742         of null on error.
17743
17744         * class.cs (Property): Abstract or extern properties have no bodies.
17745
17746         * parameter.cs (GetParameterInfo): return a zero-sized array.
17747
17748         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17749         method modifier validation to the typecontainer so we can reuse
17750         this on properties.
17751
17752         (MethodCore.ParameterTypes): return an empty sized array of types.
17753
17754         (Property.Define): Test property modifier validity.
17755
17756         Add tests for sealed/override too.
17757
17758         (Method.Emit): abstract or extern methods have no bodies.
17759
17760 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17761
17762         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17763         thing.
17764
17765         (Method::Define, ::Emit): Modify accordingly.
17766
17767         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17768
17769         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17770
17771         * makefile: Pass in /unsafe.
17772
17773 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * class.cs (MakeKey): Kill routine.
17776
17777         * class.cs (TypeContainer.Define): Correctly define explicit
17778         method implementations (they require the full interface name plus
17779         the method name).
17780
17781         * typemanager.cs: Deply the PtrHashtable here and stop using the
17782         lame keys.  Things work so much better.
17783
17784         This of course broke everyone who depended on `RegisterMethod' to
17785         do the `test for existance' test.  This has to be done elsewhere.
17786
17787         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17788         the object stupid Equals method (because, that like fails all over
17789         the place).  We still do not use it.
17790
17791         * class.cs (TypeContainer.SetRequiredInterface,
17792         TypeContainer.RequireMethods): Killed these two routines and moved
17793         all the functionality to RegisterRequiredImplementations.
17794
17795         (TypeContainer.RegisterRequiredImplementations): This routine now
17796         registers all the implementations required in an array for the
17797         interfaces and abstract methods.  We use an array of structures
17798         which can be computed ahead of time to reduce memory usage and we
17799         also assume that lookups are cheap as most classes will not
17800         implement too many interfaces.
17801
17802         We also avoid creating too many MethodSignatures.
17803
17804         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17805         clear the "pending" bit if we find that there are problems with
17806         the declaration.
17807
17808         (TypeContainer.VerifyPendingMethods): Update to report errors of
17809         methods that look like implementations but are not.
17810
17811         (TypeContainer.Define): Add support for explicit interface method
17812         implementation. 
17813
17814 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * typemanager.cs: Keep track of the parameters here instead of
17817         being a feature of the TypeContainer.
17818
17819         * class.cs: Drop the registration of parameters here, as
17820         InterfaceMethods are also interface declarations.
17821
17822         * delegate.cs: Register methods with the TypeManager not only with
17823         the TypeContainer.  This code was buggy.
17824
17825         * interface.cs: Full registation here.
17826
17827 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * expression.cs: Remove reducer for binary expressions, it can not
17830         be done this way.
17831
17832         * const.cs: Put here the code that used to go into constant.cs
17833
17834         * constant.cs: Put here the code for constants, this is a new base
17835         class for Literals.
17836
17837         * literal.cs: Make Literal derive from Constant.
17838
17839 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17840
17841         * statement.cs (Return.Emit): Report error 157 if the user
17842         attempts to return from a finally block.
17843
17844         (Return.Emit): Instead of emitting a return, jump to the end of
17845         the function.
17846
17847         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17848         LocalBuilder to store the result of the function.  ReturnLabel is
17849         the target where we jump.
17850
17851
17852 2001-12-09  Radek Doulik  <rodo@ximian.com>
17853
17854         * cs-parser.jay: remember alias in current namespace
17855
17856         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17857         namespaces
17858
17859         * class.cs (LookupAlias): lookup alias in my_namespace
17860
17861         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17862         aliases hashtable
17863         (LookupAlias): lookup alias in this and if needed in parent
17864         namespaces
17865
17866 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17867
17868         * support.cs: 
17869
17870         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17871         making things static.  I need this to avoid passing the
17872         TypeContainer when calling ParameterType.
17873
17874         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17875         that did string manipulation to compute the type and then call
17876         GetType.  Use Parameter.ParameterType instead.
17877
17878         * cs-tokenizer.cs: Consume the suffix for floating values.
17879
17880         * expression.cs (ParameterReference): figure out whether this is a
17881         reference parameter or not.  Kill an extra variable by computing
17882         the arg_idx during emission.
17883
17884         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17885         function that returns whether a parameter is an out/ref value or not.
17886
17887         (Parameter.ParameterType): The type of the parameter (base,
17888         without ref/out applied).
17889
17890         (Parameter.Resolve): Perform resolution here.
17891         (Parameter.ExternalType): The full type (with ref/out applied).
17892
17893         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17894         support for expressions on the using statement.
17895
17896 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17897
17898         * statement.cs (Using.EmitLocalVariableDecls): Split the
17899         localvariable handling of the using statement.
17900
17901         (Block.EmitMeta): Keep track of variable count across blocks.  We
17902         were reusing slots on separate branches of blocks.
17903
17904         (Try.Emit): Emit the general code block, we were not emitting it. 
17905
17906         Check the type of the declaration to be an IDisposable or
17907         something that can be implicity converted to it. 
17908
17909         Emit conversions if required.
17910
17911         * ecore.cs (EmptyExpression): New utility class.
17912         (Expression.ImplicitConversionExists): New utility function.
17913
17914 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * statement.cs (Using): Implement.
17917
17918         * expression.cs (LocalVariableReference): Support read only variables.
17919
17920         * statement.cs: Remove the explicit emit for the Leave opcode.
17921         (VariableInfo): Add a readonly field.
17922
17923 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * ecore.cs (ConvCast): new class used to encapsulate the various
17926         explicit integer conversions that works in both checked and
17927         unchecked contexts.
17928
17929         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17930         properly generate the overflow opcodes.
17931
17932 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17933
17934         * statement.cs: The correct type for the EmptyExpression is the
17935         element_type, not the variable type.  Ravi pointed this out.
17936
17937 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17938
17939         * class.cs (Method::Define): Handle PInvoke methods specially
17940         by using DefinePInvokeMethod instead of the usual one.
17941
17942         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17943         above to do the task of extracting information and defining the method.
17944
17945 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17946
17947         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17948         of the condition for string type.
17949
17950         (Emit): Move that here. 
17951
17952         (ArrayCreation::CheckIndices): Keep string literals in their expression
17953         form.
17954
17955         (EmitDynamicInitializers): Handle strings appropriately.
17956
17957 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17958
17959         * codegen.cs (EmitContext): Replace multiple variables with a
17960         single pointer to the current Switch statement.
17961
17962         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17963         EmitContext.
17964
17965 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17966
17967         * statement.cs 
17968
17969         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17970         default'.
17971
17972         (Foreach.Emit): Foreach on arrays was not setting
17973         up the loop variables (for break/continue).
17974
17975         (GotoCase): Semi-implented.
17976
17977 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17978
17979         * attribute.cs (CheckAttribute): Handle system attributes by using
17980         Attribute.GetAttributes to examine information we need.
17981
17982         (GetValidPlaces): Same here.
17983
17984         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17985
17986         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17987
17988         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17989
17990         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17991
17992         (Method::Emit): Handle the case when we are a PInvoke method.
17993
17994 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * expression.cs: Use ResolveWithSimpleName on compound names.
17997
17998 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17999
18000         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18001         before trying to reduce it.
18002
18003         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18004
18005         * constant.cs (LookupConstantValue): Implement.
18006
18007         (EmitConstant): Use the above in emitting the constant.
18008
18009         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18010         that are user-defined by doing a LookupConstantValue on them.
18011
18012         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18013         too, like above.
18014
18015 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18016
18017         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18018
18019         (BaseAccess.DoResolve): Implement.
18020
18021         (MemberAccess.DoResolve): Split this routine into a
18022         ResolveMemberAccess routine that can be used independently
18023
18024 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18025
18026         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18027         As that share bits of the implementation.  Is returns a boolean,
18028         while As returns the Type that is being probed.
18029
18030 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18031
18032         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18033         instead of a Literal - much easier.
18034
18035         (EnumInTransit): Remove - utterly useless :-)
18036
18037         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18038
18039         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18040
18041         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18042         chain when we have no associated expression.
18043
18044 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18045
18046         * constant.cs (Define): Use Location while reporting the errror.
18047
18048         Also emit a warning when 'new' is used and there is no inherited
18049         member to hide.
18050
18051         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18052         populated.
18053
18054         (LookupEnumValue): Implement to lookup an enum member's value and define it
18055         if necessary.
18056
18057         (Populate): Re-write accordingly to use the above routine.
18058
18059 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * expression.cs (This): Fix prototype for DoResolveLValue to
18062         override the base class DoResolveLValue.
18063
18064         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18065         declarations) 
18066
18067         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18068         (we need to load the address of the field here).  This fixes
18069         test-22. 
18070
18071         (FieldExpr.DoResolveLValue): Call the DoResolve
18072         function to initialize the Instance expression.
18073
18074         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18075         correctly the GetEnumerator operation on a value type.
18076
18077         * cs-parser.jay: Add more simple parsing error catches.
18078
18079         * statement.cs (Switch): Add support for string switches.
18080         Handle null specially.
18081
18082         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18083
18084 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18085
18086         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18087
18088         (declare_local_constant): New helper function.
18089
18090         * statement.cs (AddConstant): Keep a separate record of constants
18091
18092         (IsConstant): Implement to determine if a variable is a constant.
18093
18094         (GetConstantExpression): Implement.
18095
18096         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18097
18098         * statement.cs (IsVariableDefined): Re-write.
18099
18100 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18101
18102         * class.cs (TypeContainer::FindMembers): Look for constants
18103         in the case when we are looking for MemberTypes.Field
18104
18105         * expression.cs (MemberAccess::DoResolve): Check that in the
18106         case we are a FieldExpr and a Literal, we are not being accessed
18107         by an instance reference.
18108
18109         * cs-parser.jay (local_constant_declaration): Implement.
18110
18111         (declaration_statement): Implement for constant declarations.
18112
18113 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18114
18115         * statement.cs (Switch): Catch double defaults.
18116
18117         (Switch): More work on the switch() statement
18118         implementation.  It works for integral values now, need to finish
18119         string support.
18120
18121
18122 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18123
18124         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18125         integer literals into other integer literals.  To be used by
18126         switch. 
18127
18128 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18129
18130         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18131         some memory.
18132
18133         (EmitDynamicInitializers): Cope with the above since we extract data
18134         directly from ArrayData now.
18135
18136         (ExpectInitializers): Keep track of whether initializers are mandatory
18137         or not.
18138
18139         (Bounds): Make it a hashtable to prevent the same dimension being 
18140         recorded for every element in that dimension.
18141
18142         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18143         from being found.
18144
18145         Also fix bug which was causing the indices to be emitted in the reverse
18146         order.
18147
18148 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18149
18150         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18151         unfinished.  They do not work, because the underlying code is
18152         sloppy.
18153
18154 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18155
18156         * cs-parser.jay: Remove bogus fixme.
18157
18158         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18159         on Switch statement.
18160
18161 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18162
18163         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18164         the same. 
18165
18166         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18167         parameter. Apparently, any expression is allowed. 
18168
18169         (ValidateInitializers): Update accordingly.
18170
18171         (CheckIndices): Fix some tricky bugs thanks to recursion.
18172
18173         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18174         I was being completely brain-dead.
18175
18176         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18177         and re-write acordingly.
18178
18179         (DelegateInvocation): Re-write accordingly.
18180
18181         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18182
18183         (MakeByteBlob): Handle types more correctly.
18184
18185         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18186         initialization from expressions but it is incomplete because I am a complete
18187         Dodo :-|
18188
18189 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18192         on If.  Basically, we have to return `true' (ie, we do return to
18193         our caller) only if both branches of the if return.
18194
18195         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18196         short-circuit operators, handle them as short circuit operators. 
18197
18198         (Cast.DoResolve): Resolve type.
18199         (Cast.Cast): Take an expression as the target type.
18200
18201         * cs-parser.jay (cast_expression): Remove old hack that only
18202         allowed a limited set of types to be handled.  Now we take a
18203         unary_expression and we resolve to a type during semantic
18204         analysis.
18205
18206         Use the grammar productions from Rhys to handle casts (this is
18207         not complete like Rhys syntax yet, we fail to handle that corner
18208         case that C# has regarding (-x), but we will get there.
18209
18210 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18211
18212         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18213         field which is an array type.
18214
18215         * cs-parser.jay (declare_local_variables): Support array initialization too.
18216
18217         * typemanager.cs (MakeKey): Implement.
18218
18219         (everywhere): Use the above appropriately.
18220
18221         * cs-parser.jay (for_statement): Update for array initialization while
18222         declaring variables.
18223
18224         * ecore.cs : The error message was correct, it's the variable's names that
18225         were misleading ;-) Make the code more readable.
18226
18227         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18228         the correct type etc.
18229
18230         (ConvertExplicit): Handle Enum types by examining the underlying type.
18231
18232 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18233
18234         * parameter.cs (GetCallingConvention): Always return
18235         CallingConventions.Standard for now.
18236
18237 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18240         and `r' after calling DoNumericPromotions.
18241
18242         * ecore.cs: Fix error message (the types were in the wrong order).
18243
18244         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18245         BindingFlags.Instance as well 
18246
18247         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18248         implicit int literal conversion in an empty cast so that we
18249         propagate the right type upstream.
18250
18251         (UnboxCast): new class used to unbox value types.
18252         (Expression.ConvertExplicit): Add explicit type conversions done
18253         by unboxing.
18254
18255         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18256         the target type before applying the implicit LongLiterals to ULong
18257         literal cast.
18258
18259 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * cs-parser.jay (for_statement): Reworked the way For works: now
18262         we declare manually any variables that are introduced in
18263         for_initializer to solve the problem of having out-of-band code
18264         emition (that is what got for broken).
18265
18266         (declaration_statement): Perform the actual variable declaration
18267         that used to be done in local_variable_declaration here.
18268
18269         (local_variable_declaration): Do not declare anything, just pass
18270         the information on a DictionaryEntry
18271
18272 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18273
18274         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18275         re-write of the logic to now make it recursive.
18276
18277         (UpdateIndices): Re-write accordingly.
18278
18279         Store element data in a separate ArrayData list in the above methods.
18280
18281         (MakeByteBlob): Implement to dump the array data into a byte array.
18282
18283 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18284
18285         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18286         into CheckIndices.
18287
18288         * constant.cs (Define): Implement.
18289
18290         (EmitConstant): Re-write fully.
18291
18292         Pass in location info.
18293
18294         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18295         respectively.
18296
18297         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18298         DictionaryEntry since we need location info too.
18299
18300         (constant_declaration): Update accordingly.
18301
18302         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18303         code into another method : UpdateIndices.
18304
18305 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18306
18307         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18308         some type checking etc.
18309
18310 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18311
18312         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18313         bits to provide dimension info if the user skips doing that.
18314
18315         Update second constructor to store the rank correctly.
18316
18317 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18318
18319         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18320         and try to implement.
18321
18322         * ../errors/cs0150.cs : Add.
18323
18324         * ../errors/cs0178.cs : Add.
18325
18326 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * statement.cs: Implement foreach on multi-dimensional arrays. 
18329
18330         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18331         name of the params argument.
18332
18333         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18334         initializing the array.
18335
18336         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18337         we can use this elsewhere.
18338
18339         * statement.cs: Finish implementation of foreach for single
18340         dimension arrays.
18341
18342         * cs-parser.jay: Use an out-of-band stack to pass information
18343         around, I wonder why I need this.
18344
18345         foreach_block: Make the new foreach_block the current_block.
18346
18347         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18348         function used to return a static Parameters structure.  Used for
18349         empty parameters, as those are created very frequently.
18350
18351         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18352
18353 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18354
18355         * interface.cs : Default modifier is private, not public. The
18356         make verify test passes again.
18357
18358 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18359
18360         * support.cs (ReflectionParameters): Fix logic to determine
18361         whether the last parameter is a params one. Test 9 passes again.
18362
18363         * delegate.cs (Populate): Register the builders we define with
18364         RegisterParameterForBuilder. Test 19 passes again.
18365
18366         * cs-parser.jay (property_declaration): Reference $6 instead
18367         of $$ to get at the location.
18368
18369         (indexer_declaration): Similar stuff.
18370
18371         (attribute): Ditto.
18372
18373         * class.cs (Property): Register parameters for the Get and Set methods
18374         if they exist. Test 23 passes again.
18375
18376         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18377         call to EmitArguments as we are sure there aren't any params arguments. 
18378         Test 32 passes again.
18379
18380         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18381         IndexOutOfRangeException. 
18382
18383         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18384         Test 33 now passes again.
18385
18386 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18387
18388         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18389         broke a bunch of things.  Will have to come up with a better way
18390         of tracking locations.
18391
18392         * statement.cs: Implemented foreach for single dimension arrays.
18393
18394 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18397         an error.  This removes the lookup from the critical path.
18398
18399         * cs-parser.jay: Removed use of temporary_loc, which is completely
18400         broken. 
18401
18402 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * support.cs (ReflectionParameters.ParameterModifier): Report
18405         whether the argument is a PARAMS argument or not.
18406
18407         * class.cs: Set the attribute `ParamArrayAttribute' on the
18408         parameter argument.
18409
18410         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18411         and cons_param_array_attribute (ConstructorInfo for
18412         ParamArrayAttribute)., 
18413
18414         * codegen.cs: Emit the return using the `Return' statement, that
18415         way we can report the error correctly for missing return values. 
18416
18417         * class.cs (Method.Emit): Clean up.
18418
18419         * expression.cs (Argument.Resolve): Take another argument: the
18420         location where this argument is used.  Notice that this is not
18421         part of the "Argument" class as to reduce the size of the
18422         structure (we know the approximate location anyways).
18423
18424         Test if the argument is a variable-reference, if not, then
18425         complain with a 206.
18426
18427         (Argument.Emit): Emit addresses of variables.
18428
18429         (Argument.FullDesc): Simplify.
18430
18431         (Invocation.DoResolve): Update for Argument.Resolve.
18432
18433         (ElementAccess.DoResolve): ditto.
18434
18435         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18436         method should be virtual, as this method is always virtual.
18437
18438         (NewDelegate.DoResolve): Update for Argument.Resolve.
18439
18440         * class.cs (ConstructorInitializer.DoResolve): ditto.
18441
18442         * attribute.cs (Attribute.Resolve): ditto.
18443
18444 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18445
18446         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18447
18448         * expression.cs (ParameterReference): Drop IStackStorage and implement
18449         IAssignMethod instead. 
18450
18451         (LocalVariableReference): ditto.
18452
18453         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18454         IAssignMethod instead. 
18455
18456 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18457
18458         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18459         enumerations that are used in heavily used structures derive from
18460         byte in a laughable and pathetic attempt to reduce memory usage.
18461         This is the kind of pre-optimzations that you should not do at
18462         home without adult supervision.
18463
18464         * expression.cs (UnaryMutator): New class, used to handle ++ and
18465         -- separatedly from the other unary operators.  Cleans up the
18466         code, and kills the ExpressionStatement dependency in Unary.
18467
18468         (Unary): Removed `method' and `Arguments' from this class, making
18469         it smaller, and moving it all to SimpleCall, so I can reuse this
18470         code in other locations and avoid creating a lot of transient data
18471         strucutres when not required.
18472
18473         * cs-parser.jay: Adjust for new changes.
18474
18475 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18476
18477         * enum.cs (Enum.Populate): If there is a failure during
18478         definition, return
18479
18480         * cs-parser.jay (opt_enum_base): we used to catch type errors
18481         here, but this is really incorrect.  The type error should be
18482         catched during semantic analysis.
18483
18484 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18485
18486         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18487         current_local_parameters as expected since I, in my stupidity, had forgotten
18488         to do this :-)
18489
18490         * attribute.cs (GetValidPlaces): Fix stupid bug.
18491
18492         * class.cs (Method::Emit): Perform check on applicability of attributes.
18493
18494         (Constructor::Emit): Ditto.
18495
18496         (Field::Emit): Ditto.
18497
18498         (Field.Location): Store location information.
18499
18500         (Property, Event, Indexer, Operator): Ditto.
18501
18502         * cs-parser.jay (field_declaration): Pass in location for each field.
18503
18504         * ../errors/cs0592.cs : Add.
18505
18506 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18507
18508         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18509
18510         (InitCoreTypes): Update accordingly.
18511
18512         (RegisterAttrType, LookupAttr): Implement.
18513
18514         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18515         info about the same.
18516
18517         (Resolve): Update to populate the above as necessary.
18518
18519         (Error592): Helper.
18520
18521         (GetValidPlaces): Helper to the above.
18522
18523         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18524
18525         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18526
18527 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18528
18529         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18530
18531         * ../errors/cs0617.cs : Add.
18532
18533 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18534
18535         * enum.cs (Emit): Rename to Populate to be more consistent with what
18536         we expect it to do and when exactly it is called.
18537
18538         * class.cs, rootcontext.cs : Update accordingly.
18539
18540         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18541         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18542
18543         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18544
18545         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18546         of a fieldinfo using the above, when dealing with a FieldBuilder.
18547
18548 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18549
18550         * ../errors/cs0031.cs : Add.
18551
18552         * ../errors/cs1008.cs : Add.
18553
18554         * ../errrors/cs0543.cs : Add.
18555
18556         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18557         enum type.
18558
18559         (FindMembers): Implement.
18560
18561         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18562         enums and delegates too.
18563
18564         (enum_types): Rename to builder_to_enum.
18565
18566         (delegate_types): Rename to builder_to_delegate.
18567
18568         * delegate.cs (FindMembers): Implement.
18569
18570 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18571
18572         * typemanager.cs (IsEnumType): Implement.
18573
18574         * enum.cs (Emit): Re-write parts to account for the underlying type
18575         better and perform checking etc.
18576
18577         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18578         of the underlying type.
18579
18580         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18581         value
18582
18583         * enum.cs (error31): Helper to report error #31.
18584
18585         * cs-parser.jay (enum_declaration): Store location of each member too.
18586
18587         * enum.cs (member_to_location): New hashtable. 
18588
18589         (AddEnumMember): Update location hashtable.
18590
18591         (Emit): Use the location of each member while reporting errors.
18592
18593 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * cs-parser.jay: A for_initializer if is a
18596         local_variable_declaration really ammount to have an implicit
18597         block with the variable declaration and no initializer for for.
18598
18599         * statement.cs (For.Emit): Cope with null initializers.
18600
18601         This fixes the infinite loop on for initializers.
18602
18603 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18604
18605         * enum.cs: More cleanup.
18606
18607         * ecore.cs: Remove dead code.
18608
18609         * class.cs (Property.Emit): More simplification.
18610         (Event.Emit): ditto.
18611
18612         Reworked to have less levels of indentation.
18613
18614 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18615
18616         * class.cs (Property): Emit attributes.
18617
18618         (Field): Ditto.
18619
18620         (Event): Ditto.
18621
18622         (Indexer): Ditto.
18623
18624         (Operator): Ditto.
18625
18626         * enum.cs (Emit): Ditto.
18627
18628         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18629         Enums too.
18630
18631         * class.cs (Field, Event, etc.): Move attribute generation into the
18632         Emit method everywhere.
18633
18634         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18635         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18636         as we had no way of defining nested enums !
18637
18638         * rootcontext.cs : Adjust code accordingly.
18639
18640         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18641
18642 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18643
18644         * expression.cs (EvalConstantExpression): Move into ecore.cs
18645
18646         * enum.cs (Enum): Rename some members and make them public and readonly
18647         according to our convention.
18648
18649         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18650         nothing else.
18651
18652         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18653
18654         (Enum::Emit): Write a simple version for now which doesn't try to compute
18655         expressions. I shall modify this to be more robust in just a while.
18656
18657         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18658
18659         (TypeContainer::CloseType): Create the Enum types too.
18660
18661         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18662
18663         * expression.cs (EvalConstantExpression): Get rid of completely.
18664
18665         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18666         user-defined values and other cases.
18667
18668         (IsValidEnumLiteral): Helper function.
18669
18670         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18671         out there in the case we had a literal FieldExpr.
18672
18673         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18674
18675         (Literalize): Revamp a bit to take two arguments.
18676
18677         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18678
18679 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18680
18681         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18682
18683         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18684
18685         (Resolve): Use the above to ensure we have proper initializers.
18686
18687 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18688
18689         * expression.cs (Expression::EvalConstantExpression): New method to 
18690         evaluate constant expressions.
18691
18692         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18693
18694 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18695
18696         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18697         in an array.
18698
18699         (Binary.ResolveOperator): Handle operator != (object a, object b)
18700         and operator == (object a, object b);
18701
18702         (Binary.DoNumericPromotions): Indicate whether the numeric
18703         promotion was possible.
18704
18705         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18706         Implement.  
18707
18708         Made the ArrayAccess implement interface IAssignMethod instead of
18709         IStackStore as the order in which arguments are passed reflects
18710         this.
18711
18712         * assign.cs: Instead of using expr.ExprClass to select the way of
18713         assinging, probe for the IStackStore/IAssignMethod interfaces.
18714
18715         * typemanager.cs: Load InitializeArray definition.
18716
18717         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18718         static data that can be used to initialize arrays. 
18719
18720 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18721
18722         * expression.cs: Handle operator== and operator!= for booleans.
18723
18724         (Conditioal.Reduce): Implement reducer for the ?: operator.
18725
18726         (Conditional.Resolve): Implement dead code elimination.
18727
18728         (Binary.Resolve): Catch string literals and return a new
18729         concatenated string.
18730
18731         (Unary.Reduce): Implement reduction of unary expressions.
18732
18733         * ecore.cs: Split out the expression core handling here.
18734
18735         (Expression.Reduce): New method used to perform constant folding
18736         and CSE.  This is needed to support constant-expressions. 
18737
18738         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18739         targets, and optimize for !x.
18740
18741 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18742
18743         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18744         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18745         set custom atttributes.
18746
18747         * literal.cs (Literal::GetValue): New abstract method to return the actual
18748         value of the literal, cast as an object.
18749
18750         (*Literal): Implement GetValue method.
18751
18752         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18753         expressions to the arraylist but objects of type Argument.
18754
18755         * class.cs (TypeContainer::Emit): Emit our attributes too.
18756
18757         (Method::Emit, Constructor::Emit): Ditto.
18758
18759         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18760         to be ignoring earlier.
18761
18762 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18763
18764         * attribute.cs (AttributeSection::Define): Implement to do the business
18765         of constructing a CustomAttributeBuilder.
18766
18767         (Attribute): New trivial class. Increases readability of code.  
18768
18769         * cs-parser.jay : Update accordingly.
18770
18771         (positional_argument_list, named_argument_list, named_argument): New rules
18772
18773         (attribute_arguments): Use the above so that we are more correct.
18774
18775 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18776
18777         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18778         to perform all checks for a method with a params parameter.
18779
18780         (Invocation::OverloadResolve): Update to use the above method and therefore
18781         cope correctly with params method invocations.
18782
18783         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18784         params too.
18785
18786         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18787         constructors in our parent too because we can't afford to miss out on 
18788         protected ones ;-)
18789
18790         * attribute.cs (AttributeSection): New name for the class Attribute
18791
18792         Other trivial changes to improve readability.
18793
18794         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18795         use the new class names.
18796
18797 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18798
18799         * class.cs (Method::Define): Complete definition for params types too
18800
18801         (Indexer::Define): Ditto.
18802
18803         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18804         Cope everywhere with a request for info about the array parameter.
18805
18806 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18807
18808         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18809
18810         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18811         local_variable_type to extract the string corresponding to the type.
18812
18813         (local_variable_type): Fixup the action to use the new helper method.
18814
18815         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18816         go.
18817
18818         * expression.cs : Clean out code which uses the above.
18819
18820 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18821
18822         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18823         and bale out if necessary by returning a false.
18824
18825         (RegisterProperty): Ditto.
18826
18827         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18828         and print out appropriate error messages.
18829
18830         * interface.cs (everywhere): Ditto.
18831
18832         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18833         location to constructor.
18834
18835         * class.cs (Property, Event, Indexer): Update accordingly.
18836
18837         * ../errors/cs111.cs : Added.
18838
18839         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18840         of a method, as laid down by the spec.
18841
18842         (Invocation::OverloadResolve): Use the above method.
18843
18844 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18845
18846         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18847         now take a TypeContainer and a Parameters object.
18848
18849         (ParameterData): Modify return type of ParameterModifier method to be 
18850         Parameter.Modifier and not a string.
18851
18852         (ReflectionParameters, InternalParameters): Update accordingly.
18853
18854         * expression.cs (Argument::GetParameterModifier): Same here.
18855
18856         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18857         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18858         symbol in it at all so maybe this is only for now.
18859
18860 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18861
18862         * support.cs (InternalParameters): Constructor now takes an extra argument 
18863         which is the actual Parameters class.
18864
18865         (ParameterDesc): Update to provide info on ref/out modifiers.
18866
18867         * class.cs (everywhere): Update call to InternalParameters to pass in
18868         the second argument too.
18869
18870         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18871         to return the modifier info [ref/out etc]
18872
18873         (InternalParameters, ReflectionParameters): Implement the above.
18874
18875         * expression.cs (Argument::ParameterModifier): Similar function to return
18876         info about the argument's modifiers.
18877
18878         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18879         too.
18880
18881         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18882         a new SetFormalParameters object which we pass to InternalParameters.
18883
18884 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18885
18886         * expression.cs (NewArray): Merge into the ArrayCreation class.
18887
18888 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18889
18890         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18891         NewUserdefinedArray into one as there wasn't much of a use in having
18892         two separate ones.
18893
18894         * expression.cs (Argument): Change field's name to ArgType from Type.
18895
18896         (Type): New readonly property which returns the proper type, taking into 
18897         account ref/out modifiers.
18898
18899         (everywhere): Adjust code accordingly for the above.
18900
18901         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18902         whether we are emitting for a ref or out parameter.
18903
18904         * expression.cs (Argument::Emit): Use the above field to set the state.
18905
18906         (LocalVariableReference::Emit): Update to honour the flag and emit the
18907         right stuff.
18908
18909         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18910
18911         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18912
18913         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18914
18915         (ReflectionParameters, InternalParameters): Implement the above method.
18916
18917         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18918         reporting errors.
18919
18920         (Invocation::FullMethodDesc): Ditto. 
18921
18922 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * cs-parser.jay: Add extra production for the second form of array
18925         creation. 
18926
18927         * expression.cs (ArrayCreation): Update to reflect the above
18928         change. 
18929
18930         * Small changes to prepare for Array initialization.
18931
18932 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18933
18934         * typemanager.cs (ImplementsInterface): interface might be null;
18935         Deal with this problem;
18936
18937         Also, we do store negative hits on the cache (null values), so use
18938         this instead of calling t.GetInterfaces on the type everytime.
18939
18940 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18941
18942         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18943
18944         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18945         split functionality out into different classes.
18946
18947         (New::FormArrayType): Move into NewBuiltinArray.
18948
18949         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18950         quite useless.
18951
18952         (NewBuiltinArray): New class to handle creation of built-in arrays.
18953
18954         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18955         account creation of one-dimensional arrays.
18956
18957         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18958
18959         (NewUserdefinedArray::DoResolve): Implement.
18960
18961         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18962
18963         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18964         we maintain inside the TypeManager. This is necessary to perform lookups on the
18965         module builder.
18966
18967         (LookupType): Update to perform GetType on the module builders too.     
18968
18969         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18970
18971         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18972
18973 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18974
18975         * expression.cs (New::DoResolve): Implement guts of array creation.
18976
18977         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18978
18979 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18980
18981         * expression.cs: Fix bug I introduced lsat night that broke
18982         Delegates. 
18983
18984         (Expression.Resolve): Report a 246 error (can not resolve name)
18985         if we find a SimpleName in the stream.
18986
18987         (Expression.ResolveLValue): Ditto.
18988
18989         (Expression.ResolveWithSimpleName): This function is a variant of
18990         ResolveName, this one allows SimpleNames to be returned without a
18991         warning.  The only consumer of SimpleNames is MemberAccess
18992
18993 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18996         might arrive here.  I have my doubts that this is correct.
18997
18998         * statement.cs (Lock): Implement lock statement.
18999
19000         * cs-parser.jay: Small fixes to support `lock' and `using'
19001
19002         * cs-tokenizer.cs: Remove extra space
19003
19004         * driver.cs: New flag --checked, allows to turn on integer math
19005         checking. 
19006
19007         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19008         Threading.Monitor.Exit 
19009
19010 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19011
19012         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19013         Expression Class to be IndexerAccess.
19014
19015         Notice that Indexer::DoResolve sets the eclass to Value.
19016
19017 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19018
19019         * class.cs (TypeContainer::Emit): Emit code for indexers.
19020
19021         * assign.cs (IAssignMethod): New interface implemented by Indexers
19022         and Properties for handling assignment.
19023
19024         (Assign::Emit): Simplify and reuse code. 
19025
19026         * expression.cs (IndexerAccess, PropertyExpr): Implement
19027         IAssignMethod, clean up old code. 
19028
19029 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19030
19031         * typemanager.cs (ImplementsInterface): New method to determine if a type
19032         implements a given interface. Provides a nice cache too.
19033
19034         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19035         method.
19036
19037         (ConvertReferenceExplicit): Ditto.
19038
19039         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19040         various methods, with correct names etc.
19041
19042         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19043         Operator.UnaryNegation.
19044
19045         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19046         we have a unary plus or minus operator.
19047
19048         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19049         UnaryMinus.
19050
19051         * everywhere : update accordingly.
19052
19053         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19054         respectively.
19055
19056         * class.cs (Method::Define): For the case where we are implementing a method
19057         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19058         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19059
19060 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19061
19062         * interface.cs (FindMembers): Implement to work around S.R.E
19063         lameness.
19064
19065         * typemanager.cs (IsInterfaceType): Implement.
19066
19067         (FindMembers): Update to handle interface types too.
19068
19069         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19070         use IsAssignableFrom as that is not correct - it doesn't work.
19071
19072         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19073         and accordingly override EmitStatement.
19074
19075         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19076         using the correct logic :-)
19077
19078 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19079
19080         * ../errors/cs-11.cs : Add to demonstrate error -11 
19081
19082 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19083
19084         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19085         then pass this as a hint to ResolveLValue.
19086
19087         * expression.cs (FieldExpr): Add Location information
19088
19089         (FieldExpr::LValueResolve): Report assignment to readonly
19090         variable. 
19091
19092         (Expression::ExprClassFromMemberInfo): Pass location information.
19093
19094         (Expression::ResolveLValue): Add new method that resolves an
19095         LValue. 
19096
19097         (Expression::DoResolveLValue): Default invocation calls
19098         DoResolve. 
19099
19100         (Indexers): New class used to keep track of indexers in a given
19101         Type. 
19102
19103         (IStackStore): Renamed from LValue, as it did not really describe
19104         what this did.  Also ResolveLValue is gone from this interface and
19105         now is part of Expression.
19106
19107         (ElementAccess): Depending on the element access type
19108
19109         * typemanager.cs: Add `indexer_name_type' as a Core type
19110         (System.Runtime.CompilerServices.IndexerNameAttribute)
19111
19112         * statement.cs (Goto): Take a location.
19113
19114 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19115
19116         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19117         if two delegates are compatible.
19118
19119         (NewDelegate::DoResolve): Update to take care of the case when
19120         we instantiate a delegate from another delegate.
19121
19122         * typemanager.cs (FindMembers): Don't even try to look up members
19123         of Delegate types for now.
19124
19125 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19126
19127         * delegate.cs (NewDelegate): New class to take care of delegate
19128         instantiation.
19129
19130         * expression.cs (New): Split the delegate related code out into 
19131         the NewDelegate class.
19132
19133         * delegate.cs (DelegateInvocation): New class to handle delegate 
19134         invocation.
19135
19136         * expression.cs (Invocation): Split out delegate related code into
19137         the DelegateInvocation class.
19138
19139 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19140
19141         * expression.cs (New::DoResolve): Implement delegate creation fully
19142         and according to the spec.
19143
19144         (New::DoEmit): Update to handle delegates differently.
19145
19146         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19147         because of which we were printing out arguments in reverse order !
19148
19149         * delegate.cs (VerifyMethod): Implement to check if the given method
19150         matches the delegate.
19151
19152         (FullDelegateDesc): Implement.
19153
19154         (VerifyApplicability): Implement.
19155
19156         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19157         delegate invocations too.
19158
19159         (Invocation::Emit): Ditto.
19160
19161         * ../errors/cs1593.cs : Added.
19162
19163         * ../errors/cs1594.cs : Added.
19164
19165         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19166
19167 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19168
19169         * typemanager.cs (intptr_type): Core type for System.IntPtr
19170
19171         (InitCoreTypes): Update for the same.
19172
19173         (iasyncresult_type, asynccallback_type): Ditto.
19174
19175         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19176         correct.
19177
19178         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19179         too.
19180
19181         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19182         the builders for the 4 members of a delegate type :-)
19183
19184         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19185         type.
19186
19187         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19188
19189         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19190
19191 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19192
19193         * statement.cs (Break::Emit): Implement.   
19194         (Continue::Emit): Implement.
19195
19196         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19197         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19198         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19199         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19200         end loop
19201
19202         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19203         properties that track the label for the current loop (begin of the
19204         loop and end of the loop).
19205
19206 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19207
19208         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19209         use of emitting anything at all.
19210
19211         * class.cs, rootcontext.cs : Get rid of calls to the same.
19212
19213         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19214
19215         (Populate): Define the constructor correctly and set the implementation
19216         attributes.
19217
19218         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19219         have been defined.
19220
19221         (AddDelegateType): Implement.
19222
19223         (IsDelegateType): Implement helper method.
19224
19225         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19226
19227         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19228         and accordingly handle it.
19229
19230         * delegate.cs (Populate): Take TypeContainer argument.
19231         Implement bits to define the Invoke method. However, I still haven't figured out
19232         how to take care of the native int bit :-(
19233
19234         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19235         Qualify the name of the delegate, not its return type !
19236
19237         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19238         conversion.
19239
19240         (StandardConversionExists): Checking for array types turns out to be recursive.
19241
19242         (ConvertReferenceExplicit): Implement array conversion.
19243
19244         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19245
19246 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19247
19248         * cs-parser.jay (delegate_declaration): Store the fully qualified
19249         name as it is a type declaration.
19250
19251         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19252         readonly.
19253
19254         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19255         as TypeContainer::DefineType.
19256
19257         (Populate): Method in which all the definition of the various methods (Invoke)
19258         etc is done.
19259
19260         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19261         see.
19262
19263         (CloseDelegate): Finally creates the delegate.
19264
19265         * class.cs (TypeContainer::DefineType): Update to define delegates.
19266         (Populate, Emit and CloseType): Do the same thing here too.
19267
19268         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19269         delegates in all these operations.
19270
19271 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19272
19273         * expression.cs: LocalTemporary: a new expression used to
19274         reference a temporary that has been created.
19275
19276         * assign.cs: Handle PropertyAccess back here, so that we can
19277         provide the proper semantic access to properties.
19278
19279         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19280         a few more explicit conversions. 
19281
19282         * modifiers.cs: `NEW' modifier maps to HideBySig.
19283
19284         * expression.cs (PropertyExpr): Make this into an
19285         ExpressionStatement, and support the EmitStatement code path. 
19286
19287         Perform get/set error checking, clean up the interface.
19288
19289         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19290         them into toplevel access objects.
19291
19292 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19293
19294         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19295         SRE.
19296
19297         * typemanager.cs: Keep track here of our PropertyBuilders again to
19298         work around lameness in SRE.
19299
19300 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * expression.cs (LValue::LValueResolve): New method in the
19303         interface, used to perform a second resolution pass for LValues. 
19304
19305         (This::DoResolve): Catch the use of this in static methods.
19306
19307         (This::LValueResolve): Implement.
19308
19309         (This::Store): Remove warning, assigning to `this' in structures
19310         is 
19311
19312         (Invocation::Emit): Deal with invocation of
19313         methods on value types.  We need to pass the address to structure
19314         methods rather than the object itself.  (The equivalent code to
19315         emit "this" for structures leaves the entire structure on the
19316         stack instead of a pointer to it). 
19317
19318         (ParameterReference::DoResolve): Compute the real index for the
19319         argument based on whether the method takes or not a `this' pointer
19320         (ie, the method is static).
19321
19322         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19323         value types returned from functions when we need to invoke a
19324         method on the sturcture.
19325
19326
19327 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19328
19329         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19330         defining the type in the Modulebuilder or Typebuilder. This is to take
19331         care of nested types which need to be defined on the TypeBuilder using
19332         DefineNestedMethod.
19333
19334         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19335         methods in RootContext, only ported to be part of TypeContainer.
19336
19337         (TypeContainer::GetInterfaceOrClass): Ditto.
19338
19339         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19340
19341         * interface.cs (Interface::DefineInterface): New method. Does exactly
19342         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19343         too.
19344
19345         (Interface::GetInterfaces): Move from RootContext here and port.
19346
19347         (Interface::GetInterfaceByName): Same here.
19348
19349         * rootcontext.cs (ResolveTree): Re-write.
19350
19351         (PopulateTypes): Re-write.
19352
19353         * class.cs (TypeContainer::Populate): Populate nested types too.
19354         (TypeContainer::Emit): Emit nested members too.
19355
19356         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19357         instead just use the name argument passed in as it is already fully
19358         qualified.
19359
19360         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19361         to TypeContainer mapping to see if a type is user-defined.
19362
19363         * class.cs (TypeContainer::CloseType): Implement. 
19364
19365         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19366         the default constructor.
19367
19368         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19369         twice.
19370
19371         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19372
19373         * interface.cs (CloseType): Create the type here.
19374
19375         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19376         the hierarchy.
19377
19378         Remove all the methods which are now in TypeContainer.
19379
19380 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19381
19382         * delegate.cs (Define): Re-write bits to define the delegate
19383         correctly.
19384
19385 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19386
19387         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19388
19389         * expression.cs (ImplicitReferenceConversion): handle null as well
19390         as a source to convert to any reference type.
19391
19392         * statement.cs (Return): Perform any implicit conversions to
19393         expected return type.  
19394
19395         Validate use of return statement.  
19396
19397         * codegen.cs (EmitContext): Pass the expected return type here.
19398
19399         * class.cs (Method, Constructor, Property): Pass expected return
19400         type to EmitContext.
19401
19402 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19403
19404         * expression.cs: Make DoResolve take an EmitContext instead of a
19405         TypeContainer.
19406
19407         Replaced `l' and `location' for `loc', for consistency.
19408
19409         (Error, Warning): Remove unneeded Tc argument.
19410
19411         * assign.cs, literal.cs, constant.cs: Update to new calling
19412         convention. 
19413
19414         * codegen.cs: EmitContext now contains a flag indicating whether
19415         code is being generated in a static method or not.
19416
19417         * cs-parser.jay: DecomposeQI, new function that replaces the old
19418         QualifiedIdentifier.  Now we always decompose the assembled
19419         strings from qualified_identifier productions into a group of
19420         memberaccesses.
19421
19422 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19423
19424         * rootcontext.cs: Deal with field-less struct types correctly now
19425         by passing the size option to Define Type.
19426
19427         * class.cs: Removed hack that created one static field. 
19428
19429 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19430
19431         * statement.cs: Moved most of the code generation here. 
19432
19433 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19434
19435         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19436         seem very right.
19437
19438         (ElementAccess): Remove useless bits for now - keep checks as the spec
19439         says.
19440
19441 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19442
19443         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19444         and start performing checks according to the spec.
19445
19446 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19447
19448         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19449         rank_specifiers instead.
19450
19451         (rank_specifiers): Change the order in which the rank specifiers are stored
19452
19453         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19454
19455         * expression.cs (ElementAccess): Implement the LValue interface too.
19456
19457 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19458
19459         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19460         except that user defined conversions are not included.
19461
19462         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19463         perform the conversion of the return type, if necessary.
19464
19465         (New::DoResolve): Check whether we are creating an array or an object
19466         and accordingly do the needful.
19467
19468         (New::Emit): Same here.
19469
19470         (New::DoResolve): Implement guts of array creation.
19471
19472         (New::FormLookupType): Helper function.
19473
19474 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * codegen.cs: Removed most of the code generation here, and move the
19477         corresponding code generation bits to the statement classes. 
19478
19479         Added support for try/catch/finalize and throw.
19480
19481         * cs-parser.jay: Added support for try/catch/finalize.
19482
19483         * class.cs: Catch static methods having the flags override,
19484         virtual or abstract.
19485
19486         * expression.cs (UserCast): This user cast was not really doing
19487         what it was supposed to do.  Which is to be born in fully resolved
19488         state.  Parts of the resolution were being performed at Emit time! 
19489
19490         Fixed this code.
19491
19492 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * expression.cs: Implicity convert the result from UserCast.
19495
19496 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19497
19498         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19499         prevented it from working correctly. 
19500
19501         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19502         merely ConvertImplicit.
19503
19504 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19505
19506         * typemanager.cs: Make the LookupTypeContainer function static,
19507         and not per-instance.  
19508
19509         * class.cs: Make static FindMembers (the one that takes a Type
19510         argument). 
19511
19512         * codegen.cs: Add EmitForeach here.
19513
19514         * cs-parser.jay: Make foreach a toplevel object instead of the
19515         inline expansion, as we need to perform semantic analysis on it. 
19516
19517 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19518
19519         * expression.cs (Expression::ImplicitUserConversion): Rename to
19520         UserDefinedConversion.
19521
19522         (Expression::UserDefinedConversion): Take an extra argument specifying 
19523         whether we look for explicit user conversions too.
19524
19525         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19526
19527         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19528
19529         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19530         with the appropriate arguments.
19531
19532         * cs-parser.jay (cast_expression): Record location too.
19533
19534         * expression.cs (Cast): Record location info.
19535
19536         (Expression::ConvertExplicit): Take location argument.
19537
19538         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19539         to determine if we are doing explicit conversions.
19540
19541         (UserCast::Emit): Update accordingly.
19542
19543         (Expression::ConvertExplicit): Report an error if everything fails.
19544
19545         * ../errors/cs0030.cs : Add.
19546
19547 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19548
19549         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19550         virtual and newslot bits. 
19551
19552         * class.cs (TypeContainer::RegisterRequiredImplementations):
19553         Record methods we need.
19554
19555         (TypeContainer::MakeKey): Helper function to make keys for
19556         MethodBases, since the Methodbase key is useless.
19557
19558         (TypeContainer::Populate): Call RegisterRequiredImplementations
19559         before defining the methods.   
19560
19561         Create a mapping for method_builders_to_methods ahead of time
19562         instead of inside a tight loop.
19563
19564         (::RequireMethods):  Accept an object as the data to set into the
19565         hashtable so we can report interface vs abstract method mismatch.
19566
19567 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * report.cs: Make all of it static.
19570
19571         * rootcontext.cs: Drop object_type and value_type computations, as
19572         we have those in the TypeManager anyways.
19573
19574         Drop report instance variable too, now it is a global.
19575
19576         * driver.cs: Use try/catch on command line handling.
19577
19578         Add --probe option to debug the error reporting system with a test
19579         suite. 
19580
19581         * report.cs: Add support for exiting program when a probe
19582         condition is reached.
19583
19584 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19585
19586         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19587         we do a forcible conversion regardless of type, to check if 
19588         ForceConversion returns a null.
19589
19590         (Binary::error19): Use location to report error.
19591
19592         (Unary::error23): Use location here too.
19593
19594         * ../errors/cs0019.cs : Check in.
19595
19596         * ../errors/cs0023.cs : Check in.
19597
19598         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19599         case of a non-null MethodInfo object with a length of 0 !
19600
19601         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19602         an applicable member - according to the spec :-)
19603         Also fix logic to find members in base types.
19604
19605         (Unary::ResolveOperator): Same here.
19606
19607         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19608         as I was getting thoroughly confused between this and error19 :-)
19609
19610         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19611         (::FindMostEncompassedType): Implement.
19612         (::FindMostEncompassingType): Implement.
19613         (::StandardConversionExists): Implement.
19614
19615         (UserImplicitCast): Re-vamp. We now need info about most specific
19616         source and target types so that we can do the necessary conversions.
19617
19618         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19619         mathematical union with no duplicates.
19620
19621 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19622
19623         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19624         in order from base classes to child classes, so that we can in
19625         child classes look up in our parent for method names and
19626         attributes (required for handling abstract, virtual, new, override
19627         constructs: we need to instrospect our base class, and if we dont
19628         populate the classes in order, the introspection might be
19629         incorrect.  For example, a method could query its parent before
19630         the parent has any methods and would determine that the parent has
19631         no abstract methods (while it could have had them)).
19632
19633         (RootContext::CreateType): Record the order in which we define the
19634         classes.
19635
19636 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19637
19638         * class.cs (TypeContainer::Populate): Also method definitions can
19639         fail now, keep track of this.
19640
19641         (TypeContainer::FindMembers): Implement support for
19642         DeclaredOnly/noDeclaredOnly flag.
19643
19644         (Constructor::Emit) Return the ConstructorBuilder.
19645
19646         (Method::Emit) Return the MethodBuilder. 
19647         Check for abstract or virtual methods to be public.
19648
19649         * rootcontext.cs (RootContext::CreateType): Register all the
19650         abstract methods required for the class to be complete and the
19651         interface methods that must be implemented. 
19652
19653         * cs-parser.jay: Report error 501 (method requires body if it is
19654         not marked abstract or extern).
19655
19656         * expression.cs (TypeOf::Emit): Implement.
19657
19658         * typemanager.cs: runtime_handle_type, new global type.
19659
19660         * class.cs (Property::Emit): Generate code for properties.
19661
19662 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19663
19664         * expression.cs (Unary::ResolveOperator): Find operators on base type
19665         too - we now conform exactly to the spec.
19666
19667         (Binary::ResolveOperator): Same here.
19668
19669         * class.cs (Operator::Define): Fix minor quirk in the tests.
19670
19671         * ../errors/cs0215.cs : Added.
19672
19673         * ../errors/cs0556.cs : Added.
19674
19675         * ../errors/cs0555.cs : Added.
19676
19677 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19680         single integer which is really efficient
19681
19682 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19683
19684         *  expression.cs (Expression::ImplicitUserConversion): Use location
19685         even in the case when we are examining True operators.
19686  
19687         * class.cs (Operator::Define): Perform extensive checks to conform
19688         with the rules for operator overloading in the spec.
19689
19690         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19691         some of the other conversions mentioned in the spec.
19692
19693         * typemanager.cs (array_type): New static member for the System.Array built-in
19694         type.
19695
19696         (cloneable_interface): For System.ICloneable interface.
19697
19698         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19699         we start resolving the tree and populating types.
19700
19701         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19702  
19703 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19704
19705         * expression.cs (Expression::ExprClassFromMemberInfo,
19706         Expression::Literalize): Create literal expressions from
19707         FieldInfos which are literals.
19708
19709         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19710         type casts, because they were wrong.  The test suite in tests
19711         caught these ones.
19712
19713         (ImplicitNumericConversion): ushort to ulong requires a widening
19714         cast. 
19715
19716         Int32 constant to long requires widening cast as well.
19717
19718         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19719         for integers because the type on the stack is not i4.
19720
19721 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19722
19723         * expression.cs (report118): require location argument. 
19724
19725         * parameter.cs: Do not dereference potential null value.
19726
19727         * class.cs: Catch methods that lack the `new' keyword when
19728         overriding a name.  Report warnings when `new' is used without
19729         anything being there to override.
19730
19731         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19732
19733         * class.cs: Only add constructor to hashtable if it is non-null
19734         (as now constructors can fail on define).
19735
19736         (TypeManager, Class, Struct): Take location arguments.
19737
19738         Catch field instance initialization in structs as errors.
19739
19740         accepting_filter: a new filter for FindMembers that is static so
19741         that we dont create an instance per invocation.
19742
19743         (Constructor::Define): Catch errors where a struct constructor is
19744         parameterless 
19745
19746         * cs-parser.jay: Pass location information for various new
19747         constructs. 
19748
19749         * delegate.cs (Delegate): take a location argument.
19750
19751         * driver.cs: Do not call EmitCode if there were problesm in the
19752         Definition of the types, as many Builders wont be there. 
19753
19754         * decl.cs (Decl::Decl): Require a location argument.
19755
19756         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19757         into integers, and find the most appropiate integer for it.
19758
19759         * literal.cs: Implement ULongLiteral.
19760
19761         * rootcontext.cs: Provide better information about the location of
19762         failure when CreateType fails.
19763
19764 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19767         as well.
19768
19769         * expression.cs (Binary::CheckShiftArguments): Add missing type
19770         computation.
19771         (Binary::ResolveOperator): Add type to the logical and and logical
19772         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19773         before.
19774
19775         (Binary::DoNumericPromotions): In the case where either argument
19776         is ulong (and most signed types combined with ulong cause an
19777         error) perform implicit integer constant conversions as well.
19778
19779 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * expression.cs (UserImplicitCast): Method should always be
19782         non-null. 
19783         (Invocation::BetterConversion): Simplified test for IntLiteral.
19784
19785         (Expression::ImplicitNumericConversion): Split this routine out.
19786         Put the code that performs implicit constant integer conversions
19787         here. 
19788
19789         (Expression::Resolve): Become a wrapper around DoResolve so we can
19790         check eclass and type being set after resolve.
19791
19792         (Invocation::Badness): Remove this dead function
19793
19794         (Binary::ResolveOperator): Do not compute the expensive argumnets
19795         unless we have a union for it.
19796
19797         (Probe::Emit): Is needs to do an isinst and then
19798         compare against null.
19799
19800         (::CanConvert): Added Location argument.  If the Location argument
19801         is null (Location.Null), then we do not report errors.  This is
19802         used by the `probe' mechanism of the Explicit conversion.  We do
19803         not want to generate an error for something that the user
19804         explicitly requested to be casted.  But the pipeline for an
19805         explicit cast first tests for potential implicit casts.
19806
19807         So for now, if the Location is null, it means `Probe only' to
19808         avoid adding another argument.   Might have to revise this
19809         strategy later.
19810
19811         (ClassCast): New class used to type cast objects into arbitrary
19812         classes (used in Explicit Reference Conversions).
19813
19814         Implement `as' as well.
19815
19816         Reverted all the patches from Ravi below: they were broken:
19817
19818                 * The use of `level' as a mechanism to stop recursive
19819                   invocations is wrong.  That was there just to catch the
19820                   bug with a strack trace but not as a way of addressing
19821                   the problem.
19822
19823                   To fix the problem we have to *understand* what is going
19824                   on and the interactions and come up with a plan, not
19825                   just get things going.
19826
19827                 * The use of the type conversion cache that I proposed
19828                   last night had an open topic: How does this work across
19829                   protection domains.  A user defined conversion might not
19830                   be public in the location where we are applying the
19831                   conversion, a different conversion might be selected
19832                   (ie, private A->B (better) but public B->A (worse),
19833                   inside A, A->B applies, but outside it, B->A will
19834                   apply).
19835
19836                 * On top of that (ie, even if the above is solved),
19837                   conversions in a cache need to be abstract.  Ie, `To
19838                   convert from an Int to a Short use an OpcodeCast', not
19839                   `To convert from an Int to a Short use the OpcodeCast on
19840                   the variable 5' (which is what this patch was doing).
19841
19842 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19843
19844         * expression.cs (Invocation::ConversionExists): Re-write to use
19845         the conversion cache
19846
19847         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19848         cache all conversions done, not just user-defined ones.
19849
19850         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19851         to determine if a conversion exists instead of acutually trying to 
19852         perform the conversion. It's faster too.
19853
19854         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19855         and only then attempt the implicit conversion.
19856
19857 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19858
19859         * expression.cs (ConvertImplicit): Use a cache for conversions
19860         already found. Check level of recursion and bail out if necessary.
19861
19862 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19865         Export standard methods that we expect for string operations.
19866
19867         * statement.cs (Block::UsageWarning): Track usage of variables and
19868         report the errors for not used variables.
19869
19870         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19871         operator. 
19872
19873 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19874
19875         * codegen.cs: remove unnneded code 
19876
19877         * expression.cs: Removed BuiltinTypeAccess class
19878
19879         Fix the order in which implicit conversions are
19880         done.  
19881
19882         The previous fixed dropped support for boxed conversions (adding a
19883         test to the test suite now)
19884
19885         (UserImplicitCast::CanConvert): Remove test for source being null,
19886         that code is broken.  We should not feed a null to begin with, if
19887         we do, then we should track the bug where the problem originates
19888         and not try to cover it up here.
19889
19890         Return a resolved expression of type UserImplicitCast on success
19891         rather than true/false.  Ravi: this is what I was talking about,
19892         the pattern is to use a static method as a "constructor" for
19893         objects. 
19894
19895         Also, do not create arguments until the very last minute,
19896         otherwise we always create the arguments even for lookups that
19897         will never be performed. 
19898
19899         (UserImplicitCast::Resolve): Eliminate, objects of type
19900         UserImplicitCast are born in a fully resolved state. 
19901
19902         * typemanager.cs (InitCoreTypes): Init also value_type
19903         (System.ValueType). 
19904
19905         * expression.cs (Cast::Resolve): First resolve the child expression.
19906
19907         (LValue): Add new method AddressOf to be used by
19908         the `&' operator.  
19909
19910         Change the argument of Store to take an EmitContext instead of an
19911         ILGenerator, because things like FieldExpr need to be able to call
19912         their children expression to generate the instance code. 
19913
19914         (Expression::Error, Expression::Warning): Sugar functions for
19915         reporting errors.
19916
19917         (Expression::MemberLookup): Accept a TypeContainer instead of a
19918         Report as the first argument.
19919
19920         (Expression::ResolvePrimary): Killed.  I still want to improve
19921         this as currently the code is just not right.
19922
19923         (Expression::ResolveMemberAccess): Simplify, but it is still
19924         wrong. 
19925
19926         (Unary::Resolve): Catch errors in AddressOf operators.
19927
19928         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19929         index to a byte for the short-version, or the compiler will choose
19930         the wrong Emit call, which generates the wrong data.
19931
19932         (ParameterReference::Emit, ::Store): same.
19933
19934         (FieldExpr::AddressOf): Implement.
19935
19936         * typemanager.cs: TypeManager: made public variable instead of
19937         property.
19938
19939         * driver.cs: document --fatal.
19940
19941         * report.cs (ErrorMessage, WarningMessage): new names for the old
19942         Error and Warning classes.
19943
19944         * cs-parser.jay (member_access): Turn built-in access to types
19945         into a normal simplename
19946
19947 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19948
19949         * expression.cs (Invocation::BetterConversion): Fix to cope
19950         with q being null, since this was introducing a bug.
19951
19952         * expression.cs (ConvertImplicit): Do built-in conversions first.
19953
19954 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19955
19956         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19957
19958 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19959
19960         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19961         I had introduced long ago (what's new ?).
19962
19963         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19964         the work of all the checking. 
19965         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19966         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19967
19968         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19969         that is the right way. 
19970
19971         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19972         overloading resolution. Use everywhere instead of cutting and pasting code.
19973
19974         (Binary::ResolveOperator): Use MakeUnionSet.
19975
19976         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19977         we have to convert to bool types. Not complete yet.
19978
19979 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * typemanager.cs (TypeManager::CSharpName): support ushort.
19982
19983         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19984         to provide an expression that performsn an implicit constant int
19985         conversion (section 6.1.6).
19986         (Expression::ConvertImplicitRequired): Reworked to include
19987         implicit constant expression conversions.
19988
19989         (Expression::ConvertNumericExplicit): Finished.
19990
19991         (Invocation::Emit): If InstanceExpression is null, then it means
19992         that we perform a call on this.
19993
19994 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19995
19996         * expression.cs (Unary::Emit): Remove some dead code.
19997         (Probe): Implement Resolve and Emit for `is'.
19998         (Expression::ConvertImplicitRequired): Attempt to do constant
19999         expression conversions here.  Maybe should be moved to
20000         ConvertImplicit, but I am not sure.
20001         (Expression::ImplicitLongConstantConversionPossible,
20002         Expression::ImplicitIntConstantConversionPossible): New functions
20003         that tell whether is it possible to apply an implicit constant
20004         expression conversion.
20005
20006         (ConvertNumericExplicit): Started work on explicit numeric
20007         conversions.
20008
20009         * cs-parser.jay: Update operator constants.
20010
20011         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20012         (Parameters::GetSignature): Hook up VerifyArgs here.
20013         (Parameters::VerifyArgs): Verifies that no two arguments have the
20014         same name. 
20015
20016         * class.cs (Operator): Update the operator names to reflect the
20017         ones that the spec expects (as we are just stringizing the
20018         operator names).
20019
20020         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20021         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20022         previous usage did only work for our methods.
20023         (Expression::ConvertImplicit): Handle decimal implicit numeric
20024         conversions as well.
20025         (Expression::InternalTypeConstructor): Used to invoke constructors
20026         on internal types for default promotions.
20027
20028         (Unary::Emit): Implement special handling for the pre/post
20029         increment/decrement for overloaded operators, as they need to have
20030         the same semantics as the other operators.
20031
20032         (Binary::ResolveOperator): ditto.
20033         (Invocation::ConversionExists): ditto.
20034         (UserImplicitCast::Resolve): ditto.
20035
20036 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20037
20038         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20039         operator, return after emitting body. Regression tests pass again !
20040
20041         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20042         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20043         (Invocation::OverloadResolve): Ditto.
20044         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20045
20046         * everywhere : update calls to the above methods accordingly.
20047
20048 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20049
20050         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20051
20052         * expression.cs (ExpressionStatement): New base class used for
20053         expressions that can appear in statements, so that we can provide
20054         an alternate path to generate expression that do not leave a value
20055         on the stack.
20056
20057         (Expression::Emit, and all the derivatives): We no longer return
20058         whether a value is left on the stack or not.  Every expression
20059         after being emitted leaves a single value on the stack.
20060
20061         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20062         facilties of ExpressionStatement if possible.
20063
20064         * cs-parser.jay: Update statement_expression.
20065
20066 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20067
20068         * driver.cs: Change the wording of message
20069
20070 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20071
20072         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20073         the type of the expression to the return type of the method if
20074         we have an overloaded operator match ! The regression tests pass again !
20075         (Unary::ResolveOperator): Ditto.
20076
20077         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20078         to find "op_Implicit", not "implicit" ;-)
20079         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20080         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20081
20082         * everywhere : Correct calls to the above accordingly.
20083
20084         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20085         (ConvertImplicit): Do user-defined conversion if it exists.
20086
20087 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * assign.cs: track location.
20090         (Resolve): Use implicit conversions on assignment.
20091
20092         * literal.cs: Oops.  Not good, Emit of short access values should
20093         pass (Bytes) or the wrong argument will be selected.
20094
20095         * expression.cs (Unary::Emit): Emit code for -expr.
20096
20097         (Unary::ResolveOperator): Handle `Substract' for non-constants
20098         (substract from zero from the non-constants).
20099         Deal with Doubles as well. 
20100
20101         (Expression::ConvertImplicitRequired): New routine that reports an
20102         error if no implicit conversion exists. 
20103
20104         (Invocation::OverloadResolve): Store the converted implicit
20105         expressions if we make them
20106
20107 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20108
20109         * class.cs (ConstructorInitializer): Take a Location argument.
20110         (ConstructorBaseInitializer): Same here.
20111         (ConstructorThisInitializer): Same here.
20112
20113         * cs-parser.jay : Update all calls accordingly.
20114
20115         * expression.cs (Unary, Binary, New): Take location argument.
20116         Update accordingly everywhere.
20117
20118         * cs-parser.jay : Update all calls to the above to take a location
20119         argument.
20120
20121         * class.cs : Ditto.
20122
20123 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20124
20125         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20126         (Invocation::BetterConversion): Same here
20127         (Invocation::ConversionExists): Ditto.
20128
20129         (Invocation::ConversionExists): Implement.
20130
20131 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20132
20133         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20134         Also take an additional TypeContainer argument.
20135
20136         * All over : Pass in TypeContainer as argument to OverloadResolve.
20137
20138         * typemanager.cs (CSharpName): Update to check for the string type and return
20139         that too.
20140
20141         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20142         a given method.
20143
20144 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20145
20146         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20147         (Invocation::BetterFunction): Implement.
20148         (Invocation::BetterConversion): Implement.
20149         (Invocation::ConversionExists): Skeleton, no implementation yet.
20150
20151         Okay, things work fine !
20152
20153 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20154
20155         * typemanager.cs: declare and load enum_type, delegate_type and
20156         void_type. 
20157
20158         * expression.cs (Expression::Emit): Now emit returns a value that
20159         tells whether a value is left on the stack or not.  This strategy
20160         might be reveted tomorrow with a mechanism that would address
20161         multiple assignments.
20162         (Expression::report118): Utility routine to report mismatches on
20163         the ExprClass.
20164
20165         (Unary::Report23): Report impossible type/operator combination
20166         utility function.
20167
20168         (Unary::IsIncrementableNumber): Whether the type can be
20169         incremented or decremented with add.
20170         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20171         complemented. 
20172         (Unary::ResolveOperator): Implement ++, !, ~,
20173
20174         (Invocation::Emit): Deal with new Emit convetion.
20175
20176         * All Expression derivatives: Updated their Emit method to return
20177         whether they leave values on the stack or not.
20178
20179         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20180         stack for expressions that are statements. 
20181
20182 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * expression.cs (LValue): New interface.  Must be implemented by
20185         LValue objects.
20186         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20187         LValue interface.
20188
20189         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20190         interface for generating code, simplifies the code.
20191
20192 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20193
20194         * expression.cs (everywhere): Comment out return statements in ::Resolve
20195         methods to avoid the warnings.
20196
20197 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20198
20199         * driver.cs (parse): Report error 2001 if we can not open the
20200         source file.
20201
20202         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20203         not resolve it.
20204
20205         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20206         object. 
20207
20208         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20209         otherwise nested blocks end up with the same index.
20210
20211         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20212
20213         * expression.cs:  Instead of having FIXMEs in the Resolve
20214         functions, throw exceptions so it is obvious that we are facing a
20215         bug. 
20216
20217         * cs-parser.jay (invocation_expression): Pass Location information.
20218
20219         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20220         Use a basename for those routines because .NET does not like paths
20221         on them. 
20222
20223         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20224         already defined.
20225
20226 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20229         are loading the correct data types (throws an exception if not).
20230         (TypeManager::InitCoreTypes): Use CoreLookupType
20231
20232         * expression.cs (Unary::ResolveOperator): return the child
20233         expression for expressions which are just +expr.
20234         (Unary::ResolveOperator): Return negative literals for -LITERAL
20235         expressions (otherwise they are Unary {Literal}).
20236         (Invocation::Badness): Take into account `Implicit constant
20237         expression conversions'.
20238
20239         * literal.cs (LongLiteral): Implement long literal class.
20240         (IntLiteral): export the `Value' of the intliteral. 
20241
20242 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20243
20244         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20245
20246         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20247         instead of 'Operator'
20248
20249         * expression.cs (Binary::ResolveOperator): Update accordingly.
20250         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20251         and 'Minus'
20252
20253         * cs-parser.jay (unary_expression): Update to use the new names.
20254
20255         * gen-treedump.cs (GetUnary): Same here.
20256
20257         * expression.cs (Unary::Resolve): Implement.
20258         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20259         operators are found instead of making noise ;-)
20260         (Unary::ResolveOperator): New method to do precisely the same thing which
20261         Binary::ResolveOperator does for Binary expressions.
20262         (Unary.method, .Arguments): Add.
20263         (Unary::OperName): Implement.   
20264         (Unary::ForceConversion): Copy and Paste !
20265
20266         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20267         a unary operator.
20268
20269         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20270         for the inbuilt operators. Only overloading works for now ;-)
20271
20272 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20275         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20276
20277         * expression.cs (This::Emit): Implement. 
20278         (This::Resolve): Implement.
20279         (TypeOf:Resolve): Implement.
20280         (Expression::ResolveSimpleName): Add an implicit this to instance
20281         field references. 
20282         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20283         Bind instance variable to Field expressions.
20284         (FieldExpr::Instance): New field used to track the expression that
20285         represents the object instance.
20286         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20287         binding 
20288         (FieldExpr::Emit): Implement.
20289
20290         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20291         the last instruction contains a return opcode to avoid generating
20292         the last `ret' instruction (this generates correct code, and it is
20293         nice to pass the peverify output).
20294
20295         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20296         initializer for static and instance variables.
20297         (Constructor::Emit): Allow initializer to be null in the case of
20298         static constructors.  Only emit initializer for instance
20299         constructors. 
20300
20301         (TypeContainer::FindMembers): Return a null array if there are no
20302         matches.
20303
20304         Also fix the code for the MemberTypes.Method branch, as it was not
20305         scanning that for operators (or tried to access null variables before).
20306
20307         * assign.cs (Assign::Emit): Handle instance and static fields. 
20308
20309         * TODO: Updated.
20310
20311         * driver.cs: Stop compilation if there are parse errors.
20312
20313         * cs-parser.jay (constructor_declaration): Provide default base
20314         initializer for non-static constructors.
20315         (constructor_declarator): Do not provide a default base
20316         initializers if none was specified.
20317         Catch the fact that constructors should not have parameters.
20318
20319         * class.cs: Do not emit parent class initializers for static
20320         constructors, that should be flagged as an error.
20321
20322 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20323
20324         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20325         Move back code into TypeContainer::Populate.
20326
20327 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20328
20329         * class.cs (TypeContainer::AddConstructor): Fix the check to
20330         compare against Name, not Basename. 
20331         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20332
20333         * cs-parser.jay : Update accordingly.
20334
20335         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20336         for methods, don't forget to look into the operators too.
20337         (RegisterMethodBuilder): Helper method to take care of this for
20338         methods, constructors and operators.
20339         (Operator::Define): Completely revamp.
20340         (Operator.OperatorMethod, MethodName): New fields.
20341         (TypeContainer::Populate): Move the registering of builders into
20342         RegisterMethodBuilder.
20343         (Operator::Emit): Re-write.
20344
20345         * expression.cs (Binary::Emit): Comment out code path to emit method
20346         invocation stuff for the case when we have a user defined operator. I am
20347         just not able to get it right !
20348
20349 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20352         argument. 
20353
20354         (Expression::MemberLookup): Provide a version that allows to
20355         specify the MemberTypes and BindingFlags. 
20356
20357         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20358         so it was not fetching variable information from outer blocks.
20359
20360         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20361         Beforefieldinit as it was buggy.
20362
20363         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20364         that Ravi put here.  
20365
20366         * class.cs (Constructor::Emit): Only emit if block is not null.
20367         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20368         deal with this by semantically definining it as if the user had
20369         done it.
20370
20371         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20372         constructors as we now "emit" them at a higher level.
20373
20374         (TypeContainer::DefineDefaultConstructor): Used to define the
20375         default constructors if none was provided.
20376
20377         (ConstructorInitializer): Add methods Resolve and Emit. 
20378
20379         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20380
20381 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20382
20383         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20384         the default constructor builder with our hashtable for methodbuilders
20385         to methodcores.
20386
20387         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20388         and argument_count is 0 in which case we have a match.
20389         (Binary::ResolveOperator): More null checking and miscellaneous coding
20390         style cleanup.
20391
20392 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20393
20394         * rootcontext.cs (IsNameSpace): Compare against null.
20395
20396         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20397
20398         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20399         and Unary::Operator.
20400
20401         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20402         accordingly.
20403
20404         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20405         we have overloaded operators.
20406         (Binary::ResolveOperator): Implement the part which does the operator overload
20407         resolution.
20408
20409         * class.cs (Operator::Emit): Implement.
20410         (TypeContainer::Emit): Emit the operators we have too.
20411
20412         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20413         the case when we have a user-defined operator.
20414
20415 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20416
20417         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20418
20419 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20420
20421         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20422         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20423         (Constructor::Emit): Implement.
20424         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20425         if we have no work to do. 
20426         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20427         Emit method.
20428
20429         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20430         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20431
20432         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20433         of parent.parent.
20434
20435 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20436
20437         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20438         in the source.
20439         (Tree::RecordNamespace): Method to do what the name says ;-)
20440         (Tree::Namespaces): Property to get at the namespaces hashtable.
20441
20442         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20443         keep track.
20444
20445         * rootcontext.cs (IsNamespace): Fixed it :-)
20446
20447 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * class.cs (TypeContainer::FindMembers): Add support for
20450         constructors. 
20451         (MethodCore): New class that encapsulates both the shared aspects
20452         of a Constructor and a Method.  
20453         (Method, Constructor): Factored pieces into MethodCore.
20454
20455         * driver.cs: Added --fatal which makes errors throw exceptions.
20456         Load System assembly as well as part of the standard library.
20457
20458         * report.cs: Allow throwing exceptions on errors for debugging.
20459
20460         * modifiers.cs: Do not use `parent', instead use the real type
20461         container to evaluate permission settings.
20462
20463         * class.cs: Put Ravi's patch back in.  He is right, and we will
20464         have to cope with the
20465
20466 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20467
20468         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20469         FamORAssem, not FamANDAssem.
20470
20471 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20472
20473         * driver.cs: Added --parse option that only parses its input files
20474         and terminates.
20475
20476         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20477         incorrect.  IsTopLevel is not used to tell whether an object is
20478         root_types or not (that can be achieved by testing this ==
20479         root_types).  But to see if this is a top-level *class* (not
20480         necessarly our "toplevel" container). 
20481
20482 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20483
20484         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20485         parent instead of a direct call to GetType.
20486
20487 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20488
20489         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20490         Modifiers.TypeAttr. This should just be a call to that method.
20491
20492         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20493         object so that we can determine if we are top-level or not.
20494
20495         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20496         TypeContainer too.
20497
20498         * enum.cs (Enum::Define): Ditto.
20499
20500         * modifiers.cs (FieldAttr): Re-write.
20501
20502         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20503         (TypeContainer::HaveStaticConstructor): New property to provide access
20504         to precisely that info.
20505
20506         * modifiers.cs (MethodAttr): Re-write.
20507         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20508
20509         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20510         of top-level types as claimed.
20511
20512 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20513
20514         * expression.cs (MemberLookup): Fruitless attempt to lookup
20515         constructors.  Maybe I need to emit default constructors?  That
20516         might be it (currently .NET emits this for me automatically).
20517         (Invocation::OverloadResolve): Cope with Arguments == null.
20518         (Invocation::EmitArguments): new function, shared by the new
20519         constructor and us.
20520         (Invocation::Emit): Handle static and instance methods.  Emit
20521         proper call instruction for virtual or non-virtual invocations.
20522         (New::Emit): Implement.
20523         (New::Resolve): Implement.
20524         (MemberAccess:Resolve): Implement.
20525         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20526         to track instances.
20527         (FieldExpr::Resolve): Set type.
20528
20529         * support.cs: Handle empty arguments.
20530                 
20531         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20532         SimpleLookup): Auxiliary routines to help parse a qualifier
20533         identifier.  
20534
20535         Update qualifier_identifier rule.
20536
20537         * codegen.cs: Removed debugging messages.
20538
20539         * class.cs: Make this a global thing, this acts just as a "key" to
20540         objects that we might have around.
20541
20542         (Populate): Only initialize method_builders_to_methods once.
20543
20544         * expression.cs (PropertyExpr): Initialize type from the
20545         PropertyType. 
20546
20547         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20548         Resolve pattern.  Attempt to implicitly convert value to boolean.
20549         Emit code.
20550
20551         * expression.cs: Set the type for the int32/int32 argument case.
20552         (Binary::ResolveOperator): Set the return type to boolean for
20553         comparission operators
20554
20555         * typemanager.cs: Remove debugging print code.
20556
20557         (Invocation::Resolve): resolve type.
20558
20559         * class.cs: Allocate a MemberInfo of the correct size, as the code
20560         elsewhere depends on the test to reflect the correct contents.
20561
20562         (Method::) Keep track of parameters, due to System.Reflection holes
20563
20564         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20565         mapping here.
20566
20567         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20568         of the exact size and return that.
20569
20570         (Class::LookupMethodByBuilder): New function that maps
20571         MethodBuilders to its methods.  Required to locate the information
20572         on methods because System.Reflection bit us again.
20573
20574         * support.cs: New file, contains an interface ParameterData and
20575         two implementations: ReflectionParameters and InternalParameters
20576         used to access Parameter information.  We will need to grow this
20577         as required.
20578
20579         * expression.cs (Invocation::GetParameterData): implement a cache
20580         and a wrapper around the ParameterData creation for methods. 
20581         (Invocation::OverloadResolve): Use new code.
20582
20583 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20584
20585         * class.cs (TypeContainer::EmitField): Remove and move into 
20586         (Field::Define): here and modify accordingly.
20587         (Field.FieldBuilder): New member.
20588         (TypeContainer::Populate): Update accordingly.
20589         (TypeContainer::FindMembers): Implement.
20590
20591 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * statement.cs: (VariableInfo::VariableType): New field to be
20594         initialized with the full type once it is resolved. 
20595
20596 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20597
20598         * parameter.cs (GetParameterInfo): Use a type cache to compute
20599         things only once, and to reuse this information
20600
20601         * expression.cs (LocalVariableReference::Emit): Implement.
20602         (OpcodeCast::Emit): fix.
20603
20604         (ParameterReference::Resolve): Implement.
20605         (ParameterReference::Emit): Implement.
20606
20607         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20608         that are expressions need to stay as Expressions.
20609
20610         * typemanager.cs (CSharpName): Returns the C# name of a type if
20611         possible. 
20612
20613         * expression.cs (Expression::ConvertImplicit): New function that
20614         implements implicit type conversions.
20615
20616         (Expression::ImplicitReferenceConversion): Implements implicit
20617         reference conversions.
20618
20619         (EmptyCast): New type for transparent casts.
20620
20621         (OpcodeCast): New type for casts of types that are performed with
20622         a sequence of bytecodes.
20623
20624         (BoxedCast): New type used for casting value types into reference
20625         types.  Emits a box opcode.
20626
20627         (Binary::DoNumericPromotions): Implements numeric promotions of
20628         and computation of the Binary::Type.
20629
20630         (Binary::EmitBranchable): Optimization.
20631
20632         (Binary::Emit): Implement code emission for expressions.
20633
20634         * typemanager.cs (TypeManager): Added two new core types: sbyte
20635         and byte.
20636
20637 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20638
20639         * class.cs (TypeContainer::FindMembers): Method which does exactly
20640         what Type.FindMembers does, only we don't have to use reflection. No
20641         implementation yet.
20642
20643         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20644         typecontainer objects as we need to get at them.
20645         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20646
20647         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20648         typecontainer object.
20649
20650         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20651         of just a Report object.
20652
20653 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20654
20655         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20656         "remove_"
20657         (TypeContainer::Populate): Now define the delegates of the type too.
20658         (TypeContainer.Delegates): Property to access the list of delegates defined
20659         in the type.
20660
20661         * delegates.cs (Delegate::Define): Implement partially.
20662
20663         * modifiers.cs (TypeAttr): Handle more flags.
20664
20665 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20666
20667         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20668         and not <=
20669         (Operator::Define): Re-write logic to get types by using the LookupType method
20670         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20671         (Indexer::Define): Ditto.
20672         (Event::Define): Ditto.
20673         (Property::Define): Ditto.
20674
20675 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20676
20677         * class.cs (TypeContainer::Populate): Now define operators too. 
20678         (TypeContainer.Operators): New property to access the list of operators
20679         in a type.
20680         (Operator.OperatorMethodBuilder): New member to hold the method builder
20681         for the operator we are defining.
20682         (Operator::Define): Implement.
20683
20684 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20685
20686         * class.cs (Event::Define): Make the prefixes of the accessor methods
20687         addOn_ and removeOn_ 
20688
20689         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20690         of the location being passed in too. Ideally, this should go later since all
20691         error reporting should be done through the Report object.
20692
20693         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20694         (Populate): Iterate thru the indexers we have and define them too.
20695         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20696         for the get and set accessors.
20697         (Indexer::Define): Implement.
20698
20699 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20700
20701         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20702         my previous implementation, did not work.
20703
20704         * typemanager.cs: Add a couple of missing types (the longs).
20705
20706         * literal.cs: Use TypeManager.bool_type instead of getting it.
20707
20708         * expression.cs (EventExpr): New kind of expressions.
20709         (Expressio::ExprClassFromMemberInfo): finish
20710
20711 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20712
20713         * assign.cs: Emit stores to static fields differently.
20714
20715 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20716
20717         * Merge in changes and adjust code to tackle conflicts. Backed out my
20718         code in Assign::Resolve ;-) 
20719
20720 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20721
20722         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20723         instead Report.Error and also pass in the location.
20724         (CSharpParser::Lexer): New readonly property to return the reference
20725         to the Tokenizer object.
20726         (declare_local_variables): Use Report.Error with location instead of plain 
20727         old error.
20728         (CheckDef): Ditto.
20729
20730         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20731         (Operator.CheckBinaryOperator): Ditto.
20732
20733         * cs-parser.jay (operator_declarator): Update accordingly.
20734
20735         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20736         (CheckBinaryOperator): Same here.
20737
20738         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20739         on the name without any prefixes of namespace names etc. This is because we
20740         already might have something already fully qualified like 
20741         'System.Console.WriteLine'
20742
20743         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20744
20745 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20746
20747         * cs-tokenizer.cs (location): Return a string which also contains
20748         the file name.
20749
20750         * expression.cs (ElementAccess): New class for expressions of the
20751         type 'element access.'
20752         (BaseAccess): New class for expressions of the type 'base access.'
20753         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20754         respectively.
20755
20756         * cs-parser.jay (element_access): Implement action.
20757         (base_access): Implement actions.
20758         (checked_expression, unchecked_expression): Implement.
20759
20760         * cs-parser.jay (local_variable_type): Correct and implement.
20761         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20762
20763         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20764
20765         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20766         name and the specifiers.
20767
20768         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20769
20770         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20771         making them all public ;-)
20772
20773         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20774         class anyways.
20775
20776 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20777
20778         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20779         PropertyExprs.
20780         (FieldExpr, PropertyExprs): New resolved expressions.
20781         (SimpleName::MemberStaticCheck): Perform static checks for access
20782         to non-static fields on static methods. Maybe this should be
20783         generalized for MemberAccesses. 
20784         (SimpleName::ResolveSimpleName): More work on simple name
20785         resolution. 
20786
20787         * cs-parser.jay (primary_expression/qualified_identifier): track
20788         the parameter index.
20789
20790         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20791         (EmitContext::EmitBoolExpression): Chain to expression generation
20792         instead of temporary hack.
20793         (::EmitStatementExpression): Put generic expression code generation.
20794
20795         * assign.cs (Assign::Emit): Implement variable assignments to
20796         local variables, parameters and fields.
20797
20798 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20799
20800         * statement.cs (Block::GetVariableInfo): New method, returns the
20801         VariableInfo for a variable name in a block.
20802         (Block::GetVariableType): Implement in terms of GetVariableInfo
20803
20804         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20805         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20806
20807 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20808
20809         * cs-parser.jay (operator_declaration): Continue on my quest : update
20810         to take attributes argument.
20811         (event_declaration): Ditto.
20812         (enum_declaration): Ditto.
20813         (indexer_declaration): Ditto.
20814
20815         * class.cs (Operator::Operator): Update constructor accordingly.
20816         (Event::Event): Ditto.
20817
20818         * delegate.cs (Delegate::Delegate): Same here.
20819
20820         * enum.cs (Enum::Enum): Same here.
20821
20822 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20823
20824         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20825
20826         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20827
20828         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20829         being passed around as an arraylist.
20830         (Attributes::AddAttribute): Method to add attribute sections.
20831
20832         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20833         (struct_declaration): Update accordingly.
20834         (constant_declaration): Update.
20835         (field_declaration): Update.
20836         (method_header): Update.
20837         (fixed_parameter): Update.
20838         (parameter_array): Ditto.
20839         (property_declaration): Ditto.
20840         (destructor_declaration): Ditto.
20841
20842         * class.cs (Struct::Struct): Update constructors accordingly.
20843         (Class::Class): Ditto.
20844         (Field::Field): Ditto.
20845         (Method::Method): Ditto.
20846         (Property::Property): Ditto.
20847         (TypeContainer::OptAttribute): update property's return type.
20848
20849         * interface.cs (Interface.opt_attributes): New member.
20850         (Interface::Interface): Update to take the extra Attributes argument.
20851
20852         * parameter.cs (Parameter::Parameter): Ditto.
20853
20854         * constant.cs (Constant::Constant): Ditto.
20855
20856         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20857         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20858         the attributes as a parameter.
20859         (InterfaceProperty): Update constructor call.
20860         (InterfaceEvent): Ditto.
20861         (InterfaceMethod): Ditto.
20862         (InterfaceIndexer): Ditto.
20863
20864         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20865         pass the attributes too.
20866         (interface_event_declaration): Ditto.
20867         (interface_property_declaration): Ditto.
20868         (interface_method_declaration): Ditto.
20869         (interface_declaration): Ditto.
20870
20871 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * class.cs (Method::Define): Track the "static Main" definition to
20874         create an entry point. 
20875
20876         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20877         EntryPoint if we find it. 
20878
20879         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20880         (EmitContext::ig): Make this variable public.
20881
20882         * driver.cs: Make the default output file be the first file name
20883         with the .exe extension.  
20884
20885         Detect empty compilations
20886
20887         Handle various kinds of output targets.  Handle --target and
20888         rename -t to --dumper.
20889
20890         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20891         methods inherited from Expression return now an Expression.  This
20892         will is used during the tree rewriting as we resolve them during
20893         semantic analysis.
20894
20895         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20896         the spec.  Missing entirely is the information about
20897         accessability of elements of it.
20898
20899         (Expression::ExprClassFromMemberInfo): New constructor for
20900         Expressions that creates a fully initialized Expression based on
20901         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20902         a Type.
20903
20904         (Invocation::Resolve): Begin implementing resolution of invocations.
20905
20906         * literal.cs (StringLiteral):  Implement Emit.
20907
20908 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20909
20910         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20911         member.
20912
20913 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20914
20915         * cs-parser.jay (attribute_arguments): Implement actions.
20916         (attribute): Fix bug in production. Implement action.
20917         (attribute_list): Implement.
20918         (attribute_target): Implement.
20919         (attribute_target_specifier, opt_target_specifier): Implement
20920         (CheckAttributeTarget): New method to check if the attribute target
20921         is valid.
20922         (attribute_section): Implement.
20923         (opt_attributes): Implement.
20924
20925         * attribute.cs : New file to handle attributes.
20926         (Attribute): Class to hold attribute info.
20927
20928         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20929         (attribute_section): Modify production to use 2 different rules to 
20930         achieve the same thing. 1 s/r conflict down !
20931         Clean out commented, useless, non-reducing dimension_separator rules.
20932
20933         * class.cs (TypeContainer.attributes): New member to hold list
20934         of attributes for a type.
20935         (Struct::Struct): Modify to take one more argument, the attribute list.
20936         (Class::Class): Ditto.
20937         (Field::Field): Ditto.
20938         (Method::Method): Ditto.
20939         (Property::Property): Ditto.
20940
20941         * cs-parser.jay (struct_declaration): Update constructor call to
20942         pass in the attributes too.
20943         (class_declaration): Ditto.
20944         (constant_declaration): Ditto.
20945         (field_declaration): Ditto.
20946         (method_header): Ditto.
20947         (fixed_parameter): Ditto.
20948         (parameter_array): Ditto.
20949         (property_declaration): Ditto.
20950
20951         * constant.cs (Constant::Constant): Update constructor similarly.
20952         Use System.Collections.
20953
20954         * parameter.cs (Parameter::Parameter): Update as above.
20955
20956 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20957
20958         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20959         (TypeContainer.delegates): New member to hold list of delegates.
20960
20961         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20962         this time as I seem to be on crack ;-)
20963
20964 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20965
20966         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20967         tell whether an identifier represents a namespace.
20968
20969         * expression.cs (NamespaceExpr): A namespace expression, used only
20970         temporarly during expression resolution.
20971         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20972         utility functions to resolve names on expressions.
20973
20974 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * codegen.cs: Add hook for StatementExpressions. 
20977
20978         * class.cs: Fix inverted test for static flag in methods.
20979
20980 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20981
20982         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20983         to make it coincide with MS' number.
20984         (Operator::CheckBinaryOperator): Ditto.
20985
20986         * ../errors/errors.txt : Remove error numbers added earlier.
20987
20988         * ../errors/cs1019.cs : Test case for error # 1019
20989
20990         * ../errros/cs1020.cs : Test case for error # 1020
20991
20992         * cs-parser.jay : Clean out commented cruft.
20993         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20994         used anywhere - non-reducing rule.
20995         (namespace_declarations): Non-reducing rule - comment out.
20996
20997         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20998         with TypeContainer::AddEnum.
20999
21000         * delegate.cs : New file for delegate handling classes.
21001         (Delegate): Class for declaring delegates.
21002
21003         * makefile : Update.
21004
21005         * cs-parser.jay (delegate_declaration): Implement.
21006
21007 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21008
21009         * class.cs (Event::Define): Implement.
21010         (Event.EventBuilder): New member.
21011
21012         * class.cs (TypeContainer::Populate): Update to define all enums and events
21013         we have.
21014         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21015         readonly fields for all these cases ?
21016
21017 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21018
21019         * class.cs (Property): Revamp to use the convention of making fields readonly.
21020         Accordingly modify code elsewhere.
21021
21022         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21023         the Define method of the Property class.
21024
21025         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21026         trivial bug.
21027         (TypeContainer::Populate): Update to define all the properties we have. Also
21028         define all enumerations.
21029
21030         * enum.cs (Define): Implement.
21031
21032 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21033
21034         * cs-parser.jay (overloadable_operator): The semantic value is an
21035         enum of the Operator class.
21036         (operator_declarator): Implement actions.
21037         (operator_declaration): Implement.
21038
21039         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21040         validity of definitions.
21041         (Operator::CheckBinaryOperator): Static method to check for binary operators
21042         (TypeContainer::AddOperator): New method to add an operator to a type.
21043
21044         * cs-parser.jay (indexer_declaration): Added line to actually call the
21045         AddIndexer method so it gets added ;-)
21046
21047         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21048         already taken care of by the MS compiler ?  
21049
21050 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21051
21052         * class.cs (Operator): New class for operator declarations.
21053         (Operator::OpType): Enum for the various operators.
21054
21055 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21056
21057         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21058         ostensibly handle this in semantic analysis.
21059
21060         * cs-parser.jay (general_catch_clause): Comment out
21061         (specific_catch_clauses, specific_catch_clause): Ditto.
21062         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21063         (catch_args, opt_catch_args): New productions.
21064         (catch_clause): Rewrite to use the new productions above
21065         (catch_clauses): Modify accordingly.
21066         (opt_catch_clauses): New production to use in try_statement
21067         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21068         and re-write the code in the actions to extract the specific and
21069         general catch clauses by being a little smart ;-)
21070
21071         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21072         Hooray, try and catch statements parse fine !
21073
21074 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21075
21076         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21077         string from the hashtable of variables.
21078
21079         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21080         I end up making that mistake ;-)
21081         (catch_clauses): Fixed gross error which made Key and Value of the 
21082         DictionaryEntry the same : $1 !!
21083
21084 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21085
21086         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21087
21088         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21089         when the add and remove accessors are specified. 
21090
21091 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21092
21093         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21094         information about indexer_declarator.
21095         (indexer_declarator): Implement actions.
21096         (parsing_indexer): New local boolean used to keep track of whether
21097         we are parsing indexers or properties. This is necessary because 
21098         implicit_parameters come into picture even for the get accessor in the 
21099         case of an indexer.
21100         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21101
21102         * class.cs (Indexer): New class for indexer declarations.
21103         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21104         (TypeContainer::indexers): New member to hold list of indexers for the
21105         type.
21106
21107 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21108
21109         * cs-parser.jay (add_accessor_declaration): Implement action.
21110         (remove_accessor_declaration): Implement action.
21111         (event_accessors_declaration): Implement
21112         (variable_declarators): swap statements for first rule - trivial.
21113
21114         * class.cs (Event): New class to hold information about event
21115         declarations.
21116         (TypeContainer::AddEvent): New method to add an event to a type
21117         (TypeContainer::events): New member to hold list of events.
21118
21119         * cs-parser.jay (event_declaration): Implement actions.
21120
21121 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21122
21123         * cs-parser.jay (dim_separators): Implement. Make it a string
21124         concatenating all the commas together, just as they appear.
21125         (opt_dim_separators): Modify accordingly
21126         (rank_specifiers): Update accordingly. Basically do the same
21127         thing - instead, collect the brackets here.
21128         (opt_rank_sepcifiers): Modify accordingly.
21129         (array_type): Modify to actually return the complete type string
21130         instead of ignoring the rank_specifiers.
21131         (expression_list): Implement to collect the expressions
21132         (variable_initializer): Implement. We make it a list of expressions
21133         essentially so that we can handle the array_initializer case neatly too.
21134         (variable_initializer_list): Implement.
21135         (array_initializer): Make it a list of variable_initializers
21136         (opt_array_initializer): Modify accordingly.
21137
21138         * expression.cs (New::NType): Add enumeration to help us
21139         keep track of whether we have an object/delegate creation
21140         or an array creation.
21141         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21142         members to hold data about array creation.
21143         (New:New): Modify to update NewType
21144         (New:New): New Overloaded contructor for the array creation
21145         case.
21146
21147         * cs-parser.jay (array_creation_expression): Implement to call
21148         the overloaded New constructor.
21149
21150 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21151
21152         * class.cs (TypeContainer::Constructors): Return member
21153         constructors instead of returning null.
21154
21155 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * typemanager.cs (InitCoreTypes): Initialize the various core
21158         types after we have populated the type manager with the user
21159         defined types (this distinction will be important later while
21160         compiling corlib.dll)
21161
21162         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21163         on Expression Classification.  Now all expressions have a method
21164         `Resolve' and a method `Emit'.
21165
21166         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21167         generation from working.     Also add some temporary debugging
21168         code. 
21169
21170 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21171
21172         * codegen.cs: Lots of code generation pieces.  This is only the
21173         beginning, will continue tomorrow with more touches of polish.  We
21174         handle the fundamentals of if, while, do, for, return.  Others are
21175         trickier and I need to start working on invocations soon.
21176
21177         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21178         s.InitStatement. 
21179
21180         * codegen.cs (EmitContext): New struct, used during code
21181         emission to keep a context.   Most of the code generation will be
21182         here. 
21183
21184         * cs-parser.jay: Add embedded blocks to the list of statements of
21185         this block.  So code generation proceeds in a top down fashion.
21186
21187 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21188
21189         * statement.cs: Add support for multiple child blocks.
21190
21191 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * codegen.cs (EmitCode): New function, will emit the code for a
21194         Block of code given a TypeContainer and its ILGenerator. 
21195
21196         * statement.cs (Block): Standard public readonly optimization.
21197         (Block::Block constructors): Link children. 
21198         (Block::Child): Child Linker.
21199         (Block::EmitVariables): Emits IL variable declarations.
21200
21201         * class.cs: Drop support for MethodGroups here, delay until
21202         Semantic Analysis.
21203         (Method::): Applied the same simplification that I did before, and
21204         move from Properties to public readonly fields.
21205         (Method::ParameterTypes): Returns the parameter types for the
21206         function, and implements a cache that will be useful later when I
21207         do error checking and the semantic analysis on the methods is
21208         performed.
21209         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21210         and made a method, optional argument tells whether this is a class
21211         or a structure to apply the `has-this' bit.
21212         (Method::GetCallingConvention): Implement, returns the calling
21213         convention. 
21214         (Method::Define): Defines the type, a second pass is performed
21215         later to populate the methods.
21216
21217         (Constructor::ParameterTypes): implement a cache similar to the
21218         one on Method::ParameterTypes, useful later when we do semantic
21219         analysis. 
21220
21221         (TypeContainer::EmitMethod):  New method.  Emits methods.
21222
21223         * expression.cs: Removed MethodGroup class from here.
21224
21225         * parameter.cs (Parameters::GetCallingConvention): new method.
21226
21227 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * class.cs (TypeContainer::Populate): Drop RootContext from the
21230         argument. 
21231
21232         (Constructor::CallingConvention): Returns the calling convention.
21233         (Constructor::ParameterTypes): Returns the constructor parameter
21234         types. 
21235
21236         (TypeContainer::AddConstructor): Keep track of default constructor
21237         and the default static constructor.
21238
21239         (Constructor::) Another class that starts using `public readonly'
21240         instead of properties. 
21241
21242         (Constructor::IsDefault): Whether this is a default constructor. 
21243
21244         (Field::) use readonly public fields instead of properties also.
21245
21246         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21247         track of static constructors;  If none is used, turn on
21248         BeforeFieldInit in the TypeAttributes. 
21249
21250         * cs-parser.jay (opt_argument_list): now the return can be null
21251         for the cases where there are no arguments. 
21252
21253         (constructor_declarator): If there is no implicit `base' or
21254         `this', then invoke the default parent constructor. 
21255
21256         * modifiers.cs (MethodAttr): New static function maps a set of
21257         modifiers flags into a MethodAttributes enum
21258         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21259         MethodAttr, TypeAttr to represent the various mappings where the
21260         modifiers are used.
21261         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21262
21263 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21264
21265         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21266         method arguments.
21267
21268         * interface.cs (PopulateIndexer): Implemented the code generator
21269         for interface indexers.
21270
21271 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21272
21273         * interface.cs (InterfaceMemberBase): Now we track the new status
21274         here.  
21275
21276         (PopulateProperty): Implement property population.  Woohoo!  Got
21277         Methods and Properties going today. 
21278
21279         Removed all the properties for interfaces, and replaced them with
21280         `public readonly' fields. 
21281
21282 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21283
21284         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21285         initialize their hashtables/arraylists only when they are needed
21286         instead of doing this always.
21287
21288         * parameter.cs: Handle refs and out parameters.
21289
21290         * cs-parser.jay: Use an ArrayList to construct the arguments
21291         instead of the ParameterCollection, and then cast that to a
21292         Parameter[] array.
21293
21294         * parameter.cs: Drop the use of ParameterCollection and use
21295         instead arrays of Parameters.
21296
21297         (GetParameterInfo): Use the Type, not the Name when resolving
21298         types. 
21299
21300 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21301
21302         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21303         and instead use public readonly fields.
21304
21305         * class.cs: Put back walking code for type containers.
21306
21307 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * class.cs (MakeConstant): Code to define constants.
21310
21311         * rootcontext.cs (LookupType): New function.  Used to locate types 
21312
21313
21314 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21317         this System.Reflection code is.  Kudos to Microsoft
21318
21319         * typemanager.cs: Implement a type cache and avoid loading all
21320         types at boot time.  Wrap in LookupType the internals.  This made
21321         the compiler so much faster.  Wow.  I rule!
21322
21323         * driver.cs: Make sure we always load mscorlib first (for
21324         debugging purposes, nothing really important).
21325
21326         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21327         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21328
21329         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21330         on namespaces that have been imported using the `using' keyword.
21331
21332         * class.cs (TypeContainer::TypeAttr): Virtualize.
21333         (Class::TypeAttr): Return attributes suitable for this bad boy.
21334         (Struct::TypeAttr): ditto.
21335         Handle nested classes.
21336         (TypeContainer::) Remove all the type visiting code, it is now
21337         replaced with the rootcontext.cs code
21338
21339         * rootcontext.cs (GetClassBases): Added support for structs. 
21340
21341 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21342
21343         * interface.cs, statement.cs, class.cs, parameter.cs,
21344         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21345         Drop use of TypeRefs, and use strings instead.
21346
21347 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * rootcontext.cs: 
21350
21351         * class.cs (Struct::Struct): set the SEALED flags after
21352         checking the modifiers.
21353         (TypeContainer::TypeAttr): new property, returns the
21354         TypeAttributes for a class.  
21355
21356         * cs-parser.jay (type_list): Oops, list production was creating a
21357         new list of base types.
21358
21359         * rootcontext.cs (StdLib): New property.
21360         (GetInterfaceTypeByName): returns an interface by type name, and
21361         encapsulates error handling here.
21362         (GetInterfaces): simplified.
21363         (ResolveTree): Encapsulated all the tree resolution here.
21364         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21365         types. 
21366
21367         * driver.cs: Add support for --nostdlib, to avoid loading the
21368         default assemblies.
21369         (Main): Do not put tree resolution here. 
21370
21371         * rootcontext.cs: Beginning of the class resolution.
21372
21373 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21374
21375         * rootcontext.cs: Provide better error reporting. 
21376
21377         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21378
21379         * rootcontext.cs (CreateInterface): Handle the case where there
21380         are no parent interfaces.
21381
21382         (CloseTypes): Routine to flush types at the end.
21383         (CreateInterface): Track types.
21384         (GetInterfaces): Returns an array of Types from the list of
21385         defined interfaces.
21386
21387         * typemanager.c (AddUserType): Mechanism to track user types (puts
21388         the type on the global type hash, and allows us to close it at the
21389         end). 
21390
21391 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21392
21393         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21394         RecordInterface instead.
21395
21396         * cs-parser.jay: Updated to reflect changes above.
21397
21398         * decl.cs (Definition): Keep track of the TypeBuilder type that
21399         represents this type here.  Not sure we will use it in the long
21400         run, but wont hurt for now.
21401
21402         * driver.cs: Smaller changes to accomodate the new code.
21403
21404         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21405         when done. 
21406
21407         * rootcontext.cs (CreateInterface):  New method, used to create
21408         the System.TypeBuilder type for interfaces.
21409         (ResolveInterfaces): new entry point to resolve the interface
21410         hierarchy. 
21411         (CodeGen): Property, used to keep track of the code generator.
21412
21413 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21414
21415         * cs-parser.jay: Add a second production for delegate_declaration
21416         with `VOID'.
21417
21418         (enum_body): Put an opt_comma here instead of putting it on
21419         enum_body or enum_member_declarations so we can handle trailing
21420         commas on enumeration members.  Gets rid of a shift/reduce.
21421
21422         (type_list): Need a COMMA in the middle.
21423
21424         (indexer_declaration): Tell tokenizer to recognize get/set
21425
21426         * Remove old targets.
21427
21428         * Re-add the parser target.
21429
21430 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21431
21432         * cs-parser.jay: Add precendence rules for a number of operators
21433         ot reduce the number of shift/reduce conflicts in the grammar.
21434
21435 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21436
21437         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21438         and put it here.
21439
21440         Get rid of old crufty code.
21441
21442         * rootcontext.cs: Use this to keep track of the parsed
21443         representation and the defined types available to the program. 
21444
21445         * gen-treedump.cs: adjust for new convention.
21446
21447         * type.cs: Split out the type manager, and the assembly builder
21448         from here. 
21449
21450         * typemanager.cs: the type manager will live here now.
21451
21452         * cil-codegen.cs: And the code generator here. 
21453
21454 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21455
21456         * makefile: Fixed up for easy making.
21457
21458 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21459
21460         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21461         the 
21462
21463         (unary_expression): Expand pre_increment_expression and
21464         post_decrement_expression to reduce a shift/reduce.
21465
21466 2001-07-11  Simon Cozens
21467
21468         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21469
21470         Improve allow_keyword_as_indent name.
21471
21472 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * Adjustments for Beta2. 
21475
21476 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * decl.cs: Added `Define' abstract method.
21479         (InTransit): new property, used to catch recursive definitions. 
21480
21481         * interface.cs: Implement `Define'. 
21482
21483         * modifiers.cs: Map Modifiers.constants to
21484         System.Reflection.TypeAttribute flags.
21485
21486         * class.cs: Keep track of types and user-defined types.
21487         (BuilderInit): New method for creating an assembly
21488         (ResolveType): New function to launch the resolution process, only
21489         used by interfaces for now.
21490
21491         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21492         that are inserted into the name space. 
21493
21494 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21495
21496         * ARGH.  I have screwed up my tree so many times due to the use of
21497         rsync rather than using CVS.  Going to fix this at once. 
21498
21499         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21500         load types.
21501
21502 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * Experiment successful: Use System.Type rather that our own
21505         version of Type.  
21506
21507 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21508
21509         * cs-parser.jay: Removed nsAliases from here.
21510
21511         Use new namespaces, handle `using XXX;' 
21512
21513         * namespace.cs: Reimplemented namespace handling, use a recursive
21514         definition of the class.  Now we can keep track of using clauses
21515         and catch invalid using clauses.
21516
21517 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21518
21519         * gen-treedump.cs: Adapted for all the renaming.
21520
21521         * expression.cs (Expression): this class now has a Type property
21522         which returns an expression Type.
21523
21524         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21525         `Type', as this has a different meaning now in the base
21526
21527 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21528
21529         * interface.cs, class.cs: Removed from all the sources the
21530         references to signature computation, as we can not do method
21531         signature computation during the parsing time, as we are not
21532         trying to solve at that point distinguishing:
21533
21534         class X {
21535                 void a (Blah x) {}
21536                 void a (NS.Blah x) {}
21537         }
21538
21539         Which depending on the context might be valid or not, as we do not
21540         know if Blah is the same thing as NS.Blah at that point.
21541
21542         * Redid everything so the code uses TypeRefs now instead of
21543         Types.  TypeRefs are just temporary type placeholders, that need
21544         to be resolved.  They initially have a pointer to a string and the
21545         current scope in which they are used.  This is used later by the
21546         compiler to resolve the reference to an actual Type. 
21547
21548         * DeclSpace is no longer a CIR.Type, and neither are
21549         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21550         are all DeclSpaces, but no Types. 
21551
21552         * type.cs (TypeRefManager): This implements the TypeRef manager,
21553         which keeps track of all the types that need to be resolved after
21554         the parsing has finished. 
21555
21556 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21557
21558         * ARGH.  We are going to have to store `foreach' as a class rather
21559         than resolving it, as we need to verify error 1579 after name
21560         resolution.   *OR* we could keep a flag that says `This request to
21561         IEnumerator comes from a foreach statement' which we can then use
21562         to generate the error.
21563
21564 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21565
21566         * class.cs (TypeContainer.AddMethod): we now add methods to the
21567         MethodGroup instead of the method hashtable.  
21568
21569         * expression.cs: Add MethodGroup abstraction, which gets us one
21570         step closer to the specification in the way we handle method
21571         declarations.  
21572
21573         * cs-parser.jay (primary_expression): qualified_identifier now
21574         tried to match up an identifier to a local variable reference or
21575         to a parameter reference.
21576
21577         current_local_parameters is now a parser global variable that
21578         points to the current parameters for the block, used during name
21579         lookup.
21580
21581         (property_declaration): Now creates an implicit `value' argument to
21582         the set accessor.
21583
21584 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21585
21586         * parameter.cs: Do not use `param' arguments as part of the
21587         signature, per the spec.
21588
21589 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21590
21591         * decl.cs: Base class for classes, structs and interfaces.  This
21592         is the "Declaration Space" 
21593
21594         * cs-parser.jay: Use CheckDef for checking declaration errors
21595         instead of having one on each function.
21596
21597         * class.cs: Factor out some code for handling error handling in
21598         accordance to the "Declarations" section in the "Basic Concepts"
21599         chapter in the ECMA C# spec.
21600
21601         * interface.cs: Make all interface member classes derive from
21602         InterfaceMemberBase.
21603
21604 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21605
21606         * Many things: all interfaces are parsed and generated in
21607         gen-treedump.  Support for member variables, constructors,
21608         destructors, properties, constants is there.
21609
21610         Beginning of the IL backend, but very little done, just there for
21611         testing purposes. 
21612
21613 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21614
21615         * cs-parser.jay: Fix labeled statement.
21616
21617         * cs-tokenizer.cs (escape): Escape " and ' always.
21618         ref_line, ref_name: keep track of the line/filename as instructed
21619         by #line by the compiler.
21620         Parse #line.
21621
21622 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21623
21624         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21625         to match the values in System.CodeDOM.
21626
21627         Divid renamed to Divide.
21628
21629         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21630         statements. 
21631         (Statements.set): remove.
21632
21633         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21634         statements. 
21635
21636         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21637         falseStatements always have valid values. 
21638
21639         * cs-parser.jay: Use System.CodeDOM now.
21640