2005-11-07 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2
3         * statement.cs (Try.DoEmit): When a variable is captured, do not
4         try to emit the vi.LocalBuilder variable as it has been captured.
5         Create a temporary variable and store the results on the
6         FieldBuilder.  Fixes #76642
7
8 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9
10         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
11
12         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
13
14         * expression.cs (Binary.DoResolve): Added && optimalization.
15     
16         * typemanager.cs (AddUserType): Removed useless argument.
17
18 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
19
20         * statement.cs (Block.variables): Uses ListDictionary.
21
22 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
23
24         Fix #75969.
25         * class.cs (PartialContainer.EmitType): Customized to emit
26         security attributes.
27         (ClassPart.ApplyAttributeBuilder): Transform security attribute
28         for partial classes.
29
30 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
31
32         Fix #76599.
33         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
34         access has to be fixed.
35         
36         * typemanager.cs (IsUnmanagedType): Wrong common field type.
37
38 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
39
40         Fix #76590.
41         * ecore.cs (NullCast.Reduce): Implemented.
42
43         * expression.cs (ArrayCreation.CheckIndices): Correcly check
44         constant type.
45         
46         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
47         properly.
48         (Foreach.Resolve): Catch null properly.
49
50 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
51  
52         * cs-tokenizer.cs: Warning text fix.
53
54         * driver.cs: AllWarningNumbers exposed on public interface.
55
56         * report.cs (): Reviewed warning numbers.
57         (IsValidWarning): Use binary search.
58
59 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
60  
61         * driver.cs: Implemeted resource visibility.
62         (Resources): New class for code sharing between /res: and
63         /linkres:
64  
65 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
66
67         Fix #76568.
68         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
69         folding.
70         
71         * convert (Convert.ImplicitReferenceConversion): NullCast holds
72         contants only.
73         
74         * ecore.cs (NullCast): Child is contant only.
75         
76         * literal.cs (NullLiteral.Reduce): null can be converted to any
77         reference type.
78
79 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
80
81         * driver.cs: Use Encoding.Default as default code page instead
82           of ISO-28591.
83
84 2005-10-27  Raja R Harinath  <rharinath@novell.com>
85
86         Fix #76085.
87         * expression.cs (Invocation.Error_InvalidArguments): Handle
88         __arglist parameters.
89         (Invocation.VerifyArgumentsCompat): Likewise.
90         * support.cs (ReflectionParameters.GetSignatureForError): Print
91         __arglist parameters.
92         (InternalParamters.GetSignatureForError): Likewise.
93         * parameter.cs (Parameters.GetSignatureForError): Likewise.
94
95 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
96
97         * attribute.cs (GetPropertyValue): Made public.
98
99         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
100         Resolve.
101         Add new property WrapNonExceptionThrows to handle 2.0 assembly
102         attribute.
103         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
104         is not defined.
105         
106         * driver.cs: Reflect method name change.
107         
108         * statement.cs (Try.Resolve): Warn when try has both general
109         exception handlers.
110         
111         * typemanager.cs: runtime_compatibility_attr_type new predefined
112         type.
113
114 2005-10-26  Raja R Harinath  <harinath@gmail.com>
115
116         Fix #76419.
117         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
118         treat it as an empty parameter list.
119
120 2005-10-26  Raja R Harinath  <rharinath@novell.com>
121
122         Fix #76271.     
123         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
124         ResolveAsTypeStep silent.
125         * statement.cs (Block.AddConstant): Mark block as used.
126         (Block.ResolveMeta): Avoid piling on error messages
127         if a constant initializer resolution fails.
128
129 2005-10-25  Raja R Harinath  <rharinath@novell.com>
130
131         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
132         Remove.
133         (NamespaceEntry.VerifyAllUsing): New.
134         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
135         behaviour.  Delegates actual resolution of alias to ...
136         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
137         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
138         Update.
139         * driver.cs (Driver.MainDriver): Update.
140         
141         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
142         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
143         property.
144         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
145         Remove.
146         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
147         RootNamespace.DefineNamespacesForAll.
148
149 2005-10-24  Raja R Harinath  <harinath@gmail.com>
150
151         * typemanager.cs (assemblies, external_aliases, modules)
152         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
153         (ComputeNamespaces, GetRootNamespace): Remove extra staging
154         overhead.  Move resposibility ...
155         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
156         * driver.cs, attribute.cs, codegen.cs: Update to changes.
157
158 2005-10-23  Raja R Harinath  <harinath@gmail.com>
159
160         * namespace.cs (RootNamespace.all_namespaces): Renamed from
161         cached_namespaces.  Improve usage.
162         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
163         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
164         Move from GlobalRootNamespace and simplify.
165         (RootNamespace.Global): Make instance variable.
166         (RootNamespace.RootNamespace): Add "alias name" parameter.
167         (GlobalRootNamespace): Simplify drastically.
168         (Namespace.Lookup): Don't use GetNamespace.
169         * typemanager.cs (GetRootNamespace): Rename from
170         ComputeNamespaceForAlias.
171         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
172
173 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
174
175         * anonymous.cs (AnonymousContainer): Don't crash when container
176         doesn't exist.
177
178 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
179
180         * expression.cs (Binary.DoResolve): Warn when comparing same
181         values.
182
183 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
184
185         Fix #76486.
186         * expression.cs (Binary.DoResolve): It looks like there are no
187         convetsion rules in enum context.
188
189 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
190
191         Add support for extern alias qualifiers.
192         * typemanager.cs: Move some LookupTypeReflection code
193         to namespace.cs, to have cleaner code. Added some methods
194         to help us keep track of the extern aliased references.
195         * driver.cs: Add suport for extern alias assemblies on command
196         line and check for their warnings/errors. Also keep track of the
197         extern aliased assemblies.
198         * namespace.cs: Move the global functionality of Namespace
199         to GlobalRootNamespace/RootNamespace. Now the global namespace
200         is GlobalRootNamespace.Globa. Also the code moved from 
201         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
202         Finally added LocalAliasEntry (AliasEntry before) and
203         ExternAliasEntry, to handle alias statements.
204         * cs-parser.jay: Add support in the grammar for extern alias
205         statement.
206         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
207         Update callings to Namespace (now in GlobalRootNamespace).
208
209 2005-10-18  Raja R Harinath  <rharinath@novell.com>
210
211         Fix #76371.
212         * class.cs (TypeContainer.DefineType): Move updating of
213         topological sort earlier in the code.
214         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
215
216 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
217
218         Fix #76273.
219         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
220         
221         * constant.cs (Constant.TryReduce): Moved from Cast class.
222         (Reduce): Made little bit more OO and fixed missing conversions.
223         
224         * ecore.cs (Reduce): Implemented.
225         (Binary.EnumLiftUp): New method to upgrade values to enum values.
226         
227         * literal.cs (Reduce): Implemented.
228         
229         * class.cs: Reverted Miguel's wrong commit.
230
231 2005-10-14  Miguel de Icaza  <miguel@novell.com>
232
233         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
234
235 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
236
237         * cs-parser.jay, expression.cs : CS0214 was missing error location
238           for constants. Fixed bug #76404.
239
240 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
241
242         Fix #76370.
243         * convert.cs (ExplicitConversionCore): Fixed object->enum
244         conversion.
245
246 2005-10-10  Raja R Harinath  <rharinath@novell.com>
247
248         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
249         InstanceExpression.
250         (PropertyExpr.EmitCall): Likewise.
251         * expression.cs (Invocation.EmitArguments): Handle case where
252         arguments == null.
253         (Invocation.EmitCall): Avoid allocating temporary variable if
254         there are no arguments.
255
256 2005-10-07  Raja R Harinath  <rharinath@novell.com>
257
258         Fix #76323.
259         * convert.cs (ImplicitConversionStandard): Move conversion of
260         void* to arbitrary pointer types ...
261         (ExplicitConversionStandard): .. here.
262         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
263         error to always print typenames.
264
265 2005-10-07  Raja R Harinath  <rharinath@novell.com>
266
267         * convert.cs (GetConversionOperator): Rename from
268         GetConversionOperators.  Move operator selection code from ...
269         (UserDefinedConversion): ... here.
270
271 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
272
273         * convert.cs (ExplicitConversionCore): Removed duplicate enum
274         conversion.
275
276 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
277
278         * assign.cs (Assign.DoResolve): Error method changed.
279
280         * cfold.cs (DoConstantNumericPromotions): Error method changed.
281         
282         * const.cs (ResolveValue): Reset in_transit immediately.
283         
284         * constant.cs: Error method changed.
285         
286         * convert.cs: Removed useless location parameter.
287         (ExplicitNumericConversion): Don't do double enum check.
288         (ExplicitConversionCore): Renamed from ExplicitConversion.
289         (ExplicitUnsafe): Extracted from ExplicitConversion.
290         (ExplicitConversion): Uses for error reporting.
291         
292         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
293         error messages.
294         (ResolveBoolean): Uses common error method.
295         (CastToDecimal): Get rid of ec.
296         (CastFromDecimal): Optimized.
297         (ConvCast): Get rid of ec.
298         
299         * enum.cs (ResolveValue): Reset in_transit immediately.
300         (Emit): Return after first error.
301         
302         * expression.cs: Convert changes.
303         
304         * literal.cs: Error method changed.
305         
306         * statement.cs: Error method changed.
307
308 2005-10-03  Raja R Harinath  <rharinath@novell.com>
309
310         * support.cs (SeekableStreamReader.Position): Don't error out when
311         the requested position is just beyond the end of the current
312         buffered data.
313
314 2005-09-28  Raja R Harinath  <rharinath@novell.com>
315
316         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
317         try to keep in sync with the byte count of the underlying Stream.
318         However, this limits us to a window size of 2048 characters: i.e.,
319         the maximum lookahead of our lexer/parser can be 2048 characters.
320
321 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
322
323         Fix #76255.
324         * driver.cs: Fix compilation files with full root path.
325
326 2005-09-25  Miguel de Icaza  <miguel@novell.com>
327
328         * report.cs (SymbolRelatedToPreviousError): Format the output so
329         it does not use an open parenthesis that is never closed. 
330
331         * driver.cs: Follow coding guidelines
332
333 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
334
335         Fix #72930.
336         * const.cs (Const.ResolveValue): Check for assigning non-null
337         value to reference type.
338
339 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
340
341         * anonymous.cs: Implemented ExprClassName.
342         
343         * assign.cs (Assign.DoResolve): Don't chrash when type is not
344         delegate.
345         
346         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
347         check.
348         
349         * class.cs (StaticClass.DefineContainerMembers): Report protected
350         members as error.
351         
352         * codegen.cs: if(ed) PRODUCTION.
353         
354         * convert.cs (Error_CannotImplicitConversion): Better error
355         distinction.
356         
357         * cs-parser.jay: More error checks.
358         
359         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
360         
361         * driver.cs (CSCParseOption): Enabled wrong option check.
362         
363         * ecore.cs (Expression.ExprClassName): Turned to property.
364         (MemberExpr.CheckIntermediateModification): For checking boxed
365         value types     modification.
366         
367         * statement.cs (Fixed.Resolve): Expression type must be
368         convertible to fixed type.
369         (CollectionForeach.GetEnumeratorFilter,TryType):
370         Small refactoring for easier error checking.
371
372 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
373
374         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
375         attributes.
376         
377         * class.cs (GeneratedBaseInitializer): New class for customization
378         compiler generated initializers.
379         (MemberBase.DoDefine): Check Obsolete attribute here.
380         (FieldMember.DoDefine): Ditto.
381         
382         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
383         constants.
384         
385         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
386         (MemberCore.GetObsoleteAttribute): Removed argument.
387         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
388         (MemberCore.CheckObsoleteType): New helper.
389         
390         * delegate.cs,
391         * enum.cs,
392         * statement.cs: Updates after MemberCore changes.
393         
394         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
395         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
396         
397         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
398         obsolete attribute for compiler construct.
399         (As.DoResolve): Cache result.
400         
401         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
402
403 2005-09-26  Raja R Harinath  <rharinath@novell.com>
404
405         Fix #76133.
406         * expression.cs (This.VerifyFixed): In a value type T, the type of
407         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
408         value type R, 'this' is treated as a value parameter.
409
410 2005-09-22  Miguel de Icaza  <miguel@novell.com>
411
412         * statement.cs (Lock): Use the TemporaryVariable class instead of
413         manually using local variables as those do not work when variables
414         are captured.
415
416         * ecore.cs: Moved the TemporaryVariable class from being a nested
417         class inside Foreach to be a public class that can be employed in
418         other places. 
419
420 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
421
422         * cs-parser.jay: interface_accessors replaced by
423         accessor_declarations.
424
425         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
426         location.
427         
428         * statement.cs (GotoCase.Resolve): Convert null constant to
429         null case.
430         (SwitchLabel.ResolveAndReduce): Ditto.
431         (SwitchLabel.NullStringCase): Custom null stamp.
432         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
433         
434         typemanager.cs (CSharpSignature): Don't skip first argument
435         for full names.
436
437 2005-09-18  Miguel de Icaza  <miguel@novell.com>
438
439         * driver.cs: Set InEmacs based on the environment variable EMACS. 
440
441         * location.cs (InEmacs): in this mode, do not report column
442         location as it confuses Emacs.
443
444 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
445
446         * cfold.cs, constant.cs, convert.cs, ecore.cs,
447         expression.cs, iterators.cs, literal.cs: Store constants and
448         literals location.
449         
450         * class.cs (MemberBase.ShortName): Pass location.
451         
452         * cs-parser.jay: Some location fixes.
453         
454         * ecore.cs (Expression.Location): Made virtual.
455
456 2005-09-05  Miguel de Icaza  <miguel@novell.com>
457
458         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
459         if the underlying types are the same, otherwise we need to produce
460         code that will do the proper cast.
461
462         This was exposed by Marek's constant rewrite which produced
463         invalid code for the call site:
464
465         enum X : long { a }
466         void Method (X v) {}
467
468         Method ((X) 5)
469
470         This fixes test-49.cs
471
472 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
473
474         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
475           Type/Object should be allowed as well. Fixed bug #75968.
476
477 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
478
479         * expression.cs : (Binary.DoResolve): when one is enum constant and
480           another is constant 0, then return enum one *as enum type*.
481           Fixed bug 74846.
482
483 2005-09-02  Raja R Harinath  <rharinath@novell.com>
484
485         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
486         internal.
487
488         Fix #75941.
489         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
490         flow-branching for LocalVariableReferences in case we were invoked
491         from a MemberAccess.
492         * expression.cs (LocalVariableReference.VerifyAssigned): New.
493         Carved out of ...
494         (LocalVariableReference.DoResolveBase): ... this.
495         (MemberAccess.Resolve): Do the check that was disabled during
496         SimpleNameResolve.
497
498 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
499
500         * class.cs :
501           (PartialContainer.Create): check abstract/sealed/static strictly
502           but abstract/sealed can exist only at one side. Fixed bug #75883.
503
504 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
505
506         Fix #75945.
507         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
508         specified, don't default to UnmanagedType.I4.
509
510 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
511
512         * expression.cs : conditional operator should check possibly
513           incorrect assign expression. Fixed bug #75946.
514
515 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
516
517         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
518           Reverting the change. gmcs is much complex than mcs on this matter.
519
520 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
521
522         * cs-tokenizer.cs : To read another token ahead of the actual 
523           consumption, use new SavedToken and cache token instead of moving
524           back the stream with SeekableStreamReader (it seemed problematic).
525         * cs-parser.jay,
526           driver.cs : Thus use StreamReader directly.
527         * support.cs : Thus removed SeekableStreamReader.
528
529 2005-08-30  Raja R Harinath  <rharinath@novell.com>
530
531         Fix #75934.
532         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
533         (ScopeInfo.EmitScopeType): Use it to construct field names from
534         names of captured locals.
535
536         Fix #75929.
537         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
538         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
539         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
540         (ExplicitConversion): Remove enum cases already handled by
541         implicit conversion.  Move implicit conversion check to the beginning.
542         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
543         * expression.cs (ArrayCreation.EmitDynamicInitializers):
544         Don't treat System.Enum as a struct.
545
546 2005-08-30  Jb Evain  <jbevain@gmail.com>
547
548         * attribute.cs: handles as expression in parameters.
549
550 2005-08-30  Raja R Harinath  <rharinath@novell.com>
551
552         Fix #75802.
553         * class.cs (TypeContainer.VerifyClsName): Don't use a
554         PartialContainer when verifying CLS compliance.
555         (AbstractPropertyEventMethod): Set Parent here, ...
556         (PropertyMethod): ... not here.
557
558 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
559
560         * attribute.cs : escaped attribute name should not be allowed to be
561           resolved (e.g. @class as classAttribute). Fixed bug #75930.
562
563 2005-08-29  Raja R Harinath  <rharinath@novell.com>
564
565         Fix #75927.
566         * convert.cs (ImplicitStandardConversionExists): Allow zero also
567         when converting a long constant to unsigned long.
568         * expression.cs (Invocation.OverloadResolve): Add sanity check to
569         detect where IsApplicable and VerifyArgumentsCompat disagree.
570
571 2005-08-29  Raja R Harinath  <rharinath@novell.com>
572         and Carlos Alberto Cortez  <carlos@unixmexico.org>
573
574         Fix #75848.
575         * class.cs (TypeContainer.CanElideInitializer): New helper.
576         (TypeContainer.EmitFieldInitializers): Use it to determine if we
577         can safely emitting the initializer of a field.
578
579 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
580
581         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
582           allowed inside a switch (without loop). Fixed bug #75433.
583
584 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
585
586         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
587         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
588
589 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
590
591         * driver.cs : kinda reverting the default encoding changes (not exact 
592           revert since I noticed that "codepage:reset" might not work fine).
593
594 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
595
596         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
597           Location. Now getter and setter store location correctly.
598           (errors/cs0111-12.cs now reports the expected location.)
599
600 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
601
602         * driver.cs : Use default encoding on the environment.
603           Removed (now that) extra parameter for SeekableStreamReader.
604         * support.cs : (SeekableStreamReader) third .ctor() argument for
605           StreamReader is not required (always true). preamble size could
606           be acquired in simpler and safe way.
607
608 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
609
610         * cs-parser.jay: report CS0642 at warning level 3
611           and report CS0642 for an if else statement also
612           fixes bug #74745. Patch by John Luke (and a bit
613           modified by me).
614           Removed extra CS0642 warning check for "while",
615           "for" and "fixed".
616         * statement.cs: In Block.Resolve(), CS0642 check
617           is reimplemented to check a sequence of an empty
618           statement and a block.
619
620           Both fix bug #66777.
621
622 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
623
624         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
625         detection until I fix it.
626         
627         * cs-tokenizer.cs: Changed error message.
628         
629         * cs-parser.jay: Fixed 2 error locations.
630         
631         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
632         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
633         properties.
634         
635         * enum.cs (GetSignatureForError): Fixed.
636         
637         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
638         method detection.
639         
640         * class.cs,
641         * typemanager.cs (RegisterProperty): Removed.
642         
643         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
644
645 2005-08-24  Raja R Harinath  <rharinath@novell.com>
646
647         Fix #75874.
648         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
649         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
650
651 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
652
653         * expression.cs : tiny fix is required for not warning positive ulong.
654           See test-441.cs.
655
656 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
657
658         * expression.cs : add CS0652 check for constant and integral
659           expression. Fixed bug #53974.
660
661 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
662
663         * expression.cs : in DoNumericPromotions(), check if there is implicit
664           conversion overload for string (to check CS0034). Fixed bug #52492.
665
666 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
667
668         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
669
670 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
671
672         * ecore.cs : report location when it is *not* Null.
673
674 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
675
676         * codegen.cs,
677           ecore.cs,
678           flowanalysis.cs,
679           expression.cs:
680           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
681           correctly. Fixed bug #75721.
682
683 2005-08-23  Raja R Harinath  <rharinath@novell.com>
684
685         * support.cs (SeekableStreamReader.Position): Avoid an expensive
686         loop that performs 'min (pos, char_count)'.
687
688         Fix #75862.
689         * expression.cs (Unary.ResolveOperator): Don't discard implicit
690         converted value in Operator.OnesComplement.
691
692 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
693
694         * anonymous.cs: If the anon method is pulled into a helper class,
695         it needs to be `internal' not `private'. Fixes runtime behavior on
696         msft. bug #75704
697
698 2005-08-20  Martin Baulig  <martin@ximian.com>
699
700         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
701         scope if we don't already have it.
702
703         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
704         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
705         fixes #75867.
706
707 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
708
709         Fix #75803
710         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
711         is a partial class.
712
713 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
714
715         The big constants rewrite
716         Fix #75746, #75685 and more
717         As a side effect saved 1MB for MWF ;-)
718         
719         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
720         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
721         enum based for corlib compilation.
722         
723         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
724         subtractions.
725         
726         * class.cs (FixedField.Define): Use ResolveAsConstant.
727         
728         * const.cs (IConstant): Interface constants and enums.
729         (Const.ResolveValue): New method for constant resolvning.
730         (ExternalConstant): Constants from imported assemblies.
731         
732         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
733         conversion; like enums.
734         (Constant.ToType): Converts this constant to different type.
735         (Constant.Increment): Adds 1.
736         
737         * convert.cs (ImplicitConversionRequired): Simplified.
738         
739         * cs-parser.jay: Create EnumMember directly.
740         
741         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
742         
743         * doc.cs (GenerateEnumDocComment): Removed.
744         
745         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
746         (ConvertIntLiteral): Removed.
747         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
748         
749         * enum.cs (EnumMember): Implement IConstant.
750         (Enum.IsValidEnumConstant): Removed.
751         (Enum.GetNextDefaultValue): Removed.
752         (Enum.FindMembers): Updated.
753         (Enum.GenerateDocComment): Iterate enum members.
754         
755         * expression.cs (Cast.TryReduce): Handle enums correctly.
756         (New.Constantify): Made public.
757         (MemberAccess.DoResolve): Removed contant specific if(s).
758         
759         * literal.cs (NullLiteral): Implement new abstract methods.
760         
761         * statement.cs (GotoCase.Resolve): Use new constant methods.
762         (SwitchLabel.ResolveAndReduce): Use new constant methods.
763         
764         * typemanager.cs (LookupEnum): Removed.
765         (IsEnumType): Fixed to work with corlib.
766         (RegisterConstant): Removed.
767         (LookupConstant): Removed.
768         (GetConstant): Changed to work with IConstant.
769
770 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
771
772         * location.cs : Fixed overflown (>255) column number.
773
774 2005-08-03  Raja R Harinath  <rharinath@novell.com>
775
776         First cut of the qualified-alias-member feature.
777         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
778         token.
779         * cs-parser.jay (DOUBLE_COLON): New token.
780         (namespace_or_type_name): Add rule for recognizing
781         qualified-alias-members.
782         (primary_expression): Likewise.
783         (element_access): Allow QualifiedAliasMember as a possible
784         type-bearing expression.
785         (local_variable_type, local_variable_pointer_type): Likewise.
786         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
787         aliases in the current and enclosing namespace declarations.
788         (NamespaceEntry.UsingAlias): Add CS0440 warning.
789         * decl.cs (MemberName.is_double_colon): New.
790         (MemberName.MemberName): Add new constructor for alias-member.
791         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
792         * expression.cs (QualifiedAliasMember): New expression type.
793
794 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
795
796         * location.cs : it borked when no argument was specified.
797
798 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
799
800         * location.cs : tiny ToString() format fix.
801
802 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
803
804         * statement.cs : oops, it was missing.
805
806 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
807
808         A set of fixes for precise line/column location.
809
810         * location.cs :
811           "token" field now holds a file/line "delta", a line number offset 
812           from the segment, and a column number. See also:
813           http://lists.ximian.com/pipermail/mono-devel-list/2004-
814           December/009508.html
815           Removed static IsNull. Use instance IsNull property instead.
816         * cs-tokenizer.cs :
817           For some tokens it stores Location. For Identifier it stores
818           LocatedToken which is a pair of string name and location.
819           Column numbers are adjusted only at getChar().
820         * report.cs :
821           Use Location.ToString() for reporting (it now contains column).
822         * cs-parser.jay :
823           Largely modified to use LocatedToken instead of
824           string (IDENTIFIER), and to acquire Location from some tokens.
825         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
826           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
827           codegen.cs :
828           Now MemberName holds Location. DeclSpace.ctor() receives Location
829           as a parameter. Removed extra parameters to all derived classes.
830           Replaced Location.IsNull() with instance property.
831         * assign.cs, expression.cs :
832           Added .ctor() overload that omits Location.
833         * attribute.cs :
834           Added "nameEscaped" flag that indicates the identifier was escaped
835           in the source file. This fixes bug #57047.
836
837 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
838
839         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
840         New method, looking for lo-case imported cls type.
841
842         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
843         here.
844
845         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
846
847         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
848
849         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
850         all_imported_types.
851         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
852
853         Optimized to save 3.5 MB for SWF compilation.
854
855 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
856
857         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
858         (PartialContainer.Create): Moved logic AddToContainer.
859         (PartialContainer.MarkForDuplicationCheck): Shares name.
860         
861         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
862         place.
863         
864         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
865         initialization.
866         (Namespace.GetSignatureForError): New method.
867         
868         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
869         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
870
871 2005-08-01  Raja R Harinath  <rharinath@novell.com>
872
873         Fix #75669.
874         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
875         member lookup rather than qualifier_type, since qualifier_type can
876         be null.
877
878 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
879
880         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
881         enum member.
882
883 2005-07-31  Miguel de Icaza  <miguel@novell.com>
884
885         * statement.cs: Copy the local exception into the exception
886         captured local.  Fixes 75674
887
888 2005-07-31  Raja R Harinath  <harinath@gmail.com>
889
890         Fix #75658.
891         * expression.cs (Invocation.OverloadResolve): Don't report error
892         CS1501 if error CS1502 has been reported.
893         (New.DoResolve): Delegate CS1501 reporting to
894         Invocation.OverloadResolve.
895
896         Fix #75656.
897         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
898         invariant-meaning-in-block property in an enclosing block if
899         necessary.
900
901 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
902
903         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
904         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
905         (Switch.CheckSwitch): Just save 50kb for SWF.
906
907 2005-07-27  Martin Baulig  <martin@ximian.com>
908
909         * anonymous.cs (CaptureContext.AddField): Added
910         `AnonymousContainer am' argument; compute its toplevel scope if
911         it's not already computed.  Fixes #75649.
912
913 2005-07-26  Raja R Harinath  <rharinath@novell.com>
914
915         Fix #75628.
916         * class.cs (Constructor.Emit): Reset block to null if the block
917         resolve fails.
918
919 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
920
921         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
922
923 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
924
925         * class.cs (MethodData.Define): Check whether accessor implementing
926         interface is public.
927
928         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
929
930 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
931
932         Fix #57245
933         * namespace.cs (LookupType): Moved same type check to...
934         
935         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
936         with the same name.
937
938 2005-07-21  Raja R Harinath  <rharinath@novell.com>
939
940         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
941         already found a typebuilder.
942         * class.cs (MethodCore.IsDuplicateImplementation): Compare
943         MemberNames, not strings.
944
945         * const.cs (Error_ExpressionMustBeConst): 
946         Rename from Error_EpressionMustBeConst.
947         * const.cs, class.cs, statement.cd: Update.
948
949 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
950
951         Fix #65573
952
953         * const.cs (Const.LookupConstantValue): Report missing contant expression
954         everytime.
955         (Error_EpressionMustBeConstant): Only one error method.
956
957         * class.cs, statement.c: Updated.
958
959 2005-07-20  Raja R Harinath  <rharinath@novell.com>
960
961         * statement.cs (Block.Flags): Add back HasVarargs.
962         (Block.flags): Make protected.
963         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
964
965         * typemanager.cs (types, typecontainers, user_types): Remove.
966         (UserTypes, TypeContainers): Likewise.
967         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
968         (CleanUp, Reset): Update.
969         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
970         (GetNestedType): Use Type.GetNestedType.
971         (CoreLookupType): Take two arguments, the namespace and the
972         basename of the type.  Update to use the Namespace.Lookup
973         mechanism.
974         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
975         (RealMemberLookup): Use IsNestedChildOf instead of playing with
976         string concatenation and substring matches.
977         * class.cs, enum.cs, delegate.cs: Update to changes.
978
979 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
980
981         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
982         Expression and made virtual.
983
984         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
985         (ImplicitStandardConversionExists): Fixed `byte' typo ?
986
987         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
988
989         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
990         error message.
991
992         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
993         change.
994
995 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
996
997         Fix #57707
998         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
999         AssemblyCultureAttribute is not used on executable.
1000
1001         * rootcontext.cs,
1002         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1003
1004 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1005
1006         Fix #60638.
1007         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1008         New.  Reports CS0252/CS0253.
1009         Mostly taken from preliminary patch by Duncak Mak.
1010         (Binary.DoResolveOperator): Store results of operator lookup.
1011         Use them to detect if we need to warn about unintended reference
1012         comparisons.
1013
1014 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1015
1016         Fix #72969.
1017         * namespace.cs (Namespace.Lookup): Add back location parameter.
1018         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1019         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1020
1021         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1022         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1023         (Namespace.LookupType): ... this.
1024         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1025         of namespaces.
1026         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1027         purported to handle pointers.
1028         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1029         CoreLookupType.
1030
1031 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1032
1033         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1034         type as namespace.
1035
1036 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1037
1038         * namespace.cs (Namespace.Lookup): Drop location parameter.
1039         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1040         (NamespaceEntry.Lookup): ... this.
1041         (NamespaceEntry.Error_AmbiguousTypeReference):
1042         Move here from DeclSpace.
1043         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1044         names ...
1045         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1046         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1047         Move to NamespaceEntry.
1048         * delegate.cs, expression.cs: Update to changes.
1049
1050 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1051
1052         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1053         CheckAttributeType and refactored.
1054         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1055         ResolveAsTypeTerminal error handling.
1056         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1057         handling.
1058         (GetSignatureForError): Print errors in same way.
1059
1060         * class.cs,
1061         * codegen.cs: Reflect attribute GetSignatureForError change.
1062
1063         * ecore.cs,
1064         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1065
1066         * namespace.cs (UsingEntry): Refactored to make fields private.
1067
1068         * assign.cs,
1069         statement.cs: Error_UnexpectedKind has extra parameter.
1070
1071 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1072
1073         * ecore.cs (IAlias): Remove.
1074         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1075         that implement the interface.
1076         * namespace.cs (Namespace): Likewise.
1077         (Namespace.declspaces): Renamed from 'defined_names'.
1078         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1079         DeclSpace instead of an IAlias.
1080         * tree.cs (Tree.AddDecl): Update.
1081
1082 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1083
1084         * statement.cs (Block.Flags); Remove HasVarargs.
1085         (Block.HasVarargs): Move to ToplevelBlock.
1086         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1087         (Block.Variables): Make protected.  Initialize variable hashtable
1088         if necessary.
1089         (Block.AddVariable): Update.
1090         (Block.Resolve): Update to changes.
1091         (ToplevelBlock.HasVarargs): New boolean.
1092         (ToplevelBlock.ThisVariable): Move here from Block.
1093         (ToplevelBlock.AddThisVariable): Likewise.
1094         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1095         * expression.cs (This.ResolveBase): Update to changes.
1096         (ArglistAccess.DoResolve): Likewise.
1097
1098 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1099
1100         Fix #75321
1101         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1102
1103         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1104         not used and not used & assigned.
1105         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1106
1107 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1108
1109         Fix #75053
1110         * expression.cs (Is.DoResolve): null is never provided type.
1111
1112 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1113
1114         Fix #52496
1115         * cs-parser.jay: Less strict event error rule to catch more errors.
1116
1117 2005-07-08  Martin Baulig  <martin@ximian.com>
1118
1119         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1120         gettter (allowed) or setter (not allowed).
1121
1122         * class.cs (Accessor): Implement IIteratorContainer.
1123         (Accessor.Yields): New public field.
1124         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1125         per-accessor basis.
1126
1127         * cs-parser.jay
1128         (get_accessor_declaration, set_accessor_declaration): Set the
1129         `yields' flag on the accessor, not the property.
1130         (property_declaration): Do the iterators check on a per-accessor
1131         basis and not for the whole property.
1132
1133 2005-07-08  Martin Baulig  <martin@ximian.com>
1134
1135         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1136         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1137
1138 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1139
1140         Fix #74975
1141         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1142         (ExtractSecurityPermissionSet): Cope with self referencing security
1143         attributes properly.
1144
1145         * driver.cs (SetOutputFile): Made public property OutputFile.
1146
1147 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1148
1149         Fix #75486.
1150         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1151         has_nonstatic_fields.  Make into a FieldBase pointer.
1152         (TypeContainer.AddField): Add CS0282 check.
1153         (TypeContainer.EmitType): Update.
1154
1155 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1156
1157         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1158         compare if they start with __.
1159
1160 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1161
1162         * statement.cs (Switch.SwitchGoverningType): Only look at
1163         UserCasts that don't need implicit standard conversions to one of
1164         the allowed switch types (Fixes test-322.cs).
1165         (LocalInfo.Resolve): Re-enable sanity-test.
1166
1167 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1168
1169         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1170         
1171         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1172         
1173         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1174
1175 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1176
1177         Fix #75472.
1178         * ecore.cs (SimpleName.GetSignatureForError): Add.
1179         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1180         (MemberAccess.GetSignatureForError): Add.
1181
1182 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1183  
1184         The big error and warning messages review.
1185         
1186         * anonymous.cs,
1187         * assign.cs,
1188         * attribute.cs,
1189         * class.cs,
1190         * codegen.cs,
1191         * convert.cs,
1192         * cs-parser.jay,
1193         * cs-tokenizer.cs,
1194         * decl.cs,
1195         * delegate.cs,
1196         * doc.cs,
1197         * driver.cs,
1198         * ecore.cs,
1199         * enum.cs,
1200         * expression.cs,
1201         * flowanalysis.cs,
1202         * iterators.cs,
1203         * literal.cs,
1204         * location.cs,
1205         * modifiers.cs,
1206         * namespace.cs,
1207         * parameter.cs,
1208         * pending.cs,
1209         * report.cs,
1210         * rootcontext.cs,
1211         * statement.cs,
1212         * support.cs,
1213         * tree.cs,
1214         * typemanager.cs: Updated.
1215         
1216         * class.cs: (MethodCore.SetYields): Moved here to share.
1217         (PropertyMethod.Define): Moved iterator setup here.
1218         
1219         * iterators.cs: Add orig_method to have full access to parent
1220         container.
1221
1222 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1223
1224         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1225         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1226         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1227         variable of struct type.
1228         * expression.cs (Unary.ResolveOperator): Update to change.
1229         (Indirection.VerifyFixed): Likewise.
1230         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1231         (ParameterReference.VerifyFixed): Value parameters are fixed.
1232         (This.VerifyFixed): Treat 'this' as a value parameter.
1233         * statement.cs (LocalInfo.IsFixed): Remove.
1234
1235 2005-07-01  Martin Baulig  <martin@ximian.com>
1236
1237         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1238         `ec.EmitThis ()' to get the correct scope.
1239
1240 2005-07-01  Martin Baulig  <martin@ximian.com>
1241
1242         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1243         instance is a ParameterReference; fixes #75299.
1244
1245 2005-07-01  Martin Baulig  <martin@ximian.com>
1246
1247         Reverted Marek's latest patch (r46725):
1248         - it contains structural changes which are neither mentioned in
1249           the ChangeLog nor explained anywhere; for example the additional
1250           argument of EmitContext's and Iterator's .ctor's and the
1251           TypeContainer.DefineMembers() change.
1252         - structural changes like this should go in in seperate patches
1253           and not be hidden in a huge patch which just seems to affect
1254           warnings and errors.
1255           a big and hard to understand patch.
1256         - it breaks iterators and causes regressions, for instance in
1257           test-iter-03.cs.      
1258
1259 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1260
1261         Fix #75412.
1262         * expression.cs (Indexers.map): Remove.
1263         (Indexers.Append): Filter out inaccessible setters and getters.
1264         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1265
1266         Fix #75283.
1267         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1268         Refactored from ...
1269         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1270         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1271         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1272         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1273
1274 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1275
1276         Fix #75322
1277         * class.cs (FieldBase.GetInitializerExpression): One more field
1278         for backup.
1279
1280 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1281
1282         * pending.cs: Do not define a proxy if the base method is virtual,
1283         it will be picked up by the runtime (bug 75270).
1284
1285 2005-06-08  Martin Baulig  <martin@ximian.com>
1286
1287         The big Iterators rewrite :-)
1288
1289         * iterators.cs: Rewrite this to use the anonymous methods framework.
1290
1291         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1292         before the TypeContainers; see 2test-21.cs.
1293
1294         * class.cs
1295         (TypeContainer.DefineType): Don't create a new EmitContext if we
1296         already have one (this only happens if we're an Iterator).
1297         (TypeContainer.Define): Also call Define() on all our iterators.
1298         (Method.CreateEmitContext): Added support for iterators.
1299
1300         * anonymous.cs
1301         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1302         (AnonymousContainer.CreateMethodHost): Moved here from
1303         AnonymousMethod and made abstract.
1304         (AnonymousContainer.CreateScopeType): New abstract method.
1305         (AnonymousContainer.IsIterator): New public property.
1306         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1307         get the ScopeTypeBuilder rather than manually defining it here. 
1308         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1309         iterators here.
1310
1311         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1312         before RootContext.DefineTypes().
1313
1314         * codegen.cs (EmitContext.RemapToProxy): Removed.
1315         (EmitContext.CurrentAnonymousMethod): Changed type from
1316         AnonymousMethod -> AnonymousContainer.
1317         (EmitContext.ResolveTopBlock): Protect from being called twice.
1318         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1319         (EmitContext.EmitThis): Removed the iterators hacks; use the
1320         anonymous methods framework for that.
1321
1322         * statement.cs
1323         (ToplevelBlock.Container): Make this a property, not a field.
1324         (ToplevelBlock.ReParent): New public method; move the
1325         ToplevelBlock into a new container.
1326         (Foreach.TemporaryVariable): Simplify.
1327
1328 2005-06-05  Martin Baulig  <martin@ximian.com>
1329
1330         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1331         (Block.AddTemporaryVariable): New public method; creates a new
1332         `LocalInfo' for a temporary variable.
1333         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1334         variables here.
1335         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1336         non-iterator variables.
1337
1338 2005-06-05  Martin Baulig  <martin@ximian.com>
1339
1340         * statement.cs (Foreach.TemporaryVariable): Create the
1341         LocalBuilder in the Emit phase and not in Resolve since in some
1342         situations, we don't have an ILGenerator during Resolve; see
1343         2test-19.cs for an example.
1344
1345 2005-06-04  Martin Baulig  <martin@ximian.com>
1346
1347         **** Merged r45395 from GCS ****
1348
1349         The big Foreach rewrite - Part II.
1350
1351         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1352         with `PropertyInfo ienumerator_getcurrent'.
1353
1354         * codegen.cs (VariableStorage): Removed.
1355
1356         * statement.cs
1357         (Foreach): Derive from Statement, not ExceptionStatement.
1358         (Foreach.CollectionForeach): New nested class.  Moved all the code
1359         dealing with collection foreach here.
1360         (Foreach.ForeachHelperMethods): Removed.
1361         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1362
1363 2005-05-23  Martin Baulig  <martin@ximian.com>
1364
1365         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1366         don't need to.  Fix #75014.
1367
1368 2005-05-20  Martin Baulig  <martin@ximian.com>
1369
1370         Merged r44808 from GMCS.
1371
1372         * class.cs (TypeContainer.CircularDepException): Removed.
1373         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1374         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1375         (CS0146) and interface (CS0529) dependencies here.
1376
1377 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1378
1379         * expression.cs (Invocation.EmitCall): Fix initialization
1380         'this_call' to reflect current behaviour.  Fix indentation.
1381
1382         * convert.cs (FindMostEncompassedType): Add two trivial special
1383         cases (number_of_types == 0 || number_of_types == 1).
1384         (FindMostEncompasingType): Likewise.
1385
1386 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1387
1388         Some cleanups preparing for the fix of #75283.
1389         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1390         error testing.
1391         (EventExpr.InstanceResolve): Likewise.
1392         (EventExpr.DoResolve): Remove redundant checks.
1393
1394 2005-06-10  Duncan Mak  <duncan@novell.com>
1395
1396         * cs-tokenizer.cs (process_directives): New flag for controlling
1397         the processing of preprocessor directives.
1398         (x_token): After seeing a '#', return Token.NONE instead of going
1399         to handle_preprocessing_directive() when not processing
1400         directives. This avoids unnecessary processing during the token peek in
1401         is_punct().
1402
1403         This fixes #74939.
1404
1405         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1406         the existing error reporting methods instead of Report.Error.
1407
1408         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1409         after Raja's rewrite.
1410
1411 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1412
1413         * class.cs: Small fix.
1414
1415 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1416
1417         Fix #75160.
1418         * class.cs (GetPartialBases): Fix return value check of
1419         part.GetClassBases.
1420
1421 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1422
1423         Ensure that partial classes are registered in their enclosing
1424         namespace.  Initial part of fix of #75160.
1425         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1426         Register declspace with namespace here, not in
1427         DeclSpace.RecordDecl.
1428         * cs-parser.jay: Pass namespace to RecordDecl.
1429         * class.cs (PartialContainer.Create): Likewise.
1430         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1431         called.
1432         * decl.cs (Declspace.RecordDecl): Remove.
1433         * namespace.cs (NamespaceEntry.DefineName): Remove.
1434
1435 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1436
1437         * rootcontext.cs: Reset TargetExt as well.
1438
1439 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1440
1441         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1442         -langversion:ISO-1.
1443
1444 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1445
1446         Fix #75080, cs0119.cs.
1447         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1448         of ...
1449         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1450         allowing ExprClass.Type and ExprClass.Namespace for
1451         ResolveFlags.VariableOrValue.
1452         (Expression.Resolve) [1-argument variant]: Change default resolve
1453         flags based on language version.
1454         (Expression.Error_UnexpectedKind): Use a simple string array
1455         rather than an ArrayList.
1456         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1457         not ExprClass.Type.
1458         (TypeOfVoid.DoResolve): Likewise.
1459         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1460         flags argument -- it always has the same value.
1461
1462 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1463
1464         Fix #75081.
1465         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1466         Use it in the error message.
1467         * assign.cs, expression.cs, statement.cs: Update.
1468
1469 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1470
1471         Fix #75088.
1472         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1473         the "almostMatchedMember" case too.
1474         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1475         that failed the accessibility checks to 'almost_match'.
1476
1477 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1478
1479         * attribute.cs: Use internal MethodBuilder methods to set
1480         ExactSpelling and SetLastError on PInvoke methods, instead
1481         of passing them via charset.  Fixes #75060.
1482
1483 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1484
1485         * parameter.cs (Parameter): Remove TODO comment.
1486         (Parameter.DefineParameter): Remove Location parameter.
1487         (Parameters.LabelParameters): Likewise.
1488         * class.cs (Constructor.Emit): Update to change.
1489         (MethodData.Emit): Likewise.
1490         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1491         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1492
1493 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1494
1495         * parameter.cs,
1496           Removed Parameters.Location and added Parameter.Location instead.
1497           Removed Location parameter from Emit() and GetSignature().
1498         * anonymous.cs,
1499           class.cs,
1500           cs-parser.jay,
1501           delegate.cs,
1502           iterators.cs,
1503           statement.cs :
1504           Modified all related calls.
1505
1506 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1507
1508         Improve user-defined conversion handling.
1509         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1510         applicable operators.
1511         (AddConversionOperators): New.  Helper for GetConversionOperators.
1512         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1513         there is only one most encompassed/encompassing type.
1514         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1515         "applicable operator" handling.
1516         (UserConversion): Move cache here from GetConversionOperators.
1517         Directly cache the chosen operator, rather than the whole
1518         MethodGroup.
1519         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1520         case.  Allow conversion of decimal to sbyte and byte too.
1521         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1522         New static methods.  Used to avoid allocating EmptyExpressions in
1523         convert.cs.
1524
1525 2005-05-24  Duncan Mak  <duncan@novell.com>
1526
1527         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1528         another class, used in Convert.ExplicitNumericConversion.
1529         (CastToDecimal): New class, similar to above, but casts to
1530         System.Decimal, used in Convert.ImplicitNumericConversion and also
1531         in explicit convesion from double/float to decimal.
1532
1533         * convert.cs (ImplicitNumericConversion): Handle implicit
1534         conversions to System.Decimal.
1535         (ExplicitNumericConversion): handle explicit conversions to
1536         System.Decimal.
1537
1538         This fixes #68711.
1539         
1540 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1541
1542         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1543         know the type at this stage, just break through.   Fixes #75008 
1544
1545 2005-05-19  Martin Baulig  <martin@ximian.com>
1546
1547         * delegate.cs
1548         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1549         to disable error reporting.
1550
1551         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1552         here since we don't want to report an error; see the new test-336.cs.
1553
1554 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1555
1556         * statement.cs (ToplevelBlock.GetParameterReference)
1557         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1558         Move here from class Block.
1559         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1560         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1561
1562 2005-05-18  Martin Baulig  <martin@ximian.com>
1563
1564         Fix #74978.
1565
1566         * flowanalysis.cs
1567         (FlowBranching.Reachability): Add non-static public And() and Or()
1568         methods.
1569         (FlowBranchingSwitch): New class; do the `break_origins' thing
1570         like in FlowBranchingLoop.
1571         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1572         reachability, not just locals and parameters.
1573         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1574         switch; MergeBreakOrigins() now takes care of that.
1575
1576 2005-05-18  Martin Baulig  <martin@ximian.com>
1577
1578         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1579         a loop and may leave it, reset the barrier; fixes #74974.
1580
1581 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1582         
1583         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1584         is back.
1585         
1586         * cs-parser.jay: Catch more lexical errors.
1587         
1588         * report.cs: Add one more Error method.
1589         
1590         * rootcontext.cs,
1591         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1592
1593 2005-05-17  Martin Baulig  <martin@ximian.com>
1594
1595         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1596         #70970. 
1597
1598 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1599
1600         Fix test-382.cs.  Emit values of decimal constants.
1601         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1602         Carved out of ...
1603         (TypeContainer.AddField): ... this.
1604         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1605         with initializers to include 'Const's.
1606         (ClassPart.RegisterFieldForInitialization): Forward to
1607         PartialContainer.
1608         * const.cs (Const.Const): Pass initializer to base class.
1609         (Const.Define): In case of decimal constants, register them for
1610         initialization in a static constructor.
1611
1612 2005-05-14  Martin Baulig  <martin@ximian.com>
1613
1614         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1615         do not call ResolveUnreachable() on unreachable statements in
1616         here, see the comment in the source code.
1617
1618 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1619
1620         Fix #74934.
1621         * expression.cs (BinaryResolveOperator): If one of the operands of
1622         an equality comparison is 'null' and the other is a pointer type,
1623         convert the null to a NullPointer.
1624         * convert.cs (ImplicitReferenceConversion): If the expression is a
1625         NullLiteral and the target type is a pointer type, return a
1626         NullPointer instead.
1627         (ImplicitConversionStandard): Likewise.
1628
1629 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1630         
1631         * cs-parser.jay: Set readonly context based on special constructs.
1632         
1633         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1634         readonly variable error handling.
1635         
1636         * rootcontext.cs (EmitCode): Don't verify members when error
1637         occurred.
1638         
1639         * statement.cs (LocalInfo): Add reaodnly context information.
1640         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1641
1642 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1643
1644         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1645         for #74041 to initialize 'resolved' to false only for explicit
1646         blocks.  Fixes #74873.
1647
1648 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1649
1650         Fix #74920.
1651         * typemanager.cs (unmanaged_enclosing_types): New.
1652         (IsUnmanagedType): Avoid infloops by using
1653         'unmanaged_enclosing_types' to talk with recursive invocations.
1654
1655 2005-05-13  Martin Baulig  <martin@ximian.com>
1656
1657         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1658         instance variable, not a local.  Fix #74873.
1659         (Block.ResolveUnreachable): Set it to true here.
1660
1661 2005-05-11  Duncan Mak  <duncan@novell.com>
1662
1663         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1664         continuing to process for 'arg'.
1665         (handle_preprocessing_directive): Check the argument of the #endif
1666         directive and report error CS1025 if there are any trailing
1667         characters.
1668
1669         According to the C# spec, having even whitespace after the #endif
1670         directive is illegal; however, because we call arg.TrimEnd ()
1671         beforehand, we have the same behavior as csc, allowing whitespace
1672         after the directive.
1673
1674         Fixes #74892.
1675
1676 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1677
1678         Fix #74863.
1679         
1680         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1681         (Constructor.GetObsoleteAttribute): Implemented correctly.
1682
1683 2005-05-10  Martin Baulig  <martin@ximian.com>
1684
1685         * support.cs (ReflectionParameters.ParameterModifier): Use
1686         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1687         and `ParameterAttributes.In'.  Fixes #74884.
1688
1689 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1690
1691         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1692         
1693         * expression.cs (Argument.GetParameterModifier): Turned to property.
1694         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1695         
1696         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1697         its C# equivalent.
1698         
1699 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1700
1701         Fix #74852.
1702         * decl.cs (MemberCache.AddMethods): Register override methods,
1703         rather than non-override methods.
1704         * typemanager.cs (RegisterOverride): New.
1705         (IsOverride): Update.
1706
1707 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1708
1709         Fix #73105.
1710         
1711         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1712         recursive declaration.
1713         
1714         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1715         
1716 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1717
1718         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1719         
1720         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1721
1722 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1723
1724         Fix #74797.
1725         * decl.cs (DeclSpace.FamilyAccessible): 
1726         Use TypeManager.IsNestedFamilyAccessible.
1727
1728         Fix reopened #64812.
1729         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1730         internal'.
1731
1732 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1733             Abin Thomas  <projectmonokochi@rediffmail.com>
1734             Anoob V E  <projectmonokochi@rediffmail.com>
1735             Harilal P R  <projectmonokochi@rediffmail.com>
1736
1737         Fix #64812.
1738         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1739         allow access to all static members.
1740
1741 2005-05-04  Martin Baulig  <martin@ximian.com>
1742
1743         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1744
1745 2005-05-04  Martin Baulig  <martin@ximian.com>
1746
1747         Fix #74655.
1748
1749         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1750         section at the end; make things work if `default' is not the last
1751         section.        
1752
1753 2005-05-04  Martin Baulig  <martin@ximian.com>
1754
1755         Fix #70400.
1756
1757         * statement.cs (Switch): Replaced the `got_default' field with a
1758         `default_section' one.
1759         (Switch.CheckSwitch): Set `default_section' here.
1760         (Switch.Resolve): If we're a constant switch and the constant is
1761         not found, use the default section.
1762
1763 2005-05-03  Martin Baulig  <martin@ximian.com>
1764
1765         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1766
1767         * statement.cs (Foreach.ArrayForeach): New nested class.
1768         (Foreach.TemporaryVariable): New nested class.
1769         (Foreach.EmitArrayForeach): Removed; this is now in the new
1770         ArrayForeach class.
1771
1772 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1773
1774         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1775         more conservative.
1776         (VerifyPendingMethods): Revert change below.
1777
1778         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1779         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1780         that used to trigger warning -28.  Remove warning -28.
1781         * expression.cs (Invocation.OverloadResolve): Use
1782         TypeManager.IsOverride to distinguish override methods.
1783
1784         Fix #74773.
1785         * pending.cs (VerifyPendingMethods): If a base type implements the
1786         requested interface, don't bother checking individual methods of
1787         the base type.  As a side-effect, this prevents the creation of
1788         unnecessary proxies.
1789
1790 2005-05-02  Martin Baulig  <martin@ximian.com>
1791
1792         Fix #70182.
1793
1794         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1795         Also `And' the locals if the old vector is null.
1796         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1797         null; in this case we basically reset all the variables.        
1798
1799 2005-05-02  Martin Baulig  <martin@ximian.com>
1800
1801         Fix #74529.
1802
1803         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1804         Added `FlowBranching branching' argument; always `and' the
1805         variables instead of `or'ing them unless we're an infinite loop.
1806
1807         * statement.cs (While.Resolve): Create a new sibling unless we're
1808         infinite.       
1809
1810 2005-05-02  Martin Baulig  <martin@ximian.com>
1811
1812         Fix #70140.
1813
1814         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1815         arguments; use it instead of creating a new TopLevelBlock.
1816         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1817         our ConstructorInitializer.
1818
1819         * statement.cs
1820         (TopLevelBlock.TopLevelBranching): New public property.
1821         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1822         and create our `TopLevelBranching'.
1823
1824         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1825         anonymous method host, use `block.TopLevelBranching' rather than
1826         creating a new branching.
1827
1828 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1829
1830         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1831         a ScopeInfo, if any of the current children is a child of the new
1832         entry, move those children there.
1833
1834 2005-04-30  Martin Baulig  <martin@ximian.com>
1835
1836         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1837         at the beginning of a SwitchSection.  Fix #73335.
1838
1839 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1840
1841         Fix #74378
1842         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1843         
1844         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1845         (FieldExpr.DoResolve): Obsolete members are ignored for field
1846         initializers.
1847         
1848 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1849
1850         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1851         of arrays detection.
1852
1853         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1854         verification.
1855         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1856
1857         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1858         arrays report.
1859
1860 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1861
1862         * cs-parser.jay: Use the prefered version of -unsafe in error
1863         message.
1864
1865 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1866
1867         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1868         circumstances.
1869
1870 2005-04-20  John Luke  <john.luke@gmail.com>
1871
1872         * driver.cs: fix typo in error message, --outout to --output
1873
1874 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1875
1876         * codegen.cs (InRefOutArgumentResolving): New field.
1877         
1878         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1879         fields outside contructor.
1880         
1881         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1882         
1883 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1884
1885         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1886         parameter code was not completed ever, so it was not as up-to-date
1887         as local variables.  Must finish it.
1888
1889         The bug fix was to compare the Toplevel of the block, not the
1890         current block.  Thanks for Ben for pointing this out. 
1891
1892 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1893
1894         * decl.cs (AddMethods): Use the declaring type of the problem
1895         method to determine if we want to squash a warning.
1896
1897 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1898
1899         * attribute.cs: Removed debug output.
1900
1901         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1902         
1903         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1904         Report.Stderr.
1905         
1906 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1907
1908         Fix #74481.
1909         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1910         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1911         all null comparisons against reference types.
1912
1913 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1914
1915         Fix# 74565
1916         * class.cs (TypeContainer.CircularDepException) New nested
1917         exception class.
1918         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1919         (TypeContainer.DefineType): Removed error, reset InTransit before
1920         exit.
1921         (Class.DefineType): Throw exception when is in Transit.
1922         Catch exception and report error.
1923         (Struct.DefineType): Throw exception when is in Transit.
1924         Catch exception and report error.
1925         (Interface.DefineType): Throw exception when is in Transit.
1926         Catch exception and report error.
1927
1928         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1929         handle nested exception handlers.
1930
1931         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1932         a catch.
1933
1934         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1935         InFinally and InCatch storage.
1936
1937         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1938         (Catch.Resolve): Set and Restore ec.InCatch.
1939         (Try.Resolve): Set and Restore ec.InFinally.
1940         (Try.HasCatch): True when try has catch.
1941
1942 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1943
1944         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1945           for the same event member, so exclude such cases from warning 419.
1946           Fixed bug #74633.
1947
1948 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1949
1950         * expression.cs (Binary.ResolveOperator): Apply patch from John
1951         Luke to fix bug 59864: operators &, | and ^ on enumerations
1952         require that the same enum type on both sides.
1953
1954         * driver.cs: Add warnings to old flag usage, this is to assist
1955         people who produce Makefiles and hope that the Makefiles will be
1956         used on Windows.
1957
1958         * class.cs (TypeContainer.EmitType): Moved the definition of the
1959         special $PRIVATE$ field from the resolve phase to the Emit phase.
1960         During resolve we do not know if we are a struct with
1961         HasExplicitLayout, we know this only after the attributes for the
1962         type are emitted.
1963
1964         Set the FieldOffset to zero on the dummy field that we create for
1965         the class.   Fixes 74590.
1966
1967 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1968
1969         Fix #73834.
1970         * ecore.cs (PropertyExpr.resolved): New.
1971         (DoResolve): Use it to handle a case of double resolution here.
1972         Handle a case of identical-name-and-type-name.
1973         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1974         resolution by storing the results of expression resolution back
1975         into the "probes" array.
1976
1977 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1978
1979         Fix cs0208-7.cs and cs0208-8.cs.
1980         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1981         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1982         error reporting to point out the reason a struct is not unmanaged.
1983
1984 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1985
1986         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1987           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1988
1989 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1990
1991         Fix #74528.
1992         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1993         IdenticalNameAndTypeName here.
1994         (EventExpr.InstanceResolve): Likewise.
1995
1996 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1997
1998         C# 2.0 DefaultCharSetAttribute implementation
1999         
2000         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2001         which allows us to set GlobalNamespace for every resolve.
2002         (Attribute.ResolveArguments): Cut from Resolve.
2003         (Attribute.GetCharSetValue): Returns CharSet named argument.
2004         (Attribute.DefinePInvokeMethod): Gets default charset from
2005         module settings.
2006         (GlobalAttribute.ResolveAsTypeStep): Override.
2007         (GlobalAttribute.ResolveArguments): Override.
2008         
2009         * class.cs (TypeAttr): Is protected.
2010         
2011         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2012         (ModuleClass.DefaultCharSetType): New memeber.
2013         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2014         
2015         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2016         charset from module.
2017         
2018         * delegate.cs (TypeAttr): Override.
2019         (Delegate.DefineType): Use this TypeAttr.
2020         
2021         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2022         at very early stage (before types are defined) to resolve model
2023         module attributes. It will probably not work with corlib but it
2024         should be ok.
2025         
2026         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2027         charset from module.
2028         
2029         * typemanager.cs (default_charset_type): New type.
2030
2031 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2032
2033         * decl.cs (MemberCache.AddMethods): Don't warn if
2034         System.Object.Finalize has buggy MethodAttributes.
2035
2036         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2037         removed below.
2038
2039 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2040
2041         * doc.cs : detect ambiguous reference to overloaded members.
2042           Fixed bug #71603. MS 1.1 csc does not detect it.
2043
2044 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2045
2046         * doc.cs : delegates must not be referenced with parameters.
2047           Fixed bug #71605.
2048
2049 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2050
2051         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2052
2053 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2054
2055         * driver.cs (MainDriver): Stop processing if the CLS stage found
2056         errors. 
2057
2058         (CompilerCallableEntryPoint.InvokeCompiler): Always
2059         reset after execution;   Take a TextWriter argument for the
2060         output.
2061
2062         * report.cs: Use the error stream instead of hardcoding stderr. 
2063
2064 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2065
2066         * class.cs: Reduce code paths to test, too small of an
2067         optimization to make it worth the extra testing.  Always perform
2068         it. 
2069
2070 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2071
2072         Fix #74510.
2073         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2074         operators that had errors reported on them.
2075
2076 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2077
2078         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2079         argument types.
2080         (Attribute.Resolve): Add named argument type checking.
2081         
2082         * class.cs (FixedField.Define): Use IsPrimitiveType
2083         
2084         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2085         
2086         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2087         unsafe parameter types.
2088         
2089         * statement.cs (Using.ResolveExpression): Add better error description.
2090         
2091         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2092         
2093 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2094
2095         Fix #74484.
2096         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2097         AttributeUsageAttribute in the emitcontext of the attribute class,
2098         not in the emitcontext of the attributable entity it was attached to.
2099         * cs-parser.jay: Use 'current_class', not 'current_container',
2100         when creating a GlobalAttribute.
2101
2102 2005-04-08  Alp Toker  <alp@atoker.com>
2103
2104         * pending.cs: The fix to #58413 failed to compile methods implementing
2105         interfaces with/without params modifiers and vice versa, even though
2106         params modifiers aren't part of the signature. Make the modifier check
2107         less strict as in csc.
2108
2109 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2110             Anoob V E  <projectmonokochi@rediffmail.com>
2111             Harilal P R  <projectmonokochi@rediffmail.com>
2112
2113         Fix #58413.
2114         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2115         modifiers of pending methods.
2116         (PendingImplementation.PendingImplementation): Initialize it.
2117         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2118         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2119         with ParameterData.  Add check for modifiers.
2120         * class.cs (MethodData.Define): Update to changes.
2121
2122 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2123
2124         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2125
2126 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2127
2128         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2129         property.
2130         
2131         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2132         
2133         * rootcontext.cs,
2134         * typemanager.cs: Registered RequiredAttributeAttribute.
2135         
2136 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2137
2138         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2139         Warning CS0169 is back at level 3.
2140         (IMethodData.SetMemberIsUsed): New method.
2141         
2142         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2143         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2144         
2145         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2146
2147         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2148         contants.
2149         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2150         is used.
2151         
2152         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2153         is used.
2154         
2155         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2156         to avoid the problems with nested types.
2157
2158 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2159             Anoob V.E  <projectmonokochi@rediffmail.com>
2160             Harilal P.R  <projectmonokochi@rediffmail.com>
2161             Raja R Harinath  <rharinath@novell.com>
2162
2163         Fix #73820.
2164         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2165         attribute.
2166         * typemanager (GetConstructor): Make public.
2167
2168 2005-04-05  John Luke  <john.luke@gmail.com>
2169             Raja R Harinath  <rharinath@novell.com>
2170
2171         Fix #62232.
2172         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2173         struct too.  Return false quicker in a few cases.
2174         (VerifyUnManaged): Use it.
2175
2176 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2177
2178         Fix #74041.
2179         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2180         not 'unreachable_seen'.
2181
2182 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2183
2184         * attribute.cs (Attribute.GetValue): Removed unused.
2185         
2186         * codegen.cs (CodeGen.TrimExt): Removed unused.
2187         
2188         * cs-parser.jay (output): Removed unused.
2189         
2190         * cs-tokenizer.cs (hex_digits): Removed unused.
2191         
2192         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2193         
2194         * expression.cs (Indirection.LoadExprValue): Removed unused.
2195         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2196         
2197         * iterators.cs (Iterator.param_types): Removed unused.
2198         
2199         * statement.cs (Goto.block): Removed unused.
2200         (ToplevelBlock.did): Removed unused.
2201         (Switch.ResolveConstantSwitch): Removed unused.
2202
2203 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2204
2205         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2206         resetting thingy.
2207
2208 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2209
2210         Fix #74232 and cs0208-3.cs.
2211         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2212         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2213         unmanaged type.  Don't use FieldBuilders when 't' is a
2214         TypeBuilder.  Use ModFlags and MemberType fields.
2215         * class.cs (MemberBase.member_type): Rename from MemberType.
2216         (MemberBase.MemberType): New property.  Determines member_type on
2217         demand.
2218         (MemberBase.DoDefine): Don't initialize MemberType here.
2219         (FieldMember.Define): Likewise.
2220
2221 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2222
2223         Fix #74241
2224         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2225         Attributes are emitted there.
2226         
2227 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2228
2229         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2230         keyword in 'partial enum' too.
2231         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2232         is not allowed).
2233         Report from Kamil Skalski <nazgul@omega.pl>.
2234
2235         Fix #74309.
2236         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2237         have partial containers too.
2238
2239         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2240         in block' checks to Block.CheckInvariantMeaningInBlock.
2241         * statement.cs (Block.GetKnownVariableInfo): Make private.
2242         (Block.IsVariableUsedInChildBlock): Remove.
2243         (Block.IsVariableUsedInBlock): Likewise.
2244         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2245         conflicting declaration.
2246         (Block.AddVariable): Make error messages less long-winded and more
2247         specific.  Show location of conflicting declaration.
2248         * parameter.cs (Parameters.Location): New readonly property.
2249
2250 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2251
2252         Clean up semantics of invoking ResolveMemberAccess.
2253         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2254         can have an instance, ensure that we pass in a non-TypeExpression
2255         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2256         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2257         argument.  Update to changes and simplify.
2258         (FieldExpr.Emitinstance): Remove CS0120 check.
2259         (PropertyExpr.EmitInstance): Likewise.
2260         * expression.cs (Argument.Resolve): Likewise.
2261         (Invocation.DoResolve): Update to changes in semantics of
2262         InstanceExpression.
2263
2264 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2265
2266         Fix #74241
2267         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2268         customization.
2269         
2270         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2271
2272 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2273
2274         Fix difference in behaviour with commandline invocation.
2275         * driver.cs (Driver.Reset): New.
2276         (CompilerCallableEntryPoint): Call it.
2277
2278         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2279         variable" warnings if the boolean expression failed to resolve.
2280
2281 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2282
2283         * attribute.cs: Fix the union of several permissions when some of them
2284         are unrestricted (so the result isn't an unrestricted permission set).
2285         Fix #74036.
2286
2287 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2288
2289         * ecore.cs (MemberExpr): New class.  Convert from interface
2290         IMemberExpr.
2291         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2292         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2293         error checks.
2294         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2295         (MethodGroupExpr.IsExplicitImpl): Remove.
2296         (Expression.GetFieldFromEvent): Remove.
2297         (SimpleName.MemberStaticCheck): Remove.
2298         (SimpleName.DoSimpleNameResolve): Update to changes.
2299         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2300         (MemberAccess.IdenticalNameAndTypeName): Remove.
2301         (MemberAccess.error176): Move to MemberExpr.
2302         (MemberAccess.DoResolve): Update to changes.
2303         (BaseAccess.DoResolve): Likewise.
2304
2305 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2306
2307         C# 2.0 Conditional attribute class implementation
2308         
2309         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2310         Analyzes class whether it has attribute which has ConditionalAttribute
2311         and its condition is not defined.
2312         
2313         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2314         (Class.IsExcluded): New method. Search for at least one defined
2315         condition in ConditionalAttribute of attribute class.
2316
2317 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2318
2319         * ecore.cs (PropertyExpr): Derive from Expression, not
2320         ExpressionStatement.
2321         (PropertyExpr.EmitStatement): Remove.
2322
2323 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2324
2325         Fix #74060.
2326         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2327         internal field "value__" of an enum be private.  The examples for
2328         "value__" that I found on MSDN all used FieldAttributes.Private.
2329
2330         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2331         Don't mention IL method attribute names.
2332
2333         Fix #47991.  Remove a TODO.
2334         * statement.cs (Block.Toplevel): Make into a field.
2335         (Block.Parameters): Move into ToplevelBlock.
2336         (Block.known_variables): Rename from child_variable_names.
2337         (Block.Block): Remove variants that take Parameters.  Initialize
2338         'Toplevel' with the immediately surrounding toplevel block.
2339         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2340         LocalInfo parameter.
2341         (Block.GetKnownVariableInfo): New.
2342         (Block.IsVariableNameUsedInChildBlock): Update.
2343         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2344         the block, even though it may not be in scope.
2345         (Block.AddVariable): Remove Parameters parameter.  Use
2346         Toplevel.Parameters instead.
2347         (Block.AddConstant): Remove Parameters parameter.
2348         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2349         (Block.IsParamaterReference): Likewise.
2350         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2351         (ToplevelBlock.Parameters): New.  Moved from Block.
2352         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2353         initialize Parameters to a non-null value.
2354         * cs-parser.jay: Update to changes.
2355         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2356         simple names that mean different things in the same block.  Use
2357         Block.IsVariableNameUsedInBlock.
2358
2359 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2360
2361         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2362         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2363         GetTypeHandle.  It is possible for a reflected type to derive from
2364         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2365         System.Array during mscorlib compilation).
2366         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2367         contain a method_hash, don't create one either.  Don't create a
2368         deep copy of the base cache's method_hash.
2369         (MemberCache.SetupCache): Rename back from DeepCopy.
2370         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2371         already initialized.  If we see an override function, add its
2372         underlying base virtual function to the member_hash too.
2373
2374         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2375
2376 2005-03-26  Raja R Harinath  <harinath@acm.org>
2377
2378         Fix #73038.
2379         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2380         fails to resolve, ensure that the LHS is still resolved as an
2381         lvalue.
2382
2383 2005-03-25  Raja R Harinath  <harinath@acm.org>
2384
2385         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2386         ec.ContainerType.
2387         (Enum.current_ec): Remove.
2388         (Enum.LookupEnumValue): Remove EmitContext argument.
2389         Just uses the one created during DefineType.
2390         (Enum.FindMembers): Update.
2391         * expression.cs (MemberAccess.DoResolve): Update.
2392
2393 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2394
2395         * assign.cs (Assign.DoResolve): Check for CS1717 when
2396         source and target are same (uses Equals).
2397
2398         * expression.cs (LocalVariableReference, ParameterReference,
2399         This): Implemented Equals, GetHashCode.
2400
2401         * statement.cs (Block.GetParameterReference): Removed useless
2402         local variable.
2403
2404 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2405
2406         Fix cs0128.cs
2407         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2408         blocks before deciding whether the error is cs0136 or cs0128.
2409
2410         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2411         (using_alias_directive, using_namespace_directive): Pass
2412         MemberName, not an expression to Namespace.UsingAlias and
2413         Namespace.Using.
2414         (MakeName): Use the MemberName of the namespace.
2415         * namespace.cs (Namespace.MemberName): New.
2416         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2417         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2418         Likewise.
2419         * decl.cs (MemberName.Name): Make readonly.
2420         (MemberName.FromDotted): New "constructor".
2421         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2422         (MemberCore.Name): Compute from MemberName on demand.
2423         (MemberCore.SetMemberName): Provide a way to change the
2424         MemberName.
2425         (MemberCore.AddToContainer): Don't take a fullname parameter.
2426         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2427         fully qualified name of the container to the member name.
2428         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2429         only if the type is a member of the root container.
2430         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2431         MemberName.Left rather than searching for an embedded ".".
2432         (PartialContainer.CreatePart): Update to changes in RootContext.
2433         (MemberBase.ShortName): Turn into a property.  Use
2434         MemberCore.SetMemberName.
2435         (MemberBase.ExplicitInterfaceName): Remove.
2436         (MemberBase.UpdateMemberName): Remove.
2437         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2438         (PropertyBase.SetMemberName): New override.
2439         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2440         (Tree.GetDecl): New.
2441         (Tree.AllDecls): Rename from Decls.
2442         * attribute.cs, enum.cs, report.cs: Update to changes.
2443         * driver.cs (MainDriver): Use MemberName.FromDotted on
2444         RootContext.MainClass.
2445
2446 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2447
2448         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2449         checks.
2450
2451         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2452
2453 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2454
2455         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2456         property accessor modifiers.
2457
2458         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2459         fixed buffer attribute (CS1716).
2460         (PropertyMethod.HasCustomAccessModifier): When property accessor
2461         has custom modifier.
2462
2463         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2464         modifiers.
2465         (PropertyExpr.DoResolveLValue): Add CS0272.
2466
2467 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2468
2469         * convert.cs: When converting to a pointer, use the proper Conv.U
2470         or Conv.I depending on the source data type.
2471
2472         * cs-tokenizer.cs: Make the size for large decimal constants,
2473         fixes #72957.
2474
2475 2005-03-17  Martin Baulig  <martin@ximian.com>
2476
2477         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2478         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2479
2480 2005-03-17  Martin Baulig  <martin@ximian.com>
2481
2482         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2483         to bool so we can return an error condition.
2484         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2485         returned an error.
2486
2487 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2488
2489         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2490         attributes.
2491
2492 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2493
2494         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2495         Refactor to avoid traversing the list of assemblies, and to avoid
2496         string concatenation.
2497         * typemanager.cs (guid_attr_type): Remove.
2498         (negative_hits, pointers, references): Remove hashes.
2499         (type_hash): New.
2500         (GetConstructedType): New.  Uses type_hash to handle constructed
2501         types (arrays, references, pointers).
2502         (GetReferenceType, GetPointerType): Use it.
2503         (GetNestedType): New.  Uses type_hash to handle nested types of
2504         reflected types.
2505         (LookupType, LookupTypeDirect): Remove.
2506         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2507         'types' hash and LookupTypeReflection directly.
2508         (params_string, params_object): Use GetConstructedType.
2509         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2510         top-level types.
2511         (Namespace.Lookup): Use cached_types.
2512         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2513         provided by old TypeManager.LookupType.
2514         * rootcontext.cs (MakeFQN): Remove.
2515         * decl.cs (DeclSpace.MakeFQN): Likewise.
2516         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2517         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2518         TypeManager.GetConstructedType.
2519         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2520
2521 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2522
2523         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2524         indexers.
2525
2526         * cs-parser.jay: Reports CS1527 for any namespace element.
2527
2528         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2529         Added CS0407.
2530
2531         * expression.cs (ParameterReference.IsAssigned): Changed error to
2532         CS0269.
2533         (Error_WrongNumArguments): Moved CS0245 detection here.
2534
2535         * statement.cs (Return.Resolve): Add CS1622 report.
2536
2537 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2538
2539         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2540
2541 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2542
2543         * attribute.cs expression.cs: Get rid of some allocations.
2544
2545 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2546
2547         * doc.cs : just eliminate the latest change.
2548
2549 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2550
2551         * doc.cs : commented out the latest change. It breaks xml-030.cs
2552
2553 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2554
2555         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2556           fail. So invoke CreateType() in FindDocumentedType().
2557
2558 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2559
2560         * cs-tokenizer.cs : added IsKeyword().
2561         * doc.cs : Detect keyword incorrectly used as identifier.
2562           Allow identifiers prefixed by @.
2563
2564 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2565
2566         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2567         It caused exception in namespace resolving (again!).
2568         
2569         * class.cs (Class.ctor): Removed exit.
2570         (PropertyMethod.ctor): ditto.
2571         
2572         * codegen.cs (Codegen.Reset): Reset static data.
2573         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2574         
2575         * cs-tokenizer.cs (Cleanup): Removed.
2576         
2577         * driver.cs (GetSystemDir): Rewrote to one line command.
2578         It caused problem with unloaded dynamic modules.
2579         (UnixParseOption): Removed Exit.
2580         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2581         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2582         Now can be mcs used as library.
2583         
2584         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2585         empty location.
2586         
2587         * location.cs (Reset): Reset static data.
2588         
2589         * namespace.cs (Reset): Reset static data.
2590         
2591         * report.cs (Report.Reset): Reset static data.
2592         
2593         * rootcontext.cs (RootContext.Reset): Reset static data.
2594         
2595         * tree.cs (RootTypes.ctor): Use Location.Null
2596         
2597         * typemanager.cs (TypeManager.Reset): Reset static data.
2598         (CoreLookupType): Removed Exit.
2599         (TypeHandle.Reset): Reset static data.
2600         
2601 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2602
2603         Fix #73516.
2604         * typemanager.cs (ComputeNamespaces): Import namespaces from
2605         referenced modules too.
2606
2607 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2608
2609         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2610         than '.'.
2611
2612 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2613
2614         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2615         enclosing DeclSpace.  This ensures that a name-lookup populates
2616         more caches and there are fewer 'TypeExpression's.  Carve out
2617         nested type lookup into ...
2618         (LookupNestedTypeInHierarchy): ... this.
2619
2620 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2621
2622         Clean up a few partial-class semantics.  
2623         Fixes test-357.cs and cs1618-2.cs.
2624         * cs-parser.jay (struct_declaration): Use 'current_class' as
2625         parent of newly-created struct.  Remove call to Register ().
2626         Use 'pop_current_class' to complete handing the current struct.
2627         (interface_declaration): Likewise.
2628         (class_declaration): Likewise.
2629         (enum_declaration): Use 'current_class' as parent of newly created
2630         enum.
2631         (delegate_declaration): Likewise.
2632         (pop_current_class): New function.  This is used to handle closing
2633         up the 'current_class' and 'current_container', and pointing them
2634         to the enclosing class/container.
2635         (CSharpParser): Initialize 'current_class' too.
2636         * decl.cs (MemberCore): Add check for invariant: a partial
2637         container is not a parsed entity, and thus does not enclose any
2638         parsed members.
2639         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2640         (DeclSpace.BaseTypeExpr): Use it.
2641         (DeclSpace.LookupType): Add check for invariant.
2642         * class.cs (TypeContainer): Add check for invariant: a nested
2643         class should have the same NamespaceEntry as its enclosing class.
2644         (TypeContainer.EmitFieldInitializers): Make virtual.
2645         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2646         MemberCore.
2647         (TypeContainer.Register): Remove.
2648         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2649         null.  Use TypeResolveEmitContext for resolving base types and
2650         interfaces.  Move initialization of Parts.TypeBuilder here from
2651         ...
2652         (TypeContainer.DefineNestedTypes): ... here.
2653         (PartialContainer): Take a Namespace not a NamespaceEntry.
2654         (PartialContainer.Create): Don't use Register.  Call the
2655         appropriate Add... function directly.
2656         (ClassPart): Take both the PartialContainer and the enclosing
2657         class as constructor arguments.
2658         (ClassPart.EmitFieldInitializers): Override.
2659         (ClassPart.PartFindNestedTypes): Remove.
2660         (FieldBase.GetInitializerExpression): Resolve the initializer
2661         expression in the emit context of the enclosing class.
2662         * tree.cs (RootTypes): Remove Register ().
2663         
2664 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2665
2666         * cs-parser.jay: Removed CS0134.
2667         
2668         * driver.cs: Removed CS1901.
2669         
2670         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2671         for predefined types.
2672
2673 2005-03-07  Duncan Mak  <duncan@novell.com>
2674
2675         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2676         well. Fixes bug #73454.
2677
2678 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2679
2680         * cs-tokenizer.cs (xtoken): Add CS1035.
2681         
2682         * class.cs (MethodData.Define): Add CS0683.
2683         (FieldMember.ctor): Add CS0681.
2684
2685 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2686
2687         * ecore.cs (SimpleName.DoResolve): Rename from
2688         SimpleName.DoResolveAllowStatic.
2689         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2690         Pass 'intermediate' flag to MemberStaticCheck.
2691         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2692         of "intermediate" lookups via MemberAccess.
2693         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2694         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2695
2696 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2697
2698         Fix #73394.
2699         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2700         slipped in because of variable names that are identical to a
2701         builtin type's BCL equivalent ('string String;', 'int Int32;').
2702         (PropertyExpr.EmitInstance): Likewise.
2703
2704 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2705
2706         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2707         
2708         * report.cs (warning_ignore_table): Made public.
2709
2710 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2711
2712         Fix #73282.
2713         * class.cs (MethodData.Emit): Pass 'container' to
2714         container.GetObsoleteAttribute instead of 'container.Parent'.
2715
2716 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2717
2718         * cs-parser.jay: Add 1534 error test.
2719
2720         * iterators.cs (Yield.CheckContext): Add error 1629.
2721         (Iterator.ctor): Save unsafe modifier.
2722         (MoveNextMethod.DoEmit): Restore unsafe context.
2723
2724         * namespace.cs (UsingAlias): Better error message.
2725
2726 2005-03-03  Dan Winship  <danw@novell.com>
2727
2728         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2729         the warning message [#73219]
2730
2731 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2732
2733         Fix compile with MCS 1.0.0.0.
2734         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2735         w_restore to not depend on string constant folding.
2736
2737 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2738
2739         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2740         CS0246 check to users who passed 'silent = false'.
2741         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2742         check.
2743         (SimpleName.SimpleNameResolve): Update.
2744         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2745         (MemberAccess.IdenticalNameAndTypeName): Update.
2746         * doc.cs (FindDocumentedTypeNonArray): Update.
2747
2748 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2749
2750         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2751         * parameters.cs (ComputeAndDefineParameters): Remove.
2752         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2753         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2754         Use GetParameterInfo.
2755
2756 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2757
2758         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2759
2760 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2761
2762         Unify DeclSpace.LookupType and DeclSpace.FindType.
2763         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2764         is in charge of defining nested types on demand.
2765         (DeclSpace.LookupType): Use it when the current_type is a
2766         TypeBuilder.  Use LookupTypeDirect for reflected types.
2767         (DeclSpace.FindType): Remove.
2768         (DeclSpace.LookupInterfaceOrClass): Likewise.
2769         (DeclSpace.DefineTypeAndParents): Likewise.
2770         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2771         DeclSpace.LookupType.
2772         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2773         * typemanager.cs (LookupType): Simplify.
2774         (AddUserType): Remove type from negative_hits.
2775         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2776         * class.cs (TypeContainer.FindMembers): Move handling of nested
2777         types ...
2778         (TypeContainer.FindMembers_NestedTypes): ... here.
2779         (TypeContainer.FindNestedType): Implement override.
2780         (ClassPart.FindNestedType): Delegate to PartialContainer.
2781         (ClassPart.PartFindNestedType): Looks up the nested types of the
2782         part alone.
2783
2784 2005-03-02  Martin Baulig  <martin@ximian.com>
2785
2786         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2787         static constructor in static classes.
2788
2789 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2790
2791         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2792         sizeParamIndex is not specified.
2793
2794 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2795
2796         Fix #73117
2797         * report.cs (WarningMessage.IsEnabled): Missing null check.
2798
2799 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2800
2801         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2802         in the fields and not in the properties.
2803
2804 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2805
2806         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2807         fields as well.
2808
2809 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2810
2811         * attribute.cs: Small refactoring (improved robustness).
2812         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2813         (ValidateGuid): Removed.
2814         (Resolve): Removed referenced to above mentioned.
2815         (GetAttributeUsage): Made private and changed to work without
2816         class assistance.
2817         (GetIndexerAttributeValue): Don't crash.
2818         (GetConditionalAttributeValue): Ditto.
2819         (GetClsCompliantAttributeValue): Ditto.
2820         (ExtractSecurityPermissionSet): All attributes exceptions are
2821         error 648.
2822         (GetPropertyValue): New helper.
2823         (GetMethodImplOptions): New method.
2824         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2825         some missing properties.
2826         
2827         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2828         (Method.ApplyAttributeBuilder): Updated.
2829         
2830         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2831         exception.
2832
2833 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2834
2835         Fix #73052.
2836         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2837         non-simple types (array, pointer, reference).
2838
2839 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2840
2841         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2842
2843         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2844         for operators.
2845         (Method.CheckBase): Catch wrong destructor here.
2846         (MethodData.Define): Add errors 550, 668.
2847
2848         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2849
2850         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2851
2852         * pending.cs (VerifyPendingMethods): Add error 551.
2853
2854         * typemanager.cs (CSharpName): Next error report helper.
2855
2856 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2857
2858         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2859         attributes. Removed useless attribute double check.
2860         It saves almost 2MBs for corlib.
2861
2862 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2863
2864         Fix #72924.
2865         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2866         called twice in case of error.
2867
2868 2005-02-23  Chris Toshok  <toshok@ximian.com>
2869
2870         Fix compiler portions of #72827.
2871         * statement.cs (Block.Emit): call Begin/EndScope on the
2872         EmitContext instead of the ILGenerator.
2873
2874         * codegen.cs (EmitContext.BeginScope): new method, call
2875         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2876         we have one.)
2877         (EmitContext.BeginScope): same, but EndScope and CloseScope
2878
2879         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2880         offset and call the superclass's OpenScope(int) with it.
2881         (SymbolWriter.CloseScope): get the current il
2882         offset and call superclass's CloseScope(int) with it.
2883
2884 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2885
2886         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2887         CS1677 for out and ref as well.
2888
2889         * class.cs (Method.Define): Add error CS1599 detection.
2890         
2891         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2892         
2893         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2894         
2895         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2896         
2897         * support.cs.cs (ModifierDesc): New helper method.
2898
2899 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2900             Abin Thomas  <projectmonokochi@rediffmail.com>
2901             Anoob V E  <projectmonokochi@rediffmail.com>
2902             Harilal P R  <projectmonokochi@rediffmail.com>
2903
2904         Fix #57851, #72718.
2905         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2906         MemberLookup (used for error reporting) actually returns a result.
2907         Fix error report number (122, not 112).
2908
2909 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2910             Anoob V E  <projectmonokochi@rediffmail.com>
2911             Harilal P R  <projectmonokochi@rediffmail.com>
2912
2913         Fix #71134.
2914         * pending.cs (PendingImplementation.GetAbstractMethods):
2915         Find NonPublic members too.
2916
2917 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2918
2919         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2920         Fixed error 217.
2921         
2922         * class.cs (MethodCore.CheckMethodAgainstBase):
2923         Add error 239 report.
2924
2925 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2926
2927         Fix #68955.
2928         * expression.cs (Invocation.IsApplicable): Make public.
2929         (Invocation.IsParamsMethodApplicable): Likewise.
2930         * delegate.cs (Delegate.VerifyApplicability): Don't use
2931         Invocation.VerifyArgumentCompat for parameter applicability
2932         testing.  Use Invocation.IsApplicable and
2933         Invocation.IsParamsMethodApplicable.
2934
2935 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2936
2937         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2938         
2939         * class.cs (Operator.Define): Add error 217 report.
2940         
2941 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2942
2943         * namespace.cs (UsingEntry.Resolve): Undo change below.
2944
2945 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2946
2947         Fix #72756.
2948         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2949         disable the error message when the extended MemberLookup also
2950         fails.
2951         (Expression.MemberLookupFinal): Update.
2952         (SimpleName.DoSimpleNameResolve): Update.
2953         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2954         Don't use MemberLookupFinal.
2955         (New.DoResolve): Update.
2956         (BaseAccess.CommonResolve): Update.
2957
2958 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2959
2960         Fix #72732.
2961         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2962         occured previously, don't resolve again.
2963
2964 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2965
2966         Fix #69949
2967         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2968         argument. Call ResolveAttributeUsage for unresolved.
2969         when types doesn't match ctor arguments.
2970         
2971         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2972         for nested attribute classes.
2973         (Class.attribute_usage): Removed.
2974         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2975         for attribute class.
2976         
2977         * ecore.cs (IsAttribute): Removed.
2978         
2979         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2980         
2981         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2982         now normal types.
2983         (attribute_types): Removed.
2984         (EmitCode): Global attributes are emited as the latest.
2985
2986 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2987
2988         * class.cs (EmitFieldInitializers): Don't emit field initializer
2989         for default values when optimilization is on.
2990         
2991         * constant.cs (Constant.IsDefaultValue): New property.
2992         
2993         * driver.cs: Add /optimize handling.
2994         
2995         * constant.cs,
2996         * ecore.cs,
2997         * literal.cs: Implement new IsDefaultValue property.
2998         
2999         * rootcontext.cs (Optimize): New field, holds /optimize option.
3000
3001 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3002
3003         Fix crasher in re-opened #72347.
3004         * namespace.cs (Namespace.Lookup): Return null if
3005         DeclSpace.DefineType returns null.
3006
3007         Fix #72678.
3008         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3009
3010 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3011
3012         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3013         now returns null if it cannot resolve to an lvalue.
3014         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3015         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3016         returned null.  Remove check for SimpleName.
3017         (EventExpr.DoResolveLValue): New.
3018         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3019         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3020         error from ...
3021         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3022         avoid CS0131 error.
3023         (Unary.ResolveOperator): Move CS0211 check ...
3024         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3025         CS0131 error.
3026         (Unary.DoResolveLValue): Simplify.
3027         (AddressOf.DoResolveLValue): New.
3028         (ArrayAccess.DoResolveLValue): New.
3029
3030 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3031
3032         * attribute.cs (Attribute.Resolve): Add arguments casting for
3033         when types doesn't match ctor arguments.
3034
3035 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3036
3037         Fix parts of #63202.
3038         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3039         lookup of operator in base type.  Ensure that all checks happen
3040         when the operator resolves to an "op_..." method.
3041
3042 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3043
3044         Fix #71992.
3045         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3046         'ignore_cs0104' parameter.  Pass it to ...
3047         (NamespaceEntry.Lookup): ... this.
3048         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3049         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3050         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3051         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3052         Update.  Request that cs0104 errors be ignored.
3053         (ComposedCast.ResolveAsTypeStep): Update.
3054
3055 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3056
3057         Fix #59209.
3058         * expression.cs (Invocation.BetterFunction): Remove support for
3059         comparing virtual functions and their overrides.
3060         (Invocation.IsOverride): New.
3061         (Invocation.OverloadResolve): Don't consider 'override' functions
3062         during candidate selection.  Store them in a lookaside list.
3063         If the selected method is a 'virtual' function, use the list to
3064         find any overrides that are closer to the LHS type.
3065
3066 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3067
3068         * expression.cs (New.DoResolve): Add complex core type reduction.
3069         (New.Constantify): Converts complex core type syntax like 'new int ()'
3070         to simple constant.
3071         
3072 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3073
3074         * decl.cs (EntryType.EntryType): New constructor to create an
3075         updated copy of a cache entry.
3076         (MemberCache.AddMethods): Use it.
3077         (MemberCache.ClearDeclaredOnly): Remove.
3078         (MemberCache.MemberCache): Update.
3079
3080 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3081
3082         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3083         variable.  This one is represents the actual low-level declaration
3084         of the method, as opposed to the semantic level `IsStatic'.   
3085
3086         An anonymous method which is hosted into a static method might be
3087         actually an instance method.  IsStatic would reflect the
3088         container, while MethodIsStatic represents the actual code
3089         generated.
3090
3091         * expression.cs (ParameterReference): Use the new MethodIsStatic
3092         instead of IsStatic.
3093
3094         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3095         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3096         set on the current EmitContext. 
3097
3098         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3099         resolve our casted expression as an LValue.  This triggers the
3100         proper LValue processing that is later required by Assign.
3101
3102         This fixes 72347.
3103
3104         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3105
3106 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3107
3108         C# 2.0 Fixed buffer implementation
3109
3110         * anonymous.cs: Update after RegisterHelperClass renaming.
3111
3112         * attribute.cs (AttributeTester.fixed_buffer_cache):
3113         Cache of external fixed buffers.
3114         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3115         implementation if field is fixed buffer else null.
3116
3117         * class.cs
3118         (TypeContainer.AddField): Accept FieldMember instead of Field.
3119         (FieldBase.IsFieldClsCompliant): Extracted code from
3120         VerifyClsCompliance descendant customization.
3121         (FixedField): New class handles fixed buffer fields.
3122         (FixedFieldExternal): Keeps information about imported fixed
3123         buffer.
3124         (IFixedField): Make access to internal or external fixed buffer
3125         same.
3126
3127         * cs-parser.jay: Add fixed buffer parsing.
3128
3129         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3130         buffer.
3131
3132         * expression.cs (Indirection): Extended implementation to accept
3133         fixed buffer field.
3134         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3135         (ElementAccess.MakePointerAccess): Get type as parameter.
3136         (DoResolve): Add fixed buffer field expression conversion.
3137         (DoResolveLValue): Ditto.
3138         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3139         (ArrayPtr): Derives from FixedBufferPtr.
3140         (ArrayPtr.Emit): Add extra emit for array elements.
3141
3142         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3143
3144         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3145         for compiler generated types.
3146         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3147
3148         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3149         and consume less memory.
3150         (Fixed.Resolve): Add fixed buffer case.
3151
3152         * typemanager.cs (compiler_generated_attr_ctor,
3153         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3154         (HasElementType): Add our own implementation to work on every
3155         runtime.
3156
3157 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3158
3159         * anonymous.cs (CaptureContext): Track whether `this' has been
3160         referenced.   
3161
3162         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3163         only captured `this' if it was implicitly done (instance
3164         methods/variables were used). 
3165
3166         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3167         `this' must be captured.
3168
3169 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3170  
3171         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3172         is null it means that there has been no need to capture anything,
3173         so we just create a sibling.
3174
3175         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3176
3177         Just a partial fix.  The other half is fairly elusive.
3178         
3179 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3180
3181         Fix #52586, cs0121-4.cs.
3182         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3183         and return a hashtable.
3184         (MemberCache.ClearDeclaredOnly): New.
3185         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3186         the method_hash of a base type too.
3187         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3188         type methods.  Overwrite entries with the same MethodHandle so
3189         that the ReflectedType is correct.  The process leaves in base
3190         virtual functions and their overrides as distinct entries.
3191         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3192         matters since it was boxed in a ArrayList before.
3193         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3194         modifier.
3195         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3196         case of a virtual function and its override (choose the overload
3197         as better).
3198         (Invocation.OverloadResolve): Avoid 'override' members during
3199         'applicable_type' calculation.
3200
3201 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3202
3203         Combine two near-redundant caches.
3204         * typemanager.cs (method_params): Rename from method_internal_params.
3205         (TypeManager.GetParameterData): New.  Replace
3206         Invocation.GetParameterData.
3207         (TypeManager.LookupParametersByBuilder): Remove.
3208         * expression.cs (Invocation.method_parameter_cache): Remove.
3209         (Invocation.GetParameterData): Remove.
3210         Update to changes.
3211         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3212         Update to changes.
3213
3214 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3215
3216         Fix #72015.
3217         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3218         TypeManager.multicast_delegate_type is null, resolve it by looking
3219         up "System.MulticastDelegate".
3220         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3221
3222 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3223             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3224             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3225
3226         Fix cs0164.cs.
3227         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3228         (LabeledStatement.AddReference): New.  Set 'referenced'.
3229         (Goto.Resolve): Use it.
3230
3231 2005-02-05  John Luke  <john.luke@gmail.com>
3232
3233         * driver.cs: remove duplicate -doc line in Usage ()
3234
3235 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3236
3237         * location.cs (Location.AddFile): Fix CS2002 error report.
3238
3239 2005-02-02  Martin Baulig  <martin@ximian.com>
3240
3241         * delegate.cs (Delegate.DefineType): Report an internal error if
3242         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3243         details.        
3244
3245 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3246
3247         Fix a crasher in a variant of #31984.
3248         * const.cs (Constant.CheckBase): New override that defers the
3249         new-or-override check in case the base type hasn't been populated
3250         yet.
3251         (Constant.Define): Ensure the new-or-override check is performed.
3252
3253 2005-02-01  Duncan Mak  <duncan@ximian.com>
3254
3255         * const.cs (LookupConstantValue): Check that `ce' is not null
3256         before calling GetValue ().
3257
3258 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3259
3260         Fix test-334.cs (#69519).
3261         * cs-parser.jay (using_alias_directive): Pass in an expression to
3262         NamespaceEntry.UsingAlias.
3263         (using_namespace_directive): Pass in an expression to
3264         NamespaceEntry.Using.
3265         (namespace_name): Don't flatten to a string.
3266         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3267         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3268         ResolveAsTypeStep.
3269         (NamespaceEntry.UsingEntry): Likewise.
3270         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3271         changes.
3272         (NamespaceEntry.LookupForUsing): Remove.
3273         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3274         names.
3275         (NamespaceEntry.Lookup): Remove support for dotted names.
3276
3277 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3278
3279         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3280         split into two.
3281         (NamespaceEntry.ImplicitParent): Compute on demand.
3282         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3283         parallels the current.
3284         (NamespaceEntry.LookupForUsing): Use it.
3285         (NamespaceEntry.Lookup): If the current namespace-entry is
3286         implicit, don't search aliases and using tables.
3287
3288 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3289
3290         Fix #31984.
3291         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3292         BaseCache here.
3293         (TypeContainer.BaseCache): Compute on demand.
3294         (TypeContainer.FindMembers): Define constants and types if they're
3295         not already created.
3296         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3297         check.
3298         * const.cs (Constant.Define): Make idempotent.
3299
3300 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3301
3302         * pending.cs: Produce better code (no nops produced by using Ldarg
3303         + value).
3304         
3305         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3306         i - 1' it should be arg + 1.
3307
3308         Fixes bug #71819.
3309
3310 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3311
3312         * attribute.cs (Attribute.CheckAttributeType): Make private
3313         non-virtual.
3314         (Attribute.ResolveType): Make virtual.
3315         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3316         handling of RootContext.Tree.Types.
3317
3318 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3319
3320         Update attribute-handling to use the SimpleName/MemberAccess
3321         mechanisms.
3322         * cs-parser.jay (attribute): Pass in an expression to the
3323         constructors of Attribute and GlobalAttribute.
3324         * attribute.cs (Attribute): Take an expression for the name.
3325         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3326         passed in attribute name expression.
3327         (Attribute.CheckAttributeType): Use it.
3328         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3329         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3330         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3331         argument to prevent error messages if the lookup fails.
3332
3333 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3334
3335         * expression.cs (Indirection): Implemented IVariable interface
3336         to support indirection in AddressOf operator.
3337         (PointerArithmetic.Emit): Add optimalization for case where
3338         result can be precomputed.
3339
3340 2005-01-26  Martin Baulig  <martin@ximian.com>
3341
3342         * class.cs (TypeContainer.AttributeTargets): Return the correct
3343         AttributeTargets depending on our `Kind' instead of throwing an
3344         exception; fixes #71632.
3345
3346 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3347
3348         Fix #71257
3349         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3350         constant members.
3351
3352 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3353
3354         Fix #71602.
3355         * expression.cs (MemberAccess.DoResolve): Don't complain with
3356         cs0572 when the LHS of a member access has identical name and type
3357         name.
3358
3359 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3360
3361         Fix #71651, #71675
3362         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3363         CreatePermission.
3364         Create custom PermissionSet only for PermissionSetAttribute.
3365
3366 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3367
3368         Fix #71649
3369         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3370         delegates in static class.
3371
3372 2005-01-24  Martin Baulig  <martin@ximian.com>
3373
3374         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3375         merging an implicit block, just use its reachability.
3376
3377         * statement.cs (Block.Resolve): Make the unreachable code check
3378         work wrt. implicit blocks; see test-337 from #63842.
3379
3380 2005-01-21  Alp Toker  <alp@atoker.com>
3381  
3382         * cs-parser.jay: destructor_declaration's container is PartialContainer
3383         not Class when partial types are used, so use Kind prop instead of
3384         'is'.
3385         
3386 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3387
3388         * cs-parser.jay: Improve error reporting when an interface
3389         declares new types.
3390
3391 2005-01-20  Dick Porter  <dick@ximian.com>
3392
3393         * support.cs: SeekableStreamReader fix from Sandor Dobos
3394         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3395         chars are read.  Fixes bug 70369.
3396
3397 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3398
3399         * cs-parser.jay (catch_clause): Simplify current_block handling
3400         somewhat.
3401
3402 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3403
3404         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3405         code with ImplicitStandardConversion to handle the implicit
3406         conversion of method groups into valid delegate invocations. 
3407
3408         The problem is that in parameter handling we were using this code
3409         path.  Fixes bug #64698
3410
3411 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3412
3413         * cs-parser.jay: Fix several infelicities.
3414         - Avoid assigning to the parser value stack.  Code like 
3415           '$3 = null' is unclean.  Synthesize a value for the code block
3416           instead. 
3417         - Avoid using oob_stack for storing location information.  Use ...
3418         (_mark_): ... this.  New (empty) rule.  Saves the current location
3419         in $$.
3420         (foreach_statement): Avoid using oob_stack for current_block
3421         handling.  Use technique used in for_statement and
3422         using_statement.  Synthesize a value for the code block to store
3423         additional intermediate information.
3424
3425 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3426
3427         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3428         of a different type is only allowed to private fields of a
3429         containing type, not on fields of a base class.
3430
3431         See test-174.cs and error cs0122-9.cs
3432
3433 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3434
3435         Fix test-335.cs (bug #58126).
3436         * cs-parser.jay (argument): Split out non-expression parts of the
3437         rule into 'non_simple_argument'.
3438         (invocation_expression): Support parenthesized invocations with
3439         multiple arguments, and with single non-simple arguments.
3440
3441 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3442
3443         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3444         places.
3445
3446 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3447
3448         Fix cs0038-1.cs, cs1640-6.cs.
3449         * ecore.cs (Expression.Resolve): Remove special-case for
3450         SimpleName in error-handling.
3451         (Expression.almostMatchedMembers): Relax access permission to
3452         protected.
3453         (Expression.MemberLookupFailed): Handle duplicates in
3454         almostMatchedMembers list.
3455         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3456         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3457         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3458         overload if the passed in MemberInfo is a MethodBase.
3459
3460 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3461
3462         Fix #70749
3463         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3464         for non-CAS & merge permission sets properly.
3465
3466 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3467
3468         Improve standard-compliance of simple name and member access 
3469         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3470         * ecore.cs (FullNamedExpression): New abstract base class 
3471         for Namespaces and TypeExpressions.
3472         (ResolveFlags.SimpleName): Remove.
3473         (SimpleName): Remove support for dotted names.
3474         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3475         DeclSpace.FindType and DeclSpace.LookupType.
3476         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3477         (Expression.ExprClassName): Make member function.
3478         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3479         a namespace.  Remove creation of dotted "SimpleName"s.
3480         (MemberAccess.DoResolve): Likewise.
3481         * decl.cs (DeclSpace.Cache): Make private.
3482         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3483         (DeclSpace.FindType): Update.
3484         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3485         FullNamedExpression.
3486         * namespace.cs (Namespace): Derive from FullNamedExpression
3487         so that it can be part of expression resolution.
3488         (Namespace.Lookup): Return an FullNamedExpression.
3489         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3490         namespace.
3491         * rootcontext.cs (NamespaceLookup): Remove.
3492         (LookupType): Move to DeclSpace.
3493         * attribute.cs (CheckAttributeType): Update.
3494         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3495         (FindDocumentedTypeNonArray): Likewise.
3496
3497 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3498
3499         Fix cs0509.cs, cs1632.cs.
3500         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3501         is the same as IsInterface.
3502         (TypeContainer.GetClassBases): Likewise.
3503         * statement.cs (LabeledStatement.ig): New field.
3504         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3505         label.
3506         (LabeledStatement.DoEmit): Check that the label was created with
3507         the same ILGenerator.
3508
3509 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3510
3511         Fix #71058
3512         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3513         accessors to its properties.
3514
3515         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3516         from accessors to property.
3517         
3518 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3519
3520         Fix #70722
3521         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3522         only for overrides.
3523         
3524 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3525
3526         * attribute.cs: Check for null and empty strings.  
3527
3528         I have lost another battle to Paolo.
3529
3530 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3531
3532         Fix #70942
3533         * class.cs (PropertyMethod): Set Parent field in ctors.
3534         (SetMethod.InternalParameters): Add unsafe switch hack.
3535         Override MarkForDuplicationCheck where it is appropriate.
3536
3537         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3538         It says whether container allows members with the same name.
3539         Base default is no.
3540         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3541         Removed is_method parameter.
3542
3543 2005-01-06  Duncan Mak  <duncan@ximian.com>
3544
3545         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3546         because the previous change led to incorrect reporting of CS1032
3547         ("Cannot define/undefine preprocessor symbols after first token in
3548         file"). Instead of using `tokens_seen' as the only flag that
3549         triggers CS1040, introduce `comments_seen'. This new flag is used
3550         to signify having seen comments on the current line, so it is
3551         unset after a newline.
3552
3553 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3554
3555         * doc.cs : When searching for a type, find nested type too.
3556           This fixes bug #71040.
3557
3558 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3559
3560         * doc.cs :
3561           - Warn missing member comment on those classes which also does not
3562             have doc comments. Fixed bug #71041.
3563           - Don't warn missing doc comment on default constructor.
3564             Fixed bug #71042.
3565
3566 2005-01-06  Duncan Mak  <duncan@ximian.com>
3567
3568         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3569         comments, set `tokens_seen' to true. This allows us to detect
3570         misplaced preprocessor directives (i.e. not at the beginning of
3571         the a line, nor after whitespaces). In that case, report error
3572         CS1040. This fixes bug #56460.
3573
3574         * cs-parser.jay (interface_member_declaration): Add checks for
3575         IsExplicitImpl, and report CS0541 error if an interface member is
3576         defined as an explicit interface declaration.
3577
3578 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3579
3580         Fix #70817
3581         * class.cs (PropertyMethod): Set Parent field in ctors.
3582         (SetMethod.InternalParameters): Add unsafe switch hack.
3583         
3584         * decl.cs (MemberCore.Parent): Cannot be readonly.
3585
3586 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3587
3588         * decl.cs (DeclSpace.ResolveType): Remove.
3589         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3590         Merge in code from ...
3591         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3592         * class.cs, enum.cs: Update to changes.
3593
3594 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3595
3596         * anonymous.cs: Ensure that we init the scope of our parent if it
3597         has not been initialized yet.
3598
3599 2004-12-30  Duncan Mak  <duncan@ximian.com>
3600
3601         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3602         if field.FieldBuilder is null. Fixes #70758.
3603
3604         * convert.cs: Fixed some typos and updated some of the comments.
3605         (ImplicitStandardConversionExists):
3606         (TryImplicitIntConversion): If `target_type' is an interface and
3607         the type of `ic' implements this interface, return true or a new
3608         BoxedCast instead of null. This fixes #70468.
3609
3610 2004-12-29  Duncan Mak  <duncan@ximian.com>
3611
3612         * expression.cs (Argument.Emit): Check that Expr is
3613         IMemoryLocation before casting to it, and report CS1510 otherwise.
3614
3615         This fixes #70402.
3616
3617 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3618
3619         * statement.cs (Block.ThisVariable): remove the recursion here, to
3620         make the --profile more sane.
3621
3622 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3623
3624         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3625         assembly, by JB Evain.
3626
3627 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3628
3629         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3630           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3631         "parent" refers to enclosing type/class.  "base" refers to superclass.
3632
3633 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3634
3635         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3636         Ensure that we only have GlobalAttributes.
3637         * attribute.cs (Attribute.Emit): Make non-virtual.
3638         (GlobalAttribute.Emit): Remove.
3639         (Attribute.Resolve): Make virtual.
3640         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3641         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3642         the argument. Don't create one.
3643         (Attribute.GetObsoleteAttribute): Likewise.
3644         (Attribute.GetClsCompliantAttributeValue): Likewise.
3645         * class.cs, decl.cs: Update to changes.
3646
3647 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3648
3649         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3650         
3651         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3652         
3653         * statement.cs (Foreach.Resolve): Add error 186 report.
3654
3655 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3656
3657         * expression.cs (Conditional.DoResolve): Add warning 429.
3658         
3659         * statement.cs (If.Resolve): Add warning 665.
3660
3661 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3662
3663         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3664         except when in the parser, and in GlobalAttribute.
3665         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3666         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3667         RootContext.Tree.Types.NamespaceEntry once work is done.
3668         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3669         and resets RootContext.Tree.Types.NamespaceEntry.
3670
3671 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3672
3673         * cs-parser.jay: Don't create a block for every variable.
3674
3675 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3676
3677         * location.cs: Provide extra information.
3678
3679         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3680         variables from the captured environment, it is the ldarg_0.
3681
3682 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3683
3684         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3685         find a conclusion.
3686         
3687         * class.cs: Changed warning level for 169 to avoid developer
3688         displeasure from warning flooding. It will be changed back when they
3689         fix most of current BCL warnings.
3690         
3691         * RootContext.cs: Pushed default WarningLevel to 3.
3692         
3693         * statement.cs: Removed unused variable.
3694
3695 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3696
3697         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3698         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3699         Add error 502 report.
3700         (StaticClass.DefineType): Add error 441 report.
3701         (Class.AllowedModifiersProp): New virtual property as temporary
3702         extension to AllowedModifiers.
3703         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3704         to share implementation with StaticClass and don't call virtual
3705         methods from ctor.
3706         
3707         * driver.cs (MainDriver): Add error 1558 test.
3708
3709         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3710         report. Moved error 36 test here.
3711
3712         * statement.cs (Throw.Resolve): Add error 724 report.
3713
3714         * typemanager.cs: Add out_attribute_type core type.
3715         
3716 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3717
3718         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3719         3018 report.
3720         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3721
3722         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3723         3017 report.
3724         
3725         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3726
3727         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3728         Add error 3023 report.
3729         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3730
3731         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3732         implementation.
3733
3734 2004-12-12  John Luke  <john.luke@gmail.com>
3735
3736         * driver.cs (AddArgs): take -- into account when
3737         adding arguments, fixes bug 65710 
3738
3739 2004-12-12  Martin Baulig  <martin@ximian.com>
3740
3741         * expression.cs (Unary.TryReduceNegative): Added support for
3742         SByteConstant and ByteConstant.
3743         (Unary.Reduce): Check error values from TryReduceNegative().
3744
3745 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3746
3747         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3748         and report exception as error 182.
3749
3750 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3751
3752         * driver.cs (Main): Fix message when there are warnings.
3753
3754 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3755
3756         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3757
3758 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3759
3760         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3761         Reduced number of warnings.
3762         
3763         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3764
3765 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3766
3767         * driver.cs: Removed message.
3768
3769         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3770
3771 2004-12-08    <vargaz@freemail.hu>
3772
3773         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3774
3775 2004-12-08  Martin Baulig  <martin@ximian.com>
3776
3777         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3778         instead of a CS3002 for properties and indexer.
3779
3780 2004-12-08  Martin Baulig  <martin@ximian.com>
3781
3782         * decl.cs (MemberName.ToString): Make this work again.
3783
3784 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * attribute.cs (Resolve): Add error 591 detection.
3787
3788         * class.cs (FieldMember.Define): Add error 1547 detection.
3789         (Indexer.Define): Add error 620 detection.
3790         (Operator.Define): Add error 590 detection.
3791
3792         * ecore.cs: Missing argument for error 79.
3793
3794         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3795         detection.
3796
3797 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3798
3799         Fix #70106
3800         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3801         only.
3802
3803 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3804
3805         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3806           Some operator comments were suppressed.
3807         * doc.cs : Implicit/explicit operator name in doc comments are like
3808           "op_Explicit(type)~returnType", so added suffix handling.
3809
3810 2004-12-07  Martin Baulig  <martin@ximian.com>
3811
3812         * decl.cs
3813         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3814         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3815         (DeclSpace.ec): New protected field; store the EmitContext here.
3816         (DeclSpace.EmitContext): New public property; moved here from
3817         `TypeContainer'.
3818         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3819         EmitContext.
3820
3821         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3822         (Enum.Emit): Don't create a new EmitContext.
3823
3824         * delegate.cs (Delegate.DefineType): Always create the
3825         EmitContext.
3826
3827         * iterators.cs (Iterators.DefineIterator): Create a new
3828         EmitContext and store it in `ec'.
3829
3830 2004-08-24  Martin Baulig  <martin@ximian.com>
3831
3832         * typemanager.cs
3833         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3834         this for accessibility checks.
3835         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3836         IsNestedFamilyAccessible.
3837         (TypeManager.IsSubclassOf): New method, do what the name actually
3838         says.   
3839
3840 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3841
3842         Fix crash on cs0657-17.cs.
3843         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3844         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3845         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3846         the case where the NamespaceEntry gets overwritten.
3847
3848 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3849
3850         Fixed #69195, #56821
3851         * ecore.cs (ResolveBoolean): Tiny refactoring.
3852
3853         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3854         of right expression resolving when left is false constant and
3855         operator is LogicalAnd OR true constant and operator is LogicalOr.
3856
3857         * statement.cs (ResolveUnreachable): Always reports warning.
3858
3859 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3860
3861         * class.cs: Distinguish between 1721 and 1722 (just a little help
3862         for the programmer).
3863
3864 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3865
3866         * delegate.cs: Only allow this on new versions of the language. 
3867
3868 2004-12-02  Duncan Mak  <duncan@ximian.com>
3869
3870         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3871         Expression class.
3872         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3873         here as a static method. Take an additional bool out parameter
3874         `must_do_cs1540_check' for signaling to InstanceResolve.
3875         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3876         member field from PropertyExpr class and made it an argument of
3877         the method instead.
3878         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3879         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3880         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3881         and `remove_accessor' as well as InstanceResolve: report CS0122
3882         where applicable.
3883
3884         Fixes #70129.
3885
3886 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3887
3888         Fix test-327.cs, test-328.cs, and put in early infrastructure
3889         for eventually fixing #52697.
3890         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3891         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3892         from other methods.
3893         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3894         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3895         (VerifyUsing, error246): Update.
3896         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3897         'NamespaceEntry.LookupNamespaceOrType'.
3898
3899 2004-12-03  Martin Baulig  <martin@ximian.com>
3900
3901         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3902         method as our child, call AnonymousMethod.Compatible() on it.
3903
3904 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3905
3906         Disable XML documentation support in 'basic' profile.
3907         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3908         Redirect XmlElement to System.Object.
3909         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3910         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3911         * mcs.exe.sources: Add doc-bootstrap.cs.
3912         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3913         of doc.cs.
3914
3915 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3916
3917         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3918           comments are allowed.
3919
3920 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3921
3922         * delegate.cs: Add checks for subtypes in paramaters and return values
3923         in VerifyMethod () to add support for Covariance/Contravariance
3924         in delegates.
3925         
3926 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3927
3928         * report.cs: Remove extra closing parenthesis.
3929
3930         * convert.cs (Error_CannotImplicitConversion): If the name of the
3931         types are the same, provide some extra information.
3932
3933         * class.cs (FieldBase): Use an unused bit field from the field to
3934         encode the `has_offset' property from the FieldMember.  This saves
3935         a couple of Ks on bootstrap compilation.
3936
3937         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3938         method as our child, return the AnonymousMethod resolved
3939         expression.
3940
3941         * expression.cs (New.DoResolve): Allow return values from
3942         NewDelegate to also include AnonymousMethods.
3943
3944         Fixes #70150.
3945
3946 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3947
3948         Fix bug #70102
3949         * attribute.cs (Resolve): Improved implementation of params
3950         attribute arguments.
3951
3952         * support.cs (ParameterData): Add HasParams to be faster.
3953
3954 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3955
3956         all things are for /doc support:
3957
3958         * doc.cs: new file that supports XML documentation generation.
3959         * mcs.exe.sources: added doc.cs.
3960         * driver.cs:
3961           Handle /doc command line option.
3962           Report error 2006 instead of 5 for missing file name for /doc.
3963           Generate XML documentation when required, after type resolution.
3964         * cs-tokenizer.cs:
3965           Added support for picking up documentation (/// and /** ... */),
3966           including a new XmlCommentState enumeration.
3967         * cs-parser.jay:
3968           Added lines to fill Documentation element for field, constant,
3969           property, indexer, method, constructor, destructor, operator, event
3970           and class, struct, interface, delegate, enum.
3971           Added lines to warn incorrect comment.
3972         * rootcontext.cs :
3973           Added Documentation field (passed only when /doc was specified).
3974         * decl.cs:
3975           Added DocComment, DocCommentHeader, GenerateDocComment() and
3976           OnGenerateDocComment() and some supporting private members for
3977           /doc feature to MemberCore.
3978         * class.cs:
3979           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3980         * delegate.cs:
3981           Added overriden DocCommentHeader.
3982         * enum.cs:
3983           Added overriden DocCommentHeader and GenerateDocComment().
3984
3985 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3986
3987         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3988         unwrapping the enumeration values, chain to
3989         DoConstantNumericPromotions again, so we can promote things to the
3990         fundamental types (takes care of enums that are bytes, sbytes).
3991
3992         Fixes bug #62054.
3993
3994 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3995
3996         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3997         Fix long-standing bug in type-lookup.  Use FindType instead of
3998         LookupType when ec.ResolvingTypeTree.
3999         (Attribute.ResolveType, Attribute.Resolve)
4000         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4001         Update to changes.
4002         (Attributes.Search): Remove internal version.  Update.
4003         (Attributes.SearchMulti): Update.
4004         (Attributes.GetClsCompliantAttribute): Remove.
4005         (Attributes.GetIndexerNameAttribute): Remove.
4006         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4007         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4008         * class.cs (Indexer.Define): Likewise.
4009
4010 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4011
4012         Fix bug #68790
4013         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4014         MarshallByReference members access.
4015
4016         * expression.cs: Use CheckMarshallByRefAccess;
4017         Better error CS0197 message.
4018
4019         * report.cs: Print whole related error message.
4020
4021 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4022
4023         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4024         the current directory to help debugging.
4025
4026 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4027
4028         * class (GetClassBases): Better error 60 report.
4029         (EventProperty): Disabled warning 67 detection.
4030
4031 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4032
4033         Fix bug #60324
4034         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4035
4036         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4037         precise values.
4038
4039 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4040
4041         Fix bug #49488
4042         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4043
4044         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4045
4046 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4047
4048         * attribute.cs (Attribute.Resolve): Refine error reporting and
4049         report a cs0117 if the identifier does not exist, to distinguish
4050         from 0617 which is a miss-use of the actual identifier.
4051
4052         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4053         between cs0070 and cs0079.
4054
4055         * class.cs (MemberBase.DoDefine): When reporting a wrong
4056         accessibility level, we use MethodCore to compare instead of
4057         Method (this was a regression in some refactoring effort).
4058
4059         So now we correctly report cs0056 again.
4060
4061         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4062         testing the target_type (which was known to be object_type) and
4063         not the source type (which is anonymous_method).
4064
4065         Fixed reporting of error cs1660.
4066
4067         * expression.cs (UserCast.Source): Expose the underlying cast.
4068
4069         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4070         allowed types to find a match to int32 first (most common).
4071
4072         In addition, it ignores any ImplicitUserConversions that did an
4073         internal implicit conversion (as the switch statement allows only
4074         one integral conversion to exist).
4075
4076         * class.cs (PartialContainer.Create): rename `name' to
4077         `member_name' for clarity.  Then replace the string calls with a
4078         call to MemberName.GetPartialName, as now using
4079         MemberName.ToString is an error (this is due to the side effects
4080         it had, that were fixed in the past).
4081
4082         This will restore the error reporting on a number of partial class
4083         errors that were missusing this (and getting an exception as a
4084         results, which is now just a plain textual warning, because
4085         yyparse debug output would crash otherwise).
4086
4087 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4088
4089         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4090
4091 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4092
4093         * rootcontext.cs (LookupType): Make sure to cache lookups that
4094         don't give us a negative result. This saves about 5% of corlib
4095         compilation time.
4096
4097 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4098
4099         * report.cs (AbstractMessage.Print): messages are sent to stderr
4100
4101         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4102         non-interface in the list of interfaces (at this point, either
4103         parent was properly set, or a base class is being listed in the
4104         interfaces section).
4105
4106         This flags error 1722, and resolves the crash from bug 69259.
4107
4108 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4109
4110         * statement.cs (Using.EmitExpressionFinally): make this work right
4111         for valuetypes. Fixes 69926.
4112
4113 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4114
4115         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4116         converted to an enum" here, before we try to change the underlying
4117         type.  This code exists, but it is a different code path than the
4118         one used while encoding constants.
4119
4120         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4121         old bug: when converting from the null literal to a pointer,
4122         return an EmptyCast, not the NullLiteral.
4123
4124         This fixes #69921, the recent null_type changes probably made this
4125         bug more prominent.
4126
4127         (ImplicitReferenceConversionExists): In addition, resynchronized
4128         the code here, so it matches the same code in
4129         ImplicitReferenceConversionExists for the `from any class-type S
4130         to any interface-type T'.
4131         
4132
4133 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4134
4135         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4136
4137 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4138
4139         * cs-parser.jay: Use verbosity accordingly. 
4140
4141 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4142
4143         * expression.cs (Unary.ResolveOperator): Do not report warning;
4144         AddressOf reads from variable.
4145         
4146         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4147
4148 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4149
4150         Fix bug #69462
4151
4152         * attribute.cs (Attributable): Removed CheckTargets.
4153         (Attributes.Emit): Explicit attribute targets are tested here.
4154
4155         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4156         not enabled for interfaces.
4157
4158         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4159         (GetAssemblyName): Ouch next bug there.
4160
4161 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4162
4163         * expression.cs: Error 275 added.
4164         
4165 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4166
4167         Fix bug #69177 (Implemented decimal constant support)
4168
4169         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4170         (BinaryFold): Add DecimalConstant.
4171
4172         * const.cs (Define): Decimal constant 
4173         (is not constant.
4174         (ChangeType): Add decimal type handling.
4175         (LookupConstantValue): Don't set value for decimal type but
4176         emit DecimalConstantAttribute. Needed for constant optimization.
4177
4178         * constant.cs (ToDecimal): New method.
4179         (ConvertToDecimal): New method.
4180         (IntConstant): Implemented ConvertToDecimal.
4181         (DecimalConstant.Emit): Emit optimized version for decimals in
4182         int range.
4183
4184         * expression.cs (ResolveOperator): Changed order of constant
4185         reduction to work correctly with native types which have
4186         overloaded operators.
4187         (ResolveMemberAccess): Extract constant value from attribute
4188         for decimal type.
4189
4190         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4191
4192         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4193         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4194         (ChangeType): Decimal is special.
4195         (TypeToCoreType): Add decimal type.
4196
4197 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4198
4199         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4200         decimal types.
4201
4202 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4203
4204         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4205         test cs1667-5.cs.
4206
4207 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4210
4211         * pending.cs (PendingImplementation): Grab only interfaces.
4212
4213 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4214
4215         * statement.cs (ForeachHelperMethods): Add location member and
4216         error 202 detection.
4217
4218 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4219
4220         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4221         automatically handled by executable.make.
4222         (PROGRAM): Make profile-specific.
4223
4224 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4225
4226         * expression.cs (DoResolveBase): Fixed wrong warning for out
4227         variables.
4228
4229 2004-11-18  Martin Baulig  <martin@ximian.com>
4230
4231         Merged latest changes into gmcs.  Please keep this comment in
4232         here, it makes it easier for me to see what changed in MCS since
4233         the last time I merged.
4234
4235 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4236
4237         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4238         (TypeHandle.GetMemberCache): New.
4239         (TypeHandle.TypeHandle): Update.
4240         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4241         (TypeManager.LookupParentInterfacesCache):
4242         Rename from LookupInterfaceCache.  Optimize slightly.
4243         (TypeManager.MemberLookup_FindMembers): Update.
4244         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4245         multi-type variant.
4246         (AddCacheContents): Rename from AddHashtable.
4247         * class.cs (TypeContainer.parent_container): Remove.
4248         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4249         (TypeContainer.DoDefineMembers): Don't initialize it.
4250         Update to name changes.
4251         
4252 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4253
4254         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4255         that factors the code to check access modifiers on override.  
4256
4257         (PropertyBase): Use the code here.
4258
4259         Patch from Lluis S'anchez, fixes bug #69361.
4260
4261 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4262
4263         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4264         routine that is used to report the use of a captured variable
4265         whose address has been taken.
4266
4267         There are two checks: one when variables are being captured and
4268         the other check is when the address of a variable is taken. 
4269         
4270         (because an anonymous methods might be resolved before *or* after
4271         the address has been taken) and 
4272
4273         * expression.cs (Conditional.DoResolve): Remove the special
4274         casing that Martin added to trueExpr and falseExpr being both
4275         NullLiteral.  We get the right behavior now just by introducing
4276         the null_type into the compiler. 
4277
4278         * convert.cs (ExplicitConversion): Change the code to use
4279         null_type instead of testing `expr is NullLiteral'.
4280         (ImplicitConversionStandard): use null_type too.
4281         (ImplicitReferenceConversionExists): use null_type too.
4282         (ImplicitReferenceConversion): use null_type too.
4283
4284         * literal.cs: The type of `NullLiteral' is now null_type instead
4285         of object_type. 
4286         (Resolve): Set the type here.
4287
4288         * typemanager.cs: Introduce null_type.
4289
4290 2004-11-17  Martin Baulig  <martin@ximian.com>
4291
4292         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4293         direction, like FindMembers() does.  Fixes #69546, testcase is in
4294         test-315.cs.    
4295
4296 2004-11-16  Martin Baulig  <martin@ximian.com>
4297
4298         This is based on a patch from Marek Safar, see bug #69082.
4299         Fixes bugs #63705 and #67130.
4300
4301         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4302         method; create a MemberCache for an interface type and cache the
4303         result.
4304
4305         * decl.cs (IMemberContainer.ParentContainer): Removed.
4306         (IMemberContainer.ParentCache): New property.
4307         (MemberCache.SetupCacheForInterface): Removed.
4308         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4309         to create a cache for an interface's "parent".
4310
4311         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4312         interfaces too.
4313
4314 2004-11-16  Martin Baulig  <martin@ximian.com>
4315
4316         Merged back from gmcs; these changes already went into gmcs a
4317         couple of weeks ago.
4318
4319         * typemanager.cs
4320         (TypeManager.AddUserType): Removed the `ifaces' argument.
4321         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4322         `TypeExpr []'.
4323         (TypeManager.AddUserInterface): Removed.
4324         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4325         `TypeExpr []'.
4326         (TypeManager.GetInterfaces): Likewise.
4327         (TypeManager.GetExplicitInterfaces): Likewise.
4328
4329         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4330
4331         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4332         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4333
4334 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4335
4336         * statement.cs: Avoid adding bools to a hashtable.
4337
4338 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4339
4340         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4341         calling an unsafe method from a safe location.
4342
4343 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4344
4345         Fix #69167
4346         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4347
4348 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4349
4350         * namespace.cs (VerifyUsing): use GetPartialName instead of
4351         ToString. 
4352
4353 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4354
4355         * statement.cs (Return.Resolve): Fix regression in typo: if
4356         `in_exc', we have to request a NeedReturnLabel, this was a typo
4357         introduced in the anonymous method check-in.  Fixes #69131.
4358
4359         * Indexers were using the ShortName when defining themselves,
4360         causing a regression in the compiler bootstrap when applying the
4361         patch from 2004-11-02 (first part), now they use their full name
4362         and the bug is gone.
4363
4364 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4365
4366         * driver.cs: Strip the path from the names of embedded resources. Fixes
4367         #68519.
4368
4369 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4370
4371         Fix error message regression: cs0104-2.cs.
4372         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4373         (AliasEntry.Resolve): Update.
4374         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4375         'silent' flag.
4376         (RootContext.LookupType): Update.
4377
4378 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4379
4380         * cs-parser.jay: Add support for handling accessor modifiers
4381         * class: Add support port accessor modifiers and error checking,
4382         define PropertyMethod.Define as virtual (not abstract anymore)
4383         * ecore.cs: Add checking for proeprties access with access modifiers
4384         * iterators.cs: Modify Accessor constructor call based in the modified
4385         constructor
4386 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4387
4388         * expression.cs (StringConcat): Handle being called twice,
4389         as when we have a concat in a field init with more than two
4390         ctors in the class
4391
4392 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4393
4394         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4395         special case explicit implementations, we should always produce
4396         the .property or .event declaration.
4397         
4398         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4399         since it will not return correct data if people use this
4400         unresolved in the presence of using statements (see test-313).
4401
4402         * class.cs (MethodData.Define): If we are an explicit interface
4403         implementation, set the method name to the full name of the
4404         interface plus the name of the method.  
4405
4406         Notice that using the method.MethodName.GetFullName() does not
4407         work, as it will only contain the name as declared on the source
4408         file (it can be a shorthand in the presence of using statements)
4409         and not the fully qualifed type name, for example:
4410
4411         using System;
4412
4413         class D : ICloneable {
4414                 object ICloneable.Clone ()  {
4415                 }
4416         }
4417
4418         Would produce a method called `ICloneable.Clone' instead of
4419         `System.ICloneable.Clone'.
4420
4421         * namespace.cs (Alias.Resolve): Use GetPartialName.
4422         
4423 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4424
4425         * cs-parser.jay: Add error 1055 report.
4426
4427 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4428
4429         * assign.cs (Assign.DoResolve): Only do the transform of
4430         assignment into a New if the types are compatible, if not, fall
4431         through and let the implicit code deal with the errors and with
4432         the necessary conversions. 
4433
4434 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4435
4436         * cs-parser.jay: Add error 1031 report.
4437
4438         * cs-tokenizer.cs: Add location for error 1038.
4439
4440 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4441
4442         * cs-parser.jay: Add error 1016 report.
4443
4444 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4445
4446         * cs-parser.jay: Add errors 1575,1611 report.
4447
4448 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4449
4450         * cs-parser.jay: Add error 1001 report.
4451
4452 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4453
4454         Fix #68850
4455         * attribute.cs (GetMarshal): Add method argument for
4456         caller identification.
4457
4458         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4459         agument for GetMarshal and RuntimeMissingSupport.
4460
4461 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4462
4463         * attribute.cs (ExtractSecurityPermissionSet): Removed
4464         TypeManager.code_access_permission_type.
4465
4466         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4467
4468 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4469
4470         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4471         for obsolete use of a variable here.   Fixes regression on errors
4472         cs0619-25 and cs0619-26.
4473
4474 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4475
4476         Fix #62358, implemented security attribute encoding.
4477
4478         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4479         Tests permitted SecurityAction for assembly or other types.
4480         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4481         data from SecurityPermissionAttribute to PermisionSet class.
4482
4483         * class.cs (ApplyAttributeBuilder): Added special handling
4484         for System.Security.Permissions.SecurityAttribute based types.
4485
4486         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4487         special handling for System.Security.Permissions.SecurityAttribute
4488         based types.
4489
4490         * enum.cs (ApplyAttributeBuilder): Added special handling
4491         for System.Security.Permissions.SecurityAttribute based types.
4492
4493         * parameter.cs (ApplyAttributeBuilder): Added special handling
4494         for System.Security.Permissions.SecurityAttribute based types.
4495
4496         * rootcontext.cs: Next 2 core types.
4497
4498         * typemanager.cs (TypeManager.security_permission_attr_type):
4499         Built in type for the SecurityPermission Attribute.
4500         (code_access_permission_type): Build in type.
4501
4502 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4503
4504         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4505         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4506         all of this information into
4507         EmitContext.EmitCapturedVariableInstance.
4508         
4509         * codegen.cs (EmitCapturedVariableInstance): move here the
4510         funcionality of emitting an ldarg.0 in the presence of a
4511         remapping.   This centralizes the instance emit code.
4512
4513         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4514         then emit a load of this: it means that we have reached the
4515         topmost ScopeInfo: the one that contains the pointer to the
4516         instance of the class hosting the anonymous method.
4517
4518         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4519         captures to the topmost CaptureContext.
4520
4521 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4522
4523         * expression.cs (LocalVariableReference): Move the knowledge about
4524         the iterators into codegen's EmitCapturedVariableInstance.
4525
4526 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4527
4528         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4529         all code paths return a value from an anonymous method (it is the
4530         same as the 161 error, but for anonymous methods).
4531
4532 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4533
4534         The introduction of anonymous methods in the compiler changed
4535         various ways of doing things in the compiler.  The most
4536         significant one is the hard split between the resolution phase
4537         and the emission phases of the compiler.
4538
4539         For instance, routines that referenced local variables no
4540         longer can safely create temporary variables during the
4541         resolution phase: they must do so from the emission phase,
4542         since the variable might have been "captured", hence access to
4543         it can not be done with the local-variable operations from the runtime.
4544         
4545         * statement.cs 
4546
4547         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4548         is a toplevel block.
4549
4550         (ToplevelBlock): A new kind of Block, these are the blocks that
4551         are created by the parser for all toplevel method bodies.  These
4552         include methods, accessors and anonymous methods.
4553
4554         These contain some extra information not found in regular blocks:
4555         A pointer to an optional CaptureContext (for tracking captured
4556         local variables and parameters).  A pointer to the parent
4557         ToplevelBlock.
4558         
4559         (Return.Resolve): Catch missmatches when returning a value from an
4560         anonymous method (error 1662).
4561         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4562         phase.
4563
4564         (Break.Resolve): ditto.
4565
4566         (SwitchLabel): instead of defining the labels during the
4567         resolution phase, we now turned the public ILLabel and ILLabelCode
4568         labels into methods called GetILLabelCode() and GetILLabel() that
4569         only define the label during the Emit phase.
4570
4571         (GotoCase): Track the SwitchLabel instead of the computed label
4572         (its contained therein).  Emit the code by using
4573         SwitchLabel.GetILLabelCode ().
4574
4575         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4576         whether the Local has been captured or not.
4577
4578         (LocalInfo.IsCaptured): New property, used to tell whether the
4579         local has been captured.
4580         
4581         * anonymous.cs: Vastly updated to contain the anonymous method
4582         support.
4583
4584         The main classes here are: CaptureContext which tracks any
4585         captured information for a toplevel block and ScopeInfo used to
4586         track the activation frames for various local variables.   
4587
4588         Each toplevel block has an optional capture context associated
4589         with it.  When a method contains an anonymous method both the
4590         toplevel method and the anonymous method will create a capture
4591         context.   When variables or parameters are captured, they are
4592         recorded on the CaptureContext that owns them, for example:
4593
4594         void Demo () {
4595              int a;
4596              MyDelegate d = delegate {
4597                  a = 1;
4598              }
4599         }
4600
4601         Here `a' will be recorded as captured on the toplevel
4602         CapturedContext, the inner captured context will not have anything
4603         (it will only have data if local variables or parameters from it
4604         are captured in a nested anonymous method.
4605
4606         The ScopeInfo is used to track the activation frames for local
4607         variables, for example:
4608
4609         for (int i = 0; i < 10; i++)
4610                 for (int j = 0; j < 10; j++){
4611                    MyDelegate d = delegate {
4612                         call (i, j);
4613                    }
4614                 }
4615
4616         At runtime this captures a single captured variable `i', but it
4617         captures 10 different versions of the variable `j'.  The variable
4618         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4619         recorded on a child.  
4620
4621         The toplevel ScopeInfo will also track information like the `this'
4622         pointer if instance variables were referenced (this is necessary
4623         as the anonymous method lives inside a nested class in the host
4624         type of the method). 
4625
4626         (AnonymousMethod): Expanded to track the Toplevel, implement
4627         `AnonymousMethod.Compatible' to tell whether an anonymous method
4628         can be converted to a target delegate type. 
4629
4630         The routine now also produces the anonymous method content
4631
4632         (AnonymousDelegate): A helper class that derives from
4633         DelegateCreation, this is used to generate the code necessary to
4634         produce the delegate for the anonymous method that was created. 
4635
4636         * assign.cs: API adjustments for new changes in
4637         Convert.ImplicitStandardConversionExists.
4638
4639         * class.cs: Adjustments to cope with the fact that now toplevel
4640         blocks are of type `ToplevelBlock'. 
4641
4642         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4643         insteda of standard blocks.
4644
4645         Flag errors if params arguments are passed to anonymous methods.
4646
4647         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4648         `CurrentAnonymousMethod' which points to the current Anonymous
4649         Method.  The variable points to the AnonymousMethod class that
4650         holds the code being compiled.  It is set in the new EmitContext
4651         created for the anonymous method.
4652
4653         (EmitContext.Phase): Introduce a variable and an enumeration to
4654         assist in enforcing some rules about when and where we are allowed
4655         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4656         only one that enfonces this right now).
4657
4658         (EmitContext.HaveCaptureInfo): new helper method that returns
4659         whether we have a CapturedContext initialized.
4660
4661         (EmitContext.CaptureVariable): New method used to register that a
4662         LocalInfo must be flagged for capturing. 
4663
4664         (EmitContext.CapturedParameter): New method used to register that a
4665         parameters must be flagged for capturing. 
4666         
4667         (EmitContext.CapturedField): New method used to register that a
4668         field must be flagged for capturing. 
4669
4670         (EmitContext.HaveCapturedVariables,
4671         EmitContext.HaveCapturedFields): Return whether there are captured
4672         variables or fields. 
4673
4674         (EmitContext.EmitMethodHostInstance): This is used to emit the
4675         instance for the anonymous method.  The instance might be null
4676         (static methods), this (for anonymous methods that capture nothing
4677         and happen to live side-by-side with the current method body) or a
4678         more complicated expression if the method has a CaptureContext.
4679
4680         (EmitContext.EmitTopBlock): Routine that drives the emission of
4681         code: it will first resolve the top block, then emit any metadata
4682         and then emit the code.  The split is done so that we can extract
4683         any anonymous methods and flag any captured variables/parameters.
4684         
4685         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4686         during this phase, the ILGenerator should not be used as labels
4687         and local variables declared here might not be accessible to any
4688         code that is part of an anonymous method.  
4689
4690         Exceptions to this include the temporary variables that are
4691         created by some statements internally for holding temporary
4692         variables. 
4693         
4694         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4695         metadata for a cb
4696
4697         (EmitContext.TemporaryReturn): This method is typically called
4698         from the Emit phase, and its the only place where we allow the
4699         ReturnLabel to be defined other than the EmitMeta.  The reason is
4700         that otherwise we would have to duplicate a lot of logic in the
4701         Resolve phases of various methods that today is on the Emit
4702         phase. 
4703
4704         (EmitContext.NeedReturnLabel): This no longer creates the label,
4705         as the ILGenerator is not valid during the resolve phase.
4706
4707         (EmitContext.EmitThis): Extended the knowledge in this class to
4708         work in anonymous methods in addition to iterators. 
4709
4710         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4711         code is necessary on the stack to access the instance to a local
4712         variable (the variable will be accessed as a field).
4713
4714         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4715         EmitContext.EmitAddressOfParameter): Routines to support
4716         parameters (not completed at this point). 
4717         
4718         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4719         will also remove the parameters.
4720
4721         * convert.cs (Convert): Define a `ConstantEC' which points to a
4722         null.  This is just to prefity some code that uses
4723         ImplicitStandardConversion code and do not have an EmitContext
4724         handy.
4725
4726         The idea is to flag explicitly that at that point in time, it is
4727         known that the conversion will not trigger the delegate checking
4728         code in implicit conversions (which requires a valid
4729         EmitContext). 
4730
4731         Everywhere: pass new EmitContext parameter since
4732         ImplicitStandardConversionExists now requires it to check for
4733         anonymous method conversions. 
4734
4735         (Convert.ImplicitStandardConversionExists): If the type of an
4736         expression is the anonymous_method_type, and the type is a
4737         delegate, we invoke the AnonymousMethod.Compatible method to check
4738         whether an implicit conversion is possible. 
4739
4740         (Convert.ImplicitConversionStandard): Only do implicit method
4741         group conversions if the language level is not ISO_1.
4742
4743         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4744         MethodInfo for the Invoke method.  used by Delegate and
4745         AnonymousDelegate.
4746
4747         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4748         method conversions if the target type is a delegate.
4749
4750         Removed extra debugging nops.
4751
4752         (LocalVariableReference): Turn the `local_info' into a public
4753         field. 
4754
4755         Add `prepared' field, the same hack used for FieldExprs to cope
4756         with composed assignments, as Local variables do not necessarily
4757         operate purely on the stack as they used to: they can be captured
4758         fields. 
4759
4760         Add `temp' for a temporary result, like fields.
4761
4762         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4763
4764         It now copes with Local variables that are captured and emits the
4765         proper instance variable to load it from a field in the captured
4766         case. 
4767
4768         (ParameterReference.DoResolveBase): During the resolve phase,
4769         capture parameters if we are in an anonymous method.
4770
4771         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4772         anonymous method, use the EmitContext helper routines to emit the
4773         parameter reference.
4774
4775         * iterators.cs: Set RemapToProxy to true/false during the
4776         EmitDispose class.
4777
4778         * parameters.cs (GetParameterByName): New helper method. 
4779
4780         * typemanager.cs (anonymous_method_type) a new type that
4781         represents an anonyous method.  This is always an internal type,
4782         used as a fencepost to test against the anonymous-methodness of an
4783         expression. 
4784         
4785 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4786
4787         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4788         561 report.
4789         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4790
4791 2004-10-18  Martin Baulig  <martin@ximian.com>
4792
4793         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4794         `Type' directly, but call ResolveType() on it.
4795         (Catch.Resolve): Likewise.
4796         (Foreach.Resolve): Likewise.
4797
4798 2004-10-18  Martin Baulig  <martin@ximian.com>
4799
4800         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4801         `Type' directly, but call ResolveType() on it.
4802         (Probe.DoResolve): Likewise.
4803         (ArrayCreation.LookupType): Likewise.
4804         (TypeOf.DoResolve): Likewise.
4805         (SizeOf.DoResolve): Likewise.
4806
4807 2004-10-18  Martin Baulig  <martin@ximian.com>
4808
4809         * expression.cs (Invocation.BetterFunction): Put back
4810         TypeManager.TypeToCoreType().
4811
4812 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4813
4814         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4815         the ResolveType.
4816
4817 2004-10-18  Martin Baulig  <martin@ximian.com>
4818
4819         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4820         `Type' directly, but call ResolveType() on it.
4821
4822 2004-10-18  Martin Baulig  <martin@ximian.com>
4823
4824         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4825         `Type' directly, but call ResolveType() on it.
4826         (MemberBase.DoDefine): Likewise.
4827
4828         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4829         `Type' directly, but call ResolveType() on it.
4830         (ComposedCast.DoResolveAsTypeStep): Likewise.
4831
4832         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4833         `Type' directly, but call ResolveType() on it.
4834
4835 2004-10-17  John Luke  <john.luke@gmail.com>
4836
4837         * class.cs (Operator.GetSignatureForError): use CSharpName
4838
4839         * parameter.cs (Parameter.GetSignatureForError): Returns
4840         correct name even if was not defined.
4841
4842 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4843
4844         Fix #65816.
4845         * class.cs (TypeContainer.EmitContext): New property.
4846         (DefineNestedTypes): Create an emitcontext for each part.
4847         (MethodCore.DoDefineParameters): Use container's emitcontext.
4848         Pass type array to InternalParameters.
4849         (MemberBase.DoDefine): Use container's emitcontext.
4850         (FieldMember.Define): Likewise.
4851         (Event.Define): Likewise.
4852         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4853         Pass type array to InternalParameters.
4854         (SetIndexerMethod.GetParameterInfo): Likewise.
4855         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4856         * delegate.cs (Define): Pass emitcontext to
4857         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4858         array to InternalParameters.
4859         * expression.cs (ParameterReference.DoResolveBase): Pass
4860         emitcontext to GetParameterInfo.
4861         (ComposedCast.DoResolveAsTypeStep): Remove check on
4862         ec.ResolvingTypeTree.
4863         * parameter.cs (Parameter.Resolve): Change argument to
4864         EmitContext.  Use ResolveAsTypeTerminal.
4865         (Parameter.GetSignature): Change argument to EmitContext.
4866         (Parameters.ComputeSignature): Likewise.
4867         (Parameters.ComputeParameterTypes): Likewise.
4868         (Parameters.GetParameterInfo): Likewise.
4869         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4870         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4871         * support.cs (InternalParameters..ctor): Remove variant that takes
4872         a DeclSpace.
4873         * typemanager.cs (system_intptr_expr): New.
4874         (InitExpressionTypes): Initialize it.
4875
4876 2004-10-12  Chris Toshok  <toshok@ximian.com>
4877
4878         * cs-parser.jay: fix location for try_statement and catch_clause.
4879
4880 2004-10-11  Martin Baulig  <martin@ximian.com>
4881
4882         * report.cs: Don't make --fatal abort on warnings, we have
4883         -warnaserror for that.
4884
4885 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4886
4887         More DeclSpace.ResolveType avoidance.
4888         * decl.cs (MemberCore.InUnsafe): New property.
4889         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4890         with newly created EmitContext.
4891         (FieldMember.Define): Likewise.
4892         * delegate.cs (Delegate.Define): Likewise.
4893         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4894         only if normal name-lookup fails.
4895         (TypeExpr.DoResolve): Enable error-checking.
4896         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4897         (SizeOf.DoResolve): Likewise.
4898         (ComposedCast.DoResolveAsTypeStep): Likewise.
4899         (StackAlloc.DoResolve): Likewise.
4900         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4901         (Block.Unsafe): New property.
4902         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4903         (Unsafe): Set 'unsafe' flag of contained block.
4904         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4905         (Fixed.Resolve): Likewise.
4906         (Catch.Resolve): Likewise.
4907         (Using.ResolveLocalVariableDecls): Likewise.
4908         (Foreach.Resolve): Likewise.
4909
4910 2004-10-05  John Luke <john.luke@gmail.com>
4911
4912         * cs-parser.jay: add location to error CS0175
4913
4914 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4915
4916         * ecore.cs (Expression.Constantity): Add support for turning null
4917         into a constant.
4918
4919         * const.cs (Const.Define): Allow constants to be reference types
4920         as long as the value is Null.
4921
4922 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4923
4924         * namespace.cs (NamespaceEntry.Using): No matter which warning
4925         level is set, check if this namespace name has already been added.
4926
4927 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4928
4929         * expression.cs: reftype [!=]= null should always use br[true,false].
4930         # 67410
4931
4932 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4933
4934         Fix #67108
4935         * attribute.cs: Enum conversion moved to 
4936         GetAttributeArgumentExpression to be applied to the all
4937         expressions.
4938
4939 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4942         * class.c (TypeContainer.DefineType): Flag error if
4943         base types aren't accessible due to access permissions.
4944         * decl.cs (DeclSpace.ResolveType): Move logic to
4945         Expression.ResolveAsTypeTerminal.
4946         (DeclSpace.ResolveTypeExpr): Thin layer over
4947         Expression.ResolveAsTypeTerminal.
4948         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4949         Refactor code into NestedAccess.  Use it.
4950         (DeclSpace.NestedAccess): New.
4951         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4952         argument to silence errors.  Check access permissions.
4953         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4954         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4955         (Cast.DoResolve): Likewise.
4956         (New.DoResolve): Likewise.
4957         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4958         (TypeOf.DoResolve): Likewise.
4959
4960         * expression.cs (Invocation.BetterConversion): Return the Type of
4961         the better conversion.  Implement section 14.4.2.3 more faithfully.
4962         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4963         section 14.4.2.2 explicit.
4964         (Invocation.OverloadResolve): Update.
4965         (Invocation): Remove is_base field.
4966         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4967         (Invocation.Emit): Likewise.
4968
4969 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4970
4971         * README: Update to changes.
4972
4973 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * cs-parser.jay: Reverted 642 warning fix.
4976
4977 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4978
4979         Fix bug #66615
4980         * decl.cs (FindMemberWithSameName): Indexer can have more than
4981         1 argument.
4982
4983 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4984
4985         * expression.cs (LocalVariableReference.DoResolveLValue):
4986         Do not report warning 219 for out values.
4987         (EmptyExpression.Null): New member to avoid extra allocations.
4988
4989 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4990
4991         * cs-parser.jay: Fix wrong warning 642 report.
4992
4993         * cs-tokenizer.cs (CheckNextToken): New helper;
4994         Inspect next character if is same as expected.
4995
4996 2004-09-23  Martin Baulig  <martin@ximian.com>
4997
4998         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4999         (Convert.ImplicitReferenceConversionExists): Likewise.
5000
5001 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5002
5003         * class.cs (Operator.Define): Add error 448 and 559 report.
5004
5005 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5006
5007         * class.cs (MemberBase.IsTypePermitted): New protected
5008         method for checking error CS0610.
5009
5010 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5011
5012         * class.cs (TypeContainer.HasExplicitLayout): New property
5013         Returns whether container has StructLayout attribute set Explicit.
5014         (FieldMember): New abstract class for consts and fields.
5015         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5016         (Field): Reuse FieldMember.
5017
5018         * const.cs (Const): Reuse FieldMember.
5019
5020         * rootcontext.cs: EmitConstants call moved to class.
5021
5022 2004-09-22  Martin Baulig  <martin@ximian.com>
5023
5024         Thanks to Peter Sestoft for this bug report.
5025
5026         * expression.cs (Conditional): If both the `trueExpr' and the
5027         `falseExpr' is a NullLiteral, return a NullLiteral.
5028
5029 2004-09-22  Martin Baulig  <martin@ximian.com>
5030
5031         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5032         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5033         for the "get_Current" call.
5034
5035 2004-09-22  Martin Baulig  <martin@ximian.com>
5036
5037         Marek and me just fixed one of our oldest bugs: #28562 :-)
5038
5039         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5040
5041         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5042         we're an EnumConstant, just return that.
5043         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5044         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5045         to get the value which'll actually be written into the attribute.
5046         However, we have to use GetValue() to access the attribute's value
5047         in the compiler.        
5048
5049 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * constant.cs (Constant.IsNegative): New abstract property
5052         IsNegative.
5053
5054         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5055         (StackAlloc.DoResolve): Reused IsNegative.
5056
5057 2004-09-21  Martin Baulig  <martin@ximian.com>
5058
5059         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5060         if we're used in an iterator, we may be called from different
5061         methods.
5062
5063         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5064         we actually have an exception block.
5065
5066 2004-09-20  John Luke <jluke@cfl.rr.com>
5067
5068         * class.cs, cs-parser.jay: Improve the error report for 1520:
5069         report the actual line where the error happens, not where the
5070         class was declared.
5071
5072         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5073         Pass location information that was available elsewhere.
5074
5075 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5076
5077         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5078         runtime to delay sign assemblies.
5079
5080 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5081
5082         * cs-parser.jay: Do not report the stack trace, this is barely
5083         used nowadays.
5084
5085 2004-08-22  John Luke  <john.luke@gmail.com>
5086  
5087         * driver.cs : check that a resource id is not already used
5088         before adding it, report CS1508 if it is, bug #63637
5089
5090 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5091
5092         * ecore.cs: Removed dead code.
5093
5094 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5095
5096         * class.cs: Do not report warning CS0067 on the interfaces.
5097
5098 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5099
5100         * cs-parser.jay: Add error 504 report.
5101
5102 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5103
5104         * rootcontext.cs: WarningLevel is 4 by default now.
5105
5106         * statement.cs (Fixed.Resolve): Do not null
5107         VariableInfo.
5108
5109 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5110
5111         Fixed bug #55780
5112         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5113         deep search when property is not virtual.
5114         (PropertyExpr.ResolveAccessors): Make one call for both
5115         accessors.
5116
5117 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5118
5119         Fixed bug #65766
5120         * statement.cs: Error 152 report constains also location.
5121
5122 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5123
5124         Fixed bug #65766
5125         * const.cs: Explicitly set constant as static.
5126
5127 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5128
5129         Fixed bug #64226
5130         * cs-parser.jay: Add error 1017 report.
5131
5132 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5133
5134         Fixed bug #59980, #64224
5135         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5136
5137         * typemanager.cs (IsSpecialMethod): Simplified
5138
5139 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5140
5141         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5142         condition with better params.
5143
5144 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5145
5146         Fixed bug #65238
5147         * attribute.cs (Resolve): Property has to have both
5148         accessors.
5149
5150 2004-09-14  Martin Baulig  <martin@ximian.com>
5151
5152         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5153
5154 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5155
5156         Fixed bug #61902
5157         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5158         called and is obsolete then this member suppress message
5159         when call is inside next [Obsolete] method or type.
5160
5161         * expression.cs: Use TestObsoleteMethodUsage member.
5162
5163 2004-09-14  Martin Baulig  <martin@ximian.com>
5164
5165         * cs-parser.jay: Sync a bit with the GMCS version.
5166
5167 2004-09-14  Martin Baulig  <martin@ximian.com>
5168
5169         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5170         (CSharpParser.yacc_verbose_flag): New public field.
5171
5172         * genericparser.cs: Removed.
5173
5174 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5175
5176         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5177
5178 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5179
5180         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5181
5182 2004-09-10  Martin Baulig  <martin@ximian.com>
5183
5184         Backported my MemberName changes from GMCS into MCS.
5185
5186         - we are now using a special `MemberName' class instead of using
5187         strings; in GMCS, the `MemberName' also contains the type
5188         arguments.
5189
5190         - changed the grammar rules a bit:
5191           * the old `member_name' is now a `namespace_or_type_name':
5192             The rule is that we use `namespace_or_type_name' everywhere
5193             where we expect either a "member name" (GetEnumerator) or a
5194             "member name" with an explicit interface name
5195             (IEnumerable.GetEnumerator).
5196             In GMCS, the explicit interface name may include type arguments
5197             (IEnumerable<T>.GetEnumerator).
5198           * we use `member_name' instead of just `IDENTIFIER' for
5199             "member names":
5200             The rule is that we use `member_name' wherever a member may
5201             have type parameters in GMCS.       
5202
5203         * decl.cs (MemberName): New public class.
5204         (MemberCore.MemberName): New public readonly field.
5205         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5206         (DeclSpace): Likewise.
5207
5208         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5209         * enum.cs (Enum.ctor): Likewise.
5210
5211         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5212         MemberName.     
5213         (AliasEntry.ctor): Take a MemberName, not an Expression.
5214         (AliasEntry.UsingAlias): Likewise.
5215
5216         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5217         (IMethodData.MemberName): Changed type from string to MemberName.
5218         (MemberBase.ExplicitInterfaceName): Likewise.
5219         (AbstractPropertyEventMethod.SetupName): Make this private.
5220         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5221         argument; compute the member name here.
5222         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5223         on the `member.MemberName' and the `prefix'.
5224
5225         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5226         not `type_name'.
5227         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5228         thus, we get a `MemberName' instead of a `string'.  These
5229         declarations may have type parameters in GMCS.
5230         (interface_method_declaration, delegate_declaration): Likewise.
5231         (class_declaration, interface_declaration): Likewise.
5232         (method_header): Use `namespace_or_type_name' instead of
5233         `member_name'.  We may be an explicit interface implementation.
5234         (property_declaration, event_declaration): Likewise.
5235         (member_name): This is now just an `IDENTIFIER', not a
5236         `namespace_or_type_name'.
5237         (type_name, interface_type): Removed.
5238         (namespace_or_type_name): Return a MemberName, not an Expression.
5239         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5240         call GetTypeExpression() on the MemberName to get an expression.
5241         (IndexerDeclaration.interface_type): Changed type from string to
5242         MemberName.
5243         (MakeName): Operate on MemberName's instead of string's.
5244
5245 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5246
5247         Fix bug #55770.
5248         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5249         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5250         lookup to avoid symbols introduced by 'using'.
5251         * rootcontext.cs (NamespaceLookup): Update.
5252
5253 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5254
5255         * class.cs (TypeContainer.DoDefineMembers): Do not call
5256         DefineDefaultConstructor for static classes.
5257
5258 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5259
5260         * attribute.cs (Attribute.Resolve): Add error 653 report.
5261
5262         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5263         report.
5264         (Method.ApplyAttributeBuilder): Add error 685 report.
5265         (Operator.Define): Add error 564 report.
5266
5267         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5268
5269         * expression.cs (Invocation.DoResolve): Add error
5270         245 and 250 report.
5271
5272         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5273         error 674 report.
5274
5275 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5276
5277         * class.cs (ConstructorInitializer.Resolve):
5278         Wrong error number (515->516).
5279
5280 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5281
5282         * class.cs (Indexer.Define): Add error 631 report.
5283
5284 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5285
5286         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5287
5288 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5289
5290         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5291
5292 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5293
5294         * cs-parser.jay: Added error CS0241 report.
5295
5296 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5297
5298         * cs-parser.jay (fixed_statement): Introduce a scope for the
5299         declaration in the 'fixed' statement.
5300
5301 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5302
5303         * cs-parser.jay: Added CS0230 error report.
5304
5305 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5306
5307         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5308
5309 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5310
5311         * expression.cs (Argument.Resolve): Added error CS0192 and
5312         CS0199 report.
5313
5314 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5315
5316         C# 2.0 #pragma warning feature
5317
5318         * cs-tokenizer.cs (PreProcessPragma): New method; 
5319         Handles #pragma directive.
5320
5321         * report.cs (WarningRegions): New class; Support
5322         class for #pragma warning directive. It tests whether
5323         warning is enabled for a given line.
5324
5325 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5326
5327         * const.cs: Add more descriptive error report, tahnks to
5328         Sebastien. 
5329
5330 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5331
5332         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5333
5334 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5335
5336         * expression.cs: Apply patch from Ben: Remove dead code from
5337         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5338         as that code just threw an exception anwyays.
5339
5340         * const.cs: Remove the call to the turnintoconstant, for details
5341         see bug: #63144
5342         
5343         * literal.cs: The type of the null-literal is the null type;  So
5344         we use a placeholder type (literal.cs:System.Null, defined here)
5345         for it.
5346
5347         * expression.cs (Conditional.DoResolve): Remove some old code that
5348         is no longer needed, conversions have been fixed.
5349
5350         (ArrayCreationExpression.DoResolve): Return false if we fail to
5351         resolve the inner expression.
5352
5353 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5354
5355         Fix test-290.cs.
5356         * cs-parser.jay (delegate_declaration): Record a delegate
5357         declaration as a type declaration.
5358         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5359
5360 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5361
5362         * parameter.cs: Do not crash if the type can not be resolved. 
5363
5364         * expression.cs: Report errors with unsafe pointers, fixes #64896
5365
5366 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5367
5368         * expression.cs: Pointer arith always needs to do a conv.i
5369         if the operand is a long. fix 65320
5370
5371 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5372
5373         Fixed cs0619-37.cs, cs0619-38.cs
5374
5375         * enum.cs (GetObsoleteAttribute): Removed.
5376
5377         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5378         on Enum member is double staged. The first is tested member
5379         and then enum.
5380
5381 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5382
5383         Fixed #56986, #63631, #65231
5384
5385         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5386         adds member to name container.
5387         (TypeContainer.AddToTypeContainer): New method, adds type to
5388         name container.
5389         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5390         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5391         AddOperator): Simplified by reusing AddToMemberContainer.
5392         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5393         instead of field.
5394         (Method.CheckForDuplications): Fixed implementation to test all
5395         possibilities.
5396         (MemberBase): Detection whether member is explicit interface
5397         implementation is now in constructor.
5398         (MemberBase.UpdateMemberName): Handles IndexerName.
5399         (Accessor): Changed to keep also location information.
5400         (AbstractPropertyEventMethod): Is derived from MemberCore.
5401         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5402         will be emited or not.
5403         (PropertyBase.AreAccessorsDuplicateImplementation):
5404         Tests whether accessors are not in collision with some method.
5405         (Operator): Is derived from MethodCore to simplify common
5406         operations.
5407
5408         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5409         must be performed.
5410         (DeclSpace.AddToContainer): Adds the member to defined_names
5411         table. It tests for duplications and enclosing name conflicts.
5412
5413         * enum.cs (EnumMember): Clean up to reuse the base structures
5414
5415 2004-09-03  Martin Baulig  <martin@ximian.com>
5416
5417         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5418         into TypeContainer, to make partial classes work again.
5419
5420 2004-09-03  Martin Baulig  <martin@ximian.com>
5421
5422         * rootcontext.cs (RootContext.V2): Removed.
5423
5424 2004-03-23  Martin Baulig  <martin@ximian.com>
5425
5426         * expression.cs (Invocation.OverloadResolve): Added `bool
5427         may_fail' argument and use it instead of the Location.IsNull() hack.
5428
5429 2004-09-03  Martin Baulig  <martin@ximian.com>
5430
5431         Merged latest changes into gmcs.  Please keep this comment in
5432         here, it makes it easier for me to see what changed in MCS since
5433         the last time I merged.
5434
5435 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5436
5437         Fix #61128.
5438         * expression.cs (BetterConversion): Don't allow either conversion 
5439         to be null.  Remove redundant implicit conversion test when 'q ==
5440         null' -- when this function is invoked, we already know that the
5441         implicit conversion exists.
5442         (BetterFunction): Assume that 'best' is non-null.  Remove
5443         redundant reimplementation of IsApplicable when 'best' is null.
5444         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5445         number of arguments.
5446         (IsAncestralType): Extract from OverloadResolve.
5447         (OverloadResolve): Make robust to the MethodGroupExpr being
5448         unsorted.  Implement all the logic of Section 14.5.5.1, and
5449         support overloading of methods from multiple applicable types.
5450         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5451
5452         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5453         (RealError, Warning): Append type of report to related symbol.
5454
5455 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5456
5457         * enum.cs: Fixed CLS-Compliance checks for enum members.
5458         Error tests cs3008-8.cs, cs3014-8.cs
5459
5460 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5461
5462         Fixed bug #62342, #63102
5463         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5464         like ImplementMethod.
5465
5466 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5467
5468         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5469         Fixed bug #65170.
5470
5471 2004-09-02  Martin Baulig  <martin@ximian.com>
5472
5473         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5474         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5475         on the MethodBase.
5476
5477 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5478
5479         C# 2.0 Static classes implemented
5480
5481         * class.cs (TypeContainer): instance_constructors,
5482         initialized_fields, initialized_static_fields,
5483         default_constructor, base_inteface_types are protected to be
5484         accessible from StaticClass.
5485         (TypeContainer.DefineDefaultConstructor): New virtual method
5486         for custom default constructor generating
5487         (StaticClass): New class to handle "Static classes" feature.
5488
5489         * cs-parser.jay: Handle static keyword on class like instance
5490         of StaticClass.
5491
5492         * driver.cs: Added "/langversion" command line switch with two
5493         options (iso-1, default).
5494
5495 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5496
5497         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5498
5499 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5500
5501         * delegate.cs: Style.
5502
5503 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5504
5505         * delegate.cs: Add seperate instance expr field for miguel.
5506
5507 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5508
5509         * PointerArithmetic (Resolve): make sure we are not doing
5510         pointer arith on void*. Also, make sure we are resolved
5511         by not setting eclass until resolve.
5512
5513         All callers: Make sure that PointerArithmetic gets resolved.
5514
5515 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5516
5517         * ArrayCreation (LookupType): If the type does not resolve 
5518         to an array, give an error.
5519
5520 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5521
5522         * statement.cs (Try.Resolve): Fixed bug #64222
5523
5524 2004-08-27  Martin Baulig  <martin@ximian.com>
5525
5526         * class.cs
5527         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5528         crash here.     
5529
5530 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5531
5532         * ecore.cs (Constantify): Get underlying type via
5533         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5534         Windows in special cases.
5535
5536 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5539         for obtaining also private methods.
5540         (GetRemoveMethod): Used GetRemoveMethod (true)
5541         for obtaining also private methods.
5542
5543 2004-08-24  Martin Baulig  <martin@ximian.com>
5544
5545         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5546         MethodAttributes.HideBySig for operators.
5547
5548 2004-08-23  Martin Baulig  <martin@ximian.com>
5549
5550         Back to the old error reporting system :-)
5551
5552         * report.cs (Message): Removed.
5553         (Report.MessageData, ErrorData, WarningData): Removed.
5554         (Report.Error, Warning): Back to the old system.
5555
5556 2004-08-23  Martin Baulig  <martin@ximian.com>
5557
5558         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5559
5560         * class.cs (TypeContainer.ParentContainer): New public virtual
5561         method; replaces the explicit interface implementation.
5562         (ClassPart.ParentContainer): Override.
5563
5564 2004-08-23  Martin Baulig  <martin@ximian.com>
5565
5566         * statement.cs (Switch): Added support for constant switches; see
5567         #59428 or test-285.cs.
5568
5569 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5570
5571         Fixed bug #62740.
5572         * statement.cs (GetEnumeratorFilter): Removed useless
5573         logic because C# specs is strict. GetEnumerator must be
5574         public.
5575
5576 2004-08-22  Martin Baulig  <martin@ximian.com>
5577
5578         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5579         a switch and may break, reset the barrier.  Fixes #59867.
5580
5581 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5582
5583         CLS-Compliance speed up (~5% for corlib)
5584
5585         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5586         New method. Tests container for CLS-Compliant names
5587
5588         * class.cs (TypeContainer.VerifyClsName): New method.
5589         Checks whether container name is CLS Compliant.
5590         (Constructor): Implements IMethodData.
5591
5592         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5593         low-case table for CLS Compliance test.
5594         (MemberCache.VerifyClsParameterConflict): New method.
5595         Checks method parameters for CS3006 error.
5596
5597         * enum.cs (EnumMember): Is derived from MemberCore.
5598         (Enum.VerifyClsName): Optimized for better performance.
5599
5600 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5601
5602         * report.cs: Renamed Error_T to Error and changed all
5603         references.
5604
5605 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5606
5607         * class.cs (TypeContainer.IndexerArrayList): New inner class
5608         container for indexers.
5609         (TypeContainer.DefaultIndexerName): New constant for default
5610         indexer name. Replaced all "Item" with this constant.
5611         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5612
5613         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5614         DefaultMemberAttribute constructor.
5615
5616 2004-08-05  Martin Baulig  <martin@ximian.com>
5617
5618         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5619         Fix bug #59429.
5620
5621 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5622
5623         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5624         multi platforms problem.
5625
5626         * compiler.csproj: Included shared files.
5627
5628 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5629
5630         Fix bug 60333, 55971 in the more general way
5631         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5632         Added arg_type argument for constant conversion.
5633         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5634
5635 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5636
5637         Fix bug #59760
5638         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5639         OperatorArrayList, MethodCoreArrayList for typecontainer
5640         containers. Changed class member types to these new types.
5641         (MethodArrayList.DefineMembers): Added test for CS0659.
5642
5643 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5644
5645         * cfold.cs: Synchronize the folding with the code in expression.cs
5646         Binary.DoNumericPromotions for uint operands.
5647
5648         * attribute.cs: Revert patch from Raja, it introduced a regression
5649         while building Blam-1.2.1 (hard to isolate a test case).
5650
5651 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5652
5653         Fix for #55382
5654         * class.cs:
5655         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5656         name collision.
5657         (MethodCore.parent_method): New member. The method we're overriding
5658         if this is an override method.
5659         (MethodCore.CheckBase): Moved from Method class and made common.
5660         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5661         private.
5662         (MethodCore.CheckForDuplications): New abstract method. For custom
5663         member duplication search in a container
5664         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5665         method and its return type.
5666         (Event.conflict_symbol): New member. Symbol with same name in the
5667         parent class.
5668
5669         * decl.cs:
5670         (MemberCache.FindMemberWithSameName): New method. The method
5671         is looking for conflict with inherited symbols.
5672
5673 2004-08-04  Martin Baulig  <martin@ximian.com>
5674
5675         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5676
5677         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5678
5679 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5680
5681         * report.cs (Message): New enum for better error, warning reference in
5682         the code.
5683         (MessageData): New inner abstract class. It generally handles printing of
5684         error and warning messages.
5685         Removed unused Error, Warning, Message methods.
5686
5687 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5688
5689         Fix for cs0592-8.cs test
5690         * attribute.cs
5691         (Attributable.ValidAttributeTargets): Made public.
5692         (Attribute.ExplicitTarget): New member for explicit target value.
5693         (Attribute.CheckTargets): Now we translate explicit attribute
5694         target to Target here.
5695
5696 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5697
5698         * ecore.cs (MethodGroupExpr): new IsBase property.
5699
5700         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5701
5702         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5703         rather than an instance expr.
5704
5705         (DelegateCreation.Emit): Use the method group rather than
5706         the instance expression. Also, if you have base.Foo as the
5707         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5708
5709         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5710
5711         (NewDelegate.DoResolve): Only check for the existance of Invoke
5712         if the method is going to be needed. Use MethodGroupExpr.
5713
5714         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5715
5716         * expression.cs: For pointer arith., make sure to use
5717         the size of the type, not the size of the pointer to
5718         the type.
5719
5720 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5721
5722         Fix for #60722
5723         * class.cs (Class): Added error CS0502 test.
5724
5725 2004-08-03  John Luke  <jluke@cfl.rr.com>
5726             Raja R Harinath  <rharinath@novell.com>
5727
5728         Fix for #60997.
5729         * attribute.cs (Attribute.complained_before): New flag.
5730         (Attribute.ResolveType, Attribute.Resolve),
5731         (Attribute.DefinePInvokeMethod): Set it.
5732         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5733         
5734 2004-08-03  Martin Baulig  <martin@ximian.com>
5735
5736         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5737         use a user-defined operator; we still need to do numeric
5738         promotions in case one argument is a builtin type and the other
5739         one has an implicit conversion to that type.  Fixes #62322.
5740
5741 2004-08-02  Martin Baulig  <martin@ximian.com>
5742
5743         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5744         (LocalInfo.IsThis): New public property.
5745         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5746
5747 2004-08-01  Martin Baulig  <martin@ximian.com>
5748
5749         * class.cs (TypeContainer.GetClassBases): Don't set the default
5750         here since we may get called from GetPartialBases().
5751         (TypeContainer.DefineType): If GetClassBases() didn't return a
5752         parent, use the default one.
5753
5754 2004-07-30  Duncan Mak  <duncan@ximian.com>
5755
5756         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5757
5758 2004-07-30  Martin Baulig  <martin@ximian.com>
5759
5760         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5761
5762         * class.cs (SourceMethod): New public class, derive from the
5763         symbol writer's ISourceMethod.
5764         (Method): Use the new symbol writer API.
5765
5766         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5767         as argument and use the new symbol writer.
5768
5769         * location.cs
5770         (SourceFile): Implement the symbol writer's ISourceFile.
5771         (Location.SymbolDocument): Removed.
5772         (Location.SourceFile): New public property.
5773
5774         * symbolwriter.cs: Use the new symbol writer API.
5775
5776 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5777
5778         * Makefile (install-local): Remove.  Functionality moved to
5779         executable.make.
5780
5781 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5782
5783         * Makefile: Install mcs.exe.config file together with mcs.exe.
5784         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5785         correct runtime version.
5786         
5787 2004-07-25  Martin Baulig  <martin@ximian.com>
5788
5789         * class.cs
5790         (TypeContainer.RegisterOrder): Removed, this was unused.
5791         (TypeContainer, interface_order): Removed.
5792         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5793         TypeContainer as argument since we can also be called with a
5794         `PartialContainer' for a partial class/struct/interface.
5795         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5796         of checking whether we're an `Interface' - we could be a
5797         `PartialContainer'.
5798         (PartialContainer.Register): Override; call
5799         AddClass()/AddStruct()/AddInterface() on our parent.
5800
5801         * cs-parser.jay (interface_member_declaration): Add things to the
5802         `current_container', not the `current_class'.
5803
5804         * rootcontext.cs (RegisterOrder): The overloaded version which
5805         takes an `Interface' was unused, removed.
5806
5807         * typemanager.cs (TypeManager.LookupInterface): Return a
5808         `TypeContainer', not an `Interface'.
5809         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5810         contain a `PartialContainer' for an interface, so check it's
5811         `Kind' to figure out what it is.
5812
5813 2004-07-25  Martin Baulig  <martin@ximian.com>
5814
5815         * class.cs (Class.DefaultTypeAttributes): New public constant.
5816         (Struct.DefaultTypeAttributes): Likewise.
5817         (Interface.DefaultTypeAttributes): Likewise.
5818         (PartialContainer.TypeAttr): Override this and add the
5819         DefaultTypeAttributes.
5820
5821 2004-07-25  Martin Baulig  <martin@ximian.com>
5822
5823         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5824         we can just use the `Parent' field instead.
5825
5826 2004-07-25  Martin Baulig  <martin@ximian.com>
5827
5828         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5829
5830 2004-07-25  Martin Baulig  <martin@ximian.com>
5831
5832         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5833         our parts before defining any methods.
5834         (TypeContainer.VerifyImplements): Make this virtual.
5835         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5836         on our PartialContainer.
5837
5838 2004-07-25  Martin Baulig  <martin@ximian.com>
5839
5840         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5841
5842         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5843         argument, we can just use the `Parent' field instead.
5844
5845         * class.cs
5846         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5847         (MemberBase.DoDefine): Likewise.
5848
5849 2004-07-24  Martin Baulig  <martin@ximian.com>
5850
5851         * decl.cs (MemberCore.Parent): New public field.
5852         (DeclSpace.Parent): Moved to MemberCore.
5853
5854         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5855         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5856         parent's .ctor.
5857         (FieldBase, Field, Operator): Likewise.
5858         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5859         (EventField, Event): Likewise.
5860
5861 2004-07-23  Martin Baulig  <martin@ximian.com>
5862
5863         * class.cs (PartialContainer): New public class.
5864         (ClassPart): New public class.
5865         (TypeContainer): Added support for partial classes.
5866         (TypeContainer.GetClassBases): Splitted some of the functionality
5867         out into GetNormalBases() and GetPartialBases().
5868
5869         * cs-tokenizer.cs (Token.PARTIAL): New token.
5870         (Tokenizer.consume_identifier): Added some hacks to recognize
5871         `partial', but only if it's immediately followed by `class',
5872         `struct' or `interface'.
5873
5874         * cs-parser.jay: Added support for partial clases.
5875
5876 2004-07-23  Martin Baulig  <martin@ximian.com>
5877
5878         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5879         a `DeclSpace' and also made it readonly.
5880         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5881         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5882         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5883
5884         * cs-parser.jay: Pass the `current_class', not the
5885         `current_container' (at the moment, this is still the same thing)
5886         to a new Method, Property, Event, Indexer or Constructor.
5887
5888 2004-07-23  Martin Baulig  <martin@ximian.com>
5889
5890         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5891         and removed the `current_interface' one.
5892         (struct_declaration, class_declaration, interface_declaration):
5893         Set `current_class' to the newly created class/struct/interface;
5894         set their `Bases' and call Register() before parsing their body.
5895
5896 2004-07-23  Martin Baulig  <martin@ximian.com>
5897
5898         * class.cs (Kind): New public enum.
5899         (TypeContainer): Made this class abstract.
5900         (TypeContainer.Kind): New public readonly field.
5901         (TypeContainer.CheckDef): New public method; moved here from
5902         cs-parser.jay.
5903         (TypeContainer.Register): New public abstract method.
5904         (TypeContainer.GetPendingImplementations): New public abstract
5905         method.
5906         (TypeContainer.GetClassBases): Removed the `is_class' and
5907         `is_iface' parameters.
5908         (TypeContainer.DefineNestedTypes): Formerly known as
5909         DoDefineType().
5910         (ClassOrStruct): Made this class abstract.
5911
5912         * tree.cs (RootTypes): New public type. 
5913
5914 2004-07-20  Martin Baulig  <martin@ximian.com>
5915
5916         * tree.cs (Tree.RecordNamespace): Removed.
5917         (Tree.Namespaces): Removed.
5918
5919         * rootcontext.cs (RootContext.IsNamespace): Removed.
5920
5921         * cs-parser.jay (namespace_declaration): Just create a new
5922         NamespaceEntry here.
5923
5924 2004-07-20  Martin Baulig  <martin@ximian.com>
5925
5926         * statement.cs (ExceptionStatement): New abstract class.  This is
5927         now used as a base class for everyone who's using `finally'.
5928         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5929         our local variables before using them.
5930
5931         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5932         virtual method.  This is used by Yield.Resolve() to "steal" an
5933         outer block's `finally' clauses.
5934         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5935         argument.
5936
5937         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5938         version which takes an ExceptionStatement.  This version must be
5939         used to create exception branchings.
5940
5941         * iterator.cs
5942         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5943         (Iterator.EmitMoveNext): Added exception support; protect the
5944         block with a `fault' clause, properly handle 'finally' clauses.
5945         (Iterator.EmitDispose): Run all the `finally' clauses here.
5946
5947 2004-07-20  Martin Baulig  <martin@ximian.com>
5948
5949         * iterator.cs: This is the first of a set of changes in the
5950         iterator code.  Match the spec more closely: if we're an
5951         IEnumerable, then GetEnumerator() must be called.  The first time
5952         GetEnumerator() is called, it returns the current instance; all
5953         subsequent invocations (if any) must create a copy.
5954
5955 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5956
5957         * expression.cs: Resolve the constant expression before returning
5958         it. 
5959
5960 2004-07-19  Martin Baulig  <martin@ximian.com>
5961
5962         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5963         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5964         the return type of the new EmitContext.
5965
5966 2004-07-18  Martin Baulig  <martin@ximian.com>
5967
5968         * class.cs (Property.Define): Fix iterators.
5969
5970         * iterators.cs (Iterator.Define): Moved the
5971         `container.AddInterator (this)' call here from the .ctor; only do
5972         it if we resolved successfully.
5973
5974 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5975
5976         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5977         `true' for preprocessing directives that we parse.  The return
5978         value indicates whether we should return to regular tokenizing or
5979         not, not whether it was parsed successfully.
5980
5981         In the past if we were in: #if false ... #line #endif, we would
5982         resume parsing after `#line'.  See bug 61604.
5983
5984         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5985         building: IsEnumType should return true only for enums, not for
5986         enums or System.Enum itself.  This fixes #61593.
5987
5988         Likely what happened is that corlib was wrong: mcs depended on
5989         this bug in some places.  The bug got fixed, we had to add the
5990         hack, which caused bug 61593.
5991
5992         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5993         that was a workaround for the older conditions.
5994
5995 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5996
5997         * assign.cs: IAssignMethod has a new interface, as documented
5998         inline. All assignment code now uses this new api.
5999
6000         * ecore.cs, expression.cs: All classes which implement
6001         IAssignMethod now use the new interface.
6002
6003         * expression.cs (Invocation): add a hack to EmitCall so that
6004         IndexerAccess can be the target of a compound assignment without
6005         evaluating its arguments twice.
6006
6007         * statement.cs: Handle changes in Invocation api.
6008
6009 2004-07-16  Martin Baulig  <martin@ximian.com>
6010
6011         * iterators.cs: Rewrote this.  We're now using one single Proxy
6012         class for both the IEnumerable and the IEnumerator interface and
6013         `Iterator' derives from Class so we can use the high-level API.
6014
6015         * class.cs (TypeContainer.AddIterator): New method.
6016         (TypeContainer.DoDefineType): New protected virtual method, which
6017         is called from DefineType().
6018         (TypeContainer.DoDefineMembers): Call DefineType() and
6019         DefineMembers() on all our iterators.
6020         (TypeContainer.Emit): Call Emit() on all our iterators.
6021         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6022
6023         * codegen.cs (EmitContext.CurrentIterator): New public field.
6024
6025 2004-07-15  Martin Baulig  <martin@ximian.com>
6026
6027         * typemanager.cs
6028         (TypeManager.not_supported_exception_type): New type.   
6029
6030 2004-07-14  Martin Baulig  <martin@ximian.com>
6031
6032         * iterators.cs: Use real error numbers.
6033
6034 2004-07-14  Martin Baulig  <martin@ximian.com>
6035
6036         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6037         requires this to be a System.Collection.IEnumerable and not a
6038         class implementing that interface.
6039         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6040
6041 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6042
6043         * class.cs: Fixed previous fix, it broke some error tests.
6044
6045 2004-07-12  Martin Baulig  <martin@ximian.com>
6046
6047         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6048         Fixes #61293.
6049
6050 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6051
6052         * assign.cs (LocalTemporary): Add new argument: is_address,If
6053         `is_address' is true, then the value that we store is the address
6054         to the real value, and not the value itself.
6055         
6056         * ecore.cs (PropertyExpr): use the new local temporary
6057         stuff to allow us to handle X.Y += z (where X is a struct)
6058
6059 2004-07-08  Martin Baulig  <martin@ximian.com>
6060
6061         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6062         not always return, just like we're doing in Using.Resolve().
6063
6064 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6065
6066         * cs-parser.jay (fixed_statement): flag this as Pinned.
6067
6068 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6069
6070         * typemanager.cs (TypeManager): Removed MakePinned method, this
6071         mechanism is replaced with the .NET 2.x compatible mechanism of
6072         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6073
6074         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6075         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6076         `IsFixed' property which has a different meaning.
6077
6078 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6079
6080         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6081         visible from inside a nested class, not just the names of the
6082         immediately enclosing class.
6083         Fix for bug #60730.
6084
6085 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6086
6087         * expression.cs (BetterConversion): Remove buggy special-case
6088         handling of "implicit constant expression conversions".  At this
6089         point, we already know that the conversion is possible -- we're
6090         only checking to see which is better.
6091
6092 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6093
6094         * cs-parser.jay: Added error CS0210 test.
6095
6096 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6097
6098         * cs-parser.jay: Added error CS0134 test.
6099
6100 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6101
6102         Fix bug #52507
6103         * cs-parser.jay: Added error CS0145 test.
6104
6105 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6106
6107         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6108
6109 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6110         
6111         * expression.cs (StackAlloc.Resolve): The argument may not
6112         be a constant; deal with this case.
6113         
6114 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6117         GetIndexerAttributeValue.
6118         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6119
6120         * class.cs (Indexer.Define): Added error tests for CS0415,
6121         CS0609.
6122
6123 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6124
6125         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6126         property code.
6127
6128 2004-06-23  Martin Baulig  <martin@ximian.com>
6129
6130         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6131         neither return nor throw, reset the barrier as well.  Fixes #60457.
6132
6133 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6134
6135         * class.cs : EventAttributes is now set to None by default.
6136           This fixes bug #60459.
6137
6138 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6139
6140         Fix bug #60219
6141         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6142         Don't throw exception but return null (it's sufficient now).
6143
6144 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6145
6146         * typemanager.cs (GetArgumentTypes): Faster implementation.
6147
6148 2004-06-18  Martin Baulig  <martin@ximian.com>
6149
6150         * attribute.cs (Attribute.Resolve): Check whether we're an
6151         EmptyCast which a Constant child.  Fixes #60333.
6152
6153 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6154
6155         * statement.cs (EmitCollectionForeach): Account for the fact that
6156         not all valuetypes are in areas which we can take the address of.
6157         For these variables, we store to a temporary variable. Also, make
6158         sure that we dont emit a `callvirt' on a valuetype method.
6159
6160 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * expression.cs (StackAlloc.DoReSolve): Added test for
6163         negative parameter (CS0247).
6164
6165 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6166
6167         Fix bug #59792
6168         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6169
6170 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6171
6172         Fix bug #59781
6173         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6174         ulong.
6175
6176 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6177
6178         Fix bug #58254 & cs1555.cs, cs1556.cs
6179         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6180
6181 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6182
6183         * cs-parser.jay: Added error CS1669 test for indexers.
6184
6185 2004-06-11  Martin Baulig  <martin@ximian.com>
6186
6187         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6188         call this twice: for params and varargs methods.
6189
6190 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6191
6192         * class.cs:
6193         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6194
6195 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6196
6197         * attribute.cs (Attribute.GetValidTargets): Made public.
6198
6199         * class.cs: 
6200         (AbstractPropertyEventMethod): New class for better code sharing.
6201         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6202         CS1667 report.
6203         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6204
6205 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6206
6207         Fix bug #59477.
6208         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6209         that the call to Resolve is part of a MemberAccess.
6210         (Expression.Resolve): Use it for SimpleName resolution.
6211         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6212         Add 'intermediate' boolean argument.
6213         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6214         error message when the SimpleName can be resolved ambiguously
6215         between an expression and a type.
6216         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6217         public.
6218         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6219         call on the left-side.
6220
6221 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6222
6223         * class.cs:
6224         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6225
6226 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6227
6228         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6229
6230 2004-06-11  Martin Baulig  <martin@ximian.com>
6231
6232         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6233         varargs methods if applicable.
6234
6235 2004-06-11  Martin Baulig  <martin@ximian.com>
6236
6237         * expression.cs (Invocation.EmitCall): Don't use
6238         `method.CallingConvention == CallingConventions.VarArgs' since the
6239         method could also have `CallingConventions.HasThis'.
6240
6241 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6242
6243         * class.cs (Event.GetSignatureForError): Implemented.
6244         Fixed crash in error test cs3010.cs
6245
6246 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6247
6248         * cs-tokenizer.cs: Change the way we track __arglist to be
6249         consistent with the other keywords.
6250
6251 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6252
6253         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6254         tomorrow.
6255
6256 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6257
6258         * codegen.cs: Check that all referenced assemblies have a strongname
6259         before strongnaming the compiled assembly. If not report error CS1577.
6260         Fix bug #56563. Patch by Jackson Harper.
6261         * typemanager.cs: Added a method to return all referenced assemblies.
6262         Fix bug #56563. Patch by Jackson Harper.
6263
6264 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6265
6266         * class.cs:
6267         (Method.ApplyAttributeBuilder): Moved and added conditional
6268         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6269
6270         * delegate.cs:
6271         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6272
6273 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6274
6275         Fixed #59640
6276         * class.cs: (EventField.attribute_targets): Changed default target.
6277
6278 2004-06-08  Martin Baulig  <martin@ximian.com>
6279
6280         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6281
6282 2004-06-08  Martin Baulig  <martin@ximian.com>
6283
6284         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6285
6286 2004-06-07  Martin Baulig  <martin@ximian.com>
6287
6288         Added support for varargs methods.
6289
6290         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6291         keyword.
6292
6293         * cs-parser.jay: Added support for `__arglist'.
6294
6295         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6296
6297         * expression.cs (Argument.AType): Added `ArgList'.
6298         (Invocation): Added support for varargs methods.
6299         (ArglistAccess): New public class.
6300         (Arglist): New public class.
6301
6302         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6303
6304         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6305         a method's top-level block if the method has varargs.
6306
6307         * support.cs (ReflectionParameters, InternalParameters): Added
6308         support for varargs methods.    
6309
6310 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6311
6312         * class.cs: Provide location in indexer error report.
6313
6314         * driver.cs: Use standard names.
6315
6316         * namespace.cs: Catch the use of using after a namespace has been
6317         declared also on using aliases.
6318
6319 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6320
6321         Bug #50820.
6322         * typemanager.cs (closure_private_ok, closure_invocation_type)
6323         (closure_qualifier_type, closure_invocation_assembly)
6324         (FilterWithClosure): Move to ...
6325         (Closure): New internal nested class.
6326         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6327         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6328         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6329         (MemberLookup, MemberLookupFailed): Use it.
6330         * expression.cs (New.DoResolve): Treat the lookup for the
6331         constructor as being qualified by the 'new'ed type.
6332         (Indexers.GetIndexersForTypeOrInterface): Update.
6333
6334 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6335
6336         * attribute.cs
6337         (GetConditionalAttributeValue): New method. Returns
6338         condition of ConditionalAttribute.
6339         (SearchMulti): New method.  Returns all attributes of type 't'.
6340         Use it when attribute is AllowMultiple = true.
6341         (IsConditionalMethodExcluded): New method.
6342
6343         * class.cs
6344         (Method.IsExcluded): Implemented. Returns true if method has conditional
6345         attribute and the conditions is not defined (method is excluded).
6346         (IMethodData): Extended interface for ConditionalAttribute support.
6347         (PropertyMethod.IsExcluded): Implemented.
6348
6349         * decl.cs
6350         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6351
6352         * expression.cs
6353         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6354         on the method.
6355
6356 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6357
6358         * expression.cs (ArrayCreationExpression): Make this just an
6359         `expression'. It can't be a statement, so the code here was
6360         dead.
6361
6362 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6363
6364         Fixed #59072
6365         * typemanager.cs (GetFullNameSignature): New method for
6366         MethodBase types.
6367
6368 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6369
6370         Fixed #56452
6371         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6372         Use this method when MethodBuilder is null.
6373         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6374         Added test for error CS0626 (MONO reports error for this situation).
6375         (IMethodData.GetSignatureForError): Extended interface.
6376
6377 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6378
6379         * attribute.cs
6380         (AttributeTester.GetObsoleteAttribute): Returns instance of
6381         ObsoleteAttribute when type is obsolete.
6382
6383         * class.cs
6384         (TypeContainer.VerifyObsoleteAttribute): Override.
6385         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6386         (MethodCode.VerifyObsoleteAttribute): Override.
6387         (MemberBase.VerifyObsoleteAttribute): Override.
6388
6389         * decl.cs
6390         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6391         and report proper error.
6392
6393         *delegate.cs
6394         Delegate.VerifyObsoleteAttribute): Override.
6395
6396         * ecore.cs
6397         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6398         and report proper error.
6399         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6400
6401         * enum.cs
6402         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6403         and enum member.
6404
6405         * expression.cs
6406         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6407         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6408         Added test for ObsoleteAttribute.
6409
6410         * statement.cs
6411         (Catch): Derived from Statement.
6412
6413 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6414  
6415         Fixed bug #59071 & cs0160.cs
6416  
6417         * statement.cs (Try.Resolve): Check here whether order of catch
6418         clauses matches their dependencies.
6419
6420 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6421
6422         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6423         caused a regression: #59343.  Referencing nested classes from an
6424         assembly stopped working.
6425
6426 2004-05-31  Martin Baulig  <martin@ximian.com>
6427
6428         MCS is now frozen for beta 2.
6429
6430 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6431
6432         * convert.cs: add a trivial cache for overload operator resolution.
6433
6434 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6435
6436         * decl.cs: If possible, use lookuptypedirect here. We can only do
6437         this if there is no `.' after the namespace. Avoids using
6438         LookupType, which does lots of slow processing.
6439         (FindNestedType) New method, does what it says :-).
6440         * namespace.cs: use LookupTypeDirect.
6441         * rootcontext.cs: use membercache, if possible.
6442         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6443
6444 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6445
6446         * expression.cs:
6447         According to the spec, 
6448
6449         In a member access of the form E.I, if E is a single identifier,
6450         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6451         field, property, localvariable, or parameter with the same type as
6452         the meaning of E as a type-name (§3.8), then both possible
6453         meanings of E are permitted.
6454
6455         We did not check that E as a simple-name had the same type as E as
6456         a type name.
6457
6458         This trivial check gives us 5-7% on bootstrap time.
6459
6460 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6461
6462         * expression.cs (Invocation.OverloadResolve): Avoid the
6463         use of hashtables and boxing here by allocating on demand.
6464
6465 2004-05-30  Martin Baulig  <martin@ximian.com>
6466
6467         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6468         we're doing a silent lookup.  Don't try to lookup nested types in
6469         TypeManager.object_type (thanks to Ben Maurer).
6470
6471 2004-05-30  Martin Baulig  <martin@ximian.com>
6472
6473         Committing a patch from Ben Maurer.
6474
6475         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6476
6477 2004-05-29  Martin Baulig  <martin@ximian.com>
6478
6479         * class.cs (IMethodData.ShouldIgnore): New method.
6480
6481         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6482         `Location' argument, we don't need it anywhere.  Use
6483         `IMethodData.ShouldIgnore ()' instead of
6484         `MethodData.GetMethodFlags ()'.
6485         (TypeManager.AddMethod): Removed.
6486         (TypeManager.AddMethod2): Renamed to AddMethod.
6487
6488 2004-05-29  Martin Baulig  <martin@ximian.com>
6489
6490         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6491
6492         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6493         converting from a class type S to an interface type and we already
6494         have an object on the stack, don't box it again.  Fixes #52578.
6495
6496 2004-05-29  Martin Baulig  <martin@ximian.com>
6497
6498         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6499         Added support for `params' parameters.  Fixes #59267.
6500
6501 2004-05-29  Martin Baulig  <martin@ximian.com>
6502
6503         * literal.cs (NullPointer): Provide a private .ctor which sets
6504         `type' to TypeManager.object_type.  Fixes #59048.
6505
6506 2004-05-29  Martin Baulig  <martin@ximian.com>
6507
6508         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6509         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6510
6511         * ecore.cs (EventExpr.instance_expr): Make the field private.
6512
6513 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6514
6515         Fixed bug #50080 & cs0214-2.cs
6516         * expression.cs (Cast.DoResolve): Check unsafe context here.
6517         
6518         * statement.cs (Resolve.DoResolve): Likewise.
6519
6520 2004-05-26  Martin Baulig  <martin@ximian.com>
6521
6522         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6523
6524         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6525         (RootContext.LookupType): Pass down the `silent' flag.
6526
6527 2004-05-25  Martin Baulig  <martin@ximian.com>
6528
6529         * expression.cs
6530         (MethodGroupExpr.IdenticalTypeName): New public property.
6531         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6532         expression actually refers to a type.
6533
6534 2004-05-25  Martin Baulig  <martin@ximian.com>
6535
6536         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6537         for #56176 and made it actually work.
6538
6539 2004-05-25  Martin Baulig  <martin@ximian.com>
6540
6541         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6542         (FieldExpr, PropertyExpr): Override and implement
6543         CacheTemporaries.  Fixes #52279.
6544
6545 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6546
6547         * location.cs: In the new compiler listing a file twice is a
6548         warning, not an error.
6549
6550 2004-05-24  Martin Baulig  <martin@ximian.com>
6551
6552         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6553         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6554
6555 2004-05-24  Martin Baulig  <martin@ximian.com>
6556
6557         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6558         walking the `using' list.  Fixes #53921.
6559
6560 2004-05-24  Martin Baulig  <martin@ximian.com>
6561
6562         * const.cs (Const.LookupConstantValue): Added support for
6563         EmptyCast's; fixes #55251.
6564
6565 2004-05-24  Martin Baulig  <martin@ximian.com>
6566
6567         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6568         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6569         which does the CS0135 check.  The reason is that we first need to
6570         check whether the variable actually exists.
6571
6572 2004-05-24  Martin Baulig  <martin@ximian.com>
6573
6574         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6575         than RootContext.LookupType() to find the explicit interface
6576         type.  Fixes #58584.
6577
6578 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6579
6580         * Makefile: Simplify.  Use executable.make.
6581         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6582
6583 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6584
6585         * decl.cs:
6586         * enum.cs:
6587         Use the invariant culture when doing String.Compare for CLS case
6588         sensitivity.
6589         
6590 2004-05-23  Martin Baulig  <martin@ximian.com>
6591
6592         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6593         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6594
6595         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6596         
6597 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6598
6599         * class.cs (MemberBase.Define): Reuse MemberType member for 
6600         resolved type. Other methods can use it too.
6601
6602 2004-05-23  Martin Baulig  <martin@ximian.com>
6603
6604         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6605         the variable also exists in the current block (otherwise, we need
6606         to report a CS0103).  Fixes #58670.
6607
6608 2004-05-23  Martin Baulig  <martin@ximian.com>
6609
6610         * flowanalysis.cs (Reachability.Reachable): Compute this
6611         on-the-fly rather than storing it as a field.
6612
6613 2004-05-23  Martin Baulig  <martin@ximian.com>
6614
6615         * flowanalysis.cs (Reachability.And): Manually compute the
6616         resulting `barrier' from the reachability.      
6617        
6618 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6619
6620         Fix bug #57835
6621         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6622         instance of ObsoleteAttribute when symbol is obsolete.
6623
6624         * class.cs
6625         (IMethodData): Extended interface for ObsoleteAttribute support.
6626
6627 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * attribute.cs: Fix bug #55970
6630
6631 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6632
6633         Fix bug #52705
6634         * attribute.cs
6635         (GetObsoleteAttribute): New method. Creates the instance of
6636         ObsoleteAttribute.
6637         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6638         ObsoleteAttribute when member is obsolete.
6639         (AttributeTester.Report_ObsoleteMessage): Common method for
6640         Obsolete error/warning reporting.
6641
6642         * class.cs
6643         (TypeContainer.base_classs_type): New member for storing parent type.
6644
6645         * decl.cs
6646         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6647         for this MemberCore.
6648
6649 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6650
6651         * attribute.cs, const.cs: Fix bug #58590
6652
6653 2004-05-21  Martin Baulig  <martin@ximian.com>
6654
6655         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6656         out parameters if the end of the method is unreachable.  Fixes
6657         #58098. 
6658
6659 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6660
6661         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6662         Hari was right, why extra method.
6663
6664 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6665
6666         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6667
6668 2004-05-20  Martin Baulig  <martin@ximian.com>
6669
6670         Merged this back from gmcs to keep the differences to a minumum.
6671
6672         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6673         instead of a Declspace.
6674         (Attribute.ResolveType): Likewise.
6675         (Attributes.Search): Likewise.
6676         (Attributes.Contains): Likewise.
6677         (Attributes.GetClsCompliantAttribute): Likewise.
6678
6679         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6680         argument.
6681         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6682         DeclSpace.
6683
6684 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6685
6686         Fix bug #58688 (MCS does not report error when the same attribute
6687         is assigned twice)
6688
6689         * attribute.cs (Attribute.Emit): Distinction between null and default.
6690
6691 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6692
6693         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6694         of a top-level attribute without an attribute target.
6695         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6696         Make non-static.
6697         (Attribute.Conditional_GetConditionName), 
6698         (Attribute.Obsolete_GetObsoleteMessage): Update.
6699         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6700         part of ScanForIndexerName.
6701         (Attribute.CanIgnoreInvalidAttribute): New function.
6702         (Attribute.ScanForIndexerName): Move to ...
6703         (Attributes.ScanForIndexerName): ... here.
6704         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6705         (Attributes.Search): New internal variant that can choose not to
6706         complain if types aren't resolved.  The original signature now
6707         complains.
6708         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6709         complaints suppressed.
6710         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6711         only if it not useful.
6712         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6713         top-level for attributes that are shared between the assembly
6714         and a top-level class.
6715         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6716         * class.cs: Update to reflect changes.
6717         (DefineIndexers): Fuse loops.
6718         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6719         a couple more variants of attribute names.
6720
6721 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6722
6723         Fix bug #52585 (Implemented explicit attribute declaration)
6724
6725         * attribute.cs:
6726         (Attributable.ValidAttributeTargets): New abstract method. It gets
6727         list of valid attribute targets for explicit target declaration.
6728         (Attribute.Target): It holds target itself.
6729         (AttributeSection): Removed.
6730         (Attribute.CheckTargets): New method. It checks whether attribute
6731         target is valid for the current element.
6732
6733         * class.cs:
6734         (EventProperty): New class. For events that are declared like
6735         property (with add and remove accessors).
6736         (EventField): New class. For events that are declared like field.
6737         class.cs
6738
6739         * cs-parser.jay: Implemented explicit attribute target declaration.
6740
6741         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6742         Override ValidAttributeTargets.
6743
6744         * parameter.cs:
6745         (ReturnParameter): Class for applying custom attributes on 
6746         the return type.
6747         (ParameterAtribute): New class. Class for applying custom
6748         attributes on the parameter type.
6749
6750 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6751
6752         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6753         definitions. 
6754
6755         (Method): Allow UNSAFE here.
6756
6757         * modifiers.cs: Support unsafe reporting.
6758
6759 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6760
6761         * decl.cs: Fix bug #58478.
6762
6763 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6764
6765         * statement.cs: When checking for unreachable code on an EmptyStatement,
6766         set the location. Fixes bug #58488.
6767
6768 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6769
6770         * driver.cs: Add -pkg handling.
6771
6772         From Gonzalo: UseShelLExecute=false
6773
6774 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6775
6776         * attribute.cs:
6777         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6778         for attribute.
6779         (Attribute.IsClsCompliaceRequired): Moved to base for better
6780         accesibility.
6781         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6782         when attribute is AttributeUsageAttribute.
6783         (Attribute.GetValidTargets): Simplified.
6784         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6785         attribute for this type.
6786         (Attribute.ApplyAttributes): Method renamed to Emit and make
6787         non-static.
6788         (GlobalAttributeSection): New class for special handling of global
6789         attributes (assembly, module).
6790         (AttributeSection.Emit): New method.
6791
6792         * class.cs: Implemented Attributable abstract methods.
6793         (MethodCore.LabelParameters): Moved to Parameter class.
6794         (Accessor): Is back simple class.
6795         (PropertyMethod): Implemented Attributable abstract class.
6796         (DelegateMethod): Implemented Attributable abstract class.
6797         (Event): New constructor for disctintion between normal Event
6798         and Event with accessors.
6799
6800         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6801
6802         * codegen.cs, const.cs, decl.cs, delegate.cs:
6803         (CommonAssemblyModulClass): Implemented Attributable abstract class
6804         and simplified.
6805
6806         * enum.cs: Implement IAttributeSupport interface.
6807         (EnumMember): New class for emum members. Implemented Attributable
6808         abstract class
6809
6810         * parameter.cs:
6811         (ParameterBase): Is abstract.
6812         (ReturnParameter): New class for easier [return:] attribute handling.
6813
6814         * typemanager.cs: Removed builder_to_attr.
6815
6816 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6817
6818         Fix bug #57151.
6819         * attribute.cs (Attribute.GetPositionalValue): New function.
6820         * class.cs (TypeContainer.VerifyMembers): New function.
6821         (TypeContainer.Emit): Use it.
6822         (ClassOrStruct): New base class for Class and Struct.
6823         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6824         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6825         class.
6826         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6827         then each non-static field should have a FieldOffset attribute.
6828         Otherwise, none of the fields should have a FieldOffset attribute.
6829         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6830         and FieldOffset attributes.
6831         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6832         (TypeManager.field_offset_attribute_type): New core types.
6833         (TypeManager.InitCoreTypes): Initialize them.
6834
6835 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6836
6837         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6838         Return correct type.
6839         From bug #58270.
6840
6841 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6842
6843         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6844         be implicitly converted to ulong.
6845         
6846         * expression.cs: The logic for allowing operator &, | and ^ worked
6847         was wrong, it worked before because we did not report an error in
6848         an else branch.  Fixes 57895.
6849
6850         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6851         allow volatile fields to be reference types.
6852
6853 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6854
6855         * driver.cs: Add support for /debug-
6856
6857 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6858
6859         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6860         Add a 'complain' parameter to silence errors.
6861         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6862         silently overlooked type-resolutions.
6863         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6864         to reflect changes.
6865         (Attributes.Search): New function.
6866         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6867         (Attributes.GetAttributeFullName): Remove hack.
6868         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6869         Update to reflect changes.
6870         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6871         Use Attributes.Search instead of nested loops.
6872
6873 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6874
6875         * decl.cs:
6876         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6877         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6878         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6879
6880         * report.cs: (Report.Warning): Renamed to Warning_T because of
6881         parameter collision.
6882
6883 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6884
6885         * expression.cs (MemberAccess.ResolveMemberAccess):
6886         Exit with non-zero status after Report.Error.
6887         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6888         Likewise.
6889         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6890
6891 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6892
6893         * support.cs: Don't hang when the file is empty.
6894
6895 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6896
6897         * support.cs: In SeekableStreamReader, compute the preamble size of the
6898           underlying stream. Position changes should take into account that initial
6899           count of bytes.
6900
6901 2004-05-03  Todd Berman  <tberman@sevenl.net>
6902
6903         * driver.cs: remove unused GetSysVersion function.
6904
6905 2004-05-03  Todd Berman  <tberman@sevenl.net>
6906
6907         * driver.cs: Remove the hack from saturday, as well as the hack
6908         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6909         link_paths to get that bit proper.
6910
6911 2004-05-01  Todd Berman  <tberman@sevenl.net>
6912
6913         * driver.cs: Try a LoadFrom before a Load, this checks the current
6914         path. This is currently a bug in mono that is be fixed, however, this
6915         provides a workaround for now. This will be removed when the bug
6916         is fixed.
6917
6918 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6919
6920         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6921         incomplete key pairs (#57941).
6922
6923 2004-05-01  Todd Berman  <tberman@sevenl.net>
6924
6925         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6926         from the GAC
6927
6928 2004-04-30  Jackson Harper  <jackson@ximian.com>
6929
6930         * codegen.cs: Open keys readonly.
6931         
6932 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6933
6934         * typemanager.cs: don't report cyclic struct layout when a struct
6935         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6936         which has 2 Pango.Rectangle fields.
6937
6938 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6939
6940         * expression.cs: Handle IntPtr comparisons with IL code
6941         rather than a method call.
6942
6943 2004-04-29  Martin Baulig  <martin@ximian.com>
6944
6945         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6946         the list of PropertyInfo's in class hierarchy and find the
6947         accessor.  Fixes #56013.
6948
6949 2004-04-29  Martin Baulig  <martin@ximian.com>
6950
6951         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6952
6953 2004-04-29  Martin Baulig  <martin@ximian.com>
6954
6955         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6956
6957         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6958
6959 2004-04-29  Martin Baulig  <martin@ximian.com>
6960
6961         * class.cs (ConstructorInitializer.Resolve): Check whether the
6962         parent .ctor is accessible.  Fixes #52146.
6963
6964 2004-04-29  Martin Baulig  <martin@ximian.com>
6965
6966         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6967
6968         * statement.cs (Using.EmitLocalVariableDecls): Use
6969         TypeManager.idisposable_type, not typeof (IDisposable).
6970         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6971
6972 2004-04-29  Martin Baulig  <martin@ximian.com>
6973
6974         * class.cs (Event.Define): Don't emit the field and don't set
6975         RTSpecialName and SpecialName for events on interfaces.  Fixes
6976         #57703. 
6977
6978 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6979
6980         Refactor Attribute.ApplyAttributes.
6981         * attribute.cs (Attributable): New base class for objects that can
6982         have Attributes applied on them.
6983         (Attribute): Make AttributeUsage fields public.
6984         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6985         (Attribute.IsInternalCall): New property.
6986         (Attribute.UsageAttr): Convert to a public read-only property.
6987         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6988         (Attribute.ResolveType, Attribute.Resolve)
6989         (Attribute.ScanForIndexerName): Update to reflect changes.
6990         (Attribute.CheckAttributeTarget): Re-format.
6991         (Attribute.ApplyAttributes): Refactor, to various
6992         Attributable.ApplyAttributeBuilder methods.
6993         * decl.cs (MemberCore): Make Attributable.
6994         * class.cs (Accessor): Make Attributable.
6995         (MethodData.ApplyAttributes): Use proper attribute types, not
6996         attribute names.
6997         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6998         (TypeContainer.ApplyAttributeBuilder)
6999         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7000         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7001         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7002         (Operator.ApplyAttributeBuilder): New factored-out methods.
7003         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7004         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7005         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7006         * parameter.cs (ParameterBase): New Attributable base class
7007         that can also represent Return types.
7008         (Parameter): Update to the changes.
7009
7010 2004-04-29  Jackson Harper  <jackson@ximian.com>
7011
7012         * driver.cs: Prefer the corlib system version when looking for
7013         assemblies in the GAC. This is still a hack, but its a better hack
7014         now.
7015         
7016 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7017
7018         * decl.cs, enum.cs: Improved error 3005 reporting.
7019   
7020         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7021         (related_symbols): New private member for list of symbols
7022         related to reported error/warning.
7023         
7024         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7025
7026 2004-04-29  Martin Baulig  <martin@ximian.com>
7027
7028         * ecore.cs (Expression.Constantify): If we're an enum and
7029         TypeManager.TypeToCoreType() doesn't give us another type, use
7030         t.UnderlyingSystemType.  Fixes #56178.  
7031
7032 2004-04-29  Martin Baulig  <martin@ximian.com>
7033
7034         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7035         interfaces and for each interface, only add members directly
7036         declared in that interface.  Fixes #53255.
7037
7038 2004-04-28  Martin Baulig  <martin@ximian.com>
7039
7040         * expression.cs (ConditionalLogicalOperator): Use a temporary
7041         variable for `left' to avoid that we evaluate it more than once;
7042         bug #52588.
7043
7044 2004-04-28  Martin Baulig  <martin@ximian.com>
7045
7046         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7047         `void[]' (CS1547).
7048
7049 2004-04-28  Martin Baulig  <martin@ximian.com>
7050
7051         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7052         void (CS1547).
7053
7054         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7055         whether the type is not void (CS1547).
7056
7057 2004-04-28  Martin Baulig  <martin@ximian.com>
7058
7059         * expression.cs (Unary.DoResolveLValue): Override this and report
7060         CS0131 for anything but Operator.Indirection.
7061
7062 2004-04-28  Martin Baulig  <martin@ximian.com>
7063
7064         Committing a patch from Ben Maurer; see bug #50820.
7065
7066         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7067         check for classes.
7068
7069         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7070         classes.        
7071
7072 2004-04-28  Martin Baulig  <martin@ximian.com>
7073
7074         Committing a patch from Ben Maurer; see bug #50820.
7075
7076         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7077         check for classes.
7078
7079         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7080         classes.        
7081
7082 2004-04-28  Martin Baulig  <martin@ximian.com>
7083
7084         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7085         (Block.AddLabel): Call DoLookupLabel() to only search in the
7086         current block.
7087
7088 2004-04-28  Martin Baulig  <martin@ximian.com>
7089
7090         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7091         comparing StringConstants and NullLiterals in Equality and Inequality.
7092
7093 2004-04-28  Jackson Harper  <jackson@ximian.com>
7094
7095         * driver.cs: Attempt to load referenced assemblies from the
7096         GAC. This is the quick and dirty version of this method that
7097         doesnt take into account versions and just takes the first
7098         canidate found. Will be good enough for now as we will not have more
7099         then one version installed into the GAC until I update this method.
7100
7101 2004-04-28  Martin Baulig  <martin@ximian.com>
7102
7103         * typemanager.cs (TypeManager.CheckStructCycles): New public
7104         static method to check for cycles in the struct layout.
7105
7106         * rootcontext.cs (RootContext.PopulateTypes): Call
7107         TypeManager.CheckStructCycles() for each TypeContainer.
7108         [Note: We only need to visit each type once.]
7109
7110 2004-04-28  Martin Baulig  <martin@ximian.com>
7111
7112         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7113
7114         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7115         success and added `out object value'.  Use a `bool resolved' field
7116         to check whether we've already been called rather than
7117         `ConstantValue != null' since this breaks for NullLiterals.
7118
7119 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7120
7121         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7122         setting of this flag, since the 'set' method may be non-public.
7123
7124 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7125
7126         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7127         check on current_vector.Block.
7128
7129 2004-04-27  Martin Baulig  <martin@ximian.com>
7130
7131         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7132         a field initializer.  Fixes #56459.
7133
7134 2004-04-27  Martin Baulig  <martin@ximian.com>
7135
7136         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7137         we're not attempting to use an indexer.  Fixes #52154.
7138
7139 2004-04-27  Martin Baulig  <martin@ximian.com>
7140
7141         * statement.cs (Return): Don't create a return label if we don't
7142         need it; reverts my change from January 20th.  Thanks to Ben
7143         Maurer for this.
7144
7145 2004-04-27  Martin Baulig  <martin@ximian.com>
7146
7147         According to the spec, `goto' can only leave a nested scope, but
7148         never enter it.
7149
7150         * statement.cs (Block.LookupLabel): Only lookup in the current
7151         block, don't recurse into parent or child blocks.
7152         (Block.AddLabel): Check in parent and child blocks, report
7153         CS0140/CS0158 if we find a duplicate.
7154         (Block): Removed this indexer for label lookups.
7155         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7156         this already does the error reporting for us.
7157
7158         * flowanalysis.cs
7159         (FlowBranching.UsageVector.Block): New public variable; may be null.
7160         (FlowBranching.CreateSibling): Added `Block' argument.
7161         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7162         label for the target of a `goto' and check whether we're not
7163         leaving a `finally'.
7164
7165 2004-04-27  Martin Baulig  <martin@ximian.com>
7166
7167         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7168         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7169         just for returns).
7170
7171 2004-04-27  Martin Baulig  <martin@ximian.com>
7172
7173         * statement.cs (Block.AddLabel): Also check for implicit blocks
7174         and added a CS0158 check.
7175
7176 2004-04-27  Martin Baulig  <martin@ximian.com>
7177
7178         * flowanalysis.cs (FlowBranchingLoop): New class.
7179         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7180         UsageVector's instead of an ArrayList.
7181         (FlowBranching.Label): Likewise.
7182         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7183         (FlowBranching.AddBreakVector): New method.
7184
7185 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7186
7187         * attribute.cs: Small regression fix: only convert the type if we
7188         the type is different, fixes System.Drawing build.
7189
7190 2004-04-27  Martin Baulig  <martin@ximian.com>
7191
7192         * attribute.cs (Attribute.Resolve): If we have a constant value
7193         for a named field or property, implicity convert it to the correct
7194         type.
7195
7196 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7197
7198         * statement.cs (Block.Block): Implicit blocks share
7199         'child_variable_names' fields with parent blocks.
7200         (Block.AddChildVariableNames): Remove.
7201         (Block.AddVariable): Mark variable as "used by a child block" in
7202         every surrounding block.
7203         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7204         been used in a child block, complain about violation of "Invariant
7205         meaning in blocks" rule.
7206         * cs-parser.jay (declare_local_variables): Don't use
7207         AddChildVariableNames.
7208         (foreach_statement): Don't create an implicit block: 'foreach'
7209         introduces a scope.
7210
7211 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7212
7213         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7214         converting from 0L to ulong.  Fixes 57522.
7215
7216 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7217
7218         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7219         derived class hides via 'new' keyword field from base class (test-242.cs).
7220         TODO: Handle this in the more general way.
7221         
7222         * class.cs (CheckBase): Ditto.
7223
7224 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7225
7226         * decl.cs (caching_flags): New member for storing cached values
7227         as bit flags.
7228         (MemberCore.Flags): New enum where bit flags for caching_flags
7229         are defined.
7230         (MemberCore.cls_compliance): Moved to caching_flags.
7231         (DeclSpace.Created): Moved to caching_flags.
7232
7233         * class.cs: Use caching_flags instead of DeclSpace.Created
7234         
7235 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7236
7237         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7238         if we are only a derived class, not a nested class.
7239
7240         * typemanager.cs: Same as above, but do this at the MemberLookup
7241         level (used by field and methods, properties are handled in
7242         PropertyExpr).   Allow for the qualified access if we are a nested
7243         method. 
7244
7245 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7246
7247         * class.cs: Refactoring.
7248         (IMethodData): New inteface; Holds links to parent members
7249         to avoid member duplication (reduced memory allocation).
7250         (Method): Implemented IMethodData interface.
7251         (PropertyBase): New inner classes for get/set methods.
7252         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7253         (Event): New inner classes for add/remove methods.
7254         (Event.DelegateMethod): Implemented IMethodData interface.
7255
7256         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7257         EmitContext (related to class.cs refactoring).
7258
7259 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7260
7261         * delegate.cs (Delegate.VerifyApplicability): If the number of
7262         arguments are the same as the number of parameters, first try to
7263         verify applicability ignoring  any 'params' modifier on the last
7264         parameter.
7265         Fixes #56442.
7266
7267 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7268
7269         * class.cs (TypeContainer.AddIndexer): Use
7270         'ExplicitInterfaceName' to determine if interface name was
7271         explicitly specified.  'InterfaceType' is not initialized at this time.
7272         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7273         Indexers array is already in the required order.  Initialize
7274         'IndexerName' only if there are normal indexers.
7275         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7276         (TypeContainer.Emit): Emit DefaultMember attribute only if
7277         IndexerName is initialized.
7278         Fixes #56300.
7279
7280 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7281
7282         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7283         Fixes #57007
7284
7285 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7286
7287         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7288         attributes.
7289         Fix for #56456.
7290
7291         * attribute.cs (Attribute.Resolve): Check for duplicate named
7292         attributes.
7293         Fix for #56463.
7294
7295 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7296
7297         * iterators.cs (MarkYield): track whether we are in an exception,
7298         and generate code accordingly.  Use a temporary value to store the
7299         result for our state.
7300
7301         I had ignored a bit the interaction of try/catch with iterators
7302         since their behavior was not entirely obvious, but now it is
7303         possible to verify that our behavior is the same as MS .NET 2.0
7304
7305         Fixes 54814
7306
7307 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7308
7309         * iterators.cs: Avoid creating temporaries if there is no work to
7310         do. 
7311
7312         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7313         Enumerations, use TypeManager.EnumToUnderlying and call
7314         recursively. 
7315
7316         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7317         bug #57013
7318
7319         (This.Emit): Use EmitContext.EmitThis to emit our
7320         instance variable.
7321
7322         (This.EmitAssign): Ditto.
7323
7324         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7325         codepaths, we will move all the functionality into
7326         Mono.CSharp.This 
7327
7328         (FieldExpr.EmitAssign): Ditto.
7329
7330         This fixes several hidden bugs that I uncovered while doing a code
7331         review of this today.
7332
7333         * codegen.cs (EmitThis): reworked so the semantics are more clear
7334         and also support value types "this" instances.
7335
7336         * iterators.cs: Changed so that for iterators in value types, we
7337         do not pass the value type as a parameter.  
7338
7339         Initialization of the enumerator helpers is now done in the caller
7340         instead of passing the parameters to the constructors and having
7341         the constructor set the fields.
7342
7343         The fields have now `assembly' visibility instead of private.
7344
7345 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7346
7347         * expression.cs (Argument.Resolve): Check if fields passed as ref
7348         or out are contained in a MarshalByRefObject.
7349
7350         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7351         another compiler type.
7352
7353 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7354
7355         * class.cs (Indexer.Define): use the new name checking method.
7356         Also, return false on an error.
7357         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7358         (is_identifier_[start/part]_character): make static.
7359
7360 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7361
7362         * expression.cs (Binary.ResolveOperator): Do no append strings
7363         twice: since we can be invoked more than once (array evaluation)
7364         on the same concatenation, take care of this here.  Based on a fix
7365         from Ben (bug #56454)
7366
7367 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7368
7369         * codegen.cs: Fix another case where CS1548 must be reported (when 
7370         delay-sign isn't specified and no private is available #56564). Fix
7371         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7372         error when MCS is used on the MS runtime and we need to delay-sign 
7373         (which seems unsupported by AssemblyBuilder - see #56621).
7374
7375 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7376
7377         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7378         (TypeManager.ComputeNamespaces): Faster implementation for
7379         Microsoft runtime.
7380
7381         * compiler.csproj: Updated AssemblyName to mcs.
7382
7383 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7384
7385         * rootcontext.cs: Add new types to the boot resolution.
7386
7387         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7388         MulticastDelegate is not allowed.
7389
7390         * typemanager.cs: Add new types to lookup: System.TypedReference
7391         and ArgIterator.
7392
7393         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7394         check for TypedReference or ArgIterator, they are not allowed. 
7395
7396         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7397         makes us properly catch 1510 in some conditions (see bug 56016 for
7398         details). 
7399
7400 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7401
7402         * CryptoConvert.cs: update from corlib version
7403         with endian fixes.
7404
7405 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7406
7407         * class.cs (Indexer.Define): Check indexername declaration
7408
7409 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7410
7411         * attribute.cs (IsClsCompliant): Fixed problem with handling
7412         all three states (compliant, not-compliant, undetected).
7413
7414 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7415
7416         * attribute.cs (Attribute): Location is now public.
7417         (Resolve): Store resolved arguments (pos_values) in attribute class.
7418         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7419         (GetClsCompliantAttributeValue): New method that gets
7420         CLSCompliantAttribute value.
7421         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7422         if exists else null.
7423         (AttributeTester): New class for CLS-Compliant verification routines.
7424
7425         * class.cs (Emit): Add CLS-Compliant verification.
7426         (Method.GetSignatureForError): Implemented.
7427         (Constructor.GetSignatureForError): Implemented
7428         (Constructor.HasCompliantArgs): Returns if constructor has
7429         CLS-Compliant arguments.
7430         (Constructor.Emit): Override.
7431         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7432         is needed to test only parameters.
7433         (FieldBase.GetSignatureForError): Implemented.
7434         (TypeContainer): New member for storing base interfaces.
7435         (TypeContainer.FindMembers): Search in base interfaces too.
7436
7437         * codegen.cs (GetClsComplianceAttribute): New method that gets
7438         assembly or module CLSCompliantAttribute value.
7439         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7440         for assembly.
7441         (ModuleClass.Emit): Add error 3012 test.
7442
7443         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7444
7445         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7446         state for all decl types.
7447         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7448         if CLS-Compliant tests are required.
7449         (IsClsCompliaceRequired): New method. Analyze whether code
7450         must be CLS-Compliant.
7451         (IsExposedFromAssembly): New method. Returns true when MemberCore
7452         is exposed from assembly.
7453         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7454         value or gets cached value.
7455         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7456         is explicitly marked with CLSCompliantAttribute.
7457         (IsIdentifierClsCompliant): New abstract method. This method is
7458         used to testing error 3005.
7459         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7460         for identifier and parameters CLS-Compliant testing.
7461         (VerifyClsCompliance): New method. The main virtual method for
7462         CLS-Compliant verifications.
7463         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7464         null. I don't know why is null (too many public members !).
7465         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7466         and get value of first CLSCompliantAttribute that found.
7467
7468         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7469         (VerifyClsCompliance): Override and add extra tests.
7470
7471         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7472         clscheck- disable CLS-Compliant verification event if assembly is has
7473         CLSCompliantAttribute(true).
7474
7475         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7476         ApllyAttribute is now called in emit section as in the other cases.
7477         Possible future Emit integration.
7478         (IsIdentifierClsCompliant): New override.
7479         (VerifyClsCompliance): New override.
7480         (GetEnumeratorName): Returns full enum name.
7481
7482         * parameter.cs (GetSignatureForError): Implemented.
7483
7484         * report.cs (WarningData): New struct for Warning message information.
7485         (LocationOfPreviousError): New method.
7486         (Warning): New method. Reports warning based on the warning table.
7487         (Error_T): New method. Reports error based on the error table.
7488
7489         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7490         verifications are done here.
7491
7492         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7493
7494         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7495         CLSCompliantAttribute.
7496         (all_imported_types): New member holds all imported types from other
7497         assemblies.
7498         (LoadAllImportedTypes): New method fills static table with exported types
7499         from all referenced assemblies.
7500         (Modules): New property returns all assembly modules.
7501
7502 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7503
7504         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7505         throwing a parser error.
7506
7507         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7508         which removes the hardcoded get_/set_ prefixes for properties, as
7509         IL allows for the properties to be named something else.  
7510
7511         Bug #56013
7512
7513         * expression.cs: Do not override operand before we know if it is
7514         non-null.  Fix 56207
7515
7516 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7517
7518         * typemanager.cs: support for pinned variables.
7519
7520 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7521
7522         * decl.cs, typemanager.cs: Avoid using an arraylist
7523         as a buffer if there is only one result set.
7524
7525 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7526
7527         * expression.cs: Make sure you cant call a static method
7528         with an instance expression, bug #56174.
7529
7530 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7531
7532         * class.cs (IsDuplicateImplementation): Improve error reporting to
7533         flag 663 (method only differs in parameter modifier).
7534
7535         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7536         in preprocessor directives.
7537
7538         * location.cs (LookupFile): Allow for the empty path.
7539
7540         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7541         better approach for some of that patch, but its failing with the
7542         CharSet enumeration.  For now try/catch will do.
7543
7544         * typemanager.cs: Do not crash if a struct does not have fields.
7545         Fixes 56150.
7546
7547 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7548
7549         * expression.cs: cs0213, cant fix a fixed expression.
7550         fixes 50231.
7551
7552 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7553
7554         * cs-parser.jay: detect invalid embeded statements gracefully.
7555         bug #51113.
7556
7557 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7558
7559         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7560         As a regex:
7561         s/
7562         the invocation type may not be a subclass of the tye of the item/
7563         The type of the item must be a subclass of the invocation item.
7564         /g
7565
7566         Fixes bug #50820.
7567
7568 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7569
7570         * attribute.cs: Added methods to get a string and a bool from an
7571         attribute. Required to information from AssemblyKeyFileAttribute,
7572         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7573         * codegen.cs: Modified AssemblyName creation to include support for
7574         strongnames. Catch additional exceptions to report them as CS1548.
7575         * compiler.csproj: Updated include CryptoConvert.cs.
7576         * compiler.csproj.user: Removed file - user specific configuration.
7577         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7578         Mono.Security assembly. The original class is maintained and tested in
7579         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7580         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7581         like CSC 8.0 (C# v2) supports.
7582         * Makefile: Added CryptoConvert.cs to mcs sources.
7583         * rootcontext.cs: Added new options for strongnames.
7584
7585 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7586
7587         * driver.cs: For --expect-error, report error code `2'
7588         if the program compiled with no errors, error code `1' if
7589         it compiled with an error other than the one expected.
7590
7591 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7592
7593         * compiler.csproj: Updated for Visual Studio .NET 2003.
7594         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7595         * compiler.sln: Updated for Visual Studio .NET 2003.
7596
7597 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7598
7599         * expression.cs: Fix bug #47234. We basically need to apply the
7600         rule that we prefer the conversion of null to a reference type
7601         when faced with a conversion to 'object' (csc behaviour).
7602
7603 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7604
7605         * statement.cs: Shorter form for foreach, eliminates
7606         a local variable. r=Martin.
7607
7608 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7609
7610         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7611         checks if we can use brtrue/brfalse to test for 0.
7612         * expression.cs: use the above in the test for using brtrue/brfalse.
7613         cleanup code a bit.
7614
7615 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7616
7617         * expression.cs: Rewrite string concat stuff. Benefits:
7618
7619         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7620         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7621         rather than a concat chain.
7622
7623         * typemanager.cs: Add lookups for more concat overloads.
7624
7625 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7626
7627         * expression.cs: Emit shorter il code for array init.
7628
7629         newarr
7630         dup
7631         // set 1
7632
7633         // set 2
7634
7635         newarr
7636         stloc.x
7637
7638         ldloc.x
7639         // set 1
7640
7641         ldloc.x
7642         // set 2
7643
7644 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7645
7646         * statement.cs: Before, two switch blocks would be merged if the
7647         total size of the blocks (end_item - begin_item + 1) was less than
7648         two times the combined sizes of the blocks.
7649
7650         Now, it will only merge if after the merge at least half of the
7651         slots are filled.
7652
7653         fixes 55885.
7654
7655 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7656
7657         * class.cs : csc build fix for GetMethods(). See bug #52503.
7658
7659 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7660
7661         * expression.cs: Make sure fp comparisons work with NaN.
7662         This fixes bug #54303. Mig approved this patch a long
7663         time ago, but we were not able to test b/c the runtime
7664         had a related bug.
7665
7666 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7667
7668         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7669
7670 2004-03-19  Martin Baulig  <martin@ximian.com>
7671
7672         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7673         error here and not in our caller.
7674
7675 2004-03-19  Martin Baulig  <martin@ximian.com>
7676
7677         * interface.cs: Completely killed this file.
7678         (Interface): We're now a TypeContainer and live in class.cs.
7679
7680         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7681         argument; we're now also called for interfaces.
7682         (TypeContainer.DefineMembers): Allow this method being called
7683         multiple times.
7684         (TypeContainer.GetMethods): New public method; formerly known as
7685         Interface.GetMethod().  This is used by PendingImplementation.
7686         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7687         it's now private and non-static.
7688         (Interface): Moved this here; it's now implemented similar to
7689         Class and Struct.
7690         (Method, Property, Event, Indexer): Added `bool is_interface'
7691         argument to their .ctor's.
7692         (MemberBase.IsInterface): New public field.
7693
7694         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7695         instances instead of InterfaceMethod, InterfaceProperty, etc.
7696         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7697         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7698
7699 2004-03-19  Martin Baulig  <martin@ximian.com>
7700
7701         * class.cs (MethodCore.IsDuplicateImplementation): New private
7702         method which does the CS0111 checking.
7703         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7704         Use IsDuplicateImplementation().
7705
7706 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7707
7708         * decl.cs (FindMemberToOverride): New method to find the correct
7709         method or property to override in the base class.
7710         * class.cs
7711             - Make Method/Property use the above method to find the
7712               version in the base class.
7713             - Remove the InheritableMemberSignatureCompare as it is now
7714               dead code.
7715
7716         This patch makes large code bases much faster to compile, as it is
7717         O(n) rather than O(n^2) to do this validation.
7718
7719         Also, it fixes bug 52458 which is that nested classes are not
7720         taken into account when finding the base class member.
7721
7722         Reviewed/Approved by Martin.
7723
7724 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7725
7726         * interface.cs: In all interface classes removed redundant
7727         member initialization.
7728
7729 2004-03-16  Martin Baulig  <martin@ximian.com>
7730
7731         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7732
7733 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7734
7735         * decl.cs (DefineTypeAndParents): New helper method to define a
7736         type's containers before the type itself is defined;  This is a
7737         bug exposed by the recent changes to Windows.Forms when an
7738         implemented interface was defined inside a class that had not been
7739         built yet.   
7740
7741         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7742
7743         (Check): Loop correctly to report errors modifiers
7744         (UNSAFE was not in the loop, since it was the same as TOP).
7745
7746         * interface.cs: Every interface member now takes a ModFlags,
7747         instead of a "is_new" bool, which we set on the base MemberCore. 
7748
7749         Every place where we called "UnsafeOk" in the interface, now we
7750         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7751         the unsafe settings from the member declaration instead of the
7752         container interface. 
7753
7754         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7755
7756         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7757         `set_indexer_name' to the pending bits (one per type).
7758
7759         We fixed a bug today that was picking the wrong method to
7760         override, since for properties the existing InterfaceMethod code
7761         basically ignored the method name.  Now we make sure that the
7762         method name is one of the valid indexer names.
7763
7764 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7765  
7766         * support.cs (SeekableStreamReader): Keep track of stream byte
7767         positions and don't mix them with character offsets to the buffer.
7768
7769         Patch from Gustavo Giráldez
7770
7771 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7772
7773         * interface.cs (InterfaceSetGetBase): Removed double member
7774         initialization, base class does it as well.
7775
7776 2004-03-13  Martin Baulig  <martin@ximian.com>
7777
7778         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7779         when compiling corlib.
7780
7781 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7782
7783         * convert.cs (ExplicitConversion): We were reporting an error on
7784         certain conversions (object_type source to a value type, when the
7785         expression was `null') before we had a chance to pass it through
7786         the user defined conversions.
7787
7788         * driver.cs: Replace / and \ in resource specifications to dots.
7789         Fixes 50752
7790
7791         * class.cs: Add check for duplicate operators.  Fixes 52477
7792
7793 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7794
7795         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7796         that are in the middle of the statements, not only at the end.
7797         Fixes #54987
7798
7799         * class.cs (TypeContainer.AddField): No longer set the
7800         `HaveStaticConstructor' flag, now we call it
7801         `UserDefineStaticConstructor' to diferentiate the slightly
7802         semantic difference.
7803
7804         The situation is that we were not adding BeforeFieldInit (from
7805         Modifiers.TypeAttr) to classes that could have it.
7806         BeforeFieldInit should be set to classes that have no static
7807         constructor. 
7808
7809         See:
7810
7811         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7812
7813         And most importantly Zoltan's comment:
7814
7815         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7816
7817         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7818          before its static fields are used', i.e. initialization does not need
7819          to be triggered by the first access to the type. Setting this flag
7820          helps the JIT to compile better code, since it can run the static
7821          constructor at JIT time, and does not need to generate code to call it
7822          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7823          this flag for lots of classes like String. 
7824          
7825          csc sets this flag if the type does not have an explicit static 
7826          constructor. The reasoning seems to be that if there are only static
7827          initalizers for a type, and no static constructor, then the programmer
7828          does not care when this initialization happens, so beforefieldinit
7829          can be used.
7830          
7831          This bug prevents the AOT compiler from being usable, since it 
7832          generates so many calls to mono_runtime_class_init that the AOT code
7833          is much slower than the JITted code. The JITted code is faster, 
7834          because it does not generate these calls if the vtable is type is
7835          already initialized, which is true in the majority of cases. But the
7836          AOT compiler can't do this."
7837
7838 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7839
7840         * class.cs (MethodData.Emit): Refactor the code so symbolic
7841         information is generated for destructors;  For some reasons we
7842         were taking a code path that did not generate symbolic information
7843         before. 
7844
7845 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7846
7847         * class.cs: Create a Constructor.CheckBase method that
7848         takes care of all validation type code. The method
7849         contains some code that was moved from Define.
7850
7851         It also includes new code that checks for duplicate ctors.
7852         This fixes bug #55148.
7853
7854 2004-03-09  Joshua Tauberer <tauberer@for.net>
7855
7856         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7857         a { ... }-style array creation invokes EmitStaticInitializers
7858         which is not good for reference-type arrays.  String, decimal
7859         and now null constants (NullCast) are not counted toward
7860         static initializers.
7861
7862 2004-03-05  Martin Baulig  <martin@ximian.com>
7863
7864         * location.cs (SourceFile.HasLineDirective): New public field;
7865         specifies whether the file contains or is referenced by a "#line"
7866         directive.
7867         (Location.DefineSymbolDocuments): Ignore source files which
7868         either contain or are referenced by a "#line" directive.        
7869
7870 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7871
7872         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7873         direct access to our parent, so check the method inline there.
7874
7875 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7876
7877         * expression.cs (Invocation.EmitCall): Miguel's last commit
7878         caused a regression. If you had:
7879
7880             T t = null;
7881             t.Foo ();
7882
7883         In Foo the implict this would be null.
7884
7885 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * expression.cs (Invocation.EmitCall): If the method is not
7888         virtual, do not emit a CallVirt to it, use Call.
7889
7890         * typemanager.cs (GetFullNameSignature): Improve the method to
7891         cope with ".ctor" and replace it with the type name.
7892
7893         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7894         as an argument the ConstructorBuilder where it is being defined,
7895         to catch the recursive constructor invocations.
7896
7897 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7898
7899         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7900         routines to check if a type is an enumerable/enumerator allow
7901         classes that implement the IEnumerable or IEnumerator interfaces.
7902
7903         * class.cs (Property, Operator): Implement IIteratorContainer, and
7904         implement SetYields.
7905
7906         (Property.Define): Do the block swapping for get_methods in the
7907         context of iterators.   We need to check if Properties also
7908         include indexers or not.
7909
7910         (Operator): Assign the Block before invoking the
7911         OperatorMethod.Define, so we can trigger the Iterator code
7912         replacement. 
7913
7914         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7915         Property and Operator classes are not created when we parse the
7916         declarator but until we have the block completed, so we use a
7917         singleton SimpleIteratorContainer.Simple to flag whether the
7918         SetYields has been invoked.
7919
7920         We propagate this setting then to the Property or the Operator to
7921         allow the `yield' to function.
7922
7923 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7924
7925         * codegen.cs: Implemented attribute support for modules.
7926         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7927         Assembly/Module functionality.
7928
7929         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7930         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7931         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7932
7933 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * interface.cs (FindMembers): The operation is performed on all base
7936         interfaces and not only on the first. It is required for future CLS Compliance patch.
7937
7938 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7939
7940         * statement.cs, codegen.cs:
7941         This patch deals with patterns such as:
7942
7943         public class List : IEnumerable {
7944
7945                 public MyEnumerator GetEnumerator () {
7946                         return new MyEnumerator(this);
7947                 }
7948
7949                 IEnumerator IEnumerable.GetEnumerator () {
7950                         ...
7951                 }
7952                 
7953                 public struct MyEnumerator : IEnumerator {
7954                         ...
7955                 }
7956         }
7957
7958         Before, there were a few things we did wrong:
7959         1) we would emit callvirt on a struct, which is illegal
7960         2) we emited ldarg when we needed to emit ldarga
7961         3) we would mistakenly call the interface methods on an enumerator
7962         type that derived from IEnumerator and was in another assembly. For example:
7963
7964         public class MyEnumerator : IEnumerator
7965
7966         Would have the interface methods called, even if there were public impls of the
7967         method. In a struct, this lead to invalid IL code.
7968
7969 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7970
7971         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7972           renamed to Emit.
7973
7974         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7975
7976 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7977
7978         * cs-parser.jay: Fix small regression: we were not testing V2
7979         compiler features correctly.
7980
7981         * interface.cs: If the emit context is null, then create one
7982
7983 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7984
7985         * decl.cs (GetSignatureForError): New virtual method to get full name
7986           for error messages.
7987
7988         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7989           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7990
7991         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7992           Duplicated members and code in these classes has been removed.
7993           Better encapsulation in these classes.
7994
7995 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7996
7997         * assign.cs (Assign.DoResolve): When dealing with compound
7998         assignments, there is a new rule in ECMA C# 2.4 (might have been
7999         there before, but it is documented here) that states that in:
8000
8001         a op= b;
8002
8003         If b is of type int, and the `op' is a shift-operator, then the
8004         above is evaluated as:
8005
8006         a = (int) a op b 
8007
8008         * expression.cs (Binary.ResolveOperator): Instead of testing for
8009         int/uint/long/ulong, try to implicitly convert to any of those
8010         types and use that in pointer arithmetic.
8011
8012         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8013         method to print information for from the type, not from the
8014         null-method we were given.
8015
8016 2004-02-01  Duncan Mak  <duncan@ximian.com>
8017
8018         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8019         parsing for cmd, fixes bug #53694.
8020
8021 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8022
8023         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8024         in the member name duplication tests. Property and operator name duplication
8025         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8026
8027 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8028
8029         * interface.cs (PopulateMethod): Fixed crash when interface method
8030         returns not existing type (error test cs0246-3.cs).
8031
8032 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8033
8034         * cs-parser.jay (interface_accessors): Re-write actions to also
8035         store attributes attached to get and set methods. Fix spelling
8036         while at it.
8037
8038         (inteface_property_declaration): Modify accordingly.
8039
8040         (InterfaceAccessorInfo): New helper class to store information to pass
8041         around between rules that use interface_accessors.
8042
8043         * interface.cs (Emit): Apply attributes on the get and set
8044         accessors of properties and indexers too.
8045
8046         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8047         right MethodBuilder when applying attributes to the get and set accessors.
8048
8049 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8050
8051         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8052
8053 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8054
8055         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8056
8057 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8058
8059         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8060         changes that treat `yield' specially when present before `break'
8061         or `return' tokens.
8062
8063         * cs-tokenizer.cs: yield is no longer a keyword.
8064
8065 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8068         setting for default constructors.
8069         For default constructors are almost every time set wrong Modifier. The
8070         generated IL code has been alright. But inside mcs this values was
8071         wrong and this was reason why several of my CLS Compliance tests
8072         failed.
8073
8074 2004-01-22  Martin Baulig  <martin@ximian.com>
8075
8076         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8077         not a QualifiedIdentifier.  This is what `type_name_expression'
8078         was previously doing.
8079         (type_name_expression): Removed; the code is now in
8080         `namespace_or_type_name'.
8081         (qualified_identifier): Removed, use `namespace_or_type_name'
8082         instead.
8083         (QualifiedIdentifier): Removed this class.      
8084
8085 2004-01-22  Martin Baulig  <martin@ximian.com>
8086
8087         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8088         not a string as alias name.
8089
8090 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8091
8092         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8093         #52730 bug, and instead compute correctly the need to use a
8094         temporary variable when requesting an address based on the
8095         static/instace modified of the field and the constructor.
8096  
8097 2004-01-21  Martin Baulig  <martin@ximian.com>
8098
8099         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8100         class and namespace before looking up aliases.  Fixes #52517.
8101
8102 2004-01-21  Martin Baulig  <martin@ximian.com>
8103
8104         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8105         assinged in a 'try'; fixes exception4.cs.
8106
8107 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8108         * class.cs : Implemented parameter-less constructor for TypeContainer
8109
8110         * decl.cs: Attributes are now stored here. New property OptAttributes
8111
8112         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8113
8114         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8115
8116 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8117
8118         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8119           (CSharpSignature): New method for indexer and property signature.
8120
8121 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8122
8123         * pending.cs (IsVirtualFilter): Faster implementation.
8124
8125 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8126
8127         * typemanager.cs: Avoid inclusion of same assembly more than once.
8128
8129 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8130
8131         * cs-parser.jay: Fixed problem where the last assembly attribute
8132           has been applied also to following declaration (class, struct, etc.)
8133           
8134 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8135
8136         * class.cs: Added error CS0538, CS0539 reporting.
8137         Fixed crash on Microsoft runtime when field type is void.
8138
8139         * cs-parser.jay: Added error CS0537 reporting.
8140
8141         * pending.cs: Added error CS0535 reporting.
8142         Improved error report for errors CS0536, CS0534.
8143
8144 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8145
8146         Merge a few bits from the Anonymous Method MCS tree.
8147
8148         * statement.cs (ToplevelBlock): New class for toplevel methods,
8149         will hold anonymous methods, lifted variables.
8150
8151         * cs-parser.jay: Create toplevel blocks for delegates and for
8152         regular blocks of code. 
8153
8154 2004-01-20  Martin Baulig  <martin@ximian.com>
8155
8156         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8157         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8158         and `NeedExplicitReturn'; added `IsLastStatement'.
8159         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8160         have a `ReturnLabel' or we're not unreachable.
8161
8162         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8163         child's reachability; don't just override ours with it.  Fixes
8164         #58058 (lluis's example).
8165         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8166         InFinally(), InLoop(), InSwitch() and
8167         BreakCrossesTryCatchBoundary() methods.
8168
8169         * statement.cs (Return): Do all error checking in Resolve().
8170         Unless we are the last statement in a top-level block, always
8171         create a return label and jump to it.
8172         (Break, Continue): Do all error checking in Resolve(); also make
8173         sure we aren't leaving a `finally'.
8174         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8175         statement in a top-level block.
8176         (Block.Flags): Added `IsDestructor'.
8177         (Block.IsDestructor): New public property.
8178
8179 2004-01-20  Martin Baulig  <martin@ximian.com>
8180
8181         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8182
8183 2004-01-20  Martin Baulig  <martin@ximian.com>
8184
8185         * statement.cs (Statement.ResolveUnreachable): New public method.
8186         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8187         (Block.Resolve): Resolve unreachable statements.
8188
8189 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8190
8191         * expression.cs: We need to fix the case where we do
8192         not have a temp variable here.
8193
8194         * assign.cs: Only expression compound assignments need
8195         temporary variables.
8196
8197 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8198
8199         * flowanalysis.cs: Reduce memory allocation in a few ways:
8200           - A block with no variables should not allocate a bit
8201             vector for itself.
8202           - A method with no out parameters does not need any tracking
8203             for assignment of the parameters, so we need not allocate
8204             any data for it.
8205           - The arrays:
8206                 public readonly Type[] VariableTypes;
8207                 public readonly string[] VariableNames;
8208             Are redundant. The data is already stored in the variable
8209             map, so we need not allocate another array for it.
8210           - We need to add alot of checks for if (params | locals) == null
8211             due to the first two changes.
8212
8213 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8214
8215         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8216         implement IMemoryLocation, we store a copy on a local variable and
8217         take the address of it.  Patch from Benjamin Jemlich
8218
8219         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8220         to use a special "type_name_expression" rule which reduces the
8221         number of "QualifiedIdentifier" classes created, and instead
8222         directly creates MemberAccess expressions.
8223
8224 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8225
8226         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8227         that fixes #52853.  Null literal assignment to ValueType
8228
8229         * class.cs (MethodData.Emit): Instead of checking the name of the
8230         method to determine if its a destructor, create a new derived
8231         class from Method called Destructor, and test for that.  
8232
8233         * cs-parser.jay: Create a Destructor object instead of a Method.  
8234
8235         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8236
8237         Fixes: 52933
8238
8239 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8240
8241         * expression.cs (Binary.ResolveOperator): Perform an implicit
8242         conversion from MethodGroups to their delegate types on the
8243         Addition operation.
8244
8245         * delegate.cs: Introduce a new class DelegateCreation that is the
8246         base class for `NewDelegate' and `ImplicitDelegateCreation',
8247         factor some code in here.
8248
8249         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8250         conversion from MethodGroups to compatible delegate types. 
8251
8252         * ecore.cs (Expression.Resolve): Do not flag error 654
8253         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8254         we allow conversions from MethodGroups to delegate types now.
8255
8256         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8257         assignments in v2 either.
8258
8259 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8260
8261         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8262         static read-only fields in ctors.
8263
8264         Applied patch from Benjamin Jemlich 
8265
8266         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8267
8268 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8269
8270         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8271         here to return true, as they can be used like this:
8272
8273                 (XXX) int.MEMBER ()
8274
8275         Fixed 49836 and all the other dups
8276
8277 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8278
8279         * driver.cs: Implement /win32res and /win32icon.
8280
8281 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8282
8283         * cs-parser.jay: Add a rule to improve error handling for the
8284         common mistake of placing modifiers after the type.
8285
8286 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8287
8288         * cs-parser.jay (interface_event_declaration): Catch
8289         initialization of events on interfaces, and report cs0068
8290
8291         * cs-parser.jay (interface_event_declaration): Catch
8292         initialization of events. 
8293
8294         * ecore.cs: Better report missing constructors.
8295
8296         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8297         the error reporting done in the wrong place.  Fix.
8298
8299         * expression.cs (Binary.ResolveOperator): Catch the 
8300         operator + (E x, E y) error earlier, and later allow for implicit
8301         conversions in operator +/- (E e, U x) from U to the underlying
8302         type of E.
8303
8304         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8305         52596, if the container class is abstract, the default constructor
8306         is protected otherwise its public (before, we were always public).
8307
8308         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8309         fixed statement.
8310
8311         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8312         Jemlich that fixes bug #52597, MCS was generating invalid code for
8313         idisposable structs.   Thanks to Ben for following up with this
8314         bug as well.
8315
8316 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8317
8318         * driver.cs: Allow assemblies without code to be generated, fixes
8319         52230.
8320
8321 2004-01-07  Nick Drochak <ndrochak@gol.com>
8322
8323         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8324
8325 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * cs-parser.jay: Add rules to improve error reporting if fields or
8328         methods are declared at the namespace level (error 116)
8329
8330         * Add rules to catch event add/remove
8331
8332 2004-01-04  David Sheldon <dave-mono@earth.li>
8333
8334   * expression.cs: Added matching ")" to error message for 
8335   CS0077
8336
8337 2004-01-03 Todd Berman <tberman@gentoo.org>
8338
8339         * ecore.cs, attribute.cs:
8340         Applying fix from #52429.
8341
8342 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8343
8344         * ecore.cs, expression.cs, statement.cs:
8345         Total rewrite of how we handle branching. We
8346         now handle complex boolean expressions with fewer
8347         jumps. As well if (x == 0) no longer emits a ceq.
8348
8349         if (x is Foo) is much faster now, because we generate
8350         better code.
8351
8352         Overall, we get a pretty big improvement on our benchmark
8353         tests. The code we generate is smaller and more readable.
8354
8355         I did a full two-stage bootstrap. The patch was reviewed
8356         by Martin and Miguel.
8357
8358 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8359
8360         * cs-parser.jay: Make primary_expression not take a QI.
8361         we dont need this because the member_access rule covers
8362         us here. So we replace the rule with just IDENTIFIER.
8363
8364         This has two good effects. First, we remove a s/r conflict.
8365         Second, we allocate many fewer QualifiedIdentifier objects.
8366
8367 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8368
8369         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8370         set the correct information via SRE. This prevents
8371         hanging on the MS runtime. Fixes #29374.
8372
8373 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8374
8375         * convert.cs: correctly handle conversions to value types
8376         from Enum and ValueType as unboxing conversions.
8377
8378         Fixes bug #52569. Patch by Benjamin Jemlich.
8379
8380 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8381
8382         * expression.cs (BetterConversion): Prefer int -> uint
8383         over int -> ulong (csc's behaviour). This fixed bug #52046.
8384
8385 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8386
8387         * decl.cs (MemberCache.FindMembers): now returns a
8388         MemberInfo [].
8389
8390         * typemanager.cs: In general, go with with ^^.
8391         (CopyNewMethods): take an IList.
8392         (RealMemberLookup): Only allocate an arraylist
8393         if we copy from two sets of methods.
8394
8395         This change basically does two things:
8396         1) Fewer array lists allocated due to CopyNewMethods.
8397         2) the explicit cast in MemberList costed ALOT.
8398
8399 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8400
8401         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8402         a hashtable to avoid needless string allocations when an identifier is
8403         used more than once (the common case).
8404
8405 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8406
8407         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8408         is broken, it will not return anything. So, we
8409         have to use the information we have in mcs to
8410         do the task.
8411
8412         * typemanager.cs: Add a cache for GetInterfaces,
8413         since this will now be used more often (due to ^^)
8414
8415         (GetExplicitInterfaces) New method that gets the
8416         declared, not effective, interfaces on a type
8417         builder (eg, if you have interface IFoo, interface
8418         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8419         { IBar }.
8420
8421         This patch makes MCS able to bootstrap itself on
8422         Windows again.
8423
8424 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8425
8426         * expression.cs: Remove the Nop's that Miguel put
8427         in by mistake.
8428
8429 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8430
8431         * report.cs, codegen.cs: Give the real stack trace to
8432         the error when an exception is thrown.
8433
8434 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8435
8436         * decl.cs: only allocate hashtables for ifaces if 
8437         it is an iface!
8438
8439 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8440
8441         * expression.cs: fix the error from cs0121-2.cs
8442         (a parent interface has two child interfaces that
8443         have a function with the same name and 0 params
8444         and the function is called through the parent).
8445
8446 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8447
8448         * class.cs, rootcontext.cs, typmanager.cs: do not
8449         leak pointers.
8450
8451 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8452
8453         * codegen.cs: remove stack for the ec flow branching.
8454         It is already a linked list, so no need.
8455
8456 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8457
8458         * Makefile: Allow custom profiler here.
8459
8460 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8461
8462         * typemanager.cs (LookupType):
8463           - Use a static char [], because split takes
8464             a param array for args, so it was allocating
8465             every time.
8466           - Do not store true in a hashtable, it boxes.
8467
8468 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8469
8470         * flowanalysis.cs: bytify common enums.
8471
8472 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8473
8474         * modifiers.cs: Add a new set of flags for the
8475         flags allowed on explicit interface impls.
8476         * cs-parser.jay: catch the use of modifiers in
8477         interfaces correctly.
8478         * class.cs: catch private void IFoo.Blah ().
8479
8480         All related to bug #50572.
8481
8482 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8483
8484         * decl.cs: Rewrite the consistant accessability checking.
8485         Accessability is not linear, it must be implemented in
8486         a tableish way. Fixes #49704.
8487
8488 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8489
8490         * expression.cs: Handle negation in a checked context.
8491         We must use subtraction from zero. Fixes #38674.
8492
8493 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8494
8495         * class.cs: Ignore static void main in DLLs.
8496         * rootcontext.cs: Handle the target type here,
8497         since we are have to access it from class.cs
8498         * driver.cs: account for the above.
8499
8500 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8501
8502         * report.cs: Give line numbers and files if available.
8503
8504 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8505
8506         * driver.cs: Implement /addmodule.
8507
8508         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8509         ModuleBuilders.
8510
8511 2003-12-20  Martin Baulig  <martin@ximian.com>
8512
8513         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8514         (FieldBase.IsAssigned): Removed this field.
8515         (FieldBase.SetAssigned): New public method.
8516         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8517
8518 2003-12-20  Martin Baulig  <martin@ximian.com>
8519
8520         * expression.cs (LocalVariableReference.DoResolve): Don't set
8521         `vi.Used' if we're called from DoResolveLValue().
8522
8523         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8524         returns the usage vector it just merged into the current one -
8525         pass this one to UsageWarning().
8526         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8527         of the `EmitContext', don't call this recursively on our children.
8528
8529 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8530
8531         * driver.cs: Implement /target:module.
8532
8533 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8534
8535         * support.cs (CharArrayHashtable): New helper class.
8536
8537         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8538         char arrays, not strings, so we can avoid creating a string in
8539         consume_identifier if the identifier is a keyword.
8540
8541 2003-12-16  Martin Baulig  <martin@ximian.com>
8542
8543         * statement.cs (LocalInfo.Assigned): Removed this property.
8544         (LocalInfo.Flags): Removed `Assigned'.
8545         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8546         and uses flow analysis.
8547         (Block.UsageWarning): Made this method private.
8548         (Block.Resolve): Call UsageWarning() if appropriate.
8549
8550         * expression.cs (LocalVariableReference.DoResolve): Always set
8551         LocalInfo.Used here.
8552
8553 2003-12-13  Martin Baulig  <martin@ximian.com>
8554
8555         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8556         any value here; we're now using flow analysis to figure out
8557         whether a statement/block returns a value.
8558
8559 2003-12-13  Martin Baulig  <martin@ximian.com>
8560
8561         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8562         working again.
8563         (FlowBranching.MergeFinally): Don't call
8564         `branching.CheckOutParameters()' here, this is called in
8565         MergeTopBlock().
8566         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8567         when adding the `finally' vector.       
8568
8569 2003-12-13  Martin Baulig  <martin@ximian.com>
8570
8571         * flowanalysis.cs
8572         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8573         actually work and also fix #48962.
8574
8575 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8576
8577         * decl.cs: Do not check System.Object for nested types,
8578         since we know it does not have any. Big bang for buck:
8579
8580         BEFORE:
8581            Run 1:   8.35 seconds
8582            Run 2:   8.32 seconds
8583            corlib:  17.99 seconds
8584         AFTER:
8585            Run 1:   8.17 seconds
8586            Run 2:   8.17 seconds
8587            corlib:  17.39 seconds
8588
8589 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8590
8591         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8592         time we are returning 0 members, so we save alot here.
8593
8594 2003-12-11  Martin Baulig  <martin@ximian.com>
8595
8596         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8597         `MergeChild()', also just take the `FlowBranching' as argument;
8598         call Merge() on it and return the result.
8599         (FlowBranching.Merge): We don't need to do anything if we just
8600         have one sibling.
8601
8602 2003-12-11  Martin Baulig  <martin@ximian.com>
8603
8604         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8605         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8606         Maurer for this idea.
8607
8608 2003-12-11  Martin Baulig  <martin@ximian.com>
8609
8610         * flowanalysis.cs (MergeResult): This class is now gone; we now
8611         use the `UsageVector' for this.  The reason for this is that if a
8612         branching just has one sibling, we don't need to "merge" them at
8613         all - that's the next step to do.
8614         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8615         `MergeResult'.
8616
8617 2003-12-11  Martin Baulig  <martin@ximian.com>
8618
8619         Reworked flow analyis and made it more precise and bug-free.  The
8620         most important change is that we're now using a special `Reachability'
8621         class instead of having "magic" meanings of `FlowReturns'.  I'll
8622         do some more cleanups and optimizations and also add some more
8623         documentation this week.
8624
8625         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8626         largely reworked this class.
8627         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8628         the new `Reachability' class instead of having "magic" values here.
8629         (FlowBranching): We're now using an instance of `Reachability'
8630         instead of having separate `Returns', `Breaks' etc. fields.
8631
8632         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8633         based on flow analysis; ignore the return value of block.Emit ().
8634
8635 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8636
8637         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8638         if they are private.
8639
8640 2003-12-09  Martin Baulig  <martin@ximian.com>
8641
8642         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8643         call them directly on the UsageVector.
8644
8645 2003-12-09  Martin Baulig  <martin@ximian.com>
8646
8647         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8648         Changed return type from `FlowReturns' to `Reachability'.
8649
8650 2003-12-09  Martin Baulig  <martin@ximian.com>
8651
8652         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8653         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8654         `Reachable' fields with a single `Reachability' one.
8655
8656 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8657
8658         * class.cs (FindMembers): Remove foreach's.
8659
8660         Bootstrap times:
8661
8662         BEFORE
8663                 Run 1:   8.74 seconds
8664                 Run 2:   8.71 seconds
8665
8666         AFTER
8667                 Run 1:   8.64 seconds
8668                 Run 2:   8.58 seconds
8669
8670
8671 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8672
8673         * cs-parser.jay:
8674         * gen-treedump.cs:
8675         * statement.cs:
8676         This patch does a few things:
8677                 1. EmptyStatement is now a singleton, so it is never reallocated.
8678                 2. All blah is EmptyStatement constructs have been changed to
8679                    blah == EmptyStatement.Value, which is much faster and valid
8680                    now that EmptyStatement is a singleton.
8681                 3. When resolving a block, rather than allocating a new array for
8682                    the non-empty statements, empty statements are replaced with
8683                    EmptyStatement.Value
8684                 4. Some recursive functions have been made non-recursive.
8685         Mainly the performance impact is from (3), however (1) and (2) are needed for
8686         this to work. (4) does not make a big difference in normal situations, however
8687         it makes the profile look saner.
8688
8689         Bootstrap times:
8690
8691         BEFORE
8692         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8693         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8694         Total memory allocated: 56397 KB
8695
8696         AFTER
8697         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8698         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8699         Total memory allocated: 55666 KB
8700
8701 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8702
8703         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8704         than the hashtable in a hashtable version
8705
8706         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8707         we always end up concating a string. This results in a huge perf
8708         loss, because many strings have to be tracked by the GC. In this
8709         patch, we first use a hashtable that works with two keys, so that
8710         the strings do not need to be concat'ed.
8711
8712         Bootstrap times:
8713         BEFORE
8714                 Run 1:   8.74 seconds
8715                 Run 2:   8.71 seconds
8716
8717         AFTER
8718                 Run 1:   8.65 seconds
8719                 Run 2:   8.56 seconds
8720
8721 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8722
8723         * Makefile: Add a new target `do-time' that does a quick and simple
8724         profile, leaving easy to parse output.
8725
8726 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8727
8728         * codegen.cs (Init): Create the dynamic assembly with 
8729         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8730
8731 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8732
8733         * support.cs: Make the PtrHashtable use only one
8734         instance of its comparer.
8735
8736 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8737
8738         * typemanager.cs: Fix lookup of GetNamespaces.
8739
8740 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8741
8742         * expression.cs: Removed redundant line.
8743
8744         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8745         ArrayLists, use for loops with bounds.  
8746
8747         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8748         arraylist.
8749
8750         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8751         arraylists, use for loop with bounds.
8752
8753         The above three changes give us a 0.071 second performance
8754         improvement out of 3.294 seconds down to 3.223.  On my machine
8755         the above changes reduced the memory usage by 1,387 KB during
8756         compiler bootstrap.
8757
8758         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8759         QualifiedIdentifiers.  Before we created a new string through
8760         concatenation, and mostly later on, the result would be
8761         manipulated by DecomposeQI through string manipulation.
8762
8763         This reduced the compiler memory usage for bootstrapping from
8764         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8765         compile times in 0.05 seconds.
8766
8767 2003-11-28  Dick Porter  <dick@ximian.com>
8768
8769         * support.cs: Do string compares with the Invariant culture.
8770
8771         * rootcontext.cs: 
8772         * gen-treedump.cs: 
8773         * expression.cs: 
8774         * driver.cs: 
8775         * decl.cs: 
8776         * codegen.cs: 
8777         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8778         the comparison is done with the Invariant culture.
8779
8780 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8781
8782         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8783         GetEnumerator method.
8784
8785         (ProbeCollectionType): Iterate starting at the most specific type
8786         upwards looking for a GetEnumerator
8787
8788         * expression.cs: Shift count can be up to 31 for int/uint and 63
8789         for long/ulong.
8790
8791 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8792
8793         * statement.cs (Block.LookupLabel): Also look for the label on the
8794         children blocks.  Use a hash table to keep track of visited
8795         nodes. 
8796
8797         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8798         we actually did transform the other operand, otherwise fall back
8799         to the common codepath that casts to long.
8800
8801         * cs-tokenizer.cs: Use the same code pattern as the int case.
8802         Maybe I should do the parsing myself, and avoid depending on the
8803         Parse routines to get this done.
8804
8805 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8806
8807         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8808         which fixes bug 51347.  This time test it.
8809
8810         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8811         attributes for example can not tell the difference between these.
8812         The difference was only a syntax feature of the language. 
8813
8814         * attribute.cs: Apply attributes to delegates.
8815
8816         * delegate.cs: Call the apply attributes method.
8817
8818 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8819
8820         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8821         comparing 0 vs Byte.MinValue, not the value
8822
8823         (ImplicitConversionRequired): When reporting a conversion error,
8824         use error 31 to print out the constant error instead of the
8825         simpler 29.
8826
8827         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8828         which fixes bug 51347.
8829
8830 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8831
8832         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8833         which fixes the -warnaserror command line option.
8834
8835 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8836
8837         * cfold.cs (DoNumericPromotions): During constant folding of
8838         additions on UIntConstant, special case intconstants with
8839         IntConstants like we do on the expression binary operator. 
8840
8841 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8842
8843         * convert.cs (ImplicitReferenceConversion): We were missing a case
8844         (System.Enum are not value types or class types, so we need to
8845         classify them separatedly).
8846
8847         * driver.cs: We do not support error 2007.
8848
8849 2003-11-12 Jackson Harper <jackson@ximian.com>
8850
8851         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8852         system directory. Also use the full file name so users can
8853         libraries names mscorlib-o-tron.dll in a non system dir.
8854
8855 2003-11-10  Martin Baulig  <martin@ximian.com>
8856
8857         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8858         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8859         calling `ResolveType()' on them, directly assign their `Type'.
8860
8861 2003-11-08  Martin Baulig  <martin@ximian.com>
8862
8863         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8864         return value and the `out parent' parameter.
8865         (TypeContainer.DefineType): Moved the CS0644 check into
8866         GetClassBases().  Don't pass the interface types to the
8867         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8868         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8869
8870         * ecore.cs (TypeExpr.IsAttribute): New property.
8871         (TypeExpr.GetInterfaces): New method.
8872
8873         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8874         TypeExpr instead of a Type.
8875         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8876         (Interface.DefineType): Don't pass the interface types to the
8877         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8878         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8879
8880         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8881         instead of a `Type[]'.
8882         (TypeManager.RegisterBuilder): Likewise.
8883         (TypeManager.AddUserInterface): Likewise.
8884         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8885         `Type[]' and also return a `TypeExpr[]'.
8886         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8887
8888 2003-11-08  Martin Baulig  <martin@ximian.com>
8889
8890         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8891         Expression.     
8892
8893 2003-11-08  Martin Baulig  <martin@ximian.com>
8894
8895         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8896         TypeManager.ResolveExpressionTypes().
8897
8898         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8899         instead of an Expression.
8900         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8901         (TypeExpression): New public class; formerly known as `TypeExpr'.
8902
8903         * expression.cs (ComposedCast): Derive from TypeExpr.
8904
8905         * typemanager.cs (TypeManager.system_*_expr): These are now
8906         TypExpr's instead of Expression's.
8907         (TypeManager.ResolveExpressionTypes): New public static function;
8908         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8909         of them.        
8910
8911 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8912
8913         * expression.cs (New.DoResolve): Do not dereference value that
8914         might be a null return.
8915
8916         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8917         sure that the constant value has the right type.  Fixes an
8918         unreported bug, similar to 50425.
8919
8920         * const.cs (Const.LookupConstantValue): Call
8921         ImplicitStandardConversionExists before doing a conversion to
8922         avoid havng the TypeManager.ChangeType do conversions.
8923
8924         Reduced the number of casts used
8925
8926         (Const.ChangeType): New routine to enable reuse of the constant
8927         type changing code from statement.
8928
8929         * typemanager.cs (ChangeType): Move common initialization to
8930         static global variables.
8931
8932         Fixes #50425.
8933
8934         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8935         every value type to go through, even if it was void.  Fix that. 
8936
8937         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8938         character of the define, and the is_identifier_part_character for
8939         the rest of the string.
8940
8941 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8942
8943         * expression.cs (UnaryMutator.EmitCode): When I updated
8944         LocalVariableReference.DoResolve, I overdid it, and dropped an
8945         optimization done on local variable references.
8946
8947 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8948
8949         * ecore.cs: Convert the return from Ldlen into an int.
8950
8951 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8952
8953         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8954         the accessibility, this is a special case for toplevel non-public
8955         classes (internal for instance).
8956
8957 2003-10-20  Nick Drochak <ndrochak@gol.com>
8958
8959         * ecore.cs: Fix typo and build.  Needed another right paren.
8960
8961 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8962
8963         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8964         `internal' case regular and protected, but not allowing protected
8965         to be evaluated later.  Bug 49840
8966
8967 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8968
8969         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8970         to kb.Nlast, and not the kb.nFirst to isolate the switch
8971         statement.
8972
8973         Extract the underlying type, so enumerations of long/ulong are
8974         treated like long/ulong.
8975
8976 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8977
8978         * expression.cs (New): Overload the meaning of RequestedType to
8979         track the possible creation of the NewDelegate type, since
8980         DoResolve is invoked more than once for new constructors on field
8981         initialization.
8982
8983         See bugs: #48800 and #37014
8984
8985         * cs-parser.jay (declare_local_constants): Take an arraylist
8986         instead of a single constant.
8987
8988         (local_constant_declaration): It should take a
8989         constant_declarators, not a constant_declarator.  Fixes 49487
8990
8991         * convert.cs: Fix error report.
8992
8993 2003-10-13 Jackson Harper <jackson@ximian.com>
8994
8995         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8996         bug #49611
8997
8998 2003-10-09  Martin Baulig  <martin@ximian.com>
8999
9000         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9001         to the .ctor.
9002         (MethodCore.DoDefineParameters): Removed the TypeContainer
9003         argument; use the DeclSpace which was passed to the .ctor instead.
9004         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9005         TypeContainer; we only need a DeclSpace here.
9006
9007 2003-10-09  Martin Baulig  <martin@ximian.com>
9008
9009         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9010         to the .ctor.
9011         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9012         EmitContext's .ctor.    
9013
9014 2003-10-09  Martin Baulig  <martin@ximian.com>
9015
9016         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9017         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9018         AsAccessible(), moved them as well.
9019
9020         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9021
9022 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9023
9024         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9025
9026 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9027
9028         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9029         generation for >=, as spotted by Paolo, bug 48679.  
9030         Patch from David Waite.
9031
9032         * cs-tokenizer.cs: Add handling for #pragma.
9033
9034         * cs-parser.jay: Allow for both yield and yield return in the
9035         syntax.  The anti-cobolization of C# fight will go on!
9036
9037         * class.cs (TypeBuilder.DefineType): Catch error condition here
9038         (Parent.DefineType erroring out and returning null).
9039
9040         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9041         coping with enumerations variables, we were mistakenly processing
9042         them as a regular value type instead of built-in types.  Fixes the
9043         bug #48063
9044
9045         * typemanager.cs (IsBuiltinOrEnum): New method.
9046
9047 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9048
9049         * cs-parser.jay: Upgrade: yield now needs the return clause.
9050
9051 2003-09-19  Martin Baulig  <martin@ximian.com>
9052
9053         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9054         `MemberCache parent' argument.  Normally, an interface doesn't
9055         have a parent type except System.Object, but we use this in gmcs
9056         for generic type parameters.
9057
9058 2003-09-18  Martin Baulig  <martin@ximian.com>
9059
9060         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9061         on `type.IsInterface'; don't check whether the type has a parent
9062         to determine whether it's an interface.
9063
9064 2003-09-15  Martin Baulig  <martin@ximian.com>
9065
9066         * class.cs (TypeContainer.DefineType): Added an error flag to
9067         avoid reporting duplicate CS0146's ("class definition is
9068         circular.").
9069
9070         * driver.cs (Driver.MainDriver): Abort if
9071         RootContext.ResolveTree() reported any errors.
9072
9073 2003-09-07  Martin Baulig  <martin@ximian.com>
9074
9075         * report.cs (Error, Warning): Added overloaded versions which take
9076         a `params object[] args' and call String.Format().
9077
9078 2003-09-07  Martin Baulig  <martin@ximian.com>
9079
9080         * decl.cs (DeclSpace..ctor): Don't call
9081         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9082         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9083         (DeclSpace.RecordDecl): New method.
9084
9085         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9086
9087 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9088
9089         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9090         value attributes to be applied to ParameterBuilders.
9091
9092         * class.cs (MethodCore.LabelParameters): Make static and more
9093         generic so that it can be used from other places - like interface
9094         methods, for instance.
9095
9096         * interface.cs (Interface.Emit): Call LabelParameters before
9097         emitting attributes on the InterfaceMethod.
9098
9099 2003-08-26  Martin Baulig  <martin@ximian.com>
9100
9101         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9102         resolving aliases; fixes #47927.
9103
9104 2003-08-26  Martin Baulig  <martin@ximian.com>
9105
9106         * statement.cs (Using.DoResolve): This is internally emitting a
9107         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9108         do not always return.  Fixes #47681.
9109
9110 2003-08-26  Martin Baulig  <martin@ximian.com>
9111
9112         * decl.cs (MemberCore): Moved WarningNotHiding(),
9113         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9114         into MemberBase.
9115         (AdditionResult): Make this nested in DeclSpace.
9116         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9117         argument; call NamespaceEntry.Define() unless we're nested in a
9118         class or struct.
9119
9120         * namespace.cs (Namespace.DefineName): New public function.  This
9121         is called from DeclSpace's .ctor to add 
9122         (Namespace.Lookup): Include DeclSpaces in the lookup.
9123
9124         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9125
9126         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9127
9128 2003-08-25  Martin Baulig  <martin@ximian.com>
9129
9130         * convert.cs (Convert.ExplicitReferenceConversion): When
9131         converting from an interface type to a class, unbox if the target
9132         type is a struct type.  Fixes #47822.
9133
9134 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9135
9136         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9137         #47854.
9138
9139 2003-08-22  Martin Baulig  <martin@ximian.com>
9140
9141         * class.cs (TypeManager.DefineType): When defining a nested type,
9142         call DefineType() on our parent; fixes #47801.
9143
9144 2003-08-22  Martin Baulig  <martin@ximian.com>
9145
9146         * class.cs (MethodData.Define): While checking if a method is an
9147         interface implementation, improve the test a bit more to fix #47654.
9148
9149 2003-08-22  Martin Baulig  <martin@ximian.com>
9150
9151         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9152         correctly; fixes #47722.
9153
9154 2003-08-22  Martin Baulig  <martin@ximian.com>
9155
9156         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9157         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9158
9159         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9160
9161 2003-08-22  Martin Baulig  <martin@ximian.com>
9162
9163         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9164         can only be assigned in static constructors.  Fixes #47161.
9165
9166 2003-08-22  Martin Baulig  <martin@ximian.com>
9167
9168         Rewrote and improved the flow analysis code.
9169
9170         * flowbranching.cs (FlowBranching): Make this class abstract.
9171         (FlowBranching.CreateBranching): New static function to create a
9172         new flow branching.
9173         (FlowBranchingBlock, FlowBranchingException): New classes.
9174         (FlowBranching.UsageVector.Type): New public readonly field.
9175         (FlowBranching.UsageVector.Breaks): Removed the setter.
9176         (FlowBranching.UsageVector.Returns): Removed the setter.
9177         (FlowBranching.UsageVector): Added Break(), Return(),
9178         NeverReachable() and Throw() methods to modify the reachability.
9179         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9180         done by FlowBranching.Merge().
9181         (FlowBranching.UsageVector.MergeChild): New method; merges the
9182         merge result into the current vector.
9183         (FlowBranching.Merge): New abstract method to merge a branching.
9184
9185 2003-08-12  Martin Baulig  <martin@ximian.com>
9186
9187         * expression.cs (Indirection.CacheTemporaries): Create the
9188         LocalTemporary with the pointer type, not its element type.
9189
9190 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9191
9192         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9193         token was a keyword or not.
9194
9195         Add `error' options where an IDENTIFIER was expected;  Provide
9196         CheckToken and CheckIdentifierToken convenience error reporting
9197         functions. 
9198
9199         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9200
9201         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9202         NameSpaceEntry NameSpaceEntry.
9203
9204         (LookupInterfaceOrClass): Avoid creating a full qualified name
9205         from namespace and name: avoid doing lookups when we know the
9206         namespace is non-existant.   Use new Tree.LookupByNamespace which
9207         looks up DeclSpaces based on their namespace, name pair.
9208
9209         * driver.cs: Provide a new `parser verbose' to display the
9210         exception thrown during parsing.  This is turned off by default
9211         now, so the output of a failure from mcs is more graceful.
9212
9213         * namespace.cs: Track all the namespaces defined in a hashtable
9214         for quick lookup.
9215
9216         (IsNamespace): New method
9217
9218 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9221         we know that we need to concatenate (full typename can never be
9222         null). 
9223
9224         * class.cs: ditto.
9225
9226         * statement.cs: Use a bitfield;  Do not initialize to null things
9227         which are done by the constructor by default.
9228
9229         * cs-parser.jay: bug fix, parameter was 4, not 3.
9230
9231         * expression.cs: Just use the property;
9232
9233         * statement.cs: No need for GetVariableInfo method.
9234
9235 2003-08-08  Martin Baulig  <martin@ximian.com>
9236
9237         * flowanalysis.cs (FlowReturns): This is now nested in the
9238         `FlowBranching' class.
9239         (MyBitVector): Moved this here from statement.cs.
9240         (FlowBranching.SiblingType): New enum type.
9241         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9242
9243 2003-08-07  Martin Baulig  <martin@ximian.com>
9244
9245         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9246         `FlowBranching' class and called `BranchingType'.
9247
9248 2003-08-07  Martin Baulig  <martin@ximian.com>
9249
9250         * flowanalysis.cs: Moved all the control flow analysis code into
9251         its own file.
9252
9253 2003-08-07  Martin Baulig  <martin@ximian.com>
9254
9255         * assign.cs (Assign.DoResolve): `target' must either be an
9256         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9257         #37319.
9258
9259 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9260
9261         * expression.cs (BinaryMethod): This kind of expression is created by the
9262         Binary class if it determines that the operator has to be handled
9263         by a method.
9264
9265         (BinaryDelegate): This kind of expression is created if we are
9266         dealing with a + or - operator on delegates.
9267
9268         (Binary): remove method, argumetns, and DelegateOperator: when
9269         dealing with methods, 
9270
9271         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9272
9273         * statement.cs (Block): use bitfields for the three extra booleans
9274         we had in use.   Remove unused topblock parameter.
9275
9276         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9277
9278         * assign.cs: Drop extra unneeded tests.
9279
9280 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9281
9282         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9283
9284         * statement.cs (Foreach): Use VariableStorage instead of
9285         LocalBuilders.   
9286
9287         * codegen.cs (VariableStorage): New class used by clients that
9288         require a variable stored: locals or fields for variables that
9289         need to live across yield.
9290
9291         Maybe provide a convenience api for EmitThis+EmitLoad?
9292
9293         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9294         these bad boys.
9295
9296 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9297
9298         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9299         RemapParameterLValue): New methods that are used to turn a
9300         precomputed FieldInfo into an expression like this:
9301
9302                 instance.FieldInfo
9303
9304         The idea is to use this instead of making LocalVariableReference
9305         have more than one meaning.
9306
9307         * cs-parser.jay: Add error production to BASE.
9308
9309         * ecore.cs: Deal with TypeManager.GetField returning null, which
9310         is now a valid return value.
9311
9312         (FieldExprNoAddress): New expression for Fields whose address can
9313         not be taken.
9314
9315         * expression.cs (LocalVariableReference): During the resolve
9316         phases, create new expressions if we are in a remapping context.
9317         Remove code that dealt with remapping here.
9318
9319         (ParameterReference): same.
9320
9321         (ProxyInstance): New expression, like the `This' expression, but
9322         it is born fully resolved.  We know what we are doing, so remove
9323         the errors that are targeted to user-provided uses of `this'.
9324
9325         * statement.cs (Foreach): our variable is now stored as an
9326         Expression;  During resolution, follow the protocol, dont just
9327         assume it will return this.
9328
9329 2003-08-06  Martin Baulig  <martin@ximian.com>
9330
9331         * support.cs (SeekableStreamReader.cs): New public class.
9332
9333         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9334         SeekableStreamReader instead of the normal StreamReader.
9335
9336 2003-08-04  Martin Baulig  <martin@ximian.com>
9337
9338         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9339         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9340         deambiguate casts and delegate invocations.
9341         (parenthesized_expression): Use the new tokens to ensure this is
9342         not a cast of method invocation.
9343
9344         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9345         when reading a `)' and Deambiguate_CloseParens () was previously
9346         called.
9347
9348         * expression.cs (ParenthesizedExpression): New class.  This is
9349         just used for the CS0075 test.
9350         (Binary.DoResolve): Check for CS0075.   
9351
9352 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9353
9354         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9355         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9356         reference comparison.
9357
9358         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9359         examine the ReturnType for equality - this is necessary in the
9360         cases of implicit and explicit operators whose signature also
9361         includes the return type.
9362
9363 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * namespace.cs: Cache the result of the namespace computation,
9366         instead of computing it every time.
9367
9368 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * decl.cs: Use a global arraylist that we reuse over invocations
9371         to avoid excesive memory consumption.  Reduces memory usage on an
9372         mcs compile by one meg (45 average).
9373
9374         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9375         private, work around that.
9376
9377 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9378
9379         * literal.cs (IntLiteral): Define Zero and One static literals. 
9380
9381         * cs-parser.jay (integer_literal): use static literals to reduce
9382         memory usage for the most used literals (0, 1 and -1).  211kb
9383         reduced in memory usage.
9384
9385         Replace all calls to `new ArrayList' with `new
9386         ArrayList(4)' which is a good average number for most allocations,
9387         and also requires only 16 bytes of memory for its buffer by
9388         default. 
9389
9390         This reduced MCS memory usage in seven megabytes for the RSS after
9391         bootstrapping.
9392
9393 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9394
9395         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9396         handle params methods the correct way by forming only one
9397         applicable set with params and normal methods in them. Earlier we
9398         were looking at params methods only if we found no normal methods
9399         which was not the correct thing to do.
9400
9401         (Invocation.BetterFunction): Take separate arguments indicating
9402         when candidate and the best method are params methods in their
9403         expanded form.
9404
9405         This fixes bugs #43367 and #46199.
9406
9407         * attribute.cs: Documentation updates.
9408
9409         (CheckAttribute): Rename to CheckAttributeTarget.
9410         (GetValidPlaces): Rename to GetValidTargets.
9411
9412         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9413         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9414
9415         Fixes bug #44468.
9416
9417 2003-07-28  Martin Baulig  <martin@ximian.com>
9418
9419         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9420         name when looking up the base class of a nested class.  Fixes #46977.
9421
9422 2003-07-26  Martin Baulig  <martin@ximian.com>
9423
9424         * expression.cs (Indexers.Indexer): New nested struct; contains
9425         getter, setter and the indexer's type.
9426         (Indexers.Properties): This is now an ArrayList of
9427         Indexers.Indexer's.
9428         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9429         indexer doesn't have any getters.
9430
9431         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9432         for embedded property and indexer assignments.
9433
9434 2003-07-26  Martin Baulig  <martin@ximian.com>
9435
9436         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9437         preprocessor directive is not the first non-whitespace character
9438         on a line.
9439
9440 2003-07-26  Martin Baulig  <martin@ximian.com>
9441
9442         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9443         namespace parsing, follow the spec more closely.
9444
9445         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9446         NamespaceEntry.Lookup().
9447
9448 2003-07-25  Martin Baulig  <martin@ximian.com>
9449
9450         * MethodCore.cs (OverridesSomething): New public field; it's set
9451         from TypeContainer.DefineMembers if this method overrides
9452         something (which doesn't need to be a method).  Fix #39462.
9453
9454 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9455
9456         * typemanager.cs (GetMembers): Ensure that the list of members is
9457         reversed. This keeps things in sync.
9458
9459         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9460         find an AttributeUsage attribute.
9461
9462         * expression.cs (Invocation.OverloadResolve): Perform the check
9463         which disallows Invoke to be directly called on a Delegate.
9464
9465         (Error_InvokeOnDelegate): Report error cs1533.
9466
9467 2003-07-25  Martin Baulig  <martin@ximian.com>
9468
9469         * expression.cs (Indexers.GetIndexersForType): Only look in the
9470         interface hierarchy if the requested type is already an
9471         interface.  Fixes #46788 while keeping #46502 fixed.
9472
9473 2003-07-25  Martin Baulig  <martin@ximian.com>
9474
9475         * class.cs (TypeContainer.DefineMembers): Check whether all
9476         readonly fields have been assigned and report warning CS0649 if
9477         not.
9478
9479         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9480         a valuetype.
9481
9482 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9483
9484         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9485         returned from GetMethods to make things consistent with the
9486         assumptions MCS makes about ordering of methods.
9487
9488         This should comprehensively fix bug #45127 and it does :-)
9489
9490         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9491         ordering is actually reverse.
9492
9493         * Clean up some debug messages I left lying around.
9494
9495         * interface.cs (Populate*): Get rid of code which emits attributes
9496         since the stage in which we emit attributes is the 'Emit' stage,
9497         not the define stage.
9498
9499         (Emit): Move attribute emission for interface members here.
9500
9501 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9502
9503         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9504         closely: we eliminate methods in base types when we have an
9505         applicable method in a top-level type.
9506
9507         Please see section 14.5.5.1 for an exact description of what goes
9508         on. 
9509
9510         This fixes bug #45127 and a host of other related to corlib compilation.
9511
9512         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9513         array is the method corresponding to the top-level type (this is
9514         because of the changes made to icall.c) so we change this
9515         accordingly.
9516
9517         (MethodGroupExpr.Name): This too.
9518
9519         * typemanager.cs (GetElementType): New method which does the right
9520         thing when compiling corlib. 
9521
9522         * everywhere: Make use of the above in the relevant places.
9523
9524 2003-07-22  Martin Baulig  <martin@ximian.com>
9525
9526         * cs-parser.jay (invocation_expression): Moved
9527         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9528         `cast_expression', but create a InvocationOrCast which later
9529         resolves to either an Invocation or a Cast.
9530
9531         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9532         method; call this before EmitStatement() to make sure that this
9533         expression can be used as a statement.
9534
9535         * expression.cs (InvocationOrCast): New class; resolves to either
9536         an Invocation or a Cast.
9537
9538         * statement.cs (StatementExpression): Call ResolveStatement() on
9539         the ExpressionStatement before emitting it.
9540
9541 2003-07-21  Martin Baulig  <martin@ximian.com>
9542
9543         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9544         `ref' and `out' attributes match; fixes #46220.
9545         (MemberAccess.ResolveMemberAccess): You can't reference a type
9546         through an expression; fixes #33180.
9547         (Indexers.GetIndexersForType): Don't return the indexers from
9548         interfaces the class implements; fixes #46502.
9549
9550 2003-07-21  Martin Baulig  <martin@ximian.com>
9551
9552         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9553         CS0661 checks; fixes bug #30442.
9554
9555 2003-07-21  Martin Baulig  <martin@ximian.com>
9556
9557         * decl.cs (AdditionResult): Added `Error'.
9558
9559         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9560
9561         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9562         makes cs0031.cs actually work.
9563
9564 2003-07-20  Martin Baulig  <martin@ximian.com>
9565
9566         * namespace.cs: Fixed that bug which caused a crash when compiling
9567         the debugger's GUI.
9568
9569 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9570
9571         * typemanager.cs (LookupTypeReflection): Never expose types which
9572         are NotPublic, NestedPrivate, NestedAssembly, or
9573         NestedFamANDAssem.  We used to return these, and later do a check
9574         that would report a meaningful error, but the problem is that we
9575         would not get the real match, if there was a name override.
9576
9577 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9578
9579         * namespace.cs (Namespace, Name): Do not compute the namespace
9580         name dynamically, compute it in the constructor.  This reduced
9581         memory usage by 1697 KB.
9582
9583         * driver.cs: Use --pause to pause at the end.
9584
9585 2003-07-17  Peter Williams  <peter@newton.cx>
9586
9587         * Makefile: Change the name of the test target so that it doesn't
9588         conflict with the recursive test target.
9589
9590 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9591
9592         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9593         AddressOf): Do not use EmitThis, that was wrong, use the actual
9594         this pointer.
9595
9596 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9597
9598         * class.cs (MethodData.Define): While checking if a method is an
9599         interface implementation, improve the test: If we are not public
9600         (use new test here: use the computed MethodAttributes directly,
9601         instead of the parsed modifier flags) check if the `implementing'
9602         method comes from an interface or not.
9603
9604         * pending.cs (VerifyPendingMethods): Slightly better error
9605         message.
9606
9607         * makefile: add test target that does the mcs bootstrap.
9608
9609 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9610
9611         * interface.cs (Define): Do nothing here since there are no
9612         members to populate etc. Move the attribute emission out of here
9613         since this was just totally the wrong place to put it. Attribute
9614         application happens during the 'Emit' phase, not in the 'Define'
9615         phase.
9616
9617         (Emit): Add this method and move the attribute emission here
9618
9619         * rootcontext.cs (EmitCode): Call the Emit method on interface
9620         types too.
9621
9622 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9623
9624         * expression.cs (OverloadResolve): Report error only if Location
9625         is not 'Null' which means that there was a probe going on.
9626
9627 2003-07-14  Martin Baulig  <martin@ximian.com>
9628
9629         * expression.cs (ConditionalLogicalOperator): New public class to
9630         implement user defined conditional logical operators.
9631         This is section 14.11.2 in the spec and bug #40505.
9632
9633 2003-07-14  Martin Baulig  <martin@ximian.com>
9634
9635         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9636
9637 2003-07-14  Martin Baulig  <martin@ximian.com>
9638
9639         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9640
9641         * ecore.cs (IVariable.VerifyFixed): New interface method.
9642
9643         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9644         operator, check whether the variable is actually fixed.  Fixes bug
9645         #36055.  Set a variable definitely assigned when taking its
9646         address as required by the spec.
9647
9648         * statement.cs (LocalInfo.IsFixed): New field.
9649         (LocalInfo.MakePinned): Set `IsFixed' to true.
9650
9651 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9652
9653         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9654         for .ctors, ensure that we only ask for members declared in the
9655         attribute type (BindingFlags.DeclaredOnly).
9656
9657         Fixes bug #43632.
9658
9659         * expression.cs (Error_WrongNumArguments): Report error 1501
9660         correctly the way CSC does.
9661
9662 2003-07-13  Martin Baulig  <martin@ximian.com>
9663
9664         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9665         lookup on the fully qualified name, to make things like "X.X" work
9666         where "X.X" is a fully qualified type name, but we also have a
9667         namespace "X" in the using list.  Fixes #41975.
9668
9669 2003-07-13  Martin Baulig  <martin@ximian.com>
9670
9671         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9672         function. If we're a CompoundAssign, we need to create an embedded
9673         CompoundAssign, not an embedded Assign.
9674         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9675         Fixes #45854.
9676
9677 2003-07-13  Martin Baulig  <martin@ximian.com>
9678
9679         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9680         work to fix bug #46088.
9681
9682 2003-07-13  Ravi Pratap <ravi@ximian.com>
9683
9684         * class.cs (Operator.Emit): Do not emit attributes here - it is
9685         taken care of by the Method class that we delegate too. This takes
9686         care of bug #45876.
9687
9688 2003-07-10  Martin Baulig  <martin@ximian.com>
9689
9690         * expression.cs (TypeOfVoid): New class.
9691         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9692
9693 2003-07-10  Martin Baulig  <martin@ximian.com>
9694
9695         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9696         bug #35957.
9697
9698 2003-07-10  Martin Baulig  <martin@ximian.com>
9699
9700         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9701         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9702
9703         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9704
9705         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9706
9707 2003-07-10  Martin Baulig  <martin@ximian.com>
9708
9709         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9710         of decimal.  Fixes #42850.
9711
9712         NOTE: I also fixed the created byte blob, but this doesn't work on
9713         the MS runtime and csc never produces any byte blobs for decimal
9714         arrays.
9715
9716 2003-07-10  Martin Baulig  <martin@ximian.com>
9717
9718         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9719         structs; fixes #32068.
9720         (Block.AddChildVariableNames): Fixed #44302.
9721
9722 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9723
9724         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9725
9726 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9727
9728         * attribute.cs: And this test is onger needed.
9729
9730 2003-07-08  Martin Baulig  <martin@ximian.com>
9731
9732         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9733         inaccessible types.  Fixes #36313.
9734
9735         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9736
9737         * namespace.cs (NamespaceEntry): Create implicit entries for all
9738         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9739         implicit entries for N1.N2 and N1.
9740
9741 2003-07-08  Martin Baulig  <martin@ximian.com>
9742
9743         Rewrote the handling of namespaces to fix a lot of the issues
9744         wrt. `using' aliases etc.
9745
9746         * namespace.cs (Namespace): Splitted this class into a
9747         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9748
9749         * typemanager.cs (TypeManager.IsNamespace): Removed.
9750         (TypeManager.ComputeNamespaces): Only compute namespaces from
9751         loaded assemblies here, not the namespaces from the assembly we're
9752         currently compiling.
9753
9754 2003-07-08  Martin Baulig  <martin@ximian.com>
9755
9756         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9757
9758 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9759
9760         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9761         already fixed it.  
9762
9763         I thought about the memory savings here, but LookupTypeReflection
9764         is used under already very constrained scenarios.  Compiling
9765         corlib or mcs only exposes one hit, so it would not really reduce
9766         any memory consumption.
9767
9768 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9769
9770         * typemanager.cs: fixes bug #45889 by only adding public types from
9771         other assemblies to the list of known types.
9772
9773 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9776         on the type we resolved.
9777
9778 2003-07-05  Martin Baulig  <martin@ximian.com>
9779
9780         * pending.cs (PendingImplementation.ParentImplements): Don't
9781         create the proxy if the parent is abstract.
9782
9783         * class.cs (TypeContainer.DefineIndexers): Process explicit
9784         interface implementations first.  Fixes #37714.
9785
9786 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9787
9788         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9789         defined recursively;  but since we modify the input parameters
9790         (left is set to `this' temporarily), we reset this value if the
9791         left_is_explicit is false, which gives the original semantics to
9792         the code.  
9793
9794         * literal.cs (NullPointer): new class used to represent a null
9795         literal in a pointer context.
9796
9797         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9798         type is a pointer, use a NullPointer object instead of a
9799         NullLiteral.   Closes 43687
9800
9801         (ExplicitConversion): Convert pointer values using
9802         the conv opcode to the proper type.
9803
9804         * ecore.cs (New): change ValueTypeVariable property into a method,
9805         that returns whether the valuetype is suitable for being used.
9806
9807         * expression.cs (Binary.DoNumericPromotions): Only return if we
9808         the int constant was a valid uint, and we can return both left and
9809         right as uints.  If not, we continue processing, to trigger the
9810         type conversion.  This fixes 39018.
9811
9812         * statement.cs (Block.EmitMeta): During constant resolution, set
9813         the CurrentBlock property on the emitcontext, so that we resolve
9814         constants propertly.
9815
9816 2003-07-02  Martin Baulig  <martin@ximian.com>
9817
9818         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9819         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9820
9821         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9822         than emitting it here.
9823
9824         * statement.cs: Fixed some more flow analysis bugs.
9825
9826 2003-07-02  Martin Baulig  <martin@ximian.com>
9827
9828         * class.cs (MethodData.Define): When implementing interface
9829         methods, set Final unless we're Virtual.
9830
9831         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9832         check work for interface methods.
9833
9834 2003-07-01  Martin Baulig  <martin@ximian.com>
9835
9836         * ecore.cs (EmitContext.This): Replaced this property with a
9837         GetThis() method which takes a Location argument.  This ensures
9838         that we get the correct error location for a CS0188.
9839
9840 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9841
9842         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9843         ImplicitStandardConversion.
9844
9845         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9846
9847 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9848
9849         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9850         optimization.
9851
9852 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9853
9854         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9855         constructors.
9856
9857         (MethodData.Define): Turn off initlocals for unsafe methods.
9858
9859 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9860
9861         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9862         complete;  Fixes #37521.
9863
9864         * delegate.cs: Use Modifiers.TypeAttr to compute the
9865         TypeAttributes, instead of rolling our own.  This makes the flags
9866         correct for the delegates.
9867
9868 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9869
9870         * class.cs (Constructor.Define): Set the private flag for static
9871         constructors as well.
9872
9873         * cs-parser.jay (statement_expression): Set the return value to
9874         null, to avoid a crash when we catch an error.
9875
9876 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9877
9878         * cs-parser.jay: Applied patch from Jackson that adds support for
9879         extern and unsafe modifiers to destructor declarations.
9880
9881         * expression.cs: Report error 21 if the user is trying to index a
9882         System.Array.
9883
9884         * driver.cs: Add an error message, suggested by the bug report.
9885
9886         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9887         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9888
9889 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9890
9891         * namespace.cs: Add some information to reduce FAQs.
9892
9893 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9894
9895         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9896         underlying enumeration types.  Fixes #43915.
9897
9898         * expression.cs: Treat ushort/short as legal values to be used in
9899         bitwise operations.
9900
9901 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9902
9903         * delegate.cs: transfer custom attributes for paramenters from
9904         the delegate declaration to Invoke and BeginInvoke.
9905
9906 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9907
9908         * attribute.cs: handle custom marshalers and emit marshal info
9909         for fields, too.
9910
9911 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9912
9913         * makefile.gnu: Added anonymous.cs to the compiler sources.
9914
9915 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9916
9917         * iterators.cs: Change the name of the proxy class to include two
9918         underscores.
9919
9920         * cs-parser.jay: Update grammar to include anonymous methods.
9921
9922         * anonymous.cs: new file.
9923
9924 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9925
9926         * class.cs (Field.Define): Add missing test for pointers and
9927         safety. 
9928
9929 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9930
9931         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9932         we use the stobj opcode.
9933
9934         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9935         since it wasn't the correct fix. 
9936
9937         It still is puzzling that we are required to use stobj for IntPtr
9938         which seems to be a ValueType.
9939
9940 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9943         during regular simple name resolution.   Now, the trick is that
9944         instead of returning for processing the simplename, we do a
9945         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9946         contextual lookup type).   If a match is found, return that, if
9947         not, return for further composition.
9948
9949         This fixes long-standing 30485.
9950
9951         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9952         using the address to initialize an object, do an Stobj instead of
9953         using the regular Stelem.
9954
9955         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9956         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9957         Because if we are a BaseIndexerAccess that value will be true.
9958         Fixes 43643.
9959
9960         * statement.cs (GotoCase.Resolve): Return after reporting an
9961         error, do not attempt to continue. 
9962
9963         * expression.cs (PointerArithmetic.Emit): If our operand is a
9964         long, convert our constants to match the operand before
9965         multiplying.  Convert to I type before adding.   Fixes 43670.
9966
9967 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9968
9969         * enum.cs (ImplicitConversionExists) : Rename to
9970         ImplicitEnumConversionExists to remove ambiguity. 
9971
9972         * ecore.cs (NullCast): New type of cast expression class which
9973         basically is very similar to EmptyCast with the difference being
9974         it still is a constant since it is used only to cast a null to
9975         something else
9976         (eg. (string) null)
9977
9978         * convert.cs (ImplicitReferenceConversion): When casting a null
9979         literal, we return a NullCast.
9980
9981         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9982         should be around anymore.
9983
9984         The renaming (reported was slightly wrong). Corrections:
9985
9986         ConvertImplicitStandard -> ImplicitConversionStandard
9987         ConvertExplicitStandard -> ExplicitConversionStandard
9988
9989         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9990         before passing them in !
9991
9992         * convert.cs (ImplicitConversionStandard): When comparing for
9993         equal expr and target types, ensure that expr is not a
9994         NullLiteral.
9995
9996         In general, we must not be checking (expr_type ==
9997         target_type) in the top level conversion methods
9998         (ImplicitConversion, ExplicitConversion etc). This checking is
9999         done in the methods that they delegate to.
10000
10001 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10002
10003         * convert.cs: Move Error_CannotConvertType,
10004         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10005         ImplicitNumericConversion, ImplicitConversionExists,
10006         ImplicitUserConversionExists, StandardConversionExists,
10007         FindMostEncompassedType, FindMostSpecificSource,
10008         FindMostSpecificTarget, ImplicitUserConversion,
10009         ExplicitUserConversion, GetConversionOperators,
10010         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10011         TryImplicitIntConversion, Error_CannotConvertImplicit,
10012         ConvertImplicitRequired, ConvertNumericExplicit,
10013         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10014         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10015         its own file.
10016
10017         Perform the following renames:
10018
10019         StandardConversionExists -> ImplicitStandardConversionExists
10020         ConvertImplicit -> ImplicitConversion
10021         ConvertImplicitStandard -> ImplicitStandardConversion
10022         TryImplicitIntConversion -> ImplicitIntConversion
10023         ConvertImplicitRequired -> ImplicitConversionRequired
10024         ConvertNumericExplicit -> ExplicitNumericConversion
10025         ConvertReferenceExplicit -> ExplicitReferenceConversion
10026         ConvertExplicit -> ExplicitConversion
10027         ConvertExplicitStandard -> ExplicitStandardConversion
10028
10029 2003-05-19  Martin Baulig  <martin@ximian.com>
10030
10031         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10032         (TypeInfo): Added support for structs having structs as fields.
10033
10034         * ecore.cs (FieldExpr): Implement IVariable.
10035         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10036         VariableInfo for the field.
10037
10038 2003-05-18  Martin Baulig  <martin@ximian.com>
10039
10040         * expression.cs (This.DoResolve): Report a CS0027 if we're
10041         emitting a field initializer.
10042
10043 2003-05-18  Martin Baulig  <martin@ximian.com>
10044
10045         * expression.cs (This.ResolveBase): New public function.
10046         (This.DoResolve): Check for CS0188.
10047
10048         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10049         This.Resolve().
10050
10051         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10052         `instance_expression' to null if we don't have any non-static
10053         methods.
10054
10055 2003-05-18  Martin Baulig  <martin@ximian.com>
10056
10057         Reworked the way how local variables and parameters are handled by
10058         the flow analysis code.
10059
10060         * statement.cs (TypeInfo, VariableMap): New public classes.
10061         (VariableInfo): New public class.  This is now responsible for
10062         checking whether a variable has been assigned.  It is used for
10063         parameters and local variables.
10064         (Block.EmitMeta): Take the InternalParameters as argument; compute
10065         the layout of the flow vectors here.
10066         (Block.LocalMap, Block.ParameterMap): New public properties.
10067         (FlowBranching): The .ctor doesn't get the InternalParameters
10068         anymore since Block.EmitMeta() now computes the layout of the flow
10069         vector.
10070         (MyStructInfo): This class is now known as `StructInfo' and nested
10071         in `TypeInfo'; we don't access this directly anymore.
10072
10073         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10074         property and removed IsAssigned(), IsFieldAssigned(),
10075         SetAssigned() and SetFieldAssigned(); we now call them on the
10076         VariableInfo so we don't need to duplicate this code everywhere.
10077
10078         * expression.cs (ParameterReference): Added `Block block' argument
10079         to the .ctor.
10080         (LocalVariableReference, ParameterReference, This): The new
10081         VariableInfo class is now responsible for all the definite
10082         assignment stuff.
10083
10084         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10085         IsParameterAssigned, SetParameterAssigned): Removed.
10086
10087 2003-05-18  Martin Baulig  <martin@ximian.com>
10088
10089         * typemanager.cs (InitCoreTypes): Try calling
10090         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10091         the 3-args-version.  Corlib now also needs our `void_type'.
10092         (GetMethod): Added overloaded version which takes an optional
10093         `bool report_errors' to allow lookups of optional methods.
10094
10095 2003-05-12  Martin Baulig  <martin@ximian.com>
10096
10097         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10098         only used for locals and not for parameters.
10099
10100 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * support.cs (InternalParameters.ParameterType): Return the
10103         ExternalType of the parameter.
10104
10105         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10106         they were unused.
10107
10108 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10109
10110         * class.cs (MethodData.Define): Do not set the `newslot' on
10111         interface members, if they are also flagged as "override".
10112
10113         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10114         better code for ++i and i++.  This only works for static fields
10115         and local variables.
10116
10117         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10118         want to pull the DeclSpace out of the builder_to_declspace instead
10119         of the TypeBuilder (like in TypeContainer.FindMembers).
10120
10121         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10122         instead of LookupTypeContainer.  Fixes the crash on .NET for
10123         looking up interface members.
10124
10125         * const.cs: Create our own emit context during the Definition
10126         stage, so that constants are evaluated in the proper context, when
10127         a recursive definition happens.
10128
10129 2003-05-11  Martin Baulig  <martin@ximian.com>
10130
10131         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10132         new block for a switch section.
10133         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10134         the adding/lookup in the switch block.  Fixes #39828.
10135
10136 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10137
10138         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10139         functionality: I needed to convert the data after I had performed
10140         the add/sub operation into the operands type size.
10141
10142         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10143         pass the type for the box operation, otherwise the resulting
10144         object would have been of type object.
10145
10146         (BoxedCast): Add constructor to specify the type to box as.
10147
10148 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10149
10150         * iterators.cs: I was reusing the `count' variable inadvertently,
10151         take steps to not allow this to happen.
10152
10153 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10154
10155         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10156         by creating an array at the point where the params starts and
10157         putting all those arguments there, then adjusting the size of the
10158         array.
10159
10160 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * expression.cs (New.AddressOf): Implement interface
10163         IMemoryLocation.  This is used when the `new' operator is used in
10164         the context of an invocation to a method on a value type.
10165
10166         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10167         example. 
10168
10169         * namespace.cs: Also check the using aliases here.
10170
10171         * driver.cs: Move the test for using validity after the types have
10172         been entered, so we do a single pass that also includes the using
10173         aliases. 
10174
10175         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10176         in the regular case.   CreateSiblingForFinally is doing extra
10177         error checking.
10178
10179         * attribute.cs (GetAttributeArgumentExpression): Store the result
10180         on an out value, and use the return value to indicate failure
10181         instead of using null (which is a valid return for Constant.GetValue).
10182
10183         * statement.cs: Perform the analysis flow for the increment
10184         portion after the statement, because this will be the real flow of
10185         execution.  Fixes #42385
10186
10187         * codegen.cs (EmitContext.EmitArgument,
10188         EmitContext.EmitStoreArgument): New helper functions when the
10189         RemapToProxy flag is set.
10190
10191         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10192         function.
10193
10194         Add support for remapping parameters. 
10195
10196         * iterators.cs: Propagate parameter values;  Store parameter
10197         values in the proxy classes.
10198
10199 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10200
10201         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10202         need a proxy reference;  I do not know what I was thinking
10203
10204         * cs-parser.jay (constructor_initializer): catch another error,
10205         and display nice message.
10206
10207         (field_declaration): catch void field declaration
10208         to flag a better error. 
10209
10210         * class.cs (MemberBase.CheckBase): Report an error instead of a
10211         warning if a new protected member is declared in a struct. 
10212         (Field.Define): catch the error of readonly/volatile.
10213
10214         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10215
10216         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10217         volatile variable is taken
10218
10219 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * statement.cs (Fixed.Resolve): Report an error if we are not in
10222         an unsafe context.
10223
10224 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10225
10226         * typemanager.cs: reuse the code that handles type clashes for
10227         delegates and enumerations.
10228
10229         * class.cs (Report28): Always report.
10230
10231         * expression.cs (EncodeAsAttribute): Allow nulls here.
10232
10233 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10236         the functionality for testing whether an expression is valid for
10237         an attribute here.  Also handle the case of arrays of elements
10238         being stored. 
10239
10240         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10241         encoding a linear array into an array of objects that are suitable
10242         to be passed to an CustomAttributeBuilder.
10243
10244         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10245
10246         * ecore.cs: (FieldExpr): Handle field remapping here.
10247
10248         * iteratators.cs: Pass the instance variable (if the method is an
10249         instance method) to the constructors, so we can access the field
10250         variables on the class.
10251
10252         TODO: Test this with structs.  I think the THIS variable on
10253         structs might have to be a pointer, and not a refenrece
10254
10255 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10258         local variables to fields in a proxy class.
10259
10260         * iterators.cs (PopulateProxy): Rename our internal fields to
10261         <XXX>.  
10262         Create a <THIS> field if we are an instance method, so we can
10263         reference our parent container variables.
10264         (MapVariable): Called back from the EmitContext code to enter a
10265         new variable to field mapping into the proxy class (we just create
10266         a FieldBuilder).
10267
10268         * expression.cs
10269         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10270         for using the remapped locals to fields.
10271
10272         I placed the code here, because that gives the same semantics to
10273         local variables, and only changes the Emit code.
10274
10275         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10276         statements inside iterators.
10277         (VariableInfo): Add a FieldBuilder for the cases when we are
10278         remapping local variables to fields in a proxy class
10279
10280         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10281         current_block != null.
10282
10283         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10284         not cope with strings, as it has been moved to the
10285         TableSwitchEmit.  Fixed bug in switch generation.
10286
10287         * expression.cs (New.DoResolve): Provide more context for the user
10288         when reporting an error.
10289
10290         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10291         pointers. 
10292
10293         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10294         check the permissions for it.  Note than in a type-resolution
10295         context the check was already present in DeclSpace.ResolveType,
10296         but was missing from the MemberAccess.
10297
10298         (ArrayCreation.CheckIndices): warn if the user has
10299         more nested levels of expressions, but there are no more
10300         dimensions specified.  Avoids crash on bug 41906.
10301
10302 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10303
10304         * statement.cs (Block): replace Implicit bool, for a generic
10305         flags.   
10306         New flag: `Unchecked'.  This is used during the EmitMeta phase
10307         (which is out-of-line with the regular Resolve/Emit process for a
10308         statement, as this is done ahead of time, but still gets a chance
10309         to call constant resolve).
10310
10311         (Block.Flags): new enum for adding a new flag.
10312
10313         (Block.EmitMeta): track the state of unchecked.
10314
10315         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10316         to enable constant resolution to work there as well.
10317
10318 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * typemanager.cs (ienumerable_type): Also look up
10321         System.Collections.IEnumerable. 
10322
10323 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10324
10325         TODO: Test more than one conditional per method.
10326
10327         * class.cs (Indexer.Define): Report the location where the user is
10328         referencing the unsupported feature.
10329
10330         (MethodData): Overload the use of `conditionals' to
10331         minimize the creation of needless ArrayLists.   This saves roughly
10332         212kb on my machine.
10333
10334         (Method): Implement the new IIteratorContainer interface.
10335         (Method.SetYields): Implement the method by setting the ModFlags
10336         to contain METHOD_YIELDS.
10337
10338         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10339         which just got set to null.
10340
10341         * iterators.cs: New file.
10342
10343         (Yield, YieldBreak): New statements.
10344
10345         * statement.cs (Return.Resolve): Flag an error if we are used in
10346         an iterator method.
10347
10348         * codegen.cs (InIterator): New flag set if the code is being
10349         compiled in an iterator method.
10350
10351         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10352         internal modifier, and we just use it to avoid adding extra
10353         fields, as this is seldom used.  
10354
10355         * cs-parser.jay: Add yield_statement (yield and yield break).
10356
10357         * driver.cs: New flag -v2 to turn on version 2 features. 
10358
10359         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10360         hashtable when v2 is enabled.
10361
10362 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10365         there is already a namespace defined with this name.
10366
10367         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10368         people upgraded their corlibs.
10369
10370         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10371         always use fully qualified types, no need to use the compiler
10372         front end.
10373
10374         (TypeManager.IsNamespace): Use binarysearch.
10375
10376         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10377         AddDelegate): I did not quite use the new IsValid API properly: I
10378         have to pass the short-name and the fullname.  I was passing only
10379         the basename instead of the fullname sometimes. 
10380
10381         (TypeContainer.DefineType): call NamespaceClash.
10382
10383         * interface.cs (Interface.DefineType): use NamespaceClash before
10384         defining the type.
10385
10386         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10387         defining the type.
10388
10389         * enum.cs: (Enum.DefineType): use NamespaceClash before
10390         defining the type.
10391
10392         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10393         speed increase.  First, use the negative_hits cache when we get a
10394         negative.  Second, add the type with its full original name
10395         instead of the new . and + encoded name (reflection uses + to
10396         separate type from a nested type).  Use LookupTypeReflection
10397         directly which bypasses the type->name hashtable (that we already
10398         know does not contain the type.
10399
10400         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10401         location/container type. 
10402
10403         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10404
10405 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10406
10407         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10408
10409         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10410         method is being referenced in the method group from a static
10411         context, and report error 120 if so.
10412
10413         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10414         Error118. 
10415
10416         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10417         is created, we create the A namespace).
10418
10419         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10420         Fixes #41591
10421
10422 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10423
10424         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10425         invocation to ModuleBuilder.GetType with the same values will
10426         return a new type instance, so we need to cache its return
10427         values. 
10428
10429         * expression.cs (Binary.ResolveOperator): Only allow the compare
10430         operators on enums if they are of the same type.
10431
10432         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10433         types of ValueType on their own case.  Before we were giving them
10434         the same treatment as objects.
10435
10436         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10437         fullname.  Short name is used to compare against container name.
10438         Fullname is used to check against defined namespace names.
10439
10440         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10441         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10442
10443         (Method.CheckBase): Call parent.
10444         (MemberBase.CheckBase): Check for protected members on sealed
10445         classes.
10446         (PropertyBase.CheckBase): Call parent.
10447         (Field.Define): Call parent.
10448
10449         * report.cs: Negative error codes are now mapped to 8000 - code,
10450         so that the display is render more nicely.
10451
10452         * typemanager.cs: Do not use try/catch, instead report a regular
10453         error. 
10454
10455         (GetPointerType, GetReferenceType): These methods provide
10456         mechanisms to obtain the T* and T& from a T.  We had the code
10457         previously scattered around the code base, and it also used
10458         TypeManager.LookupType that would go through plenty of caches.
10459         This one goes directly to the type source.
10460
10461         In some places we did the Type.GetType followed by
10462         ModuleBuilder.GetType, but not in others, so this unifies the
10463         processing as well.
10464
10465         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10466         statements now that we have namespace information.
10467
10468         * typemanager.cs (IsNamespace): New method, returns whether the
10469         string presented is a namespace or not.
10470
10471         (ComputeNamespaces): New public entry point, computes the list of
10472         available namespaces, using the GetNamespaces API call in Mono, or
10473         the slower version in MS.NET.   
10474
10475         Now before we start the semantic analysis phase, we have a
10476         complete list of namespaces including everything that the user has
10477         provided.
10478
10479         Deleted old code to cache namespaces in .nsc files.
10480
10481 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10484         class/struct location definition Location for the implicit
10485         constructor location.
10486
10487         (Operator.Define): Use the location of the operator for the
10488         implicit Method definition.
10489
10490         (Constructor.Emit): use the constructor location for the implicit
10491         base initializer constructor.
10492
10493         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10494         and the Expression class now contains two new methods:
10495
10496         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10497         isolate type lookup from the rest of the resolution process.
10498
10499         Since we use Expressions to hold type definitions due to the way
10500         we parse the input we have historically overloaded Resolve to
10501         perform the Type lookups if a special flag is passed.  Now this is
10502         eliminated and two methods take their place. 
10503
10504         The differences in the two methods between xStep and xTerminal is
10505         that xStep is involved in our current lookup system that uses
10506         SimpleNames to compose a name, while xTerminal is used just to
10507         catch the case where the simplename lookup failed.
10508
10509 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10510
10511         * expression.cs (ResolveMemberAccess): Remove redundant code.
10512         TypeExpr expressions are always born fully resolved.
10513
10514         * interface.cs (PopulateMethod): Do not lookup the types twice.
10515         We were doing it once during SemanticAnalysis and once during
10516         PopulateMethod.
10517
10518         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10519         in local variable type definitions, were being returned as a
10520         SimpleName (we decomposed everything into a string), that is
10521         because primary_expression was being used instead of a type in the
10522         grammar (reduce/reduce conflicts).
10523
10524         The part that was wrong is that we converted the expression into a
10525         string (an oversimplification in one hand, compounded with primary
10526         expressions doing string concatenation).
10527
10528         So things like:
10529
10530         A.B.C [] x;
10531
10532         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10533         using clauses from working on this particular context.  And a type
10534         was being matched directly against "A.B.C[]".
10535
10536         We now use the correct approach, and allow for ComposedCast to be
10537         part of the unary expression.  So the "A.B.C []" become a composed
10538         cast of "A.B.C" (as a nested group of MemberAccess with a
10539         SimpleName at the end) plus the rank composition "[]". 
10540
10541         Also fixes 35567
10542
10543 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10546         for the access level checking.
10547
10548         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10549         `TypeContainer container', because I kept getting confused when I
10550         was debugging this code.
10551
10552         * expression.cs (Indexers): Instead of tracking getters/setters,
10553         we now track them in parallel.  We create one arraylist less, but
10554         most importantly it is possible now for the LValue code to find a
10555         matching get for a set.
10556
10557         (IndexerAccess.DoResolveLValue): Update the code.
10558         GetIndexersForType has been modified already to extract all the
10559         indexers from a type.  The code assumed it did not.
10560
10561         Also make the code set the correct return type for the indexer.
10562         This was fixed a long time ago for properties, but was missing for
10563         indexers.  It used to be void_type.
10564
10565         (Binary.Emit): Test first for doubles instead of
10566         floats, as they are more common.
10567
10568         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10569         when dealing with floats and the <=, >= operators.  This fixes bug
10570         #39314 
10571
10572         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10573         to load the array value by emitting a load on the foreach variable
10574         type.  This was incorrect.  
10575
10576         We now emit the code to load an element using the the array
10577         variable type, and then we emit the conversion operator.
10578
10579         Fixed #40176
10580
10581 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10582
10583         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10584
10585 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10586
10587         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10588         test for protection before we test for signatures. 
10589
10590         (MethodSignature.ToString): implement.
10591
10592         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10593         to the case where we reduced into a LongConstant.
10594
10595         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10596         depend on whether the information is acurrate, because the
10597         Microsoft runtime will always claim that the array type is public,
10598         regardless of the real state.
10599
10600         If the type is a pointer, another problem happens: the type is
10601         reported as non-public in Microsoft.  
10602
10603         In both cases we have to call CheckAccessLevel recursively with
10604         the underlying type as the argument to be tested.
10605
10606 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10607
10608         * assign.cs (Assign.Emit): If we are dealing with a compound
10609         assignment expression, we should use the code path that stores the
10610         intermediate result in a temporary value.  This fixes #40903.
10611
10612         *expression.cs (Indirection.ToString): Provide ToString method for
10613         debugging. 
10614
10615 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10616
10617         * class.cs: Null out fields holding references to Block objects so
10618         they can be garbage collected.
10619
10620         * expression.cs (OverloadResolve): Remove unused local.
10621
10622 2003-04-07  Martin Baulig  <martin@ximian.com>
10623
10624         * codegen.cs (EmitContext.CurrentFile): New public field.
10625         (EmitContext.Mark): Use the CurrentFile to check whether the
10626         location is in the correct file.
10627         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10628
10629 2003-04-07  Martin Baulig  <martin@ximian.com>
10630
10631         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10632
10633         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10634         location.  [FIXME: The location argument which gets passed to this
10635         method is sometimes wrong!]
10636
10637 2003-04-07  Nick Drochak <ndrochak@gol.com>
10638
10639         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10640
10641 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10642
10643         * expression.cs (Indirection.EmitAssign): We were using the
10644         temporary, but returning immediately instead of continuing the
10645         EmitAssing flow.
10646
10647 2003-04-06  Martin Baulig  <martin@ximian.com>
10648
10649         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10650         if it's a nested child, but also deriving from the outer class.
10651         See test 190.cs.
10652
10653         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10654         nested child, but also deriving from the outer class.  See
10655         test-190.cs.
10656         (FilterWithClosure): We may access private members of the outer
10657         class if we're a nested child and deriving from the outer class.
10658         (RealMemberLookup): Only set `closure_private_ok' if the
10659         `original_bf' contained BindingFlags.NonPublic.
10660
10661 2003-04-05  Martin Baulig  <martin@ximian.com>
10662
10663         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10664
10665 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10666
10667         * class.cs (Event.Define): Do not allow abstract events to have
10668         initializers. 
10669
10670 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10671
10672         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10673         block in event declarations.
10674
10675         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10676         value type, get its address.
10677
10678         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10679         leaving a class on the stack instead of a boolean value (int
10680         0/1).  Change the code so we compare against null, and then the
10681         result against zero.
10682
10683         * class.cs (TypeContainer.GetClassBases): We were checking for the
10684         parent class being sealed too late.
10685
10686         * expression.cs (Binary.Emit): For <= and >= when dealing with
10687         floating point values, use cgt.un and clt.un instead of cgt and
10688         clt alone.
10689
10690 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10691
10692         * statement.cs: Apply the same optimization as MS: skip the 
10693         GetEnumerator returning an IEnumerator, and use the one returning a 
10694         CharEnumerator instead. This allows us to avoid the try-finally block 
10695         and the boxing.
10696
10697 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10698
10699         * cs-parser.jay: Attributes cannot be applied to
10700                          namespaces. Fixes #40473
10701
10702 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10703
10704         * class.cs:
10705         (Add*): check if the name is valid using the full name for constants,
10706         fields, properties and events.
10707
10708 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10711         char constants to be part of the enumeration.
10712
10713         * expression.cs (Conditional.DoResolve): Add support for operator
10714         true. Implements the missing functionality from 14.12
10715
10716         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10717         operator true/false as required by the spec.
10718
10719         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10720         implicit conversion to boolean.
10721
10722         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10723         also one where the type implements `operator true'. 
10724
10725         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10726         get an expression that will invoke operator true based on an
10727         expression.  
10728
10729         (GetConversionOperators): Removed the hack that called op_True
10730         here.  
10731
10732         (Expression.ResolveBoolean): Move this from Statement.
10733
10734 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10735
10736         * ecore.cs (FieldExpr): do not allow initialization of initonly
10737         fields on derived classes
10738
10739 2003-03-13  Martin Baulig  <martin@ximian.com>
10740
10741         * statement.cs (Block.Emit): Call ig.BeginScope() and
10742         ig.EndScope() when compiling with debugging info; call
10743         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10744
10745 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10746
10747         * expression.cs (Indexers): Do not construct immediately, allow
10748         for new members to be appended as we go.  Fixes 38143
10749
10750 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10751
10752         * expression.cs: save/restore context when resolving an unchecked
10753         expression.
10754
10755 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10756
10757         * cfold.cs: Catch division by zero in modulus operator during
10758         constant folding.
10759
10760 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10761
10762         * interface.cs (Interface.DefineMembers): Avoid defining members
10763         twice. 
10764
10765 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10766
10767         * driver.cs: handle the +/- options for -noconfig
10768
10769         * statement.cs (Unckeched.Resolve): Also track the state of
10770         unchecked in the Resolve phase.
10771
10772 2003-02-27  Martin Baulig  <martin@ximian.com>
10773
10774         * ecore.cs (Expression.MemberLookup): Don't create a
10775         MethodGroupExpr for something which is not a method.  Fixes #38291.
10776
10777 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * class.cs (MemberBase.CheckParameters): Also check that the type
10780         is unmanaged if it is a pointer.
10781
10782         * expression.cs (SizeOf.Resolve): Add location information.
10783
10784         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10785         a managed type is declared.
10786
10787         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10788         parameter modifiers as well.  Fixes bug 38606
10789
10790         * class.cs: Very sad.  Am backing out the speed up changes
10791         introduced by the ArrayList -> Array in the TypeContainer, as they
10792         were not actually that much faster, and introduced a bug (no error
10793         reports on duplicated methods).
10794
10795         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10796         source first, this will guarantee that we have a valid expression
10797         before calling in lower levels functions that will require a
10798         resolved object.  Then use this original_source in the
10799         target.ResolveLValue instead of the original source that was
10800         passed to us.
10801
10802         Another change.  Use target.Resolve instead of LValueResolve.
10803         Although we are resolving for LValues, we will let the Assign code
10804         take care of that (it will be called again from Resolve).  This
10805         basically allows code like this:
10806
10807         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10808         class Y { void A (X x) { x [0] += o; }
10809
10810         The problem was that the indexer was trying to resolve for
10811         set_Item (idx, object o) and never finding one.  The real set_Item
10812         was set_Item (idx, X).  By delaying the process we get the right
10813         semantics. 
10814
10815         Fixes bug 36505
10816
10817 2003-02-23  Martin Baulig  <martin@ximian.com>
10818
10819         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10820         while calling DoEmit ().
10821
10822         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10823         source files; if you use the #line directive inside a method, the
10824         compiler stops emitting line numbers for the debugger until it
10825         reaches the end of the method or another #line directive which
10826         restores the original file.
10827
10828 2003-02-23  Martin Baulig  <martin@ximian.com>
10829
10830         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10831
10832 2003-02-23  Martin Baulig  <martin@ximian.com>
10833
10834         * statement.cs (Block.AddChildVariableNames): We need to call this
10835         recursively, not just for our immediate children.
10836
10837 2003-02-23  Martin Baulig  <martin@ximian.com>
10838
10839         * class.cs (Event.Define): Always make the field private, like csc does.
10840
10841         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10842         actually work, fixes bug #37521.
10843
10844 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10845
10846         * delegate.cs: When creating the various temporary "Parameters"
10847         classes, make sure that we call the ComputeAndDefineParameterTypes
10848         on those new parameters (just like we do with the formal ones), to
10849         allow them to be resolved in the context of the DeclSpace.
10850
10851         This fixes the bug that Dick observed in Bugzilla #38530.
10852
10853 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10854
10855         * expression.cs (ResolveMemberAccess): When resolving a constant,
10856         do not attempt to pull a constant if the value was not able to
10857         generate a valid constant.
10858
10859         * const.cs (LookupConstantValue): Do not report more errors than required.
10860
10861 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10862
10863         * expression.cs: fixes bug #38328.
10864
10865 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * class.cs: Changed all the various members that can be part of a
10868         class from being an ArrayList to be an Array of the right type.
10869         During the DefineType type_list, interface_list, delegate_list and
10870         enum_list are turned into types, interfaces, delegates and enums
10871         arrays.  
10872
10873         And during the member population, indexer_list, event_list,
10874         constant_list, field_list, instance_constructor_list, method_list,
10875         operator_list and property_list are turned into their real arrays.
10876
10877         Although we could probably perform this operation earlier, for
10878         good error reporting we need to keep the lists and remove the
10879         lists for longer than required.
10880
10881         This optimization was triggered by Paolo profiling the compiler
10882         speed on the output of `gen-sample-program.pl' perl script. 
10883
10884         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10885         not crash in methods like MemberLookupFailed that use this field.  
10886
10887         This problem arises when the compiler fails to resolve a type
10888         during interface type definition for example.
10889
10890 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10893         inherit from System.Object, so we have to stop at null, not only
10894         when reaching System.Object.
10895
10896 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10899         DeclaredOnly because the parent indexer might have had a different
10900         name, but did not loop until the top of the hierarchy was reached.
10901
10902         The problem this one fixes is 35492: when a class implemented an
10903         indexer from an interface, we were getting the interface method
10904         (which was abstract) and we were flagging an error (can not invoke
10905         abstract method).
10906
10907         This also keeps bug 33089 functioning, and test-148 functioning.
10908
10909         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10910         out if a method is special is to see if it is declared in a
10911         property or event, or whether it is one of the predefined operator
10912         names.   This should fix correctly #36804.
10913
10914 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10915
10916         The goal here is to remove the dependency on EmptyCast.Peel ().
10917         Killing it completely.
10918
10919         The problem is that currently in a number of places where
10920         constants are expected, we have to "probe" for an EmptyCast, and
10921         Peel, which is not the correct thing to do, as this will be
10922         repetitive and will likely lead to errors. 
10923
10924         The idea is to remove any EmptyCasts that are used in casts that
10925         can be reduced to constants, so we only have to cope with
10926         constants. 
10927
10928         This bug hunt was triggered by Bug 37363 and the desire to remove
10929         the duplicate pattern where we were "peeling" emptycasts to check
10930         whether they were constants.  Now constants will always be
10931         constants.
10932
10933         * ecore.cs: Use an enumconstant here instead of wrapping with
10934         EmptyCast.  
10935
10936         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10937         throwing me off.  By handling this we can get rid of a few hacks.
10938
10939         * statement.cs (Switch): Removed Peel() code.
10940
10941 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10942
10943         * class.cs: Location information for error 508
10944
10945         * expression.cs (New.DoResolve): Add a guard against double
10946         resolution of an expression.  
10947
10948         The New DoResolve might be called twice when initializing field
10949         expressions (see EmitFieldInitializers, the call to
10950         GetInitializerExpression will perform a resolve on the expression,
10951         and later the assign will trigger another resolution
10952
10953         This leads to bugs (#37014)
10954
10955         * delegate.cs: The signature for EndInvoke should contain any ref
10956         or out parameters as well.  We were not doing this in the past. 
10957
10958         * class.cs (Field.Define): Do not overwrite the type definition
10959         inside the `volatile' group.  Turns out that volatile enumerations
10960         were changing the type here to perform a validity test, which
10961         broke conversions. 
10962
10963 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10964
10965         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10966         and structs, we do not want to load the instance variable
10967
10968         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10969         enum_type has to be handled like an object reference (implicit
10970         conversions exists from this to object), but the regular IsClass
10971         and IsValueType tests will never return true for this one.
10972
10973         Also we use TypeManager.IsValueType instead of type.IsValueType,
10974         just for consistency with the rest of the code (this is only
10975         needed if we ever use the construct exposed by test-180.cs inside
10976         corlib, which we dont today).
10977
10978 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10979
10980         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10981         just InternalCall.
10982
10983 2003-02-09  Martin Baulig  <martin@ximian.com>
10984
10985         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10986         (Namespace.DefineNamespaces): New static public method; this is
10987         called when we're compiling with debugging to add all namespaces
10988         to the symbol file.
10989
10990         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10991         pass it to the Namespace's .ctor.
10992
10993         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10994         and MethodBase arguments; pass the namespace ID to the symwriter;
10995         pass the MethodBase instead of the token to the symwriter.
10996         (SymbolWriter.DefineNamespace): New method to add a namespace to
10997         the symbol file.
10998
10999 2003-02-09  Martin Baulig  <martin@ximian.com>
11000
11001         * symbolwriter.cs: New file.  This is a wrapper around
11002         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11003         methods here in near future.
11004
11005 2003-02-09  Martin Baulig  <martin@ximian.com>
11006
11007         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11008         ILGenerator.MarkSequencePoint() which are actually used by the
11009         symbol writer.
11010
11011 2003-02-09  Martin Baulig  <martin@ximian.com>
11012
11013         * location.cs (SourceFile): New public sealed class.  This
11014         contains the name and an index which is used in the location's token.
11015         (Location): Reserve an appropriate number of bits in the token for
11016         the source file instead of walking over that list, this gives us a
11017         really huge performance improvement when compiling with debugging.
11018
11019         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11020         `SourceFile' argument instead of a string.
11021         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11022         but don't parse/tokenize here, we need to generate the list of all
11023         source files before we do that.
11024         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11025         the files.
11026
11027         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11028         instead of a string.
11029
11030         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11031         of a string.
11032
11033 2003-02-09  Martin Baulig  <martin@ximian.com>
11034
11035         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11036         filename on `#line default'.
11037
11038 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11039
11040         * statement.cs: don't clear the pinned var when the fixed statement
11041         returns from the method (fixes bug#37752).
11042
11043 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11044
11045         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11046         to IsValueType.
11047
11048 2003-02-07  Martin Baulig  <martin@ximian.com>
11049
11050         * driver.cs: Removed the `--debug-args' command line argument.
11051
11052         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11053         automatically by the AsssemblyBuilder.
11054         (CodeGen.InitializeSymbolWriter): We don't need to call any
11055         initialization function on the symbol writer anymore.  This method
11056         doesn't take any arguments.
11057
11058 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11059
11060         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11061         from referenced assemblies as well.
11062
11063 2003-02-02  Martin Baulig  <martin@ximian.com>
11064
11065         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11066
11067 2003-02-02  Martin Baulig  <martin@ximian.com>
11068
11069         * class.cs (Constructor.Emit): Open the symbol writer before
11070         emitting the constructor initializer.
11071         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11072         single-stepping through constructor initializers.
11073
11074 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11075
11076         * class.cs: Handle error 549: do not allow virtual methods in
11077         sealed classes. 
11078
11079 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11080
11081         * decl.cs: Check access levels when resolving types
11082
11083 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11084
11085         * statement.cs: Add parameters and locals set in catch blocks that might 
11086         return to set vector
11087
11088 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11089
11090         * class.cs (Operator): Set the SpecialName flags for operators.
11091
11092         * expression.cs (Invocation.DoResolve): Only block calls to
11093         accessors and operators on SpecialName methods.
11094
11095         (Cast.TryReduce): Handle conversions from char constants.
11096
11097
11098 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11099
11100         * statement.cs: small memory and time optimization in FlowBranching.
11101
11102 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11103
11104         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11105         problem that the last fix but in the other sid (Set).
11106
11107         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11108         access when there is no indexer in the hierarchy.
11109
11110 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11111
11112         * class.cs: Combine some if statements.
11113
11114 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11115
11116         * driver.cs: fixed bug #37187.
11117
11118 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11119
11120         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11121         any indexer, it's needed to build a list with all the indexers in the
11122         hierarchy (AllGetters), else we have problems. Fixes #35653.
11123
11124 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11125
11126         * class.cs (MethodData.Define): It is wrong for an interface
11127         implementation to be static in both cases: explicit and implicit.
11128         We were only handling this in one case.
11129
11130         Improve the if situation there to not have negations.
11131
11132         * class.cs (Field.Define): Turns out that we do not need to check
11133         the unsafe bit on field definition, only on usage.  Remove the test.
11134
11135 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11136
11137         * driver.cs: use assembly.Location instead of Codebase (the latest
11138         patch made mcs fail when using MS assemblies).
11139
11140 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11141
11142         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11143         get the path to *corlib.dll.
11144
11145 2003-01-21  Nick Drochak <ndrochak@gol.com>
11146
11147         * cs-tokenizer.cs:
11148         * pending.cs:
11149         * typemanager.cs: Remove compiler warnings
11150
11151 2003-01-20  Duncan Mak  <duncan@ximian.com>
11152
11153         * AssemblyInfo.cs: Bump the version number to 0.19.
11154
11155 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11156
11157         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11158
11159 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11160
11161         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11162
11163 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * cs-parser.jay: Small fix: we were not comparing the constructor
11166         name correctly.   Thanks to Zoltan for the initial pointer.
11167
11168 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11169
11170         * cs-tokenizer.cs: Set file name when specified with #line
11171
11172 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11173
11174         * cs-parser.jay: Only perform the constructor checks here if we
11175         are named like the class;  This will help provider a better
11176         error.  The constructor path is taken when a type definition is
11177         not found, but most likely the user forgot to add the type, so
11178         report that rather than the constructor error.
11179
11180 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11181
11182         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11183         allocations.
11184
11185 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11186
11187         * cs-parser.jay: Add cleanup call.
11188
11189 2003-01-13  Duncan Mak  <duncan@ximian.com>
11190
11191         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11192         consistent with other methods.
11193
11194 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11195
11196         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11197
11198 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11199
11200         * attribute.cs: only set GuidAttr to true when we have a
11201         GuidAttribute.
11202
11203 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11204
11205         * ecore.cs:
11206         * expression.cs:
11207         * typemanager.cs: fixes to allow mcs compile corlib with the new
11208         Type.IsSubclassOf fix.
11209
11210 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * expression.cs (LocalVariableReference.DoResolve): Classify a
11213         constant as a value, not as a variable.   Also, set the type for
11214         the variable.
11215
11216         * cs-parser.jay (fixed_statement): take a type instead of a
11217         pointer_type, so we can produce a better error message later.
11218
11219         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11220         as an error.  
11221
11222         (For.DoEmit): Make inifinite loops have a
11223         non-conditional branch back.
11224
11225         (Fixed.DoEmit): First populate the pinned variables, then emit the
11226         statement, then clear the variables.  Before I was emitting the
11227         code once for each fixed piece.
11228
11229
11230 2003-01-08  Martin Baulig  <martin@ximian.com>
11231
11232         * statement.cs (FlowBranching.MergeChild): A break in a
11233         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11234
11235 2003-01-08  Martin Baulig  <martin@ximian.com>
11236
11237         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11238         lives in the same number space than `param_map'.  Fixes #36154.
11239
11240 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11241
11242         * cs-parser.jay (constructor_declaration): Set the
11243         Constructor.ModFlags before probing for it.  This makes the
11244         compiler report 514, 515 and 132 (the code was there, but got
11245         broken). 
11246
11247         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11248         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11249         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11250
11251 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11252
11253         * enum.cs: create the enum static fields using the enum type.
11254
11255 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11256
11257         * class.cs: don't try to create the ParamBuilder for the return
11258         type if it's not needed (and handle it breaking for the ms runtime
11259         anyway).
11260
11261 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11262
11263         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11264
11265 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11266
11267         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11268         the command.   This showed up while compiling the JANET source
11269         code, which used \r as its only newline separator.
11270
11271 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * class.cs (Method.Define): If we are an operator (because it
11274         reuses our code), then set the SpecialName and HideBySig.  #36128
11275
11276 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11277
11278         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11279         exception, report error 120 `object reference required'.
11280
11281         * driver.cs: Add --pause option, used during to measure the size
11282         of the process as it goes with --timestamp.
11283
11284         * expression.cs (Invocation.DoResolve): Do not allow methods with
11285         SpecialName to be invoked.
11286
11287 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11288
11289         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11290         number before adding it.
11291
11292 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11293
11294         * ecore.cs (StandardImplicitConversion): When in an unsafe
11295         context, we allow conversion between void * to any other pointer
11296         type. This fixes bug #35973.
11297
11298 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11299
11300         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11301         is not thrown when extensionless outputs are used 
11302
11303 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11304
11305         * rootcontext.cs: fixed compilation of corlib.
11306
11307 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11308
11309         * attribute.cs (Attributes.Contains): Add new method.
11310
11311         * class.cs (MethodCore.LabelParameters): if the parameter is an
11312         `out' parameter, check that no attribute `[In]' has been passed.
11313
11314         * enum.cs: Handle the `value__' name in an enumeration.
11315
11316 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11317
11318         * decl.cs: Added special case to allow overrides on "protected
11319         internal" methods
11320
11321 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11322
11323         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11324         since it makes much more sense.
11325
11326         (Attributes.ctor): Don't require a Location parameter.
11327
11328         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11329
11330         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11331         since we already have that information per attribute.
11332
11333         * everywhere : make appropriate changes.
11334
11335         * class.cs (LabelParameters): Write the code which actually
11336         applies attributes to the return type. We can't do this on the MS
11337         .NET runtime so we flag a warning in the case an exception is
11338         thrown.
11339
11340 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11341
11342         * const.cs: Handle implicit null conversions here too.
11343
11344 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11345
11346         * class.cs (MethodCore.LabelParameters): Remove the extra
11347         Type [] parameter since it is completely unnecessary. Instead
11348         pass in the method's attributes so that we can extract
11349         the "return" attribute.
11350
11351 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11354         of ignoring it and letting the compile continue.
11355
11356         * typemanager.cs (ChangeType): use an extra argument to return an
11357         error condition instead of throwing an exception.
11358
11359 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * expression.cs (Unary.TryReduce): mimic the code for the regular
11362         code path.  Perform an implicit cast in the cases where we can
11363         implicitly convert to one of the integral types, and then reduce
11364         based on that constant.   This fixes bug #35483.
11365
11366 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11367
11368         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11369
11370 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11371
11372         * namespace.cs: fixed bug #35489.
11373
11374 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11375
11376         * class.cs: Remove some dead code.
11377
11378         * cs-parser.jay: Estimate the number of methods needed
11379         (RootContext.MethodCount);
11380
11381         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11382         numbers instead of StringBuilders.
11383
11384         * support.cs (PtrHashtable): Add constructor with initial size;
11385         We can now reduce reallocations of the method table.
11386
11387 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11388
11389         * attribute.cs (ApplyAttributes): Keep track of the emitted
11390         attributes on a per-target basis. This fixes bug #35413.
11391
11392 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11393
11394         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11395         default to the Windows 1252 encoding.
11396
11397         (UnixParseOption): Support version, thanks to Alp for the missing
11398         pointer. 
11399
11400         * AssemblyInfo.cs: Add nice assembly information.
11401
11402         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11403         (bug 35169).
11404
11405         * cs-parser.jay: Allow a trailing comma before the close bracked
11406         in the attribute_section production.
11407
11408         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11409         address of the instance was being taken, I will take this out,
11410         because we take the address of the object immediately here.
11411
11412 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11413
11414         * typemanager.cs (AreMultipleAllowed): Take care of the most
11415         obvious case where attribute type is not in the current assembly -
11416         stupid me ;-)
11417
11418 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11419
11420         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11421         definitions, instead of doing that afterwards.  
11422
11423         Also we use a nice little hack, depending on the constructor, we
11424         know if we are a "composed" name or a simple name.  Hence, we
11425         avoid the IndexOf test, and we avoid 
11426
11427         * codegen.cs: Add code to assist in a bug reporter to track down
11428         the source of a compiler crash. 
11429
11430 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11431
11432         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11433         types have been emitted for a given element and flag an error
11434         if something which does not have AllowMultiple set is used more
11435         than once.
11436
11437         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11438         attribute types and their corresponding AllowMultiple properties
11439
11440         (AreMultipleAllowed): Check the property for a given type.
11441
11442         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11443         property in the case we have a TypeContainer.
11444
11445         (Attributes.AddAttribute): Detect duplicates and just skip on
11446         adding them. This trivial fix catches a pretty gross error in our
11447         attribute emission - global attributes were being emitted twice!
11448
11449         Bugzilla bug #33187 is now fixed.
11450
11451 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11452
11453         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11454         instead of pp_and).
11455
11456         * expression.cs (Binary.ResolveOperator): I can only use the
11457         Concat (string, string, string) and Concat (string, string,
11458         string, string) if the child is actually a concatenation of
11459         strings. 
11460
11461 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11462
11463         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11464         context where we need a 2-character lookahead.
11465
11466         * pending.cs (PendingImplementation): Rework so we can keep track
11467         of interface types all the time, and flag those which were
11468         implemented by parents as optional.
11469
11470 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11471
11472         * expression.cs (Binary.ResolveOperator): Use
11473         String.Concat(string,string,string) or
11474         String.Concat(string,string,string,string) when possible. 
11475
11476         * typemanager: More helper methods.
11477
11478
11479 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11480
11481         * pending.cs: remove the bogus return from GetMissingInterfaces()
11482         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11483
11484 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11485
11486         * namespace.cs: avoid duplicated 'using xxx' being added to
11487         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11488         when we get more than one 'using' statement for the same namespace.
11489         Report a CS0105 warning for it.
11490
11491 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11492
11493         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11494         of calling getChar/putback, uses internal knowledge of it.    
11495
11496         (xtoken): Reorder tokenizer so most common patterns are checked
11497         first.  This reduces the compilation time in another 5% (from 8.11s
11498         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11499
11500         The parsing time is 22% of the compilation in mcs, and from that
11501         64% is spent on the tokenization process.  
11502
11503         I tried using a binary search for keywords, but this is slower
11504         than the hashtable.  Another option would be to do a couple of
11505         things:
11506
11507                 * Not use a StringBuilder, instead use an array of chars,
11508                   with a set value.  Notice that this way we could catch
11509                   the 645 error without having to do it *afterwards*.
11510
11511                 * We could write a hand-parser to avoid the hashtable
11512                   compares altogether.
11513
11514         The identifier consumption process takes 37% of the tokenization
11515         time.  Another 15% is spent on is_number.  56% of the time spent
11516         on is_number is spent on Int64.Parse:
11517
11518                 * We could probably choose based on the string length to
11519                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11520                   computations. 
11521
11522         Another 3% is spend on wrapping `xtoken' in the `token' function.
11523
11524         Handle 0xa0 as whitespace (#34752)
11525
11526 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11527
11528         * typemanager.cs (IsCLRType): New routine to tell whether a type
11529         is one of the builtin types.  
11530
11531         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11532         typecode in more places instead of doing pointer comparissions.
11533         We could leverage some knowledge about the way the typecodes are
11534         laid out.
11535
11536         New code to cache namespaces in assemblies, it is currently not
11537         invoked, to be used soon.
11538
11539         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11540
11541         * expression.cs (Binary.ResolveOperator): specially handle
11542         strings, and do not perform user-defined operator overloading for
11543         built-in types.
11544
11545 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11546
11547         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11548         internalcall as it is a pretty simple operation;  Avoid whenever
11549         possible to call Char.IsLetter.
11550
11551         (consume_identifier): Cut by half the number of
11552         hashtable calls by merging the is_keyword and GetKeyword behavior.
11553
11554         Do not short-circuit, because if we do, we
11555         report errors (ie, #if false && true would produce an invalid
11556         directive error);
11557
11558
11559 2002-11-24  Martin Baulig  <martin@ximian.com>
11560
11561         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11562         check constant ranges and report a CS0221.  Fixes #33186.
11563
11564 2002-11-24  Martin Baulig  <martin@ximian.com>
11565
11566         * cs-parser.jay: Make this work for uninitialized variable
11567         declarations in the `for' initializer.  Fixes #32416.
11568
11569 2002-11-24  Martin Baulig  <martin@ximian.com>
11570
11571         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11572         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11573
11574 2002-11-24  Martin Baulig  <martin@ximian.com>
11575
11576         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11577         argument; if true, we also check for user-defined conversions.
11578         This is only needed if both arguments are of a user-defined type.
11579         Fixes #30443, added test-175.cs.
11580         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11581
11582         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11583
11584 2002-11-24  Martin Baulig  <martin@ximian.com>
11585
11586         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11587         function to get the store opcode.
11588         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11589         only emit the Ldelema if the store opcode is Stobj.  You must run
11590         both test-34 and test-167 to test this.  Fixes #34529.
11591
11592 2002-11-23  Martin Baulig  <martin@ximian.com>
11593
11594         * ecore.cs (Expression.MemberLookup): Added additional
11595         `qualifier_type' argument which is used when we're being called
11596         from MemberAccess.DoResolve() and null if we're called from a
11597         SimpleName lookup.
11598         (Expression.MemberLookupFailed): New method to report errors; this
11599         does the CS1540 check and reports the correct error message.
11600
11601         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11602         argument for the CS1540 check and redone the way how we're dealing
11603         with private members.  See the comment in the source code for details.
11604         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11605         `closure_start_type' to `closure_qualifier_type' and check whether
11606         it's not null.  It was not this filter being broken, it was just
11607         being called with the wrong arguments.
11608
11609         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11610         and pass it the correct `qualifier_type'; this also does the error
11611         handling for us.
11612
11613 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11614
11615         * expression.cs (Invocation.EmitParams): If the we are dealing
11616         with a non-built-in value type, load its address as well.
11617
11618         (ArrayCreation): Use a a pretty constant instead
11619         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11620         static initializers.  
11621
11622         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11623         because they are not really value types, just glorified integers. 
11624
11625         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11626
11627         * ecore.cs: Remove redundant code for enumerations, make them use
11628         the same code path as everything else, fixes the casting issue
11629         with enumerations in Windows.Forms.
11630
11631         * attribute.cs: Do only cast to string if it is a string, the
11632         validation happens later.
11633
11634         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11635         people upgrade their corlibs.
11636
11637         * ecore.cs: Oops, enumerations were not following the entire code path
11638
11639 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11640
11641         * typemanager.cs (FilterWithClosure): Commented out the test for
11642         1540 in typemanager.cs, as it has problems when accessing
11643         protected methods from a parent class (see test-174.cs). 
11644
11645         * attribute.cs (Attribute.ValidateGuid): new method.
11646         (Attribute.Resolve): Use above.
11647
11648 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11649
11650         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11651
11652         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11653         handling for enumerations, as we only needed the TypeContainer
11654         functionality to begin with (this is required for the fix below to
11655         work for enums that reference constants in a container class for
11656         example). 
11657
11658         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11659
11660         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11661         a valid TypeBuilder to perform lookups on.o
11662
11663         * class.cs (InheritableMemberSignatureCompare): Use true in the
11664         call to GetGetMethod and GetSetMethod, because we are comparing
11665         the signature, and we need to get the methods *even* if they are
11666         private. 
11667
11668         (PropertyBase.CheckBase): ditto.
11669
11670         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11671         GotoCase.Resolve): Use Peel on EmpytCasts.
11672
11673         * ecore.cs (EmptyCast): drop child, add Peel method.
11674
11675 2002-11-17  Martin Baulig  <martin@ximian.com>
11676
11677         * ecore.cs (EmptyCast.Child): New public property.
11678
11679         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11680         label resolved to an EmptyCast.  Fixes #34162.
11681         (GotoCase.Resolve): Likewise.
11682         (Block.EmitMeta): Likewise.
11683
11684 2002-11-17  Martin Baulig  <martin@ximian.com>
11685
11686         * expression.cs (Invocation.BetterConversion): Prefer int over
11687         uint; short over ushort; long over ulong for integer literals.
11688         Use ImplicitConversionExists instead of StandardConversionExists
11689         since we also need to check for user-defined implicit conversions.
11690         Fixes #34165.  Added test-173.cs.
11691
11692 2002-11-16  Martin Baulig  <martin@ximian.com>
11693
11694         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11695         with the `true' and `false' literals.  Fixes #33151.
11696
11697 2002-11-16  Martin Baulig  <martin@ximian.com>
11698
11699         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11700         October 22nd; don't do the cs1540 check for static members.
11701
11702         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11703         now using our own filter here and doing the cs1540 check again.
11704
11705 2002-11-16  Martin Baulig  <martin@ximian.com>
11706
11707         * support.cs (InternalParameters): Don't crash if we don't have
11708         any fixed parameters.  Fixes #33532.
11709
11710 2002-11-16  Martin Baulig  <martin@ximian.com>
11711
11712         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11713         when looking up static methods to make this work on Windows.
11714         Fixes #33773.
11715
11716 2002-11-16  Martin Baulig  <martin@ximian.com>
11717
11718         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11719         a setter rather than using PropertyInfo.CanWrite.
11720
11721 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11722
11723         * class.cs: Allow acces to block member by subclasses. Fixes build
11724         breaker.
11725
11726 2002-11-14  Martin Baulig  <martin@ximian.com>
11727
11728         * class.cs (Constructor.Emit): Added the extern/block check.
11729         Fixes bug #33678.
11730
11731 2002-11-14  Martin Baulig  <martin@ximian.com>
11732
11733         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11734         iteration while looking for indexers, this is needed because the
11735         indexer may have a different name in our base classes.  Fixed the
11736         error reporting (no indexers at all, not get accessor, no
11737         overloaded match).  Fixes bug #33089.
11738         (IndexerAccess.DoResolveLValue): Likewise.
11739
11740 2002-11-14  Martin Baulig  <martin@ximian.com>
11741
11742         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11743         indexers.  Fixes the first part of bug #33089.
11744         (MethodSignature.InheritableMemberSignatureCompare): Added support
11745         for properties.
11746
11747 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11748
11749         * attribute.cs (Attribute.Resolve): Catch the
11750         NullReferenceException and report it since it isn't supposed to
11751         happen. 
11752
11753 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11756         LogicalOr and LogicalAnd that can benefit from recursively
11757         handling EmitBranchable.  The code now should be nice for Paolo.
11758
11759 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11762         the Type lookups, as we perform quite a number of lookups on
11763         non-Types.  This can be removed once we can deterministically tell
11764         whether we have a type or a namespace in advance.
11765
11766         But this might require special hacks from our corlib.
11767
11768         * TODO: updated.
11769
11770         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11771         and double which avoids a conversion from an integer to a double.
11772
11773         * expression.cs: tiny optimization, avoid calling IsConstant,
11774         because it effectively performs the lookup twice.
11775
11776 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11777
11778         But a bogus return here to keep the semantics of the old code
11779         until the Mono runtime is fixed.
11780
11781         * pending.cs (GetMissingInterfaces): New method used to remove all
11782         the interfaces that are already implemented by our parent
11783         classes from the list of pending methods. 
11784
11785         * interface.cs: Add checks for calls after ResolveTypeExpr.
11786
11787 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11788
11789         * class.cs (Class.Emit): Report warning 67: event not used if the
11790         warning level is beyond 3.
11791
11792         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11793         being a NullLiteral.
11794
11795         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11796         specifiers. 
11797
11798         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11799         path that might fail if a type can not be resolved.
11800
11801         * expression.cs (Binary.Emit): Emit unsigned versions of the
11802         operators. 
11803
11804         * driver.cs: use error 5.
11805
11806 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11807
11808         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11809
11810 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11811
11812         * cs-parser.jay (switch_section): A beautiful patch from Martin
11813         Baulig that fixed 33094.
11814
11815 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11816
11817         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11818         Check whether the base is abstract and report an error if so.
11819
11820         * expression.cs (IndexerAccess.DoResolveLValue,
11821         IndexerAccess.DoResolve): ditto. 
11822
11823         (Invocation.DoResolve): ditto.
11824
11825         (Invocation.FullMethodDesc): Improve the report string.
11826
11827         * statement.cs (Block): Eliminate IsVariableDefined as it is
11828         basically just a wrapper for GetVariableInfo.
11829
11830         * ecore.cs (SimpleName): Use new 
11831
11832         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11833         type, as we return the actual parameter ref/unref state on a
11834         different call.
11835
11836 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * support.cs: Return proper flags REF/OUT fixing the previous
11839         commit.  
11840
11841         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11842         not used to mean `ref' but `ref or out' in ParameterReference
11843
11844         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11845         full type signature instead of calling TypeManger.CSharpName
11846         ourselves. 
11847
11848         * support.cs (InternalParameters.ParameterDesc): Do not compare
11849         directly to the modflags, because REF/OUT will actually be bitsets
11850         if set. 
11851
11852         * delegate.cs (VerifyMethod): Check also the modifiers.
11853
11854         * cs-tokenizer.cs: Fix bug where floating point values with an
11855         exponent where a sign was missing was ignored.
11856
11857         * driver.cs: Allow multiple assemblies to be specified in a single
11858         /r: argument
11859
11860 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11861
11862         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11863         because identifiers after a parenthesis would end up in this kind
11864         of production, and we needed to desamiguate it for having casts
11865         like:
11866
11867                 (UserDefinedType *) xxx
11868
11869 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11872         we should set on the Bindingflags.NonPublic, but not turn on
11873         private_ok.  private_ok controls whether a Private member is
11874         returned (this is chekced on the filter routine), while the
11875         BindingFlags.NonPublic just controls whether private/protected
11876         will be allowed.   This fixes the problem part of the problem of
11877         private properties being allowed to be used in derived classes.
11878
11879         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11880         so we can call the children DoResolveLValue method (this will
11881         properly signal errors on lvalue assignments to base properties)
11882
11883         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11884         getter are null, and we have a property info, we know that this
11885         happened because the lookup failed, so we report an error 122 for
11886         protection level violation.
11887
11888         We also silently return if setter and getter are null in the
11889         resolve functions, this condition only happens if we have flagged
11890         the error before.  This is the other half of the problem. 
11891
11892         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11893         not have accessibility information, that is why we were returning
11894         true in the filter function in typemanager.cs.
11895
11896         To properly report 122 (property is inaccessible because of its
11897         protection level) correctly, we report this error in ResolveAccess
11898         by failing if both the setter and the getter are lacking (ie, the
11899         lookup failed). 
11900
11901         DoResolve and DoLResolve have been modified to check for both
11902         setter/getter being null and returning silently, the reason being
11903         that I did not want to put the knowledge about this error in upper
11904         layers, like:
11905
11906         int old = Report.Errors;
11907         x = new PropertyExpr (...);
11908         if (old != Report.Errors)
11909                 return null;
11910         else
11911                 return x;
11912
11913         So the property expr is returned, but it is invalid, so the error
11914         will be flagged during the resolve process. 
11915
11916         * class.cs: Remove InheritablePropertySignatureCompare from the
11917         class, as we no longer depend on the property signature to compute
11918         whether it is possible to implement a method or not.
11919
11920         The reason is that calling PropertyInfo.GetGetMethod will return
11921         null (in .NET, in Mono it works, and we should change this), in
11922         cases where the Get Method does not exist in that particular
11923         class.
11924
11925         So this code:
11926
11927         class X { public virtual int A { get { return 1; } } }
11928         class Y : X { }
11929         class Z : Y { public override int A { get { return 2; } } }
11930
11931         Would fail in Z because the parent (Y) would not have the property
11932         defined.  So we avoid this completely now (because the alternative
11933         fix was ugly and slow), and we now depend exclusively on the
11934         method names.
11935
11936         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11937         reference method, instead of using the property.
11938
11939         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11940         routines are gone now.
11941
11942         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11943         names, they were incorrectly named.
11944
11945         * cs-tokenizer.cs: Return are more gentle token on failure. 
11946
11947         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11948         had an out-of-sync index variable, which caused it to remove from
11949         the list of pending methods the wrong method sometimes.
11950
11951 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11952
11953         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11954         CanWrite, because those refer to this particular instance of the
11955         property, and do not take into account the fact that we can
11956         override single members of a property.
11957
11958         Constructor requires an EmitContext.  The resolution process does
11959         not happen here, but we need to compute the accessors before,
11960         because the resolution does not always happen for properties.
11961
11962         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11963         subclass, before we did not update this flag, but we did update
11964         bindingflags. 
11965
11966         (GetAccessors): Drop this routine, as it did not work in the
11967         presence of partially overwritten set/get methods. 
11968
11969         Notice that this broke the cs1540 detection, but that will require
11970         more thinking. 
11971
11972 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11973
11974         * class.cs:
11975         * codegen.cs:
11976         * driver.cs: issue a warning instead of an error if we don't support
11977         debugging for the platform. Also ignore a couple of errors that may
11978         arise when trying to write the symbols. Undo my previous patch.
11979
11980 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11981
11982         * driver.cs: ignore /debug switch except for Unix platforms.
11983
11984 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11985
11986         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11987
11988 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11989
11990         * driver.cs: Do not make mcs-debug conditional, so we do not break
11991         builds that use it.
11992
11993         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11994         review this patch.  But basically after all the children variables
11995         have been merged, the value of "Breaks" was not being set to
11996         new_breaks for Switch blocks.  I think that it should be set after
11997         it has executed.  Currently I set this to the value of new_breaks,
11998         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11999         conservative, but I do not understand this code very well.
12000
12001         I did not break anything in the build, so that is good ;-)
12002
12003         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12004
12005 2002-10-20  Mark Crichton  <crichton@gimp.org>
12006
12007         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12008
12009 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12010
12011         * cfold.cs: Fixed compile blocker.
12012
12013 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12014
12015         * driver.cs: I was chekcing the key, not the file.
12016
12017 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12018
12019         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12020         message that we were generating - we just need to silently return
12021         a null.
12022
12023 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12024
12025         * class.cs (Event.Define): Change my previous commit, as this
12026         breaks the debugger.  This is a temporary hack, as it seems like
12027         the compiler is generating events incorrectly to begin with.
12028
12029         * expression.cs (Binary.ResolveOperator): Added support for 
12030         "U operator - (E x, E y)"
12031
12032         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12033         y)".
12034
12035         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12036         init-only variables, but this path did not take into account that
12037         there might be also instance readonly variables.  Correct this
12038         problem. 
12039
12040         This fixes bug 32253
12041
12042         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12043         delegates as well.
12044
12045         * driver.cs: Change the extension for modules to `netmodule'
12046
12047         * cs-parser.jay: Improved slightly the location tracking for
12048         the debugger symbols.
12049
12050         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12051         modifiers that were specified instead of the hardcoded value
12052         (FamAndAssem).  This was basically ignoring the static modifier,
12053         and others.  Fixes 32429.
12054
12055         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12056         fixed a bug in the process (32476)
12057
12058         * expression.cs (ArrayAccess.EmitAssign): Patch from
12059         hwang_rob@yahoo.ca that fixes bug 31834.3
12060
12061 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12062
12063         * driver.cs: Make the module extension .netmodule.
12064
12065 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12066
12067         * driver.cs: Report an error if the resource file is not found
12068         instead of crashing.
12069
12070         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12071         false, like Emit does.
12072
12073 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12074
12075         * typemanager.cs: Remove unused private member.  Also reported mcs
12076         bug to report this as a warning like csc.
12077
12078 2002-10-15  Martin Baulig  <martin@gnome.org>
12079
12080         * statement.cs (Statement.Emit): Made this a virtual method; emits
12081         the line number info and calls DoEmit().
12082         (Statement.DoEmit): New protected abstract method, formerly knows
12083         as Statement.Emit().
12084
12085         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12086
12087 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12090         have fixed a remaining problem: not every AddXXXX was adding a
12091         fully qualified name.  
12092
12093         Now everyone registers a fully qualified name in the DeclSpace as
12094         being defined instead of the partial name.  
12095
12096         Downsides: we are slower than we need to be due to the excess
12097         copies and the names being registered this way.  
12098
12099         The reason for this is that we currently depend (on the corlib
12100         bootstrap for instance) that types are fully qualified, because
12101         we dump all the types in the namespace, and we should really have
12102         types inserted into the proper namespace, so we can only store the
12103         basenames in the defined_names array.
12104
12105 2002-10-10  Martin Baulig  <martin@gnome.org>
12106
12107         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12108         from bug #31834, see the bug report for a testcase which is
12109         miscompiled.
12110
12111 2002-10-10  Martin Baulig  <martin@gnome.org>
12112
12113         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12114         flow analysis code for this.
12115
12116         * statement.cs (Do, While, For): Tell the flow analysis code about
12117         infinite loops.
12118         (FlowBranching.UsageVector): Added support for infinite loops.
12119         (Block.Resolve): Moved the dead code elimination here and use flow
12120         analysis to do it.
12121
12122 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12123
12124         * class.cs (Field.Define): Catch cycles on struct type
12125         definitions. 
12126
12127         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12128         fields if the fields are static.  We only need to check instance
12129         fields. 
12130
12131         * expression.cs (As.DoResolve): Test for reference type.
12132
12133         * statement.cs (Using.ResolveExpression): Use
12134         ConvertImplicitRequired, not ConvertImplicit which reports an
12135         error on failture
12136         (Using.ResolveLocalVariableDecls): ditto.
12137
12138         * expression.cs (Binary.ResolveOperator): Report errors in a few
12139         places where we had to.
12140
12141         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12142
12143 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12144
12145         * expression.cs: Use StoreFromPtr instead of extracting the type
12146         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12147
12148         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12149         an enumeration value to a System.Enum, but System.Enum is not a
12150         value type, but an class type, so we need to box.
12151
12152         (Expression.ConvertExplicit): One codepath could return
12153         errors but not flag them.  Fix this.  Fixes #31853
12154
12155         * parameter.cs (Resolve): Do not allow void as a parameter type.
12156
12157 2002-10-06  Martin Baulig  <martin@gnome.org>
12158
12159         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12160         if it's a class type and not a struct.  Fixes #31815.
12161
12162 2002-10-06  Martin Baulig  <martin@gnome.org>
12163
12164         * statement.cs: Reworked the flow analysis code a bit to make it
12165         usable for dead code elimination.
12166
12167 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12168
12169         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12170
12171 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12172
12173         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12174         to fix the test 165, will investigate deeper.
12175
12176 2002-10-04  Martin Baulig  <martin@gnome.org>
12177
12178         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12179         finally blocks actually work.
12180         (Try.Resolve): We don't need to create a sibling for `finally' if
12181         there is no finally block.
12182
12183 2002-10-04  Martin Baulig  <martin@gnome.org>
12184
12185         * class.cs (Constructor.Define): The default accessibility for a
12186         non-default constructor is private, not public.
12187
12188 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * class.cs (Constructor): Make AllowedModifiers public, add
12191         EXTERN.
12192
12193         * cs-parser.jay: Perform the modifiers test here, as the
12194         constructor for the Constructor class usually receives a zero
12195         because of the way we create it (first we create, later we
12196         customize, and we were never checking the modifiers).
12197
12198         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12199         is a version of LookupTypeReflection that includes the type-name
12200         cache.  This can be used as a fast path for functions that know
12201         the fully qualified name and are only calling into *.GetType() to
12202         obtain a composed type.
12203
12204         This is also used by TypeManager.LookupType during its type
12205         composition.
12206
12207         (LookupType): We now also track the real type name, as sometimes
12208         we can get a quey for the real type name from things like
12209         ComposedCast.  This fixes bug 31422.
12210
12211         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12212         complete type fullname, it does not have to go through the type
12213         resolution system to obtain the composed version of the type (for
12214         obtaining arrays or pointers).
12215
12216         (Conditional.Emit): Use the EmitBoolExpression to
12217         generate nicer code, as requested by Paolo.
12218
12219         (ArrayCreation.CheckIndices): Use the patch from
12220         hwang_rob@yahoo.ca to validate the array initializers. 
12221
12222 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12223
12224         * class.cs (ConstructorInitializer.Emit): simplify code by using
12225         Invocation.EmitCall, and at the same time, fix the bugs in calling
12226         parent constructors that took variable arguments. 
12227
12228         * ecore.cs (Expression.ConvertNumericExplicit,
12229         Expression.ImplicitNumericConversion): Remove the code that
12230         manually wrapped decimal (InternalTypeConstructor call is now gone
12231         as well).
12232
12233         * expression.cs (Cast.TryReduce): Also handle decimal types when
12234         trying to perform a constant fold on the type.
12235
12236         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12237
12238         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12239         that only turned off an error report, and did nothing else. 
12240
12241 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12242
12243         * driver.cs: Handle and ignore /fullpaths
12244
12245 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12246
12247         * expression.cs (Binary.ResolveOperator): Catch the case where
12248         DoNumericPromotions returns true, 
12249
12250         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12251
12252 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12255         report error 70.
12256
12257 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12258
12259         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12260         conversion exists, but it is also required that the conversion be
12261         performed.  This manifested in "(Type64Enum) 2".  
12262
12263         * class.cs (TypeManager.AddMethod): The fix is not to change
12264         AddEnum, because that one was using a fully qualified name (every
12265         DeclSpace derivative does), but to change the AddMethod routine
12266         that was using an un-namespaced name.  This now correctly reports
12267         the duplicated name.
12268
12269         Revert patch until I can properly fix it.  The issue
12270         is that we have a shared Type space across all namespaces
12271         currently, which is wrong.
12272
12273         Options include making the Namespace a DeclSpace, and merge
12274         current_namespace/current_container in the parser.
12275
12276 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12277
12278         * cs-parser.jay: Improve error reporting when we get a different
12279         kind of expression in local_variable_type and
12280         local_variable_pointer_type. 
12281
12282         Propagate this to avoid missleading errors being reported.
12283
12284         * ecore.cs (ImplicitReferenceConversion): treat
12285         TypeManager.value_type as a target just like object_type.   As
12286         code like this:
12287
12288         ValueType v = 1;
12289
12290         Is valid, and needs to result in the int 1 being boxed before it
12291         is assigned to the value type v.
12292
12293         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12294         to validate the enumeration name.
12295
12296         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12297         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12298         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12299
12300         * ecore.cs (TryImplicitIntConversion): When doing an
12301         implicit-enumeration-conversion, check if the type is 64-bits and
12302         perform a conversion before passing to EnumConstant.
12303
12304 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12305
12306         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12307         report ambiguous type references.  Unlike the MS version, we
12308         report what the ambiguity is.   Innovation at work ;-)
12309
12310         (DeclSpace.FindType): Require a location argument to
12311         display when we display an ambiguous error.
12312
12313         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12314
12315         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12316
12317         * expression.cs (EmitDynamicInitializers): Apply patch from
12318         hwang_rob@yahoo.ca that fixes the order in which we emit our
12319         initializers. 
12320
12321 2002-09-21  Martin Baulig  <martin@gnome.org>
12322
12323         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12324         delegate takes no arguments.
12325
12326 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12327
12328         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12329         from integers.
12330
12331         * expression.cs: Extract the underlying type.
12332
12333         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12334
12335         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12336
12337 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12338
12339         * class.cs (TypeContainer.DefineType): We can not use the nice
12340         PackingSize with the size set to 1 DefineType method, because it
12341         will not allow us to define the interfaces that the struct
12342         implements.
12343
12344         This completes the fixing of bug 27287
12345
12346         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12347         means also structs.  This fixes part of the problem. 
12348         (Expresion.ImplicitReferenceConversionExists): ditto.
12349
12350         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12351         error if there were no errors reported during the type lookup
12352         process, to avoid duplicates or redundant errors.  Without this
12353         you would get an ambiguous errors plus a type not found.  We have
12354         beaten the user enough with the first error.  
12355
12356         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12357         reference. 
12358
12359         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12360         during the resolution process, stop the lookup, this avoids
12361         repeated error reports (same error twice).
12362
12363         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12364
12365         * typemanager.cs (LookupType): Redo the type lookup code to match
12366         the needs of System.Reflection.  
12367
12368         The issue is that System.Reflection requires references to nested
12369         types to begin with a "+" sign instead of a dot.  So toplevel
12370         types look like: "NameSpace.TopLevelClass", and nested ones look
12371         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12372         levels. 
12373
12374 2002-09-19  Martin Baulig  <martin@gnome.org>
12375
12376         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12377         says that a method always returns or always throws an exception,
12378         don't report the CS0161.
12379
12380         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12381         set `Returns = new_returns'.
12382
12383 2002-09-19  Martin Baulig  <martin@gnome.org>
12384
12385         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12386         to an enum constant, check for a CS0176.
12387
12388 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12391         for operators that must be in pairs and report errors.
12392
12393         * ecore.cs (SimpleName.DoResolveType): During the initial type
12394         resolution process, when we define types recursively, we must
12395         check first for types in our current scope before we perform
12396         lookups in the enclosing scopes.
12397
12398         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12399
12400         (Invocation.VerifyArgumentsCompat): Call
12401         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12402         I thought we were supposed to always call this, but there are a
12403         few places in the code where we dont do it.
12404
12405 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12406
12407         * driver.cs: Add support in -linkres and -resource to specify the
12408         name of the identifier.
12409
12410 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12411
12412         * ecore.cs (StandardConversionExists): Sync with the conversion
12413         code: allow anything-* to void* conversions.
12414
12415         (FindMostSpecificSource): Use an Expression argument
12416         instead of a Type, because we might be handed over a Literal which
12417         gets a few more implicit conversions that plain types do not.  So
12418         this information was being lost.
12419
12420         Also, we drop the temporary type-holder expression when not
12421         required.
12422
12423 2002-09-17  Martin Baulig  <martin@gnome.org>
12424
12425         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12426         this is an explicit interface implementation.
12427
12428 2002-09-17  Martin Baulig  <martin@gnome.org>
12429
12430         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12431         different `IndexerName' attributes.
12432
12433         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12434         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12435         virtual CommonResolve().
12436
12437 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12440         and convert that to the UnderlyingType.
12441
12442         * statement.cs (Foreach.Resolve): Indexers are just like variables
12443         or PropertyAccesses.
12444
12445         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12446         inside quoted strings, we were not doing this before.
12447
12448 2002-09-16  Martin Baulig  <martin@gnome.org>
12449
12450         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12451         resolve it.  This is needed for the definite assignment check of the
12452         instance expression, fixes bug #29846.
12453         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12454
12455 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12456
12457         * parameter.cs: Fix compile error.  Cannot reference static member
12458         from an instance object.  Is this an mcs bug?
12459
12460 2002-09-14  Martin Baulig  <martin@gnome.org>
12461
12462         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12463         multiple times.  Fixes bug #30295, added test-166.cs.
12464
12465 2002-09-14  Martin Baulig  <martin@gnome.org>
12466
12467         * statement.cs (Block.Emit): Don't emit unreachable code.
12468         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12469         `break' statements.
12470         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12471
12472 2002-09-14  Martin Baulig  <martin@gnome.org>
12473
12474         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12475         is set.
12476
12477 2002-09-14  Martin Baulig  <martin@gnome.org>
12478
12479         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12480         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12481         be false on the ms runtime.
12482
12483 2002-09-13  Martin Baulig  <martin@gnome.org>
12484
12485         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12486         the CS0038 error message.
12487
12488 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12491         constant inside, return it.
12492
12493 2002-09-12  Martin Baulig  <martin@gnome.org>
12494
12495         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12496         implicit conversion can be done between enum types.
12497
12498         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12499         check whether an implicit conversion to the current enum's UnderlyingType
12500         exists and report an error if not.
12501
12502         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12503         without debugging support.
12504
12505         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12506         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12507
12508 2002-09-12  Martin Baulig  <martin@gnome.org>
12509
12510         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12511
12512         * ecore.cs (IMemberExpr.DeclaringType): New property.
12513         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12514         nonstatic member of an outer type (CS0038).
12515
12516 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12517
12518         * driver.cs: Activate the using-error detector at warning level
12519         4 (at least for MS-compatible APIs).
12520
12521         * namespace.cs (VerifyUsing): Small buglett fix.
12522
12523         * pending.cs (PendingImplementation): pass the container pointer. 
12524
12525         * interface.cs (GetMethods): Allow for recursive definition.  Long
12526         term, I would like to move every type to support recursive
12527         definitions, not the current ordering mechanism that we have right
12528         now.
12529
12530         The situation is this: Attributes are handled before interfaces,
12531         so we can apply attributes to interfaces.  But some attributes
12532         implement interfaces, we will now handle the simple cases
12533         (recursive definitions will just get an error).  
12534
12535         * parameter.cs: Only invalidate types at the end if we fail to
12536         lookup all types.  
12537
12538 2002-09-09  Martin Baulig  <martin@gnome.org>
12539
12540         * ecore.cs (PropertyExpr.Emit): Also check for
12541         TypeManager.system_int_array_get_length so this'll also work when
12542         compiling corlib.  Fixes #30003.
12543
12544 2002-09-09  Martin Baulig  <martin@gnome.org>
12545
12546         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12547         and throw an exception if we can't get the type's size.  Fixed #30040,
12548         added test-165.cs.
12549
12550 2002-09-09  Martin Baulig  <martin@gnome.org>
12551
12552         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12553
12554         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12555         context.  Fixes bug #30027.
12556
12557         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12558         virtual functions.  Fixes bug #30043, added test-164.cs.
12559
12560 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12561
12562         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12563
12564 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12565
12566         * driver.cs: Use an object to get the windows codepage since it's not a
12567         static property.
12568
12569 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * statement.cs (For.Emit): for infinite loops (test == null)
12572         return whether there is a break inside, not always "true".
12573
12574         * namespace.cs (UsingEntry): New struct to hold the name of the
12575         using definition, the location where it is defined, and whether it
12576         has been used in a successful type lookup.
12577
12578         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12579         strings.
12580
12581         * decl.cs: ditto.
12582
12583 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12584
12585         * attribute.cs : Fix incorrect code which relied on catching
12586         a NullReferenceException to detect a null being passed in
12587         where an object was expected.
12588
12589 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12590
12591         * statement.cs (Try): flag the catch variable as assigned
12592
12593         * expression.cs (Cast): Simplified by using ResolveType instead of
12594         manually resolving.
12595
12596         * statement.cs (Catch): Fix bug by using ResolveType.
12597
12598 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12599
12600         * expression.cs (BetterConversion): Special case for when we have
12601         a NullLiteral as the argument and we have to choose between string
12602         and object types - we choose string the way csc does.
12603
12604         * attribute.cs (Attribute.Resolve): Catch the
12605         NullReferenceException and report error #182 since the Mono
12606         runtime no more has the bug and having this exception raised means
12607         we tried to select a constructor which takes an object and is
12608         passed a null.
12609
12610 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12611
12612         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12613         message (1502, 1503) when we can't locate a method after overload
12614         resolution. This is much more informative and closes the bug
12615         Miguel reported.
12616
12617         * interface.cs (PopulateMethod): Return if there are no argument
12618         types. Fixes a NullReferenceException bug.
12619
12620         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12621         expressions too. Previously we were checking only in one place for
12622         positional arguments leaving out named arguments.
12623
12624         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12625         type to the enum type is not allowed. Remove code corresponding to
12626         that.
12627
12628         (ConvertNumericExplicit): Allow explicit conversions from
12629         the underlying type to enum type. This precisely follows the spec
12630         and closes a bug filed by Gonzalo.
12631
12632 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12633
12634         * compiler.csproj:
12635         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12636
12637 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12640         it was important that we stored the right value after the
12641         reduction in `converted'.
12642
12643 2002-09-04  Martin Baulig  <martin@gnome.org>
12644
12645         * location.cs (Location.SymbolDocument): Use full pathnames for the
12646         source files.
12647
12648 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12649
12650         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12651         of the expression resolve mechanism, because that will catch the
12652         SimpleName error failures.
12653
12654         (Conditional): If we can not resolve the
12655         expression, return, do not crash.
12656
12657 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12658
12659         * cs-tokenizer.cs:
12660         (location): display token name instead of its number.
12661
12662 2002-08-28  Martin Baulig  <martin@gnome.org>
12663
12664         * expression.cs (Binary.ResolveOperator): Don't silently return
12665         but return an error if an operator cannot be applied between two
12666         enum types.
12667
12668 2002-08-28  Martin Baulig  <martin@gnome.org>
12669
12670         * class.cs (Constructor.Define): Set the permission attributes
12671         correctly instead of making all constructors public.
12672
12673 2002-08-28  Martin Baulig  <martin@gnome.org>
12674
12675         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12676         for private members before reporting a CS0103; if we find anything,
12677         it's a CS0122.
12678
12679 2002-08-28  Martin Baulig  <martin@gnome.org>
12680
12681         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12682         to check whether `closure_start_type == closure_invocation_type',
12683         we also need to check whether `m.DeclaringType == closure_invocation_type'
12684         before bypassing the permission checks.  We might be accessing
12685         protected/private members from the base class.
12686         (TypeManager.RealMemberLookup): Only set private_ok if private
12687         members were requested via BindingFlags.NonPublic.
12688
12689         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12690
12691         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12692         MethodGroupExpr.IsExplicitImpl if appropriate.
12693         (Invocation.DoResolve): Don't report the CS0120 for explicit
12694         interface implementations.
12695
12696 2002-08-27  Martin Baulig  <martin@gnome.org>
12697
12698         * expression.cs (Invocation.DoResolve): If this is a static
12699         method and we don't have an InstanceExpression, we must report
12700         a CS0120.
12701
12702 2002-08-25  Martin Baulig  <martin@gnome.org>
12703
12704         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12705         `==' between a valuetype and an object.
12706
12707 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12708
12709         * ecore.cs (TypeExpr): Provide a ToString method.
12710
12711 2002-08-24  Martin Baulig  <martin@gnome.org>
12712
12713         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12714         now called proggie.dbg and it's a binary file.
12715
12716 2002-08-23  Martin Baulig  <martin@gnome.org>
12717
12718         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12719
12720 2002-08-23  Martin Baulig  <martin@gnome.org>
12721
12722         * struct.cs (MyStructInfo.ctor): Make this work with empty
12723         structs; it's not allowed to use foreach() on null.
12724
12725 2002-08-23  Martin Baulig  <martin@gnome.org>
12726
12727         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12728         writer the full pathname of the generated assembly.
12729
12730 2002-08-23  Martin Baulig  <martin@gnome.org>
12731
12732         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12733         A `finally' block never returns or breaks; improved handling of
12734         unreachable code.
12735
12736 2002-08-23  Martin Baulig  <martin@gnome.org>
12737
12738         * statement.cs (Throw.Resolve): Allow `throw null'.
12739
12740 2002-08-23  Martin Baulig  <martin@gnome.org>
12741
12742         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12743         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12744         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12745         MemberLookup would return a wrong event if this is an explicit
12746         interface implementation and the class has an event with the same
12747         name.
12748
12749 2002-08-23  Martin Baulig  <martin@gnome.org>
12750
12751         * statement.cs (Block.AddChildVariableNames): New public method.
12752         (Block.AddChildVariableName): Likewise.
12753         (Block.IsVariableNameUsedInChildBlock): Likewise.
12754         (Block.AddVariable): Check whether a variable name has already
12755         been used in a child block.
12756
12757         * cs-parser.jay (declare_local_variables): Mark all variable names
12758         from the current block as being used in a child block in the
12759         implicit block.
12760
12761 2002-08-23  Martin Baulig  <martin@gnome.org>
12762
12763         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12764         find the symbol writer.
12765
12766         * driver.cs: csc also allows the arguments to /define being
12767         separated by commas, not only by semicolons.
12768
12769 2002-08-23  Martin Baulig  <martin@gnome.org>
12770
12771         * interface.cs (Interface.GetMembers): Added static check for events.
12772
12773 2002-08-15  Martin Baulig  <martin@gnome.org>
12774
12775         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12776         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12777
12778         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12779         why the MethodData.EmitDestructor() change was necessary.
12780
12781 2002-08-20  Martin Baulig  <martin@gnome.org>
12782
12783         * class.cs (TypeContainer.FindMembers): Added static check for events.
12784
12785         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12786
12787         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12788         use Type.GetEvents(), not Type.FindMembers().
12789
12790 2002-08-20  Martin Baulig  <martin@gnome.org>
12791
12792         * decl.cs (MemberCache): Added a special method cache which will
12793         be used for method-only searched.  This ensures that a method
12794         search will return a MethodInfo with the correct ReflectedType for
12795         inherited methods.      
12796
12797 2002-08-20  Martin Baulig  <martin@gnome.org>
12798
12799         * decl.cs (DeclSpace.FindMembers): Made this public.
12800
12801 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12802
12803         * delegate.cs: fixed build on windows.
12804         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12805
12806 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12807
12808         * ecore.cs (StandardConversionExists): Return a false
12809         if we are trying to convert the void type to anything else
12810         since that is not allowed.
12811
12812         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12813         we flag error 70 in the event an event is trying to be accessed
12814         directly from outside the declaring type.
12815
12816 2002-08-20  Martin Baulig  <martin@gnome.org>
12817
12818         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12819         MemberCache from typemanager.cs to decl.cs.
12820
12821 2002-08-19  Martin Baulig  <martin@gnome.org>
12822
12823         * class.cs (TypeContainer): Implement IMemberContainer.
12824         (TypeContainer.DefineMembers): Create the MemberCache.
12825         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12826         return public members if BindingFlags.Public was given, check
12827         whether members are static.
12828
12829 2002-08-16  Martin Baulig  <martin@gnome.org>
12830
12831         * decl.cs (DeclSpace.Define): Splitted this in Define and
12832         DefineMembers.  DefineMembers is called first and initializes the
12833         MemberCache.
12834
12835         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12836         DefineMembers() on all our DeclSpaces.
12837
12838         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12839         but call DefineMembers() on all nested interfaces.  We call their
12840         Define() in our new Define() function.
12841
12842         * interface.cs (Interface): Implement IMemberContainer.
12843         (Interface.Define): Moved all code except the attribute stuf to
12844         DefineMembers().
12845         (Interface.DefineMembers): Initialize the member cache.
12846
12847         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12848         need this anymore since we can use MemberCache.FindMembers directly.
12849
12850 2002-08-19  Martin Baulig  <martin@gnome.org>
12851
12852         * typemanager.cs (MemberCache): When creating the cache for an
12853         interface type, add all inherited members.
12854         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12855         to `out bool used_cache' and documented it.
12856         (TypeManager.MemberLookup): If we already used the cache in the first
12857         iteration, we don't need to do the interfaces check.
12858
12859 2002-08-19  Martin Baulig  <martin@gnome.org>
12860
12861         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12862         here from IMemberFinder and don't implement this interface anymore.
12863         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12864
12865         * typemanager.cs (IMemberFinder): This interface is now only used by
12866         classes which actually support the member cache.
12867         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12868         since we only put DeclSpaces into this Hashtable.
12869         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12870         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12871
12872 2002-08-16  Martin Baulig  <martin@gnome.org>
12873
12874         * typemanager.cs (ICachingMemberFinder): Removed.
12875         (IMemberFinder.MemberCache): New property.
12876         (TypeManager.FindMembers): Merged this with RealFindMembers().
12877         This function will never be called from TypeManager.MemberLookup()
12878         so we can't use the cache here, just the IMemberFinder.
12879         (TypeManager.MemberLookup_FindMembers): Check whether the
12880         IMemberFinder has a MemberCache and call the cache's FindMembers
12881         function.
12882         (MemberCache): Rewrote larger parts of this yet another time and
12883         cleaned it up a bit.
12884
12885 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12886
12887         * driver.cs (LoadArgs): Support quoting.
12888
12889         (Usage): Show the CSC-like command line arguments.
12890
12891         Improved a few error messages.
12892
12893 2002-08-15  Martin Baulig  <martin@gnome.org>
12894
12895         * typemanager.cs (IMemberContainer.Type): New property.
12896         (IMemberContainer.IsInterface): New property.
12897
12898         The following changes are conditional to BROKEN_RUNTIME, which is
12899         defined at the top of the file.
12900
12901         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12902         class'es members, but add all members from TypeHandle.ObjectType
12903         if we're an interface.
12904         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12905         is the current type.
12906         (MemberCache.CacheEntry.Container): Removed this field.
12907         (TypeHandle.GetMembers): Include inherited members.
12908
12909 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12910
12911         * typemanager.cs: fixed compilation and added a comment on a field that
12912         is never used.
12913
12914 2002-08-15  Martin Baulig  <martin@gnome.org>
12915
12916         * class.cs (ConstructorInitializer.Resolve): In the
12917         Expression.MemberLookup call, use the queried_type as
12918         invocation_type.
12919
12920         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12921         declared' attribute, it's always true.
12922         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12923         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12924         temporary wrapper for FindMembers which tells MemberLookup whether
12925         members from the base classes are included in the return value.
12926         This will go away soon.
12927         (TypeManager.MemberLookup): Use this temporary hack here; once the
12928         new MemberCache is completed, we don't need to do the DeclaredOnly
12929         looping here anymore since the MemberCache will take care of this.
12930         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12931         (MemberCache): When creating the MemberCache for a class, get
12932         members from the current class and all its base classes.
12933         (MemberCache.CacheEntry.Container): New field.  This is a
12934         temporary hack until the Mono runtime is fixed to distinguish
12935         between ReflectedType and DeclaringType.  It allows us to use MCS
12936         with both the MS runtime and the unfixed Mono runtime without
12937         problems and without accecting performance.
12938         (MemberCache.SearchMembers): The DeclaredOnly looping from
12939         TypeManager.MemberLookup is now done here.      
12940
12941 2002-08-14  Martin Baulig  <martin@gnome.org>
12942
12943         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12944         Type.GetFields on dynamic types but get the fields from the
12945         corresponding TypeContainer.
12946         (MyStructInfo.GetStructInfo): Added check for enum types.
12947
12948         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12949         (MemberList.SyncRoot): Implemented.
12950         (TypeManager.FilterWithClosure): No need to check permissions if
12951         closure_start_type == closure_invocation_type, don't crash if
12952         closure_invocation_type is null.
12953
12954 2002-08-13  Martin Baulig  <martin@gnome.org>
12955
12956         Rewrote TypeContainer.FindMembers to use a member cache.  This
12957         gives us a speed increase of about 35% for the self-hosting MCS
12958         build and of about 15-20% for the class libs (both on GNU/Linux).
12959
12960         * report.cs (Timer): New class to get enhanced profiling.  This
12961         whole class is "TIMER" conditional since it remarkably slows down
12962         compilation speed.
12963
12964         * class.cs (MemberList): New class.  This is an IList wrapper
12965         which we're now using instead of passing MemberInfo[]'s around to
12966         avoid copying this array unnecessarily.
12967         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12968         (ICachingMemberFinder, IMemberContainer): New interface.
12969         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12970         has already been checked, otherwise use it for the name comparision.
12971         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12972         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12973         if possible.  Returns a MemberList, not a MemberInfo [].
12974         (TypeHandle): New class, implements IMemberContainer.  We create
12975         one instance of this class per type, it contains a MemberCache
12976         which is used to do the member lookups.
12977         (MemberCache): New class.  Each instance of this class contains
12978         all members of a type and a name-based hash table.
12979         (MemberCache.FindMembers): This is our new member lookup
12980         function.  First, it looks up all members of the requested name in
12981         the hash table.  Then, it walks this list and sorts out all
12982         applicable members and returns them.
12983
12984 2002-08-13  Martin Baulig  <martin@gnome.org>
12985
12986         In addition to a nice code cleanup, this gives us a performance
12987         increase of about 1.4% on GNU/Linux - not much, but it's already
12988         half a second for the self-hosting MCS compilation.
12989
12990         * typemanager.cs (IMemberFinder): New interface.  It is used by
12991         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12992         Enum, Delegate or Interface.
12993         (TypeManager.finder_to_member_finder): New PtrHashtable.
12994         (TypeManager.finder_to_container): Removed.
12995         (TypeManager.finder_to_delegate): Removed.
12996         (TypeManager.finder_to_interface): Removed.
12997         (TypeManager.finder_to_enum): Removed.
12998
12999         * interface.cs (Interface): Implement IMemberFinder.
13000
13001         * delegate.cs (Delegate): Implement IMemberFinder.
13002
13003         * enum.cs (Enum): Implement IMemberFinder.
13004
13005         * class.cs (TypeContainer): Implement IMemberFinder.
13006
13007 2002-08-12  Martin Baulig  <martin@gnome.org>
13008
13009         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13010
13011 2002-08-12  Martin Baulig  <martin@gnome.org>
13012
13013         * ecore.cs (ITypeExpression): New interface for expressions which
13014         resolve to a type.
13015         (TypeExpression): Renamed to TypeLookupExpression.
13016         (Expression.DoResolve): If we're doing a types-only lookup, the
13017         expression must implement the ITypeExpression interface and we
13018         call DoResolveType() on it.
13019         (SimpleName): Implement the new ITypeExpression interface.
13020         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13021         hack, the situation that we're only looking up types can't happen
13022         anymore when this method is called.  Moved the type lookup code to
13023         DoResolveType() and call it.
13024         (SimpleName.DoResolveType): This ITypeExpression interface method
13025         is now doing the types-only lookup.
13026         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13027         (ResolveFlags): Added MaskExprClass.
13028
13029         * expression.cs (MemberAccess): Implement the ITypeExpression
13030         interface.
13031         (MemberAccess.DoResolve): Added support for a types-only lookup
13032         when we're called via ITypeExpression.DoResolveType().
13033         (ComposedCast): Implement the ITypeExpression interface.
13034
13035         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13036         Expression.Resolve() with ResolveFlags.Type instead.
13037
13038 2002-08-12  Martin Baulig  <martin@gnome.org>
13039
13040         * interface.cs (Interface.Define): Apply attributes.
13041
13042         * attribute.cs (Attribute.ApplyAttributes): Added support for
13043         interface attributes.
13044
13045 2002-08-11  Martin Baulig  <martin@gnome.org>
13046
13047         * statement.cs (Block.Emit): Only check the "this" variable if we
13048         do not always throw an exception.
13049
13050         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13051         whether the property has a set accessor.
13052
13053 2002-08-11  Martin Baulig  <martin@gnome.org>
13054
13055         Added control flow analysis support for structs.
13056
13057         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13058         with control flow analysis turned off.
13059         (IVariable): New interface.
13060         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13061         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13062         (FieldExpr.DoResolve): Resolve the instance expression with flow
13063         analysis turned off and do the definite assignment check after the
13064         resolving when we know what the expression will resolve to.
13065
13066         * expression.cs (LocalVariableReference, ParameterReference):
13067         Implement the new IVariable interface, only call the flow analysis
13068         code if ec.DoFlowAnalysis is true.
13069         (This): Added constructor which takes a Block argument.  Implement
13070         the new IVariable interface.
13071         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13072         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13073         This does the definite assignment checks for struct members.
13074
13075         * class.cs (Constructor.Emit): If this is a non-static `struct'
13076         constructor which doesn't have any initializer, call
13077         Block.AddThisVariable() to tell the flow analysis code that all
13078         struct elements must be initialized before control returns from
13079         the constructor.
13080
13081         * statement.cs (MyStructInfo): New public class.
13082         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13083         argument to this indexer.  If non-zero, check an individual struct
13084         member, not the whole struct.
13085         (FlowBranching.CheckOutParameters): Check struct members.
13086         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13087         overloaded versions of these methods which take an additional
13088         `int field_idx' argument to check struct members.
13089         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13090         overloaded versions of these methods which take an additional
13091         `string field_name' argument to check struct member.s
13092         (VariableInfo): Implement the IVariable interface.
13093         (VariableInfo.StructInfo): New public property.  Returns the
13094         MyStructInfo instance of the variable if it's a struct or null.
13095         (Block.AddThisVariable): New public method.  This is called from
13096         Constructor.Emit() for non-static `struct' constructor which do
13097         not have any initializer.  It creates a special variable for the
13098         "this" instance variable which will be checked by the flow
13099         analysis code to ensure that all of the struct's fields are
13100         initialized before control returns from the constructor.
13101         (UsageVector): Added support for struct members.  If a
13102         variable/parameter is a struct with N members, we reserve a slot
13103         in the usage vector for each member.  A struct is considered fully
13104         initialized if either the struct itself (slot 0) or all its
13105         members are initialized.
13106
13107 2002-08-08  Martin Baulig  <martin@gnome.org>
13108
13109         * driver.cs (Driver.MainDriver): Only report an error CS5001
13110         if there were no compilation errors.
13111
13112         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13113         `UnsafeContext' property to determine whether the parent is in
13114         unsafe context rather than checking the parent's ModFlags:
13115         classes nested in an unsafe class are unsafe as well.
13116
13117 2002-08-08  Martin Baulig  <martin@gnome.org>
13118
13119         * statement.cs (UsageVector.MergeChildren): Distinguish between
13120         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13121         we return.  Added test17() and test18() to test-154.cs.
13122
13123 2002-08-08  Martin Baulig  <martin@gnome.org>
13124
13125         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13126         Family access, make sure the invoking type isn't a subclass of the
13127         queried type (that'd be a CS1540).
13128
13129         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13130         this method which takes an additional `Type invocation_type'.
13131
13132         * expression.cs (BaseAccess.DoResolve): Use the base type as
13133         invocation and query type.
13134         (MemberAccess.DoResolve): If the lookup failed and we're about to
13135         report a CS0122, try a lookup with the ec.ContainerType - if this
13136         succeeds, we must report a CS1540.
13137
13138 2002-08-08  Martin Baulig  <martin@gnome.org>
13139
13140         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13141         (MethodGroupExpr): Implement the IMemberExpr interface.
13142
13143         * expression (MemberAccess.ResolveMemberAccess): No need to have
13144         any special code for MethodGroupExprs anymore, they're now
13145         IMemberExprs.   
13146
13147 2002-08-08  Martin Baulig  <martin@gnome.org>
13148
13149         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13150         Family, FamANDAssem and FamORAssem permissions.
13151         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13152
13153 2002-08-08  Martin Baulig  <martin@gnome.org>
13154
13155         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13156         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13157         or loop block.
13158
13159 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13160
13161         * driver.cs: implemented /resource option to embed managed resources.
13162
13163 2002-08-07  Martin Baulig  <martin@gnome.org>
13164
13165         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13166         (FieldBase.HasFieldInitializer): New public property.
13167         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13168         returns the field initializer and makes sure it is only resolved once.
13169         (TypeContainer.EmitFieldInitializers): Call
13170         FieldBase.GetInitializerExpression to get the initializer, this ensures
13171         that it isn't resolved multiple times.
13172
13173         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13174         the resolving process (SimpleName/MemberLookup) that we're currently
13175         emitting a field initializer (which must not access any instance members,
13176         this is an error CS0236).
13177
13178         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13179         argument, if the `IsFieldInitializer' flag is set, we must report and
13180         error CS0236 and not an error CS0120.   
13181
13182 2002-08-07  Martin Baulig  <martin@gnome.org>
13183
13184         * ecore.cs (IMemberExpr): New public interface.
13185         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13186         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13187         if the expression is an IMemberExpr.
13188
13189         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13190         to be null, implicitly default to `this' if we're non-static in
13191         this case.  Simplified the code a lot by using the new IMemberExpr
13192         interface.  Also fixed bug #28176 here.
13193
13194 2002-08-06  Martin Baulig  <martin@gnome.org>
13195
13196         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13197         ParameterReferences during semantic analysis so that we can do a
13198         type-only search when resolving Cast, TypeOf and SizeOf.
13199         (block): Pass the `current_local_parameters' to the Block's
13200         constructor.
13201
13202         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13203         argument to the constructor.
13204         (ConstructorInitializer.Resolve): Create a temporary implicit
13205         block with the parameters.
13206
13207         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13208         references here if we aren't doing a type-only search.
13209
13210         * statement.cs (Block): Added constructor which takes a
13211         `Parameters parameters' argument.
13212         (Block.Parameters): New public property.
13213
13214         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13215         to `Parameters' and made it public readonly.
13216
13217 2002-08-06  Martin Baulig  <martin@gnome.org>
13218
13219         * ecore.cs (Expression.Warning): Made this public as well.
13220
13221         * report.cs (Report.Debug): Print the contents of collections.
13222
13223 2002-08-06  Martin Baulig  <martin@gnome.org>
13224
13225         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13226         used to tell Resolve() which kinds of expressions it may return.
13227         (Expression.Resolve): Added overloaded version of this method which
13228         takes a `ResolveFlags flags' argument.  This can be used to tell
13229         Resolve() which kinds of expressions it may return.  Reports a
13230         CS0118 on error.
13231         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13232         ResolveFlags.SimpleName.
13233         (Expression.Error118): Added overloaded version of this method which
13234         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13235         which kinds of expressions are allowed.
13236
13237         * expression.cs (Argument.ResolveMethodGroup): New public method.
13238         Resolves an argument, but allows a MethodGroup to be returned.
13239         This is used when invoking a delegate.
13240
13241         * TODO: Updated a bit.
13242
13243 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13244
13245         Fixed compilation with csc.
13246
13247         * ecore.cs: Expression.Error made public. Is this correct? Should
13248         Warning be made public too?
13249
13250         * expression.cs: use ea.Location instead of ea.loc.
13251         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13252
13253 2002-08-06  Martin Baulig  <martin@gnome.org>
13254
13255         * ecore.cs (Expression.loc): Moved the location here instead of
13256         duplicating it in all derived classes.
13257         (Expression.Location): New public property.
13258         (Expression.Error, Expression.Warning): Made them non-static and
13259         removed the location argument.
13260         (Expression.Warning): Added overloaded version which takes an
13261         `int level' argument.
13262         (Expression.Error118): Make this non-static and removed the
13263         expression and location arguments.
13264         (TypeExpr): Added location argument to the constructor.
13265
13266         * expression.cs (StaticCallExpr): Added location argument to
13267         the constructor.
13268         (Indirection, PointerArithmetic): Likewise.
13269         (CheckedExpr, UnCheckedExpr): Likewise.
13270         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13271         (StringPtr): Likewise.
13272
13273
13274 2002-08-05  Martin Baulig  <martin@gnome.org>
13275
13276         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13277
13278         * assign.cs (Assign.DoResolve): Check whether the source
13279         expression is a value or variable.
13280
13281         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13282         while resolving the corresponding blocks.
13283
13284         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13285         an error, don't silently return null.
13286
13287         * statement.cs (Block.AddVariable): Do the error reporting here
13288         and distinguish between CS0128 and CS0136.
13289         (Block.DoResolve): Report all unused labels (warning CS0164).
13290         (LabeledStatement): Pass the location to the constructor.
13291         (LabeledStatement.HasBeenReferenced): New property.
13292         (LabeledStatement.Resolve): Set it to true here.
13293
13294         * statement.cs (Return.Emit): Return success even after reporting
13295         a type mismatch error (CS0126 or CS0127), this is what csc does and
13296         it avoids confusing the users with any consecutive errors.
13297
13298 2002-08-05  Martin Baulig  <martin@gnome.org>
13299
13300         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13301
13302         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13303
13304         * expression.cs (MemberAccess.DoResolve): Silently return if an
13305         error has already been reported.
13306
13307         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13308         error has already been reported.
13309
13310 2002-08-05  Martin Baulig  <martin@gnome.org>
13311
13312         * statement.cs (UsageVector): Only initialize the `parameters'
13313         vector if we actually have any "out" parameters.
13314
13315 2002-08-05  Martin Baulig  <martin@gnome.org>
13316
13317         * expression.cs (Binary.ResolveOperator): When combining delegates,
13318         they must have the same type.
13319
13320 2002-08-05  Martin Baulig  <martin@gnome.org>
13321
13322         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13323         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13324         work with the ms runtime and we also don't need it: if we're a
13325         PropertyBuilder and not in the `indexer_arguments' hash, then we
13326         are a property and not an indexer.
13327
13328         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13329         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13330         since the latter one doesn't work with the ms runtime.
13331
13332 2002-08-03  Martin Baulig  <martin@gnome.org>
13333
13334         Fixed bugs #27998 and #22735.
13335
13336         * class.cs (Method.IsOperator): New public field.
13337         (Method.CheckBase): Report CS0111 if there's already a method
13338         with the same parameters in the current class.  Report CS0508 when
13339         attempting to change the return type of an inherited method.
13340         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13341         and it's not marked abstract or extern.
13342         (PropertyBase): New abstract base class for Property and Indexer.
13343         (PropertyBase.CheckBase): Moved here from Property and made it work
13344         for indexers.
13345         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13346         the same so we can reuse it there.
13347         (Property, Indexer): Derive from PropertyBase.
13348         (MethodSignature.inheritable_property_signature_filter): New delegate
13349         to find properties and indexers.
13350
13351         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13352         argument and improved error reporting.
13353
13354         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13355         EmptyReadOnlyParameters and made it a property.
13356
13357         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13358         version of this method which takes a `PropertyInfo indexer'.
13359         (TypeManager.RegisterIndexer): New method.
13360
13361         * class.cs: Added myself as author of this file :-)
13362
13363 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13364
13365         * class.cs: fixed compilation on windoze.
13366
13367 2002-08-03  Martin Baulig  <martin@gnome.org>
13368
13369         * interface.cs (Interface.GetInterfaceBases): Check whether all
13370         base interfaces are at least as accessible than the current one.
13371
13372         * class.cs (TypeContainer.GetClassBases): Check whether base types
13373         are at least as accessible than the current type.
13374         (TypeContainer.AsAccessible): Implemented and made non-static.
13375         (MemberBase.CheckParameters): Report errors if the accessibility
13376         checks fail.
13377
13378         * delegate.cs (Delegate.Delegate): The default visibility is
13379         internal for top-level types and private for nested types.
13380         (Delegate.Define): Report errors if the accessibility checks fail.
13381
13382         * enum.cs (Enum.Enum): The default visibility is internal for
13383         top-level types and private for nested types.
13384         (Enum.DefineType): Compute the correct visibility.
13385
13386         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13387         function which takes a `bool is_toplevel' instead of a TypeContainer.
13388
13389         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13390         builtin type.
13391
13392 2002-08-02  Martin Baulig  <martin@gnome.org>
13393
13394         * expression.cs (LocalVariableReferenc): Added constructor which
13395         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13396         (LocalVariableReference.IsReadOnly): New property.
13397         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13398         variable is readonly, use our own readonly flag to do this; you can
13399         use the new constructor to get a writable reference to a read-only
13400         variable.
13401
13402         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13403         reference to the local variable.
13404
13405 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13406
13407         * rootcontext.cs (ResolveCore): Also include System.Exception
13408
13409         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13410         we reach an EmptyStatement.
13411
13412         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13413         is also fine.
13414
13415         * expression.cs (Binary.ResolveOperator): Check error result in
13416         two places.
13417
13418         use brtrue/brfalse directly and avoid compares to null.
13419
13420 2002-08-02  Martin Baulig  <martin@gnome.org>
13421
13422         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13423         Fixes bug #28407, added test-155.cs.
13424
13425 2002-08-01  Martin Baulig  <martin@gnome.org>
13426
13427         * class.cs (Event.EmitDefaultMethod): Make this work with static
13428         events.  Fixes #28311, added verify-3.cs.
13429
13430 2002-08-01  Martin Baulig  <martin@gnome.org>
13431
13432         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13433         `is_disposable' fields.
13434         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13435         `hm.is_disposable' if we're using the collection pattern.
13436         (Foreach.EmitCollectionForeach): Use the correct type for the
13437         enumerator's local variable, only emit the try/finally block if
13438         necessary (fixes #27713).
13439
13440 2002-08-01  Martin Baulig  <martin@gnome.org>
13441
13442         * ecore.cs (Expression.report118): Renamed to Error118 and made
13443         it public static.
13444
13445         * statement.cs (Throw.Resolve): Check whether the expression is of
13446         the correct type (CS0118) and whether the type derives from
13447         System.Exception (CS0155).
13448         (Catch.Resolve): New method.  Do the type lookup here and check
13449         whether it derives from System.Exception (CS0155).
13450         (Catch.CatchType, Catch.IsGeneral): New public properties.
13451
13452         * typemanager.cs (TypeManager.exception_type): Added.
13453
13454 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13455
13456         * driver.cs: Updated About function.
13457
13458 2002-07-31  Martin Baulig  <martin@gnome.org>
13459
13460         Implemented Control Flow Analysis.
13461
13462         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13463         (EmitContext.CurrentBranching): Added.
13464         (EmitContext.StartFlowBranching): Added.
13465         (EmitContext.EndFlowBranching): Added.
13466         (EmitContext.KillFlowBranching): Added.
13467         (EmitContext.IsVariableAssigned): Added.
13468         (EmitContext.SetVariableAssigned): Added.
13469         (EmitContext.IsParameterAssigned): Added.
13470         (EmitContext.SetParameterAssigned): Added.
13471         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13472         Added control flow analysis stuff here.
13473
13474         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13475         resolve the expression as lvalue.
13476         (LocalVariableReference.DoResolve): Check whether the variable has
13477         already been assigned.
13478         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13479         the parameter as assigned here.
13480         (ParameterReference.DoResolve): Check whether the parameter has already
13481         been assigned.
13482         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13483         expression as lvalue.
13484
13485         * statement.cs (FlowBranching): New class for the flow analysis code.
13486         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13487         (LabeledStatement.IsDefined): New public property.
13488         (LabeledStatement.AddUsageVector): New public method to tell flow
13489         analyis that the label may be reached via a forward jump.
13490         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13491         flow analysis.
13492         (VariableInfo.Number): New public field.  This is used by flow analysis
13493         to number all locals of a block.
13494         (Block.CountVariables): New public property.  This is the number of
13495         local variables in this block (including the locals from all parent
13496         blocks).
13497         (Block.EmitMeta): Number all the variables.
13498
13499         * statement.cs: Added flow analysis support to all classes.
13500
13501 2002-07-31  Martin Baulig  <martin@gnome.org>
13502
13503         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13504         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13505         then use this argument.
13506
13507         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13508
13509         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13510         use this to specify /define options.
13511
13512 2002-07-29  Martin Baulig  <martin@gnome.org>
13513
13514         * statement.cs (Fixed): Moved all code that does variable lookups
13515         and resolvings from Emit to Resolve.
13516
13517         * statement.cs (For): Moved all code that does variable lookups
13518         and resolvings from Emit to Resolve.
13519
13520         * statement.cs (Using): Moved all code that does variable lookups
13521         and resolvings from Emit to Resolve.
13522
13523 2002-07-29  Martin Baulig  <martin@gnome.org>
13524
13525         * attribute.cs (Attribute.Resolve): Explicitly catch a
13526         System.NullReferenceException when creating the
13527         CustromAttributeBuilder and report a different warning message.
13528
13529 2002-07-29  Martin Baulig  <martin@gnome.org>
13530
13531         * support.cs (ParameterData.ParameterName): Added method to
13532         get the name of a parameter.
13533
13534         * typemanager.cs (TypeManager.IsValueType): New public method.
13535
13536 2002-07-29  Martin Baulig  <martin@gnome.org>
13537
13538         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13539         is a flag which specifies that it's either ref or out.
13540         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13541         the out parameter to `out Parameter.Modifier mod', also set the
13542         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13543
13544         * support.cs (InternalParameters.ParameterModifier): Distinguish
13545         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13546         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13547
13548         * expression.cs (Argument.GetParameterModifier): Distinguish
13549         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13550         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13551
13552 2002-07-29  Martin Baulig  <martin@gnome.org>
13553
13554         * expression.cs (ParameterReference.ParameterReference): Added
13555         `Location loc' argument to the constructor.
13556
13557         * cs-parser.jay: Pass location to ParameterReference.
13558
13559 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13560
13561         * statement.cs (Try): Initialize the location.
13562
13563         * cs-parser.jay: pass location to Try.
13564
13565         * expression.cs (Unary.Reduce): Change the prototype to return
13566         whether a constant fold could be performed or not.  The result is
13567         returned in an out parameters.  In the case of Indirection and
13568         AddressOf, we want to perform the full tests.
13569
13570 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * statement.cs (Statement.Emit): Flag dead code.
13573
13574 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13575
13576         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13577
13578 2002-07-27  Martin Baulig  <martin@gnome.org>
13579
13580         * class.cs (MethodData.Define): Put back call to
13581         TypeManager.AddMethod(), accidentally commented this out.
13582
13583         * report.cs (Debug): New public method to print debugging information,
13584         this is `[Conditional ("DEBUG")]'.
13585
13586 2002-07-26  Martin Baulig  <martin@gnome.org>
13587
13588         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13589         (switch_statement): Push the current_block to the switch_stack and
13590         pop it again when we're done with the switch.
13591         (switch_section): The new block is a child of the current_block.
13592         Fixes bug #24007, added test-152.cs.
13593
13594 2002-07-27  Martin Baulig  <martin@gnome.org>
13595
13596         * expression.cs (Invocation.EmitArguments): When calling a varargs
13597         function with only its fixed arguments, we need to pass an empty
13598         array.
13599
13600 2002-07-27  Martin Baulig  <martin@gnome.org>
13601
13602         Mono 0.13 has been released.
13603
13604 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13605
13606         * driver.cs: Rename --resource to --linkres, because that is what
13607         we do currently, we dont support --resource yet.
13608
13609         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13610
13611 2002-07-25  Martin Baulig  <martin@gnome.org>
13612
13613         * class.cs (MethodData): New public class.  This is a `method builder'
13614         class for a method or one accessor of a Property/Indexer/Event.
13615         (MethodData.GetMethodFlags): Moved here from MemberBase.
13616         (MethodData.ApplyAttributes): Likewise.
13617         (MethodData.ApplyObsoleteAttribute): Likewise.
13618         (MethodData.ApplyConditionalAttribute): Likewise.
13619         (MethodData.ApplyDllImportAttribute): Likewise.
13620         (MethodData.CheckAbstractAndExternal): Likewise.
13621         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13622         (MethodData.Emit): Formerly known as Method.Emit().
13623         (MemberBase): Moved everything which was specific to a single
13624         accessor/method to MethodData.
13625         (Method): Create a new MethodData and call Define() and Emit() on it.
13626         (Property, Indexer, Event): Create a new MethodData objects for each
13627         accessor and call Define() and Emit() on them.
13628
13629 2002-07-25  Martin Baulig  <martin@gnome.org>
13630
13631         Made MethodCore derive from MemberBase to reuse the code from there.
13632         MemberBase now also checks for attributes.
13633
13634         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13635         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13636         as virtual.
13637         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13638         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13639         (MemberBase.ApplyAttributes): New virtual method; applies the
13640         attributes to a method or accessor.
13641         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13642         (MemberBase.ApplyConditionalAttribute): Likewise.
13643         (MemberBase.ApplyDllImportAttribute): Likewise.
13644         (MemberBase.CheckAbstractAndExternal): Likewise.
13645         (MethodCore.ParameterTypes): This is now a property instead of a
13646         method, it's initialized from DoDefineParameters().
13647         (MethodCore.ParameterInfo): Removed the set accessor.
13648         (MethodCore.DoDefineParameters): New protected virtual method to
13649         initialize ParameterTypes and ParameterInfo.
13650         (Method.GetReturnType): We can now simply return the MemberType.
13651         (Method.GetMethodFlags): Override the MemberBase version and add
13652         the conditional flags.
13653         (Method.CheckBase): Moved some code from Define() here, call
13654         DoDefineParameters() here.
13655         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13656         here to avoid some larger code duplication.
13657         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13658         ensure that abstract and external accessors don't declare a body.
13659
13660         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13661         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13662         lookup in the attribute's parent classes, so we need to abort as soon
13663         as we found the first match.
13664         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13665         the attribute has no arguments.
13666
13667         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13668         of a Method.
13669
13670 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13671
13672         * cs-parser.jay: reverted previous patch.
13673
13674 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13675
13676         * cs-parser.jay: fixed bug #22119.
13677
13678 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13679
13680         * attribute.cs: fixed compilation. The error was:
13681         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13682         be assigned to before control leaves the current method."
13683         [FIXME:  Filed as bug #28186: MCS must report this error.]
13684
13685 2002-07-25  Martin Baulig  <martin@gnome.org>
13686
13687         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13688         method to pull the condition name ouf of a Conditional attribute.
13689         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13690         the obsolete message and error flag out of an Obsolete attribute.
13691
13692         * class.cs (Method.GetMethodFlags): New public method to get the
13693         TypeManager.MethodFlags for this method.
13694         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13695         private methods.
13696         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13697         if we're overriding a virtual function, set the new private variable
13698         `parent_method'; call the new TypeManager.AddMethod().
13699
13700         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13701         the MethodBuilder and the Method in a PtrHashtable.
13702         (TypeManager.builder_to_method): Added for this purpose.
13703         (TypeManager.MethodFlags): Added IsObsoleteError.
13704         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13705         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13706         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13707         the message from the attribute.
13708
13709 2002-07-24  Martin Baulig  <martin@gnome.org>
13710
13711         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13712         preprocessor directives, ensure that the argument to #define/#undef is
13713         exactly one identifier and that it's actually an identifier.
13714
13715         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13716         did not work ....
13717
13718 2002-07-24  Martin Baulig  <martin@gnome.org>
13719
13720         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13721         initialize it to TypeManager.object_type in the constructor.
13722         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13723         of the `hm.get_current' method if we're using the collection pattern.
13724         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13725         for the explicit conversion to make it work when we're using the collection
13726         pattern and the `Current' property has a different return type than `object'.
13727         Fixes #27713.
13728
13729 2002-07-24  Martin Baulig  <martin@gnome.org>
13730
13731         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13732         does not match, but don't report any errors.  This method is called in
13733         order for all methods in a MethodGroupExpr until a matching method is
13734         found, so we don't want to bail out if the first method doesn't match.
13735         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13736         matches, report the 123.  Fixes #28070.
13737
13738 2002-07-24  Martin Baulig  <martin@gnome.org>
13739
13740         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13741         TypeManager.TypeToCoreType() to the top of the method so the
13742         following equality checks will work.  Fixes #28107.
13743
13744 2002-07-24  Martin Baulig  <martin@gnome.org>
13745
13746         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13747         operand is of type uint, and the other operand is of type sbyte,
13748         short or int, the operands are converted to type long." -
13749         Actually do what this comment already told us.  Fixes bug #28106,
13750         added test-150.cs.
13751
13752 2002-07-24  Martin Baulig  <martin@gnome.org>
13753
13754         * class.cs (MethodBase): New abstract class.  This is now a base
13755         class for Property, Indexer and Event to avoid some code duplication
13756         in their Define() and DefineMethods() methods.
13757         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13758         generic methods for Define() and DefineMethods().
13759         (FieldBase): Derive from MemberBase, not MemberCore.
13760         (Property): Derive from MemberBase, not MemberCore.
13761         (Property.DefineMethod): Moved all the code from this method to the
13762         new MethodBase.DefineAccessor(), just call it with appropriate
13763         argumetnts.
13764         (Property.Define): Call the new Property.DoDefine(), this does some
13765         sanity checks and we don't need to duplicate the code everywhere.
13766         (Event): Derive from MemberBase, not MemberCore.
13767         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13768         accessors, this will also make them work with interface events.
13769         (Indexer): Derive from MemberBase, not MemberCore.
13770         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13771         (Indexer.Define): Use the new MethodBase functions.
13772
13773         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13774         argument to the constructor.
13775         (Interface.FindMembers): Added support for interface events.
13776         (Interface.PopluateEvent): Implemented.
13777
13778         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13779
13780 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13781
13782         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13783         but this is required to check for a method name being the same as
13784         the containing class.  
13785
13786         Handle this now.
13787
13788 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13789
13790         * interface.cs: initialize variable.
13791
13792 2002-07-23  Martin Baulig  <martin@gnome.org>
13793
13794         Implemented the IndexerName attribute in interfaces.
13795
13796         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13797         name if this is an explicit interface implementation.
13798         (Indexer.InterfaceIndexerName): New public variable.  If we're
13799         implementing an interface indexer, this is the IndexerName in that
13800         interface.  Otherwise, it's the IndexerName.
13801         (Indexer.DefineMethod): If we're implementing interface indexer,
13802         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13803         and Pending.ImplementIndexer methods.
13804         (Indexer.Define): Also define the PropertyBuilder if we're
13805         implementing an interface indexer and this is neither an explicit
13806         interface implementation nor do the IndexerName match the one in
13807         the interface.
13808
13809         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13810         If a method is defined here, then we always need to create a proxy
13811         for it.  This is used when implementing interface indexers.
13812         (Pending.IsInterfaceIndexer): New public method.
13813         (Pending.ImplementIndexer): New public method.
13814         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13815         This is used when implementing interface indexers to define a proxy
13816         if necessary.
13817         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13818         define a proxy if necessary.
13819
13820         * interface.cs (Interface.IndexerName): New public variable.
13821         (Interface.PopulateIndexer): Set the IndexerName.
13822         (Interface.DefineIndexers): New private method.  Populate all the
13823         indexers and make sure their IndexerNames match.
13824
13825         * typemanager.cs (IndexerPropertyName): Added support for interface
13826         indexers.
13827
13828 2002-07-22  Martin Baulig  <martin@gnome.org>
13829
13830         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13831         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13832         ret if HasReturnLabel.
13833         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13834         variables.
13835
13836         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13837         and set the ec.LoopBeginTryCatchLevel.
13838         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13839         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13840         the current ec.TryCatchLevel, the branch goes out of an exception
13841         block.  In this case, we need to use Leave and not Br.
13842
13843 2002-07-22  Martin Baulig  <martin@gnome.org>
13844
13845         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13846         block unless the block does not always return or it is contained in
13847         another try { ... } catch { ... } block.  Fixes bug #26506.
13848         Added verify-1.cs to the test suite.
13849
13850 2002-07-22  Martin Baulig  <martin@gnome.org>
13851
13852         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13853         then we do not always return.  Fixes bug #24985.
13854
13855 2002-07-22  Martin Baulig  <martin@gnome.org>
13856
13857         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13858         lookup on a per-class level; ie. walk up the class hierarchy until we
13859         found at least one applicable method, then choose the best among them.
13860         Fixes bug #24463 and test-29.cs.
13861
13862 2002-07-22  Martin Baulig  <martin@gnome.org>
13863
13864         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13865         return types of the methods.  The return type is not part of the
13866         signature and we must not check it to make the `new' modifier work.
13867         Fixes bug #27999, also added test-147.cs.
13868         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13869
13870         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13871         on the method's return type.
13872
13873 2002-07-21  Martin Baulig  <martin@gnome.org>
13874
13875         * assign.cs: Make this work if the rightmost source is a constant and
13876         we need to do an implicit type conversion.  Also adding a few more tests
13877         to test-38.cs which should have caught this.
13878
13879         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13880         target in the makefile for this.  The makefile.gnu is primarily intended
13881         for end-users who don't want to debug the compiler.
13882
13883 2002-07-21  Martin Baulig  <martin@gnome.org>
13884
13885         * assign.cs: Improved the Assign class so it can now handle embedded
13886         assignments (X = Y = Z = something).  As a side-effect this'll now also
13887         consume less local variables.  test-38.cs now passes with MCS, added
13888         a few new test cases to that test.
13889
13890 2002-07-20  Martin Baulig  <martin@gnome.org>
13891
13892         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13893         instructions.  Fixes bug #27977, also added test-146.cs.
13894
13895 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13896
13897         * cs-tokenizer.cs: fixed getHex ().
13898
13899 2002-07-19  Martin Baulig  <martin@gnome.org>
13900
13901         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13902         not Type.GetType() to lookup the array type.  This is needed when
13903         we're constructing an array of a user-defined type.
13904         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13905         single-dimensional arrays, but also for single-dimensial arrays of
13906         type decimal.
13907
13908 2002-07-19  Martin Baulig  <martin@gnome.org>
13909
13910         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13911         this function is called, it's not allowed to share LocalBuilders
13912         among ILGenerators.
13913
13914 2002-07-19  Martin Baulig  <martin@gnome.org>
13915
13916         * expression.cs (Argument.Resolve): Report an error 118 when trying
13917         to pass a type as argument.
13918
13919 2002-07-18  Martin Baulig  <martin@gnome.org>
13920
13921         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13922         Conv_R_Un for the signed `long' type.
13923
13924 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13927         `expr' for the temporary result, as that will fail if we do
13928         multiple resolves on the same expression.
13929
13930 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13933         ec.TypeContainer for looking up aliases. 
13934
13935         * class.cs (TypeContainer): Remove LookupAlias from here.
13936
13937         * decl.cs (DeclSpace); Move here.
13938
13939 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13940
13941         * class.cs (FindMembers): Only call filter if the constructor
13942         bulider is not null.
13943
13944         Also handle delegates in `NestedTypes' now.  Now we will perform
13945         type lookups using the standard resolution process.  This also
13946         fixes a bug.
13947
13948         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13949         This uses Expressions (the limited kind that can be parsed by the
13950         tree) instead of strings.
13951
13952         * expression.cs (ComposedCast.ToString): Implement, used to flag
13953         errors since now we have to render expressions.
13954
13955         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13956         FormArrayType. 
13957
13958         * ecore.cs (SimpleName.ToString): ditto.
13959
13960         * cs-parser.jay: Instead of using strings to assemble types, use
13961         Expressions to assemble the type (using SimpleName, ComposedCast,
13962         MemberAccess).  This should fix the type lookups in declarations,
13963         because we were using a different code path for this.
13964
13965         * statement.cs (Block.Resolve): Continue processing statements
13966         even when there is an error.
13967
13968 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13969
13970         * class.cs (Event.Define): Also remove the `remove' method from
13971         the list of pending items.
13972
13973         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13974         generate more compact code. 
13975
13976 2002-07-17  Martin Baulig  <martin@gnome.org>
13977
13978         * const.cs (Const.LookupConstantValue): Add support for constant
13979         `unchecked' and `checked' expressions.
13980         Also adding test case test-140.cs for this.
13981
13982 2002-07-17  Martin Baulig  <martin@gnome.org>
13983
13984         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13985         check whether mi.ReturnType implements the IEnumerator interface; the
13986         `==' and the IsAssignableFrom() will fail in this situation.
13987
13988 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13989
13990         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13991         here too.
13992
13993 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13994
13995         * expression.cs: fixed bug #27811.
13996
13997 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13998
13999         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14000         Molaro: when we are a ref, the value already contains a pointer
14001         value, do not take the address of it.
14002
14003 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14004         * removed mb-parser.jay and mb-tokenizer.cs
14005
14006 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14007
14008         * expression.cs: check against the building corlib void type.
14009
14010 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14011
14012         * ecore.cs: fix for valuetype static readonly fields: when 
14013         initializing them, we need their address, not the address of a copy.
14014
14015 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14016
14017         * typemanager.cs: register also enum_type in corlib.
14018
14019 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14020
14021         * class.cs: allow calling this (but not base) initializers in structs.
14022
14023 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14024
14025         * ecore.cs: make sure we compare against the building base types
14026         in GetTypeSize ().
14027
14028 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14029
14030         * typemanager.cs: fix TypeToCoreType() to handle void and object
14031         (corlib gets no more typerefs after this change).
14032
14033 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14034
14035         * expression.cs (ArrayCreation.EmitArrayArguments): use
14036         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14037
14038         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14039         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14040         array indexes, the runtime actually forbids them.
14041
14042         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14043         for array arguments here.
14044
14045         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14046         instead of the default for ValueTypes.
14047
14048         (New.DoEmit): Use IsValueType instead of
14049         IsSubclassOf (value_type)
14050         (New.DoResolve): ditto.
14051         (Invocation.EmitCall): ditto.
14052
14053         * assign.cs (Assign): ditto.
14054
14055         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14056         Statements *are* currently doing part of their resolution during
14057         Emit.  
14058
14059         Expressions do always resolve during resolve, but statements are
14060         only required to propagate resolution to their children.
14061
14062 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14063
14064         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14065
14066         (LoadAssembly): Do not add the dll if it is already specified
14067
14068         (MainDriver): Add the System directory to the link path at the end,
14069         after all the other -L arguments. 
14070
14071         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14072         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14073         ldelem.u1) and using the opposite for sbytes.
14074
14075         This fixes Digger, and we can finally run it.
14076
14077         * driver.cs (UnixParseOption): Move the option parsing here.  
14078         (CSCParseOption): Implement CSC-like parsing of options.
14079
14080         We now support both modes of operation, the old Unix way, and the
14081         new CSC-like way.  This should help those who wanted to make cross
14082         platform makefiles.
14083
14084         The only thing broken is that /r:, /reference: and /lib: are not
14085         implemented, because I want to make those have the same semantics
14086         as the CSC compiler has, and kill once and for all the confussion
14087         around this.   Will be doing this tomorrow.
14088
14089         * statement.cs (Unsafe.Resolve): The state is checked during
14090         resolve, not emit, so we have to set the flags for IsUnsfe here.
14091
14092 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14095         not catch the Error_ObjectRefRequired in SimpleName (as it is
14096         possible to have a class/instance variable name that later gets
14097         deambiguated), we have to check this here.      
14098
14099 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14100
14101         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14102         make static and put into Expression.
14103
14104         (Event.Define): Register the private field of the event with the 
14105         TypeManager so that GetFieldFromEvent can get at it.
14106
14107         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14108         keep track of the private field associated with an event which
14109         has no accessors.
14110
14111         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14112         private field.
14113
14114         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14115
14116 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14117
14118         * expression.cs (Binary.EmitBranchable): this routine emits the
14119         Binary expression in a branchable context.  This basically means:
14120         we need to branch somewhere, not just get the value on the stack.
14121
14122         This works together with Statement.EmitBoolExpression.
14123
14124         * statement.cs (Statement.EmitBoolExpression): Use
14125         EmitBranchable. 
14126
14127 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14128
14129         * statement.cs (For): Reduce the number of jumps in loops.
14130
14131         (For): Implement loop inversion for the For statement.
14132
14133         (Break): We can be breaking out of a Try/Catch controlled section
14134         (foreach might have an implicit try/catch clause), so we need to
14135         use Leave instead of Br.
14136
14137         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14138         now).  If the instace expression supports IMemoryLocation, we use
14139         the AddressOf method from the IMemoryLocation to extract the
14140         address instead of emitting the instance.
14141
14142         This showed up with `This', as we were emitting the instance
14143         always (Emit) instead of the Address of This.  Particularly
14144         interesting when This is a value type, as we dont want the Emit
14145         effect (which was to load the object).
14146
14147 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14148
14149         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14150
14151         * statement.cs (Checked): Set the CheckedState during the resolve
14152         process too, as the ConvCast operations track the checked state on
14153         the resolve process, and not emit.
14154
14155         * cs-parser.jay (namespace_member_declaration): Flag that we have
14156         found a declaration when we do.  This is used to flag error 1529
14157
14158         * driver.cs: Report ok when we display the help only.
14159
14160 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14161
14162         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14163
14164 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * cs-tokenizer.cs (define): We also have to track locally the
14167         defines.  AllDefines is just used for the Conditional Attribute,
14168         but we also need the local defines for the current source code. 
14169
14170 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14171
14172         * statement.cs (While, For, Do): These loops can exit through a
14173         Break statement, use this information to tell whether the
14174         statement is the last piece of code.
14175
14176         (Break): Flag that we break.
14177
14178         * codegen.cs (EmitContexts): New `Breaks' state variable.
14179
14180 2002-07-03  Martin Baulig  <martin@gnome.org>
14181
14182         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14183         modifiers in method declarations in structs.  Otherwise, you won't
14184         be able to override things like Object.Equals().
14185
14186 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14187
14188         * class.cs (Method, Property, Indexer): Do not allow the public
14189         modifier to be used in explicit interface implementations.
14190
14191         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14192         override modifiers in method declarations in structs
14193
14194 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14195
14196         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14197         integer or real overflow, report an error
14198
14199 2002-07-02  Martin Baulig  <martin@gnome.org>
14200
14201         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14202         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14203         to tell the runtime about our newly created System.Object and
14204         System.ValueType types.
14205
14206 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14207
14208         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14209         struct instead of Ldarg/Starg.
14210
14211 2002-07-02  Martin Baulig  <martin@gnome.org>
14212
14213         * expression.cs (Indirection.Indirection): Call
14214         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14215
14216 2002-07-02  Martin Baulig  <martin@gnome.org>
14217
14218         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14219         ValueType, call TypeManager.TypeToCoreType() on it.
14220         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14221         the OpCodes.Newarr argument.
14222
14223 2002-07-02  Martin Baulig  <martin@gnome.org>
14224
14225         * expression.cs (Invocation.EmitCall): When compiling corlib,
14226         replace all calls to the system's System.Array type to calls to
14227         the newly created one.
14228
14229         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14230         System.Array methods.
14231         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14232         from the system's System.Array type which must be replaced.
14233
14234 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14235
14236         * typemanager.cs: load unverifiable_code_ctor so we can build
14237         corlib using the correct type. Avoid using GetTypeCode() with
14238         TypeBuilders.
14239         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14240         TypeManager.object_type to allow building corlib.
14241
14242 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14243
14244         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14245
14246 2002-07-01  Martin Baulig  <martin@gnome.org>
14247
14248         * class.cs: Make the last change actually work, we need to check
14249         whether `ifaces != null' to avoid a crash.
14250
14251 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14252
14253         * class.cs: when we build structs without fields that implement
14254         interfaces, we need to add the interfaces separately, since there is
14255         no API to both set the size and add the interfaces at type creation
14256         time.
14257
14258 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14259
14260         * expression.cs: the dimension arguments to the array constructors
14261         need to be converted if they are a long.
14262
14263 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14264
14265         * class.cs: don't emit ldarg.0 if there is no parent constructor
14266         (fixes showstopper for corlib).
14267
14268 2002-06-29  Martin Baulig  <martin@gnome.org>
14269
14270         MCS now compiles corlib on GNU/Linux :-)
14271
14272         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14273         ie. check for MethodImplOptions.InternalCall.
14274
14275         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14276         and TypeManager.attribute_type are null, so we must explicitly check
14277         whether parent is not null to find out whether it's an attribute type.
14278         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14279         and SetBuilder, not only if the property is neither abstract nor external.
14280         This is necessary to set the MethodImplOptions on the accessor methods.
14281         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14282         SetBuilder, see Property.Emit().
14283
14284         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14285         populate "System.Object", "System.ValueType" and "System.Attribute" since
14286         they've already been populated from BootCorlib_PopulateCoreTypes().
14287
14288 2002-06-29  Martin Baulig  <martin@gnome.org>
14289
14290         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14291         is the NullLiteral, we also need to make sure that target_type is not
14292         an enum type.   
14293
14294 2002-06-29  Martin Baulig  <martin@gnome.org>
14295
14296         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14297         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14298         before calling BootstrapCorlib_ResolveDelegate ().
14299
14300 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14301
14302         * statement.cs: fixed build-breaker. All tests passed ok.
14303
14304 2002-06-27  Martin Baulig  <martin@gnome.org>
14305
14306         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14307         for System.Decimal when compiling corlib.
14308
14309 2002-06-27  Martin Baulig  <martin@gnome.org>
14310
14311         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14312         switch blocks which contain nothing but a default clause.
14313
14314 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14315
14316        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14317
14318 2002-06-27  Martin Baulig  <martin@gnome.org>
14319
14320         * ecore.cs (PropertyExpr.PropertyExpr): Call
14321         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14322
14323         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14324         is already a TypeBuilder.
14325
14326 2002-06-27  Martin Baulig  <martin@gnome.org>
14327
14328         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14329         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14330         the "from an array-type to System.Array" case.  This makes it work
14331         when compiling corlib.
14332
14333 2002-06-27  Martin Baulig  <martin@gnome.org>
14334
14335         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14336         non-static PropertyExpr, set its InstanceExpression.  This makes
14337         the `ICollection.Count' property work in System/Array.cs.
14338
14339 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14340
14341         * driver.cs: Made error handling more consistent.  Errors now
14342         tracked by Report class, so many methods which used to return int
14343         now return void.  Main() now prints success/failure and 
14344         errors/warnings message.
14345
14346         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14347         the magic number return values (123 and 124).  Now, if the
14348         expected error occurs, the compiler exits with success (exit value
14349         0).  If the compilation completes without seeing that particular
14350         error, the compiler exits with failure (exit value 1).  The
14351         makefile in mcs/errors has been changed to handle the new behaviour.
14352
14353         * report.cs: Made 'expected error' number a property and renamed
14354         it from 'Probe' to 'ExpectedError'.
14355
14356         * genericparser.cs: Removed error handling support, since it is
14357         now all done by Report class.
14358
14359         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14360         class, so parse() no longer returns an int.
14361
14362         * namespace.cs: Use Report.Error instead of GenericParser.error
14363
14364 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14367         TypeContainer.AddOperator): At the front of the list put the
14368         explicit implementations, so they get resolved/defined first. 
14369
14370 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14373         interface type is implemented by this TypeContainer.  Used during
14374         explicit interface implementation.
14375
14376         (Property.Define, Indexer.Define, Method.Define): Validate that
14377         the given interface in the explicit implementation is one of the
14378         base classes for the containing type.
14379
14380         Also if we are explicitly implementing an interface, but there is
14381         no match in the pending implementation table, report an error.
14382
14383         (Property.Define): Only define the property if we are
14384         not explicitly implementing a property from an interface.  Use the
14385         correct name also for those properties (the same CSC uses,
14386         although that is really not needed).
14387
14388         (Property.Emit): Do not emit attributes for explicitly implemented
14389         properties, as there is no TypeBuilder.
14390
14391         (Indexer.Emit): ditto.
14392
14393         Hiding then means that we do not really *implement* a pending
14394         implementation, which makes code fail.
14395
14396 2002-06-22  Martin Baulig  <martin@gnome.org>
14397
14398         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14399         the return value of Object.GetType().  [FIXME: we need to do this whenever
14400         we get a type back from the reflection library].
14401
14402 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14403
14404         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14405
14406 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * attribute.cs: Return null if we can not look up the type.
14409
14410         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14411         the interface types found.
14412
14413         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14414         interface types found.
14415
14416         * typemanager.cs (GetInterfaces): Make this routine returns alll
14417         the interfaces and work around the lame differences between
14418         System.Type and System.Reflection.Emit.TypeBuilder in the results
14419         result for GetInterfaces.
14420
14421         (ExpandInterfaces): Given an array of interface types, expand and
14422         eliminate repeated ocurrences of an interface.  This expands in
14423         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14424         be IA, IB, IC.
14425
14426 2002-06-21  Martin Baulig  <martin@gnome.org>
14427
14428         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14429         on System.Enum.
14430
14431 2002-06-21  Martin Baulig  <martin@gnome.org>
14432
14433         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14434         and called with one of the core types, return the corresponding typebuilder for
14435         that type.
14436
14437         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14438         element type.
14439
14440 2002-06-21  Martin Baulig  <martin@gnome.org>
14441
14442         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14443         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14444         (Expression.ConvertReferenceExplicit): Likewise.
14445
14446         * expression.cs (ElementAccess.DoResolve): Likewise.
14447         (ElementAccess.DoResolveLValue): Likewise.
14448
14449 2002-06-10  Martin Baulig  <martin@gnome.org>
14450
14451         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14452         add the "value" parameter to the parameter list.
14453
14454         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14455         to our caller.
14456
14457 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14460         the argument to an int, uint, long or ulong, per the spec.  Also
14461         catch negative constants in array creation.
14462
14463 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14464
14465         * class.cs: do not allow the same interface to appear twice in
14466         the definition list.
14467
14468 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14469
14470         * ecore.cs: don't use ldlen with System.Array.
14471
14472 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14473
14474         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14475
14476 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14477
14478         * modifiers.cs: produce correct field attributes for protected
14479         internal. Easy fix so miguel can work on ther harder stuff:-)
14480
14481 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * pending.cs: New file.  Move the code from class.cs here.
14484         Support clearning the pending flag for all methods (when not doing
14485         explicit interface implementation).
14486
14487 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14488
14489         * rootcontext.cs: added a couple more types needed to bootstrap.
14490
14491 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14492
14493         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14494         constructor in the type, instead of any constructor in the type
14495         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14496         a bug in the Mono runtime when applying the params attribute). 
14497
14498 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14499         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14500
14501 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14502
14503         * expression.cs (Unary.ResolveOperator): Use TypeManager
14504         to resolve the type.
14505
14506 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14507
14508         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14509         attached.
14510
14511         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14512         with each member too.
14513
14514         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14515         field builders too - this takes care of the enum member case.
14516
14517 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14518
14519         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14520         address-of operator on both value types and pointers.
14521
14522 2002-06-10  Martin Baulig  <martin@gnome.org>
14523
14524         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14525         PropertyBuilder to the `property_builders' list.
14526
14527         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14528         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14529         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14530         find any indexers which are inherited from an interface.
14531
14532 2002-06-09  Martin Baulig  <martin@gnome.org>
14533
14534         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14535         the same type as the constant if necessary.  There's also a test-130.cs
14536         for this.
14537
14538         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14539
14540         * typemanager.cs (TypeManager.ChangeType): Previously known as
14541         Enum.ChangeEnumType().
14542
14543 2002-06-09  Martin Baulig  <martin@gnome.org>
14544
14545         * expression.cs (Cast.TryReduce): Added support for consts.
14546
14547 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14548
14549         * class.cs (Accessor): Hold attributes information so we can pass
14550         it along.
14551
14552         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14553         Modify to pass in attributes attached to the methods.
14554
14555         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14556
14557         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14558         to handle the Accessor kind :-)
14559
14560         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14561
14562 2002-06-08  Martin Baulig  <martin@gnome.org>
14563
14564         * expression.cs (Unary.TryReduceNegative): Added support for
14565         ULongConstants.
14566
14567 2002-06-08  Martin Baulig  <martin@gnome.org>
14568
14569         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14570         name can't be found in the `defined_names' - the caller will do a
14571         MemberLookup in this case and thus find methods in System.Enum
14572         such as Enum.IsDefined().
14573
14574 2002-06-08  Martin Baulig  <martin@gnome.org>
14575
14576         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14577         Convert.ChangeType() which works with TypeBuilder created types.
14578         (Enum.LookupEnumValue, Enum.Define): Use it here.
14579
14580         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14581         `TypeBuilder.BaseType != null' check.
14582         (TypeContainer.FindMembers): Only lookup parent members if we
14583         actually have a parent.
14584         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14585         (ConstructorInitializer.Resolve): Likewise.
14586
14587         * interface.cs (Interface.FindMembers): Added
14588         `TypeBuilder.BaseType != null' check.
14589
14590         * rootcontext.cs (RootContext.ResolveCore): Added
14591         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14592         classes_second_stage.
14593
14594         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14595         debug_type and trace_type when compiling with --nostdlib.       
14596
14597 2002-06-07  Martin Baulig  <martin@gnome.org>
14598
14599         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14600         (AddField): Set it to true when adding a non-static field.
14601         (DefineType): Use `have_nonstatic_fields' to find out whether we
14602         have non-static fields, not `Fields != null'.
14603
14604 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14607         dereferencing a null on the static-field code path)
14608
14609 2002-05-30  Martin Baulig  <martin@gnome.org>
14610
14611         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14612         to take command line arguments.  Use reflection to call the new
14613         custom `Initialize' function on the symbol writer and pass it the
14614         command line arguments.
14615
14616         * driver.cs (--debug-args): New command line argument to pass command
14617         line arguments to the symbol writer.
14618
14619 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14622         the target type for indexers and properties.  Thanks to Joe for
14623         catching this.
14624
14625 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * typemanager.cs (MethodFlags): returns the method flags
14628         (Obsolete/ShouldIgnore) that control warning emission and whether
14629         the invocation should be made, or ignored. 
14630
14631         * expression.cs (Invocation.Emit): Remove previous hack, we should
14632         not do this on matching a base type, we should do this based on an attribute
14633
14634         Only emit calls to System.Diagnostics.Debug and
14635         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14636         on the command line.
14637
14638         * rootcontext.cs: Global settings for tracing and debugging.
14639
14640         * cs-tokenizer.cs (define): New utility function to track
14641         defines.   Set the global settings for TRACE and DEBUG if found.
14642
14643 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14644
14645         * interface.cs (Populate*): Pass in the TypeContainer as well as
14646         the DeclSpace as parameters so that we can create EmitContexts and
14647         then use that to apply attributes etc.
14648
14649         (PopulateMethod, PopulateEvent, PopulateProperty)
14650         (PopulateIndexer): Apply attributes everywhere.
14651
14652         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14653         etc.
14654
14655         (ApplyAttributes): Update accordingly.
14656
14657         We now apply interface attributes for all members too.
14658
14659 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14660
14661         * class.cs (Indexer.Define); Correctly check if we are explicit
14662         implementation (instead of checking the Name for a ".", we
14663         directly look up if the InterfaceType was specified).
14664
14665         Delay the creation of the PropertyBuilder.
14666
14667         Only create the PropertyBuilder if we are not an explicit
14668         interface implementation.   This means that explicit interface
14669         implementation members do not participate in regular function
14670         lookups, and hence fixes another major ambiguity problem in
14671         overload resolution (that was the visible effect).
14672
14673         (DefineMethod): Return whether we are doing an interface
14674         implementation. 
14675
14676         * typemanager.cs: Temporary hack until we get attributes in
14677         interfaces (Ravi is working on that) and we get IndexerName
14678         support in interfaces.
14679
14680         * interface.cs: Register the indexers as properties.
14681
14682         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14683         warning, I have verified that this is a bug in the .NET runtime
14684         (JavaScript suffers of the same problem).
14685
14686         * typemanager.cs (MemberLookup): When looking up members for
14687         interfaces, the parent of an interface is the implicit
14688         System.Object (so we succeed in searches of Object methods in an
14689         interface method invocation.  Example:  IEnumerable x;  x.ToString
14690         ()) 
14691
14692 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14693
14694         * class.cs (Event): Events should also register if they do
14695         implement the methods that an interface requires.
14696
14697         * typemanager.cs (MemberLookup); use the new GetInterfaces
14698         method. 
14699
14700         (GetInterfaces): The code used to lookup interfaces for a type is
14701         used in more than one place, factor it here. 
14702
14703         * driver.cs: Track the errors at the bottom of the file, we kept
14704         on going.
14705
14706         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14707         instance if the method we are calling is static!
14708
14709 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14710
14711         * attribute.cs (ApplyAttributes): Make this function filter out
14712         the IndexerName attribute (as that attribute in reality is never
14713         applied) and return the string constant for the IndexerName
14714         attribute. 
14715
14716         * class.cs (TypeContainer.Emit): Validate that all the indexers
14717         have the same IndexerName attribute, and if so, set the
14718         DefaultName attribute on the class. 
14719
14720         * typemanager.cs: The return value might contain other stuff (not
14721         only methods).  For instance, consider a method with an "Item"
14722         property and an Item method.
14723
14724         * class.cs: If there is a problem with the parameter types,
14725         return. 
14726
14727 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14728
14729         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14730         looks at user defined conversion after making a call to 
14731         StandardConversionExists - we need this for overload resolution.
14732
14733         * expression.cs : Update accordingly the various method calls.
14734
14735         This fixes 2 bugs filed against implicit user defined conversions 
14736
14737 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14738
14739         * statement.cs: Track the result of the assignment.
14740
14741 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * expression.cs (MemberAccess): Improved error reporting for
14744         inaccessible members.
14745
14746 2002-05-22  Martin Baulig  <martin@gnome.org>
14747
14748         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14749         itself with debugging support.
14750
14751 2002-05-22  Martin Baulig  <martin@gnome.org>
14752
14753         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14754         Removed, this isn't needed anymore.
14755
14756 2002-05-20  Martin Baulig  <martin@gnome.org>
14757
14758         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14759         be underlying type for an enum.
14760
14761 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14762
14763         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14764         that splits out the loading of just the core types.
14765
14766         * rootcontext.cs (ResolveCore): Split the struct resolution in
14767         two, so we can load the enumeration underlying types before any
14768         enums are used.
14769
14770         * expression.cs (Is): Bandaid until we fix properly Switch (see
14771         bug #24985 for details).
14772
14773         * typemanager.cs (ImplementsInterface): The hashtable will contain
14774         a null if there are no interfaces implemented.
14775
14776 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * cs-parser.jay (indexer_declarator): It is fine to have array
14779         parameters
14780
14781 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14782
14783         * typemanager.cs: (RegisterBuilder): New function used to register
14784         TypeBuilders that implement interfaces.  Since
14785         TypeBuilder.GetInterfaces (as usual) does not work with lame
14786         Reflection.Emit. 
14787         (AddUserType): register interfaces.
14788
14789         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14790         dealing with TypeBuilder.  Also, arrays are showing up as
14791         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14792         methods can not be invoked on them!
14793
14794         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14795         (ImplicitReferenceConversionExists): Split out from
14796         StandardConversionExists. 
14797
14798         * expression.cs (As): We were only implementing one of the three
14799         cases for the as operator.  We now implement them all.
14800         (Is): Implement the various other cases for Is as well.
14801
14802         * typemanager.cs (CACHE): New define used to control if we want or
14803         not the FindMembers cache.  Seems to have a negative impact on
14804         performance currently
14805
14806         (MemberLookup): Nested types have full acess to
14807         enclosing type members
14808
14809         Remove code that coped with instance/static returns for events, we
14810         now catch this in RealFindMembers.
14811
14812         (RealFindMembers): only perform static lookup if the instance
14813         lookup did not return a type or an event.  
14814
14815 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * assign.cs (CompoundAssign): We pass more semantic information
14818         now to Compound Assignments than we did before: now we have all
14819         the information at hand, and now we resolve the target *before* we
14820         do the expression expansion, which allows the "CacheValue" method
14821         to have the effect we intended (before, a [x] += 1 would generate
14822         two differen ArrayAccess expressions from the ElementAccess,
14823         during the resolution process).
14824
14825         (CompoundAssign.DoResolve): Resolve target and original_source here.
14826
14827 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14828
14829         * expression.cs (ArrayAccess): dropped debugging information. 
14830
14831         * typemanager.cs: Small bug fix: I was always returning i_members,
14832         instead of one of i_members or s_members (depending on which had
14833         the content).
14834
14835         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14836         method is invoked before any code generation takes place, and it
14837         is a mechanism to inform that the expression will be invoked more
14838         than once, and that the method should use temporary values to
14839         avoid having side effects
14840
14841         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14842
14843         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14844         implementation.
14845
14846         * expression.cs (Indirection, ArrayAccess): Add support for
14847         CacheTemporaries in these two bad boys. 
14848
14849         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14850         ldobj or ldind_ref.  
14851         (StoreFromPtr): Handle stobj as well.
14852
14853         * expression.cs (UnaryMutator): Share more code.
14854
14855         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14856         down: I was not tracking the Filter function as well, which
14857         was affecting the results of the cache.
14858
14859 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14860
14861         * attribute.cs: Remove the hack to handle the CharSet property on
14862         StructLayouts. 
14863
14864 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14865
14866         * attribute.cs (DoResolve): More uglyness, we now only try to
14867         resolve the attribute partially, to extract the CharSet
14868         information (only if we are a StructLayout attribute).  Otherwise 
14869
14870         (GetExtraTypeInfo): Add some code to conditionally kill in the
14871         future this.   I am more and more convinced that the .NET
14872         framework has special code to handle the attribute setting on
14873         certain elements.
14874
14875         * expression.cs (IsParamsMethodApplicable): Revert my previous
14876         foreach change here, it was wrong.
14877
14878 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14879
14880         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14881         (pp_expr): do not abort on unknown input, just return.
14882         (eval): abort if there are pending chars.
14883
14884         * attribute.cs (Attribute.Resolve): Positional parameters are
14885         optional.  Deal with that case.
14886
14887         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14888         the Ansi/Unicode/Auto information for the type.
14889
14890         (TypeContainer.DefineType): instantiate the EmitContext here, as
14891         we will be using it during the type definition (to resolve
14892         attributes) and during the emit phase.
14893
14894         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14895         to pull type information out of the attributes
14896
14897         (Attribute.Resolve): track the constructor builder, and allow for
14898         multiple invocations (structs and classes will use this).
14899
14900         * ecore.cs (MemberLookupFinal): new version with all the
14901         parameters customizable.
14902
14903         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14904         constructors.  Return if the result value is null (as the error
14905         would have been flagged already by MemberLookupFinal)
14906
14907         Do not allow instances of abstract classes or interfaces to be
14908         created.
14909
14910         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14911         We have to compare the assembly property here when dealing with
14912         FamANDAssem and Assembly access modifiers, because we might be
14913         creating an assembly from *modules* (that means that we are not
14914         getting TypeBuilders for types defined in other modules that are
14915         part of this assembly).
14916
14917         (Method.Emit): If the method is marked abstract and has a body,
14918         emit an error. 
14919
14920         (TypeContainer.DefineMembers): If both the defined member and the
14921         parent name match are methods, then do not emit any warnings: let
14922         the Method.Define routine take care of flagging warnings.  But if
14923         there is a mismatch (method overrides something else, or method is
14924         overriwritten by something, then emit warning).
14925
14926         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14927         set to null, this means `do not check for the return type on the
14928         signature'. 
14929
14930         (Method.Define): set the return type for the method signature to
14931         null, so that we get methods with the same name and parameters and
14932         different return types.  This is used to flag warning 114 (you are
14933         hiding a method, and you probably want to use the new/override
14934         keywords instead).
14935
14936         * typemanager.cs (MemberLookup): Implemented proper access
14937         control, closing a long standing set of bug reports.  The problem
14938         was that the Framework only has two bits: Public and NonPublic,
14939         and NonPublic includes private and protected methods, but we need
14940         to enforce the FamANDAssem, FamOrAssem and Family. 
14941
14942 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14943
14944         * statement.cs (GotoCase): Return true: Ammounts to giving up
14945         knowledge on whether we return or not, and letting the other case
14946         be responsible for it.
14947
14948 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * driver.cs: Do not load directories for each file processed, only
14951         do it if there is a pattern.
14952
14953         * ecore.cs: Report readonly assigns here as well, as we might have
14954         been resolved only by MemberAccess.
14955
14956         (SimpleName.SimpleNameResolve): Also be useful for LValue
14957         resolution.   We need this to propagate assign to local readonly variables
14958
14959         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14960         do not want to reuse potential criteria memory.
14961
14962         * class.cs (MyEventBuilder): Set reflected_type;
14963
14964         * ecore.cs (Constantify): Added support for constifying bools.
14965
14966         (RootContext.LookupType): Added a cache for values looked up in
14967         the declaration space.
14968
14969         * typemanager.cs (FindMembers): Now is a front-end to
14970         RealFindMembers, and provides a two-level hashtable-based cache to
14971         the request.  
14972
14973         15% performance improvement: from 22.5 to 19.2 seconds.
14974
14975         * expression.cs (IsParamsMethodApplicable): use foreach.
14976         (Invocation.DoResolve): ditto.
14977         (New.DoResolve): ditto.
14978         (ArrayCreation.DoResolve): ditto.
14979
14980         * ecore.cs (FindMostEncompassingType): use foreach.
14981
14982         * delegate.cs (NewDelegate.DoResolve): Use foreach
14983
14984         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14985         (RemoveMethods): use foreach.
14986
14987         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14988         nested foreach statements instead of for, and also break out of
14989         the inner loop once a match is found.
14990
14991         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14992
14993 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14996         we actually unwrap the expression to allow for extra information
14997         to be extracted. 
14998
14999         * expression.cs: Use Shr_Un on unsigned operations. 
15000
15001 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15002
15003         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15004         applicable operators was not being considered correctly. This closes
15005         the bug Miguel reported.
15006
15007 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15008
15009         * attribute.cs: check that the type derives from System.Attribute
15010         and report the correct error in that case (moved the duplicate code to
15011         its own method, too).
15012
15013 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15014
15015         * attribute.cs: lookup attribute type name as the spec says: first the
15016         bare attribute name and then name + "Attribute" (nant compiles with
15017         mcs after this fix).
15018
15019 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15020
15021         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15022         Because of the way we parse things, we should try to see if a
15023         UIntConstant can fit in an integer.
15024
15025 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15026
15027         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15028         when we are in an explicit context.
15029
15030         (ConvertReferenceExplicit): When converting from Iface type S to Class
15031         T make sure the rules are implemented as an OR.
15032
15033         * parameter.cs (ParameterType): Make it a property for now although the
15034         purpose really isn't anything immediate.
15035
15036         * expression.cs (Is*Applicable): Do better checking on the parameter type
15037         of a ref/out parameter. The ones from the system assemblies are already 
15038         marked with the correct type so we don't need to do any correction.
15039
15040         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15041         the object type is standard too so include that.
15042
15043 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15044
15045         * ecore.cs (StandardConversionExists): Augment with missing code:
15046         deal with IntConstant, LongConstants and Enumerations.
15047
15048         * assign.cs: Report the error, instead of failing silently
15049
15050         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15051         typecontainer that they are declared, because the
15052         typecontainer/namespace will have the list of using clauses that
15053         need to be applied.
15054
15055         Assembly Attributes were escaping the normal registration
15056         mechanism. 
15057
15058         (EmitCode): Apply attributes within an EmitContext that represents
15059         the container they were declared on.
15060
15061         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15062
15063 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15064
15065         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15066         Revamp completely - make much cleaner as we now operate only
15067         on a set of Types.
15068
15069         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15070         to implement the logic detailed in the spec more correctly.
15071
15072         (UserDefinedConversion): Update accordingly.
15073
15074 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * statement.cs: Return flow analysis information up.
15077
15078         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15079         and the default.
15080
15081         (token): Do not consume an extra character before calling
15082         decimal_digits.
15083
15084 2002-05-06  Piers Haken <piersh@friskit.com>
15085
15086         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15087
15088 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15089
15090         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15091         EmitContext during the instance constructor initializer
15092         resolution, to stop access to instance variables.
15093
15094         This is mandated by the spec, last paragraph of the `constructor
15095         initializers' section. 
15096
15097 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * cs-parser.jay, class.cs (Accessor): new class used to represent
15100         an accessor (get or set).  In the past we used `null' to represent
15101         a missing accessor.  But this is ambiguous because there was no
15102         way to tell in abstract indexers/properties if one of them was
15103         specified.
15104
15105         Now there is a way of addressing that.
15106
15107         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15108         instead of FindMembers.
15109
15110         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15111         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15112
15113         * attribute.cs: Treat indexers and properties as the same in terms
15114         of applying attributes
15115
15116         * ecore.cs (FindMostEncompassedType): Use statically initialized
15117         EmptyExpressions()s like we do elsewhere to avoid creating useless
15118         objects (and we take this out of the tight loop).
15119
15120         (GetConversionOperators): Move the code to extract the actual
15121         operators to a separate routine to clean things up.
15122
15123 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15124
15125         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15126         events are always registered FieldBuilders.
15127
15128         * class.cs (FieldBase): New class shared by Fields 
15129
15130         * delegate.cs: If we are a toplevel delegate, use our full name.
15131         If we are a nested delegate, then only use our tail name.
15132
15133 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15134
15135         * expression.cs (IsApplicable): Ensure that we add the "&" to
15136         ref/out types before comparing it with the type of the argument.
15137
15138         (IsParamsMethodApplicable): Ditto.
15139
15140         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15141         silly me ;-)
15142
15143         * delegate.cs : Handle the case when we have more than one applicable
15144         method. Flag an error only when we finish checking all.
15145
15146 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * expression.cs: Add support for boolean static initializers.
15149
15150 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15151
15152         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15153
15154         * parameter.cs (ComputeParameterTypes,
15155         ComputeAndDefineParameterTypes): Better error handling: now we
15156         clear the `types' cache if we fail during any of the type lookups.
15157         We also return the status code correctly to our caller
15158
15159         * delegate.cs: If we fail to define a delegate, abort the extra
15160         steps. 
15161
15162         * expression.cs (Binary.ResolveOperator): for
15163         operator==(object,object) and operator !=(object, object) we also
15164         have to verify that there is an implicit conversion from one to
15165         the other.
15166
15167         (ArrayAccess.DoResolve): Array Access can operate on
15168         non-variables. 
15169
15170 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15171
15172         * assign.cs (CompoundAssign): A new class used as a "flag" that
15173         the assignment actually is happening as part of a compound
15174         assignment operator.
15175
15176         During compound assignment, a few new rules exist to enable things
15177         like:
15178
15179         byte b |= 1 + 2
15180
15181         From the spec:
15182
15183         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15184         to the type of x) if y is implicitly convertible to the type of x,
15185         and the operator is a builtin operator and the return type of the
15186         operator is explicitly convertible to the type of x. 
15187
15188         * rootcontext.cs: Reset warning level to 2.  4 catches various
15189         "interesting" features in mcs, we must clean this up at some
15190         point, but currently am trying to kill other bugs ;-)
15191
15192         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15193         in container classes as well.  
15194
15195         * expression.cs (Binary.ResolveOperator): Handle string case
15196         before anything else (as operator overloading does emit an error
15197         before doing anything else).
15198
15199         This code could go away when we move to a table driven model, but
15200         i could not come up with a good plan last night.
15201
15202 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15203
15204         * typemanager.cs (CSharpName): reimplementation using regex.
15205         * class.cs: added null check for fields in Emit
15206         * rootcontext.cs: set warninglevel to 4
15207
15208 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15209
15210         * typemanager.cs (CSharpName): reimplemented with Lupus
15211         suggestion.
15212
15213 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * statement.cs (If): correclty implement Resolve, because we were
15216         not catching sem errors in there.  The same process is needed
15217         everywhere else. 
15218         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15219
15220
15221         (Statement.Warning_DeadCodeFound): Factorize code.
15222         (While): Report dead code here too.
15223
15224         (Statement): Added Resolve virtual method to allow
15225         for resolution split from the emit code.
15226
15227 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15228
15229         * statement.cs (EmitBoolExpression): No longer try to resolve the
15230         expression here.    
15231         (MakeBoolean): New utility function that resolve, implicitly
15232         converts to boolean and tags the expression. 
15233
15234
15235         (If, Do): Implement dead code elimination.
15236         (While): Implement loop inversion
15237
15238         (Do, While, For, If): Resolve the expression prior to calling our
15239         code generation.
15240
15241 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15242
15243         * class.cs:
15244           - added method Report28 (warning: program has more than one entry point)
15245           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15246           - modified method Method.Define, the part at the end of the method
15247
15248         * rootcontext.cs: added static public Location EntryPointLocation;
15249           
15250         * ../errors/cs0028.cs : Add test case for the above warning.              
15251
15252         * typemanager.cs:
15253           - modified method CSharpName to allow arrays of primitive type to
15254             be printed nicely (e.g. instead of System.Int32[][] it now prints
15255             int[][])
15256           - added method CSharpSignature: returns the signature of a method
15257             in string format to be used in reporting errors, warnings, etc.
15258
15259         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15260         with String.Empty.
15261
15262 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15263
15264         * delegate.cs (Define): Fix extremely silly bug where I was
15265         setting the type of the 'object' parameter of the BeginInvoke
15266         method to System.IAsyncResult instead of System.Object ;-)
15267
15268 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15271         here. 
15272
15273         (Constructor.Emit): return if we fail to initialize the
15274         constructor.  Another door closed!  
15275
15276         * expression.cs (New.DoResolve): Improve error message (from -6 to
15277         1501).  Use DeclaredOnly lookup to find the exact constructor.
15278
15279         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15280         loop.  This is useful.
15281
15282         * cs-parser.jay: Adjust the default parameters so that destructors
15283         have the proper signature.
15284
15285 2002-04-26  Martin Baulig  <martin@gnome.org>
15286
15287         * driver.cs (LoadAssembly): If `assembly' contains any characters
15288         which are only valid in path names and not in assembly names
15289         (currently slash, backslash and point), use Assembly.LoadFrom ()
15290         instead of Assembly.Load () on the `assembly' (before iteration
15291         over the link_paths).
15292
15293 2002-04-26  Martin Baulig  <martin@gnome.org>
15294
15295         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15296
15297 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * class.cs (Property): use the new typemanager.MemberLookup
15300
15301         (TypeContainer.MemberLookup): Implement using the
15302         TypeManager.MemberLookup now. 
15303
15304         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15305         and return MemberInfos, so that these can be used without an
15306         EmitContext (what we had before).
15307
15308 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15309
15310         * expression.cs: Fix the case where the argument to params if the
15311         type of the params.  I omitted handling this before.   Fixed
15312
15313 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15314
15315         * driver.cs: Call BootCorlib_PopulateCoreType
15316
15317         * class.cs (Property.CheckBase): Check for properties only, not
15318         for all members. 
15319
15320         * interface.cs: Temporary hack: try/catch around the
15321         CustomAttributeBuilder, because I am getting an exception that I
15322         do not understand.
15323
15324         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15325         types whose definitions are required to be there (attributes are
15326         defined before standard types).
15327
15328         Compute definitions as we boot the various types, as they are used
15329         immediately (value_type class will need object_type, but if we do
15330         not initialize object_type, we will pass a null, which will let
15331         the runtime pick the System.Object from the existing corlib, which
15332         is not what we want).
15333
15334 2002-04-22  Patrik Torstensson <totte@labs2.com>
15335
15336         * cs-tokenizer.cs: fixed a number of trim() issues.
15337
15338 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15339
15340         * expression.cs (Argument.Type): Ensure that we return the correct
15341         type when we have out or ref parameters [in which case we 
15342         append a "&"].
15343
15344 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * class.cs (Property, Indexer): Allow extern modifier in there. 
15347
15348         * typemanager.cs (InitBaseTypes): Initializes object_type and
15349         value_type, since those will be used early on during the bootstrap
15350         process to compile corlib.
15351
15352         (InitCoreTypes): Move code from here to InitBaseTypes.
15353
15354 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15355
15356         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15357         single-dimension arrays as using the ldlen opcode.  
15358
15359         Daniel Lewis discovered this optimization.  
15360
15361         * typemanager.cs: Add signature for System.Array::get_Length
15362
15363 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15364
15365         * statement.cs: report the error when the foreach does not apply to an
15366         array nor a collection.
15367
15368 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15369
15370         * expression.cs: Add implicit conversions to the operator ~.
15371
15372         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15373
15374         * typemanager.cs: Locate the decimal constructor.
15375
15376 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15377
15378         * attribute.cs: use the new property of TypeOf.
15379         * expression.cs: added 'get' property around typearg.
15380
15381         These changes fix a build breaker reported by NickD. Is this the
15382         correct way to fix?  If not, please, revert my changes and make it
15383         work :-).
15384
15385 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15386
15387         * attribute.cs: Add support for typeof in attribute invocations.
15388         I am not sure that this is right though.
15389
15390 2002-04-14  Duncan Mak  <duncan@ximian.com>
15391
15392         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15393         Binary.Operator.Division case.
15394
15395 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15396
15397         * class.cs (DefineType): Ensure that we do a proper check on
15398         attribute types and also register it with the TypeManager.
15399
15400         (TypeContainer.Targets): The default for attribute types is
15401         AttributeTargets.All.
15402
15403         * attribute.cs (ApplyAttributes): Registering the attribute type
15404         is done elsewhere, not when we discover we have a Usage attribute.
15405
15406 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15407
15408         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15409         and get rid of is_delegate parameter.
15410
15411         * everywhere : update.
15412
15413 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15414
15415         * cs-parser.jay (compilation_unit): Revamp completely to use
15416         some new ideas that I got from Rhys' grammar to solve the problems
15417         with assembly level attributes.
15418
15419         (outer_declaration): New grammar production.
15420
15421         (attribute_sections): Add.
15422
15423         (opt_attributes): Base on attribute_sections
15424
15425         (namespace_declaration): Allow opt_attributes to tackle the case
15426         when we have assembly level attributes - we are clever in this
15427         regard now ;-)
15428
15429         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15430         attributes in the non-global context.
15431
15432         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15433         instead of SetGlobalAttributes.
15434
15435         * class.cs, rootcontext.cs : Ensure we define and generate 
15436         attribute types before anything else.
15437
15438         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15439         and flag the new error -20 for the case when the attribute type
15440         does not have valid targets specified. csc does not catch this.
15441
15442         * ../errors/errors.txt : update for error # -20
15443
15444 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15445
15446         * support.cs (InternalParameters.ParameterModifier): Do some null
15447         checking and return sane values.
15448
15449         * class.cs (Method.Define): If we are a PInvoke method, ensure
15450         that we are static and extern. Report error # 601
15451
15452         * ../errors/cs0601.cs : Add test case for the above error.
15453
15454 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15455
15456         * rootcontext.cs (attribute_types): We need to keep type of
15457         all attribute types separately and emit code for them first.
15458
15459         (RegisterAttribute) : Implement.
15460
15461         * class.cs (DefineType): Check if the current Type is a custom
15462         attribute type and register it accordingly.
15463
15464         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15465         adding the first attribute twice and rename to
15466
15467         (SetGlobalAttributes): this.
15468
15469         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15470         lookups.
15471
15472         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15473         if we are processing global arguments. Hmm, I am unsure of this.
15474
15475 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15476
15477         * expression.cs: added static array of strings to avoid calling
15478         Enum.ToString () for Operator in Binary. Significant recover of
15479         performance.
15480
15481 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * class.cs (FindMembers): Allow the Builders of the various
15484         members to be null.  If they are skip them.  This only happens
15485         during the PInvoke declaration.
15486
15487 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15488
15489         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15490         failure, so we do not keep going afterwards.
15491
15492         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15493         wanted to pass `false' as the `is_delegate' argument.  If this is
15494         the case, why not use delegate_type == null to mean `is_delegate =
15495         false' and anything else as is_delegate = true.
15496
15497 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15498
15499         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15500         code for the section, not the beginning of the tests.
15501
15502 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15503
15504         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15505
15506         * expression.cs (Binary): same.  Warn about errors where we have
15507         Enum/Enum in operator + as well.
15508
15509 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15510
15511         * statement.cs:
15512                 - added support for switch(bool)
15513                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15514                 - add TableSwitchEmit() to handle table-based switch statements
15515
15516 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15517
15518         * expression.cs (Invocation.OverloadResolve): Factor out code which
15519         does parameter compatibility checking with arguments so that we can 
15520         re-use the code even from Delegate.VerifyApplicability
15521
15522         (VerifyArgumentsCompat): Move above code here.
15523
15524         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15525         and instead make a call to the above method.
15526
15527 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15528
15529         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15530         We use it to keep track of classes which are attribute types.
15531
15532 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15533
15534         * delegate.cs (Delegate.Define): Correctly define the types in the
15535         presence of fixed and array parameters.
15536
15537         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15538         doing FindMembers.
15539
15540         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15541         include NonPublic after the first iteration.
15542
15543         * class.cs (Indexer.CheckBase): Only check if both parents are
15544         non-null. 
15545
15546         * cs-parser.jay (accessor_body): If empty, set to null.
15547
15548         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15549         same code path here to resolve constants names that we did have in
15550         MemberAccess.DoResolve.  There is too much code duplicated here.
15551
15552 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15553
15554         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15555
15556         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15557         to MakeUnionSet.
15558
15559         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15560         tokens, numbers and strings.
15561
15562         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15563         parenthesis.
15564
15565         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15566         asyncronous parameters and the regular parameters.  
15567
15568         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15569         specify the target directory.
15570
15571         * expression.cs: (This.DoResolve): Simplify
15572         (As.Emit): Optimize, do not generate IsInst if the expression is
15573         always of the given type.
15574
15575         (Is.DoResolve): Bug fix, we were reporting both always/never for
15576         the is expression.
15577
15578         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15579         creating too many unnecessary arrays.
15580
15581 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15584         fields instead of rolling our own initializer.   Takes care of all
15585         implicit conversions, and drops unnecessary static checks/argument.
15586
15587 2002-03-31  Dick Porter  <dick@ximian.com>
15588
15589         * driver.cs: use the GetDirectories() return values properly, and
15590         use "/" as path separator.
15591
15592 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15593
15594         * expression.cs (Unary): Optimize - - expr into expr.
15595         (Binary): Optimize a + (-b) into a -b.
15596
15597         * codegen.cs (CodeGen): Made all methods static.
15598
15599 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15600
15601         * rootcontext.cs: 
15602
15603         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15604         TypeBuilder property.
15605
15606         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15607         instead. 
15608
15609         * tree.cs: Removed the various RecordXXXX, and replaced with a
15610         single RecordDecl.  Removed all the accessor methods, and just
15611         left a single access point Type 
15612
15613         * enum.cs: Rename DefineEnum to DefineType.
15614
15615         * decl.cs: New abstract method `DefineType' used to unify the
15616         Defines for Enumerations, Interfaces, TypeContainers and
15617         Delegates.
15618
15619         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15620         LookupBaseClasses method that used to live in class.cs and
15621         interface.cs here, and renamed to FindType.
15622
15623         * delegate.cs: Implement DefineType.  Take advantage of the
15624         refactored pattern for locating the parent builder without taking
15625         the parent_builder argument (which we know does not work if we are
15626         nested, and triggering a toplevel definition).
15627
15628 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15629
15630         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15631         accessibility of a member has changed during override and report
15632         an error if so.
15633
15634         * class.cs (Method.Define, Property.Define): Only complain on
15635         overrides if the method is private, any other accessibility is
15636         fine (and since we just checked the permission is the same, we are
15637         good to go).
15638
15639         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15640         and elif are processed always.  The other pre-processing
15641         directives are only processed if we are "taking" the path
15642
15643 2002-03-29  Martin Baulig  <martin@gnome.org>
15644
15645         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15646         current location is not Null.
15647
15648         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15649         a separate method so we can profile it.
15650
15651         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15652         `span.Seconds' are just seconds, but no minutes or hours.
15653         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15654
15655 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15656
15657         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15658         Remove the gratuitous set of Final:
15659
15660                                 // If an interface implementation, then we can set Final.
15661                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15662                                     implementing.DeclaringType.IsInterface)
15663                                         flags |= MethodAttributes.Final;
15664
15665         I do not know what I was smoking when I used that.
15666
15667
15668         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15669         step into fixing the name resolution issues for delegates and
15670         unifying the toplevel name resolution.
15671
15672 2002-03-28  Martin Baulig  <martin@gnome.org>
15673
15674         * class.cs (Method.Emit): If we have a symbol writer, call its
15675         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15676         tell it about the current method.
15677
15678         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15679         writer that we're going to emit the first byte of IL code for a new
15680         statement (a new source line).
15681         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15682         EmitContext.Mark() before emitting any code.
15683
15684         * location.cs (SymbolDocument): Return null when we're Null.
15685
15686         * statement.cs (Statement): Moved the `Location loc' variable here.
15687         (Statement.EmitBoolExpression): If we have a symbol writer, call
15688         ec.Mark() before emitting any code to tell it that we're at the
15689         beginning of a new statement.
15690         (StatementExpression): Added `Location' argument to the constructor.
15691         (Block): Added public readonly variable `StartLocation' and public
15692         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15693         (Block): Added constructor which takes a start and end location.
15694         (Block.SetEndLocation): New method. This sets the end location.
15695         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15696         local variables we create.
15697         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15698         each statement and do also mark the begin and end of the block.
15699
15700         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15701         tell it the current lexer.Location, use Location.Null for the end of the
15702         block.
15703         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15704         current block, set its end location using SetEndLocation().
15705         (statement_expression): StatementExpression constructor now takes the
15706         lexer.Location as additional argument.
15707         (for_statement, declare_local_variables): Likewise.
15708         (declare_local_variables): When creating a new implicit block, use the
15709         new Block constructor and pass it the lexer.Location.
15710
15711 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15712
15713         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15714         members also on the parent interfaces recursively.
15715
15716 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * report.cs: Use new formats, since Gonzalo finished the missing
15719         bits. 
15720
15721         * expression.cs (Binary.ResolveOperator): added missing operator|
15722         operator& and operator^ for bool/bool.
15723
15724         * cs-parser.jay: CheckDef now takes a Location argument that is
15725         used to report errors more precisly (instead of reporting the end
15726         of a definition, we try to track something which is a lot closer
15727         to the source of the problem).
15728
15729         * cs-tokenizer.cs: Track global token use, so we can properly flag
15730         the use of #define/#undef after the first token has been seen.
15731
15732         Also, rename the reportXXXX to Error_DescriptiveName
15733
15734         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15735         TypeContainer, so that Enum and Interface can use this too.
15736
15737         * class.cs (TypeContainer.LookupInterfaceOrClass,
15738         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15739         `builder' argument.  Typically this was used to pass the parent
15740         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15741         the definition).  
15742
15743         The problem is that a nested class could trigger the definition of
15744         a toplevel class, and the builder would be obviously wrong in that
15745         case. 
15746
15747         So we drop this argument, and we compute dynamically the
15748         TypeBuilder/ModuleBuilder (the correct information was available
15749         to us anyways from DeclSpace.Parent)
15750
15751         * interface.cs (Interface.DefineInterface): Drop builder
15752         parameter cleanup like class.cs
15753
15754         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15755         like class.cs
15756
15757         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15758         values. 
15759
15760         (Try.Emit): Propagate the returns value from the statement.
15761
15762         (Return.Emit): Even if we are leavning 
15763
15764         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15765
15766         * modifiers.cs: Fix the computation of MethodAttributes flags.
15767
15768 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15769
15770         * driver.cs: allow compilation of files that start with '/'.
15771         Add a default case when checking the argument of --target.
15772
15773 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15774
15775         * interface.cs: Implement the same search algorithm for types in
15776         the interface code.
15777
15778         * delegate.cs: Do not allow multiple definition.
15779
15780         * Recovered ChangeLog that got accidentally amputated
15781
15782         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15783
15784         * rootcontext.cs: Load manually enum to allow core classes to
15785         contain enumerations.
15786
15787         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15788         Update to new static methods in TypeManager.
15789
15790         * typemanager.cs (GetMethod, GetConstructor): Use our
15791         implementation of FindMembers to find the members, since during
15792         corlib compilation, the types are TypeBuilders and GetMethod and
15793         GetConstructor do not work.
15794
15795         Make all methods in TypeManager static.
15796
15797         (InitCodeHelpers): Split the functionality from
15798         the InitCodeTypes function.
15799
15800         * driver.cs: Call InitCodeHelpers after we have populated the
15801         types. 
15802
15803         * cs-parser.jay (delegate_declaration): we did not used to compute
15804         the delegate name correctly for void delegates.
15805
15806 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15807
15808         * rootcontext.cs (RootContext): Init the interface_resolve_order
15809         and type_container_resolve_order always.
15810
15811         (ResolveCore, BootstrapCorlib_ResolveClass,
15812         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15813         compiler when compiling with --nostdlib
15814
15815         * class.cs (TypeContainer.DefineType): Check that our parent is
15816         not null.  This test is most important when we are bootstraping
15817         the core types.
15818
15819         * codegen.cs: Split out the symbol writing code.
15820
15821 2002-03-25  Martin Baulig  <martin@gnome.org>
15822
15823         * driver.cs (-g): Made -g an alias for --debug.
15824
15825 2002-03-24  Martin Baulig  <martin@gnome.org>
15826
15827         * codegen.cs (SymbolWriter): New public variable. Returns the
15828         current symbol writer.
15829         (CodeGen): Added `bool want_debugging_support' argument to the
15830          constructor. If true, tell the ModuleBuild that we want debugging
15831         support and ask it for the ISymbolWriter.
15832         (Save): If we have a symbol writer, call it's Close() method after
15833         saving the assembly.
15834
15835         * driver.c (--debug): New command line argument to create a
15836         debugger information file.
15837
15838         * location.cs (SymbolDocument): New public property. Returns an
15839         ISymbolDocumentWriter object for the current source file or null
15840         if we don't have a symbol writer.
15841
15842 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15843
15844         * driver.cs (LoadAssembly): Correctly return when all the paths
15845         have been tried and not before.
15846
15847         * statement.cs (Switch.Emit): return the actual coverage for this
15848         statement (returns/not-returns)
15849
15850         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15851         switch of the statement if we are the last switch section.  That
15852         kills two problems: try/catch problems (we used to emit an empty
15853         nop at the end) and switch statements where all branches would
15854         return. 
15855
15856 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15857
15858         * driver.cs: Add default assemblies (the equivalent to the
15859         Microsoft CSC.RSP file)
15860
15861         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15862         also update tokens_seen and set it to false.
15863
15864         * driver.cs: Implement --recurse for Mike.
15865
15866         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15867         correctly splitting out the paths.
15868
15869 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15870
15871         * interface.cs (Interface.PopulateProperty): Instead of using
15872         `parent' as the declaration space for the set parameters, use
15873         `this' 
15874
15875         * support.cs (InternalParameters): InternalParameters constructor
15876         takes a DeclSpace instead of a TypeContainer.
15877
15878         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15879         types are being initialized, load the address of it before calling
15880         the function.  
15881
15882         (New): Provide a mechanism to disable the generation of local
15883         value type temporaries when the caller will be providing us with
15884         an address to store it.
15885
15886         (ArrayCreation.EmitDynamicInitializers): Use it.
15887
15888 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * expression.cs (Invocation.EmitArguments): Only probe for array
15891         property if there is more than one argument.  Sorry about that.
15892
15893         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15894         empty param arrays.
15895
15896         * class.cs (Method.LabelParameters): Fix incorrect code path that
15897         prevented the `ParamArrayAttribute' from being applied to the
15898         params attribute.
15899
15900 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * support.cs (ReflectionParameters): Correctly compute whether the
15903         last argument is a params array.  Fixes the problem with
15904         string.Split ('a')
15905
15906         * typemanager.cs: Make the assemblies array always be non-null
15907         (empty, but non-null)
15908
15909         * tree.cs (RecordDecl): New function that abstracts the recording
15910         of names.  This reports error 101, and provides a pointer to the
15911         previous declaration.  Fixes a crash in the compiler.
15912
15913         * cs-parser.jay (constructor_declaration): Update to new grammar,
15914         and provide a constructor_body that can be empty.
15915
15916 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15917
15918         * driver.cs: Add support for --resources.
15919
15920         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15921         Make all types for the various array helper methods be integer.
15922
15923         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15924         CheckState to ConvCast.
15925
15926         (ConvCast): Now it takes a `checked' state argument, to avoid
15927         depending on the emit context for the conversion, and just using
15928         the resolve time setting.
15929
15930         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15931         instead of Invocation.EmitArguments.  We do not emit the original
15932         arguments, instead we emit those which have been converted to
15933         unsigned int expressions.
15934
15935         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15936
15937         * codegen.cs: ditto.
15938
15939         * expression.cs (LocalVariableReference): Drop the use of the
15940         Store function that depended on the variable index.
15941
15942         * statement.cs (VariableInfo): Drop the `Idx' property from this
15943         class, as this is not taking into account the indexes for
15944         temporaries tat we generate during the execution, getting the
15945         indexes wrong.
15946
15947         * class.cs: First emit class initializers, then call the parent
15948         constructor. 
15949
15950         * expression.cs (Binary): Fix opcode emision.
15951         (UnaryMutator.EmitCode): Support checked code generation
15952
15953         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15954         matches for events for both the Static and Instance scans,
15955         pointing to the same element.   Fix that.
15956
15957 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15958
15959         * rootcontext.cs (ResolveTree): Always set the
15960         interface_resolve_order, because nested interfaces will be calling
15961         into us.
15962
15963         * class.cs (GetInterfaceOrClass): Track the same resolution
15964         process used by TypeManager.LookupType.  This fixes the nested
15965         type lookups in class declarations (separate path from
15966         LookupType). 
15967
15968         (TypeContainer.DefineType): Also define nested interfaces.
15969         (TypeContainer.RegisterOrder): New public function used to
15970         register the order in which child interfaces need to be closed.
15971
15972         Nested interfaces need to be closed after their parents have been
15973         created. 
15974
15975         * interface.cs (InterfaceAttr): Put all the logic for computing
15976         the interface attribute here. 
15977
15978         (DefineInterface): Register our interface order with the
15979         RootContext or with the TypeContainer depending on the case.
15980
15981 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * cs-parser.jay: rework foreach statement to work with the new
15984         changes to the policy on SimpleNames.
15985
15986         * report.cs: support Stacktrace on warnings as well.
15987
15988         * makefile: drop --unsafe and /unsafe from the compile.
15989
15990 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15991
15992         * ecore.cs (StandardConversionExists): Modify to take an Expression
15993         as the first parameter. Ensure we do null -> reference type conversion
15994         checking.
15995
15996         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15997         temporary Expression objects.
15998
15999 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16000
16001         * interface.cs: workaround bug in method overloading resolution
16002         (there is already a bugzilla bug for it).
16003
16004 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16005
16006         We could also solve this problem by having a separate path for
16007         performing type lookups, instead of DoResolve, we could have a
16008         ResolveType entry point, and only participating pieces of the
16009         production (simplename, deref, array) would implement this. 
16010
16011         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16012         signal SimpleName to only resolve type names and not attempt to
16013         resolve anything else.
16014
16015         * expression.cs (Cast): Set the flag.
16016
16017         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16018
16019         * class.cs: Only report 108 if there is no `new' modifier.
16020
16021         * cs-parser.jay: rework foreach statement to work with the new
16022         changes to the policy on SimpleNames.
16023
16024         * report.cs: support Stacktrace on warnings as well.
16025
16026         * makefile: drop --unsafe and /unsafe from the compile.
16027
16028 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16029
16030         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16031         lookups here, instead of doing that at parse time.  This means
16032         that our grammar will not introduce `LocalVariableReferences' as
16033         expressions at this point.  That solves the problem of code like
16034         this:
16035
16036         class X {
16037            static void Main ()
16038            { int X = 1;
16039             { X x = null }}}
16040
16041         This is only half the fix.  The full fix requires parameters to
16042         also be handled in this way.
16043
16044         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16045         makes the use more obvious of the DeclSpace.  The
16046         ec.TypeContainer.TypeBuilder is now only used to pull the
16047         TypeBuilder for it.
16048
16049         My theory is that I can get rid of the TypeBuilder completely from
16050         the EmitContext, and have typecasts where it is used (from
16051         DeclSpace to where it matters).  
16052
16053         The only pending problem is that the code that implements Aliases
16054         is on TypeContainer, and probably should go in DeclSpace.
16055
16056         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16057         lookups here, instead of doing that at parse time.  This means
16058         that our grammar will not introduce `LocalVariableReferences' as
16059         expressions at this point.  That solves the problem of code like
16060         this:
16061
16062         class X {
16063            static void Main ()
16064            { int X = 1;
16065             { X x = null }}}
16066
16067         This is only half the fix.  The full fix requires parameters to
16068         also be handled in this way.
16069
16070         * class.cs (Property.DefineMethod): When implementing an interface
16071         method, set newslot, when implementing an abstract method, do not
16072         set the flag (before we tried never setting it, or always setting
16073         it, which is the difference).
16074         (Indexer.DefineMethod): same.
16075         (Method.DefineMethod): same.
16076
16077         * ecore.cs: Only set the status used flag if we get back a Field.
16078
16079         * attribute.cs: Temporary hack, so Paolo can keep working.
16080
16081 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16082
16083         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16084         the unmanaged type in the case we have a MarshalAs attribute.
16085
16086         (Resolve): Handle the case when we are parsing the special MarshalAs
16087         attribute [we need to store the unmanaged type to use later]
16088
16089         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16090         MarshalAs Attribute.
16091
16092         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16093         on parameters and accordingly set the marshalling info.
16094
16095 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * class.cs: Optimizing slightly by removing redundant code after
16098         we switched to the `NoTypes' return value.
16099         (Property.DefineMethod): use NoTypes here too.
16100
16101         This fixes the bug I introduced in my last batch of changes.
16102
16103 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16104
16105         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16106
16107         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16108         Enums since those are types too. 
16109
16110         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16111
16112         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16113         thanks to a call during the lookup process.
16114
16115 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16116
16117         * statement.cs (Foreach): Lots of work to accomodate a particular
16118         kind of foreach statement that I had not kept in mind.  It is
16119         possible to have foreachs on classes that provide a GetEnumerator
16120         method that return objects that implement the "pattern" for using
16121         a foreach, there is no need to support GetEnumerator
16122         specifically. 
16123
16124         This is needed to compile nant.
16125
16126         * decl.cs: Only report 114 if the member is not `Finalize' and if
16127         the warning level is at least 2.
16128
16129         * class.cs: Moved the compare function from Method to
16130         MethodSignature. 
16131
16132         (MethodSignature.InheritableMemberSignatureCompare): Add new
16133         filter function that is used to extract inheritable methods from a
16134         class. 
16135
16136         (Method.Define): Use the new `inheritable_method_signature_filter'
16137         delegate
16138
16139         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16140         command. 
16141
16142 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16145
16146         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16147
16148         * expression.cs: Pass location information to
16149         ConvertImplicitStandard. 
16150
16151         * class.cs: Added debugging code to track return values from
16152         interfaces. 
16153
16154 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16155
16156         * expression.cs (Is.DoResolve): If either side of the `is' is an
16157         interface, do not flag the warning.
16158
16159         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16160         for interfaces
16161
16162         * report.cs: Allow for --fatal to be used with --probe.
16163
16164         * typemanager.cs (NoTypes): Move the definition for the empty Type
16165         array here. 
16166
16167         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16168         properties. 
16169         (TypeContainer.DefineProxy): New function used to proxy to parent
16170         implementations when implementing interfaces.
16171         (TypeContainer.ParentImplements): used to lookup if our parent
16172         implements a public function that is required by an interface.
16173         (TypeContainer.VerifyPendingMethods): Hook this up.
16174
16175         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16176         `modules' and `assemblies' arraylists into arrays.  We only grow
16177         these are the very early start up of the program, so this improves
16178         the speedof LookupType (nicely measured).
16179
16180         * expression.cs (MakeByteBlob): Replaced unsafe code with
16181         BitConverter, as suggested by Paolo.
16182
16183         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16184         folding of string concatenation, but if either side is a string,
16185         and the other is not, then return null, and let the runtime use
16186         the concatenation on the string plus the object (using
16187         `Object.ToString'). 
16188
16189 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16190
16191         Constant Folding has been implemented now.
16192
16193         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16194         the error instead on types that are not supported in one's
16195         complement. 
16196
16197         * constant.cs (Constant and all children): New set of functions to
16198         perform implict and explicit conversions.
16199
16200         * ecore.cs (EnumConstant): Implement the new functions to perform
16201         conversion by proxying to the child expression.
16202
16203         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16204         own separate setting that can not be turned off from the command
16205         line using --unchecked or --checked and is only controlled using
16206         the checked/unchecked statements and expressions.  This setting is
16207         used by the constant folder to flag errors.
16208
16209         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16210         ConstantCheckState as well.   
16211
16212         During Resolve, they also have to flag the state, because the
16213         constant folder runs completely in the Resolve phase.
16214
16215         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16216         well.
16217
16218 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16219
16220         * cfold.cs: New file, this file contains the constant folder.
16221
16222         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16223         argument to track whether we are using the resulting address to
16224         load or store a value and provide better error messages. 
16225
16226         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16227         new AddressOf arguments.
16228
16229         * statement.cs (Foreach.EmitCollectionForeach): Update
16230
16231         * expression.cs (Argument.Emit): Call AddressOf with proper
16232         arguments to track usage.
16233
16234         (New.DoEmit): Call AddressOf with new arguments.
16235
16236         (Unary.Emit): Adjust AddressOf call.
16237
16238 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16239
16240         * cs-parser.jay (member_access): Change the case for pre-defined types
16241         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16242         this suggestion.
16243
16244         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16245         a method body.
16246
16247         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16248         essentially like methods and apply attributes like MethodImplOptions to them too.
16249
16250         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16251         not being null.
16252
16253         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16254         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16255         is the DeclSpace.
16256
16257         * Update code everywhere accordingly.
16258
16259         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16260
16261         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16262
16263 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16264
16265         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16266         try performing lookups against those instead of jumping straight into using
16267         the 'using' clauses.
16268
16269         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16270
16271         (LookupType): Perform lookups in implicit parents too.
16272
16273         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16274         sequence as RootContext.LookupType. 
16275
16276         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16277         the various cases of namespace lookups into this method.
16278
16279 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16282         in positional arguments)
16283
16284         * class.cs (Operator): Update the AllowedModifiers to contain
16285         extern. 
16286
16287         * cs-parser.jay: Update operator declaration to allow for the
16288         operator body to be empty.
16289
16290         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16291         values. 
16292
16293 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16294
16295         * class.cs (Method.Emit): Label parameters.
16296
16297         * driver.cs: Return 1 or 0 as the program exit code.
16298
16299 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16300
16301         * expression.cs: Special case the `null' object when trying to
16302         auto-compute the type, as anything can be explicitly converted to
16303         that. 
16304
16305         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16306         spotting this Paolo.
16307
16308         (Expression.ImplicitNumericConversion): Perform comparissions of
16309         the type using the underlying type in the case of an enumeration
16310         rather than using the enumeration type for the compare.
16311
16312         Cope with the underlying == type case, which is not possible to
16313         catch before. 
16314
16315         (Expression.ConvertNumericExplicit): Perform comparissions of
16316         the type using the underlying type in the case of an enumeration
16317         rather than using the enumeration type for the compare.
16318
16319         * driver.cs: If the user does not supply an extension, assume .exe
16320
16321         * cs-parser.jay (if_statement): Rewrote so that we can track the
16322         location for the if statement.
16323
16324         * expression.cs (Binary.ConstantFold): Only concat strings when
16325         the operation is "+", not everything ;-)
16326
16327         * statement.cs (Statement.EmitBoolExpression): Take a location
16328         argument. 
16329         (If, While, Do): Track location.
16330
16331         * expression.cs (Binary.ResolveOperator): In the object + string
16332         case, I was missing a call to ConvertImplicit
16333
16334 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16335
16336         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16337         Location arguments. Ensure we use RootContext.LookupType to do our work
16338         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16339
16340         * interface.cs (PopulateMethod): Handle the type of the parameter being
16341         null gracefully.
16342
16343         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16344         have a params method with no fixed arguments and a call is made with no
16345         arguments.
16346
16347 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16348
16349         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16350         the verbatim-string-literal
16351
16352         * support.cs (InternalParameters.ParameterModifier): handle null
16353         fixed parameters.
16354         (InternalParameters.ParameterType): ditto.
16355
16356         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16357         duplicating the name of the variable parameter.
16358         (GetParameterByName): Fix bug where we were not looking up array
16359         paramters if they were the only present (thanks Paolo!).
16360         (GetParameterInfo): We only have an empty set of types if both
16361         fixed and array are set to null.
16362         (GetParameterInfo-idx): Handle FixedParameter == null
16363
16364         * cs-parser.jay: Handle the case where there is no catch
16365         statements (missing null test).
16366
16367 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * driver.cs (MainDriver): Be conservative on our command line
16370         handling.
16371
16372         Catch DirectoryNotFoundException when calling GetFiles.
16373
16374         (SplitPathAndPattern): Used to split the input specification into
16375         a path and a pattern that we can feed to Directory.GetFiles.
16376
16377 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16378
16379         * statement.cs (Fixed): Implement the last case of the Fixed
16380         statement (string handling).
16381
16382         * expression.cs (StringPtr): New class used to return a char * to
16383         a string;  Used by the Fixed statement.
16384
16385         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16386
16387         * expression.cs (Binary.ResolveOperator): Remove redundant
16388         MemberLookup pn parent type.
16389         Optimize union call, we do not need a union if the types are the same.
16390         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16391         type.
16392
16393         Specialize the use of MemberLookup everywhere, instead of using
16394         the default settings. 
16395
16396         (StackAlloc): Implement stackalloc keyword.
16397
16398         * cs-parser.jay: Add rule to parse stackalloc.
16399
16400         * driver.cs: Handle /h, /help, /?
16401
16402         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16403         before we supported unsafe code.
16404
16405         * makefile: add --unsafe to the self compilation of mcs.
16406
16407 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * expression.cs (PointerArithmetic): New class that is used to
16410         perform pointer arithmetic.
16411         (Binary.Resolve): Handle pointer arithmetic
16412         Handle pointer comparission.
16413         (ArrayPtr): Utility expression class that is used to take the
16414         address of an array.
16415
16416         (ElementAccess): Implement array access for pointers
16417
16418         * statement.cs (Fixed): Implement fixed statement for arrays, we
16419         are missing one more case before we are done.
16420
16421         * expression.cs (Indirection): Implement EmitAssign and set the
16422         ExprClass to Variable.  This allows pointer dereferences to be
16423         treated as variables, and to have values assigned to them.
16424
16425         * ecore.cs (Expression.StoreFromPtr): New utility function to
16426         store values dereferencing.
16427
16428 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16429
16430         * expression.cs (Binary.ResolveOperator): Ensure that we are
16431         not trying to operate on a void type - this fixes the reported
16432         bug.
16433
16434         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16435         the parent implementation is sealed.
16436
16437         * ../errors/cs0239.cs : Add.
16438
16439         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16440
16441         * typemanager.cs (unverifiable_code_type): Corresponds to 
16442         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16443         which have unsafe code in them.
16444
16445         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16446         unsafe context.
16447
16448 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * cs-tokenizer.cs: Add support for @"litreal strings"
16451
16452         Make tokenizer accept pre-processor directives
16453         on any column (remove the old C-like limitation). 
16454
16455         * rootcontext.cs (EmitCode): Emit any global attributes.
16456         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16457
16458         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16459
16460         * cs-parser.jay: Add support for global attributes.  
16461
16462 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16463
16464         * expression.cs (Indirection): New helper class.  Unary will
16465         create Indirection classes to be able to implement the
16466         IMemoryLocation interface on it.
16467
16468 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * cs-parser.jay (fixed_statement): reference the right statement.
16471
16472         * statement.cs (Fixed.Emit): Finish implementing the fixed
16473         statement for the &x case.
16474
16475 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * class.cs (Property.Define, Method.Define): Remove newslot when
16478         `implementing'.  
16479
16480         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16481         wrong.  NewSlot should only be used if the `new' keyword is present.
16482
16483         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16484         locating our system dir.  Sorry about this.
16485
16486 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * driver.cs (GetSystemDir): Compute correctly the location of our
16489         system assemblies.  I was using the compiler directory instead of
16490         the library directory.
16491
16492 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16493
16494         * expression.cs (BetterFunction): Put back in what Miguel commented out
16495         since it is the correct fix. The problem is elsewhere ;-)
16496
16497         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16498         parameters of the parms method are themselves compatible or not !
16499
16500         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16501         to check that a class implements an interface before saying that an implicit
16502         conversion was allowed. Use ImplementsInterface to do the checking.
16503
16504 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16505
16506         * class.cs (Method.Define): Track whether we are an explicit
16507         implementation or not.  And only call DefineMethodOverride if we
16508         are an explicit implementation.
16509
16510         (Property.DefineMethod): Ditto.
16511
16512 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16513
16514         * expression.cs (BetterFunction): Catch hideous bug which was
16515          preventing us from detecting ambiguous calls due to implicit casts i.e
16516         cs0121.
16517
16518 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * support.cs (Pair): Remove un-needed method.  I figured why I was
16521         getting the error in cs-parser.jay, the variable in a foreach loop
16522         is readonly, and the compiler does not really treat this as a variable.
16523
16524         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16525         instead of EQUALS in grammar.  
16526
16527         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16528
16529         * expression.cs (Unary.DoResolve): Check whether the argument is
16530         managed or not.
16531
16532 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16533
16534         * support.cs: Api for Pair to set a value.  Despite the fact that
16535         the variables are public the MS C# compiler refuses to compile
16536         code that accesses the field if the variable is part of a foreach
16537         statement. 
16538
16539         * statement.cs (Fixed): Begin implementation of the fixed
16540         statement.
16541
16542         (Block.AddVariable): Return the VariableInfo on success and null
16543         on failure instead of true/false. 
16544
16545         * cs-parser.jay (foreach): Catch errors on variables already
16546         defined (we were ignoring this value before) and properly unwind
16547         the block hierarchy
16548
16549         (fixed_statement): grammar for the fixed statement.
16550
16551 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16554         pointer types to be incretemented.
16555
16556         (SizeOf): Implement.
16557
16558         * cs-parser.jay (pointer_member_access): Implement
16559         expr->IDENTIFIER production.
16560
16561         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16562         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16563         on safe contexts.
16564
16565         (Unary): Implement indirection.
16566
16567         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16568         use in non-unsafe context).
16569
16570         (SimpleName.DoResolve): Check for pointers in field access on safe
16571         contexts. 
16572
16573         (Expression.LoadFromPtr): Factor the load-indirect code in this
16574         function.  This was duplicated in UnboxCast and ParameterReference
16575
16576 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16577
16578         * expression.cs (ComposedCast): report an error if a pointer cast
16579         is used in a safe region.
16580
16581         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16582         pointer type casts in unsafe context.
16583
16584         * codegen.cs (EmitContext): Set up IsUnsafe.
16585
16586         * cs-parser.jay (non_expression_type): Add productions for pointer
16587         casts. 
16588
16589         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16590         code.  We should not use force into static mode if the method is
16591         not virtual.  Fixes bug in MIS
16592
16593         * statement.cs (Do.Emit, While.Emit, For.Emit,
16594         Statement.EmitBoolExpression): Add support to Do and While to
16595         propagate infinite loop as `I do return' semantics.
16596
16597         Improve the For case to also test for boolean constants.
16598
16599         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16600         to the list of attributes we can add.
16601
16602         Remove `EmitContext' argument.
16603
16604         * class.cs (Method.Define): Apply parameter attributes.
16605         (Constructor.Define): Apply parameter attributes.
16606         (MethodCore.LabelParameters): Move here the core of labeling
16607         parameters. 
16608
16609         * support.cs (ReflectionParameters.ParameterModifier,
16610         InternalParameters.ParameterModifier): Use IsByRef on the type and
16611         only return the OUT bit for these parameters instead of in/out/ref
16612         flags.
16613
16614         This is because I miss-understood things.  The ParameterInfo.IsIn
16615         and IsOut represent whether the parameter has the [In] and [Out]
16616         attributes set.  
16617
16618 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16619
16620         * ecore.cs (FieldExpr.Emit): Release temporaries.
16621
16622         * assign.cs (LocalTemporary.Release): new function.
16623
16624         * codegen.cs (EmitContext.GetTemporaryStorage,
16625         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16626         temporary storage.  Now we can "put back" localbuilders when we
16627         are done with them
16628
16629 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16630
16631         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16632         need to make a copy of the variable to generate verifiable code.
16633
16634 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16635
16636         * driver.cs: Compute dynamically the system directory.
16637
16638         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16639         Slower, but more generally useful.  Used by the abstract
16640         registering implementation. 
16641
16642         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16643         the rules for the special rule on Type/instances.  First check if
16644         we have the same name, and if so, try that special static path
16645         rather than the instance path.
16646
16647 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16648
16649         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16650         for, while and if.
16651
16652         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16653         Enum, ValueType, Delegate or Array for non-corlib compiles.
16654
16655         * cs-tokenizer.cs: Catch long identifiers (645)
16656
16657         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16658         piece of code.
16659
16660         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16661         fix, we were returning too early, so we were not registering
16662         pending methods from abstract classes.
16663
16664         Do not register pending methods if the class is abstract.
16665
16666         * expression.cs (Conditional.DoResolve): Report circular implicit
16667         conversions when we neecd to compute it for conditional
16668         expressions. 
16669
16670         (Is.DoResolve): If the expression is always of the provided type,
16671         flag warning 183.  If the expression can not ever be of the
16672         provided type flag warning 184.
16673
16674         * class.cs: Catch 169 as well.
16675
16676         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16677         read. 
16678
16679 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16680
16681         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16682
16683 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16684
16685         * interface.cs: (PopulateMethod): Check for pointers being defined
16686         only if the unsafe context is active.
16687         (PopulateProperty): ditto.
16688         (PopulateIndexer): ditto.
16689
16690         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16691         specified.  If pointers are present, make sure that they are
16692         present in an unsafe context.
16693         (Constructor, Constructor.Define): ditto.
16694         (Field, Field.Define): ditto.
16695         (Property, Property.Define): ditto.
16696         (Event, Event.Define): ditto.
16697
16698         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16699         hashtable if there are classes or structs defined.
16700
16701         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16702         code, as the constant resolution moved.
16703
16704         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16705         the metadata, so we can flag error 133. 
16706
16707         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16708         pointer is being declared in an unsafe context.
16709
16710 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16711
16712         * modifiers.cs (Modifiers.Check): Require a Location argument.
16713         Report error 227 for Unsafe use.
16714
16715         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16716
16717         * statement.cs (For.Emit): If the test is null, then report that
16718         we do `return', as we wont reach anything afterwards.
16719
16720         (Switch.SwitchGoverningType): Track the expression that matched
16721         the conversion.
16722
16723         * driver.cs: Allow negative numbers as an error code to flag.
16724
16725         * cs-parser.jay: Handle 1551.
16726
16727         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16728
16729 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16730
16731         * cs-parser.jay: Report 1518 (type declaration can only contain
16732         class, struct, interface, enum or delegate)
16733
16734         (switch_label): Report 1523 (keywords `case' or `default' must
16735         preced code)
16736
16737         (opt_switch_sections): Report 1522 (empty switch)
16738
16739         * driver.cs: Report 1515 (response file specified multiple times)
16740         Report 1516 (Source file specified multiple times).
16741
16742         * expression.cs (Argument.Resolve): Signal 1510
16743
16744         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16745         access not allowed in static code)
16746
16747 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16748
16749         * typemanager.cs (IsPointerType): Utility method which we are going
16750         to need a lot.
16751
16752         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16753         the object type, so we take care of that.
16754
16755         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16756
16757         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16758         added to non-params parameters :-)
16759
16760         * typemanager.cs (CSharpName): Include 'void' type too. 
16761
16762         (void_ptr_type): Include in the set of core types.
16763
16764         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16765         duplicating code.
16766
16767         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16768         an unsafe context.
16769
16770         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16771         completely forgotten about it.
16772
16773 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16774
16775         * cs-parser.jay (pointer_type): Add. This begins our implementation
16776         of parsing rules for unsafe code.
16777
16778         (unsafe_statement): Implement.
16779
16780         (embedded_statement): Modify to include the above.
16781
16782         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16783
16784         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16785         if the current context is an unsafe one.
16786
16787         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16788         are handled differently, we need separate rules for them.
16789
16790         (local_variable_declaration): Update to use local_variable_pointer_type
16791         to allow variable declarations of unmanaged pointer types.
16792
16793         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16794         in unsafe contexts.
16795
16796         * ../errors/cs0214.cs : Add.
16797
16798 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16799
16800         * makefile: remove 'response' file when cleaning.
16801
16802 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16803
16804         * cs-parser.jay: Report 1524.
16805
16806 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16807
16808         * typemanager.cs (RegisterMethod): drop checking if we have
16809         registered this from here
16810
16811 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16812
16813         * class.cs (Method.EmitDestructor): Implement calling our base
16814         destructor. 
16815
16816         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16817         value of InFinally.
16818
16819         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16820         this routine and will wrap the call in a try/catch block.  Deal
16821         with the case.
16822
16823 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16824
16825         * ecore.cs (Expression.MemberLookup): instead of taking a
16826         parameter `same_type' that was used to tell whether we could
16827         access private members we compute our containing type from the
16828         EmitContext.
16829
16830         (FieldExpr): Added partial support for volatile fields.  This does
16831         not work for volatile fields exposed from assemblies, as I can not
16832         figure out how to extract the modreq from it.
16833
16834         Updated all the source files to use this.
16835
16836         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16837         because it is referenced by MemberLookup very often. 
16838
16839 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16840
16841         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16842         TypeBuilder.GetCustomAttributes to retrieve what we need.
16843
16844         Get rid of redundant default_member_attr_type as this is the same as
16845         default_member_type which already exists.
16846
16847         * interface.cs, attribute.cs : Update accordingly.
16848
16849 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16850
16851         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16852         work for TYpeBuilders though.  Ravi, can you please fix this?
16853
16854         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16855
16856         * expression.cs (Argument.Emit): Handle the case of ref objects
16857         being passed to ref functions;  
16858
16859         (ParameterReference.EmitLoad): Loads the content of the pointer
16860         without dereferencing.
16861
16862 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16865
16866 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16867
16868         * class.cs (Indexer.DefineMethod): Incorporate the interface
16869         type in the name of the method if we are doing explicit interface
16870         implementation.
16871
16872         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16873
16874         (BetterConversion): Fix extremely trivial bug where we were referring to
16875         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16876         again !
16877
16878         * ../errors/bug16.cs : Add although we have fixed it.
16879
16880 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * expression.cs (BaseIndexer): Begin implementation.
16883
16884         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16885
16886         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16887         production directly to remove a shift/reduce, and implement
16888         explicit interface implementation.
16889
16890         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16891         after a floating point suffix.
16892
16893         * expression.cs (DoNumericPromotions): Improved the conversion for
16894         uint/uint.  If we have a constant, we avoid doing a typecast to a
16895         larger type.
16896
16897         * class.cs (Indexer): Implement explicit interface implementation
16898         for indexers.
16899
16900 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16901
16902         * class.cs: make the default instance constructor public and hidebysig.
16903
16904 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16905
16906         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16907         so we can call it from elsewhere.
16908
16909         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16910         we emit it internally if the class has a defined indexer; otherwise the user
16911         emits it by decorating the class definition with the DefaultMemberAttribute.
16912
16913         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16914         attribute is not used on a type which defines an indexer.
16915
16916         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16917         character when we skip whitespace.
16918
16919         * ../errors/cs0646.cs : Add.
16920
16921 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16922
16923         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16924         again. 
16925
16926         * makefile: Add practical target `mcs3.exe' which builds the third
16927         generation compiler. 
16928
16929         * expression.cs (New): Fix structures constructor calling.
16930
16931         * class.cs (Property, Method, Indexer): Emit Final flag on the
16932         method if we are an interface implementation and we are not
16933         abstract. 
16934
16935         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16936         whether this property is referencing a `base' method.
16937
16938         * expression.cs (Invocation.EmitCall): take an extra argument:
16939         is_base, this is used to determine whether the `call' or
16940         `callvirt' opcode should be used.
16941
16942
16943         * delegate.cs: update EmitCall.
16944
16945         * class.cs (Method.Define): Set NewSlot for the cases where we are
16946         not implementing an interface method.
16947
16948         (Property.Define): ditto.
16949
16950 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16953         'r'.  Allows mcs to parse itself fully.
16954
16955 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16956
16957         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16958         of the number of initializers that require the InitializeArray method.
16959
16960         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16961         update the above field where necessary.
16962
16963         (MakeByteBlob): Update accordingly.
16964
16965         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16966         greater than 2.
16967
16968         (EmitDynamicInitializers): Update in accordance with the new optimization.
16969
16970         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16971         same OpCode applies.
16972
16973         * cs-parser.jay : Fix some glaring errors I introduced.
16974
16975 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16976
16977         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16978         so that we can check for name clashes there too.
16979
16980         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16981         for interface indexers.
16982
16983         * interfaces.cs (Define): Emit the default member attribute.
16984
16985         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16986         variable was being referred to while setting the value ;-)
16987
16988 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16989
16990         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16991         byte-by-byte information when we know the data is zero.
16992
16993         Make the block always a multiple of 4, because
16994         DefineInitializedData has a bug.
16995
16996         * assign.cs: Fix, we should assign from the temporary, not from
16997         the source. 
16998
16999         * expression.cs (MakeByteBlob): Fix my incorrect code.
17000
17001 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17002
17003         * typemanager.cs (EnumToUnderlying): This function is used to get
17004         the underlying type from an enumeration, because it does not
17005         always work. 
17006
17007         * constant.cs: Use the I4_S form for values between -128 and 127.
17008
17009         * statement.cs (Block.LookupLabel): Looks up a label.
17010         (Block): Drop support for labeled blocks.
17011
17012         (LabeledStatement): New kind of statement that represents a label
17013         only.
17014
17015         (Goto): Finally implement this bad boy.
17016
17017         * cs-parser.jay: Update to reflect new mechanism to implement
17018         labels.
17019
17020 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * codegen.cs (EmitContext.This): a codegen property that keeps the
17023         a single instance of this instead of creating many different this
17024         instances. 
17025
17026         * delegate.cs (Delegate.DoResolve): Update to use the property;
17027
17028         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17029
17030         * expression.cs (BaseAccess.DoResolve): Ditto.
17031
17032 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17033
17034         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17035         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17036
17037         (InitCoreTypes): Update accordingly.
17038
17039         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17040         so we can quickly store the state.
17041
17042         (ApplyAttributes): Set the correct implementation flags
17043         for InternalCall methods.
17044
17045 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17046
17047         * expression.cs (EmitCall): if a method is not virtual, then do
17048         not use callvirt on it.
17049
17050         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17051         user defined stuff) requires the use of stobj, which takes an
17052         address on the stack instead of an array and an index.  So emit
17053         the Ldelema operation for it.
17054
17055         (EmitStoreOpcode): Use stobj for valuetypes.
17056
17057         (UnaryMutator.EmitCode): Use the right 1 value depending on
17058         whether we are dealing with int64/uint64, float or doubles.
17059
17060         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17061         constructors that I implemented last night.
17062
17063         (Constructor.IsDefault): Fix to work properly for static
17064         constructors.
17065
17066         * cs-parser.jay (CheckDef): report method signature errors.
17067         Update error number 103 to be 132.
17068
17069         * decl.cs: New AdditionResult enumeration value: MethodExists.
17070         Although we do this check for methods later on in the semantic
17071         analysis, catching repeated default constructors is so easy that
17072         we catch these here. 
17073
17074         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17075         promotions code.
17076
17077         (ParameterReference.EmitAssign, Emit): handle
17078         bools as bytes.
17079
17080         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17081         (ArrayAccess.EmitStoreOpcode): ditto.
17082
17083         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17084
17085         * expression.cs (MakeByteBlob): Complete all the missing types
17086         (uint, short, ushort, byte, sbyte)
17087
17088         * class.cs: Only init instance field initializers on instance
17089         constructors. 
17090
17091         Rename `constructors' to instance_constructors. 
17092
17093         (TypeContainer.AddConstructor): Only add constructors to the list
17094         if it is not static.
17095
17096         Make sure that we handle default_static_constructor independently
17097         everywhere where we handle instance_constructors
17098
17099 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * class.cs: Do not lookup or create a base initializer for a
17102         static constructor.
17103
17104         (ConstructorInitializer.Resolve): use the proper type to lookup
17105         for constructors.
17106
17107         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17108
17109         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17110         in DeclSpace. 
17111
17112         * decl.cs: CloseType is now an virtual method, the default
17113         implementation just closes this type.
17114
17115 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17116
17117         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17118         to PreserveSig by default. Also emit HideBySig on such methods.
17119
17120         Basically, set the defaults to standard values.
17121
17122         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17123         argument, if candidate is better, it can't be worse than the best !
17124
17125         (Invocation): Re-write bits to differentiate between methods being
17126         applicable in their expanded form and their normal form - for params
17127         methods of course.
17128
17129         Get rid of use_standard everywhere as only standard conversions are allowed
17130         in overload resolution. 
17131
17132         More spec conformance.
17133
17134 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17135
17136         * driver.cs: Add --timestamp, to see where the compiler spends
17137         most of its time.
17138
17139         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17140         `this' in static code.
17141
17142         (SimpleName.DoResolve): Implement in terms of a helper function
17143         that allows static-references to be passed upstream to
17144         MemberAccess.
17145
17146         (Expression.ResolveWithSimpleName): Resolve specially simple
17147         names when called by MemberAccess to implement the special
17148         semantics. 
17149
17150         (Expression.ImplicitReferenceConversion): Handle conversions from
17151         Null to reference types before others, as Null's type is
17152         System.Object. 
17153
17154         * expression.cs (Invocation.EmitCall): Handle the special case of
17155         calling methods declared on a reference type from a ValueType
17156         (Base classes System.Object and System.Enum)
17157
17158         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17159         the left hand side is a TypeExpr, not on every enumeration. 
17160
17161         (Binary.Resolve): If types are reference types, then do a cast to
17162         object on operators != and == of both arguments.
17163
17164         * typemanager.cs (FindMembers): Extract instance and static
17165         members if requested.
17166
17167         * interface.cs (PopulateProperty): Use void_type instead of null
17168         as the return type for the setter method.
17169
17170         (PopulateIndexer): ditto.
17171
17172 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17173
17174         * support.cs (ReflectionParameters): Fix minor bug where we
17175         were examining the wrong parameter for the ParamArray attribute.
17176
17177         Cope with requests for the type of the parameter at position
17178         greater than the params parameter's. We now return the element
17179         type of the params array as that makes more sense.
17180
17181         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17182         accordingly as we no longer have to extract the element type
17183         ourselves.
17184
17185         (Invocation.OverloadResolve): Update.
17186
17187 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17188
17189         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17190         against IEnumerator, test whether the return value is a descendant
17191         of the IEnumerator interface.
17192
17193         * class.cs (Indexer.Define): Use an auxiliary method to implement
17194         the other bits of the method definition.  Begin support for
17195         explicit interface implementation.
17196
17197         (Property.DefineMethod): Use TypeManager.void_type instead of null
17198         for an empty return value.
17199
17200 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17203         dealing with a FieldExpr which is composed of a FieldBuilder, in
17204         the code path we did extract the constant, but we should have
17205         obtained the underlying value to be able to cast it (otherwise we
17206         end up in an infinite loop, this is what Ravi was running into).
17207
17208         (ArrayCreation.UpdateIndices): Arrays might be empty.
17209
17210         (MemberAccess.ResolveMemberAccess): Add support for section
17211         14.5.4.1 that deals with the special case of E.I when E is a type
17212         and something else, that I can be a reference to a static member.
17213
17214         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17215         handle a particular array type to create byte blobs, it is just
17216         something we dont generate byteblobs for.
17217
17218         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17219         arguments. 
17220
17221         * location.cs (Push): remove the key from the hashtable that we
17222         are about to add.   This happens for empty files.
17223
17224         * driver.cs: Dispose files after we have parsed them.
17225
17226         (tokenize): new function that only runs the tokenizer on its
17227         input, for speed testing.
17228
17229 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17230
17231         * class.cs (Event.Define): Define the private field only if there
17232         are no accessors defined.
17233
17234         * expression.cs (ResolveMemberAccess): If there is no associated
17235         field with the event, that means we have an event defined with its
17236         own accessors and we should flag error cs0070 since transforming
17237         ourselves into a field is not valid in that case.
17238
17239         * ecore.cs (SimpleName.DoResolve): Same as above.
17240
17241         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17242         and charset to sane values.
17243
17244 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17245
17246         * assign.cs (DoResolve): Perform check on events only if they 
17247         are being accessed outside the declaring type.
17248
17249         * cs-parser.jay (event_declarations): Update rules to correctly
17250         set the type of the implicit parameter etc.
17251
17252         (add_accessor, remove_accessor): Set current local parameters.
17253
17254         * expression.cs (Binary): For delegate addition and subtraction,
17255         cast the return value from the method into the appropriate delegate
17256         type.
17257
17258 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17259
17260         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17261         of these as the workaround is unnecessary.
17262
17263         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17264         delegate data - none of that is needed at all.
17265
17266         Re-write bits to extract the instance expression and the delegate method
17267         correctly.
17268
17269         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17270         on delegates too.
17271
17272         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17273         of attaching attributes instead of duplicating code everywhere.
17274
17275         * everywhere : Update code to do attribute emission using the above method.
17276
17277 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17278
17279         * expression.cs (IsParamsMethodApplicable): if there are not
17280         parameters, return immediately.
17281
17282         * ecore.cs: The 0 literal can be implicity converted to an enum
17283         type. 
17284
17285         (SimpleName.DoResolve): First lookup the type, then lookup the
17286         members. 
17287
17288         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17289         want to get its address.  If the InstanceExpression is not
17290         addressable, store the result in a temporary variable, then get
17291         the address of it.
17292
17293         * codegen.cs: Only display 219 errors on warning level or above. 
17294
17295         * expression.cs (ArrayAccess): Make it implement the
17296         IMemoryLocation interface.
17297
17298         (Binary.DoResolve): handle the operator == (object a, object b)
17299         and operator != (object a, object b) without incurring into a
17300         BoxedCast (because 5 != o should never be performed).
17301
17302         Handle binary enumerator operators.
17303
17304         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17305         value type, otherwise use Ldelem_ref.
17306
17307         Use precomputed names;
17308
17309         (AddressOf): Implement address of
17310
17311         * cs-parser.jay (labeled_statement): Fix recursive block
17312         addition by reworking the production.
17313
17314         * expression.cs (New.DoEmit): New has a special case:
17315                 
17316                  If we are dealing with a ValueType, we have a few
17317                  situations to deal with:
17318                 
17319                     * The target of New is a ValueType variable, that is
17320                       easy, we just pass this as the variable reference
17321                 
17322                     * The target of New is being passed as an argument,
17323                       to a boxing operation or a function that takes a
17324                       ValueType.
17325                 
17326                       In this case, we need to create a temporary variable
17327                       that is the argument of New.
17328
17329
17330 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17331
17332         * rootcontext.cs (LookupType): Check that current_type is not null before
17333         going about looking at nested types.
17334
17335         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17336         not implement the IAssignMethod interface any more.
17337
17338         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17339         where we tranform them into FieldExprs if they are being resolved from within
17340         the declaring type.
17341
17342         * ecore.cs (SimpleName.DoResolve): Do the same here.
17343
17344         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17345
17346         * ../errors/bug10.cs : Add.
17347
17348         * ../errors/cs0070.cs : Add.
17349
17350         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17351
17352         * assign.cs : Get rid of EventIsLocal everywhere.
17353
17354 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17355
17356         * ecore.cs (ConvertIntLiteral): finished the implementation.
17357
17358         * statement.cs (SwitchLabel): Convert the value we are using as a
17359         key before looking up the table.
17360
17361 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17362
17363         * codegen.cs (EmitTopBlock): Require a Location argument now.
17364
17365         * cs-parser.jay (constructor_declarator): We need to setup
17366         current_local_parameters before we parse the
17367         opt_constructor_initializer, to allow the variables to be bound
17368         to the constructor arguments.
17369
17370         * rootcontext.cs (LookupType): First lookup nested classes in our
17371         class and our parents before we go looking outside our class.
17372
17373         * expression.cs (ConstantFold): Extract/debox the values at the
17374         beginnning. 
17375
17376         * rootcontext.cs (EmitCode): Resolve the constants first before we
17377         resolve the types.  This is not really needed, but it helps debugging.
17378
17379         * statement.cs: report location.
17380
17381         * cs-parser.jay: pass location to throw statement.
17382
17383         * driver.cs: Small bug fix.
17384
17385         * report.cs: Updated format to be 4-zero filled digits.
17386
17387 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17388
17389         * expression.cs (CheckIndices): Fix minor bug where the wrong
17390         variable was being referred to ;-)
17391
17392         (DoEmit): Do not call EmitStaticInitializers when the 
17393         underlying type is System.Object.
17394
17395 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17396
17397         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17398         and do the usual workaround for SRE.
17399
17400         * class.cs (MyEventBuilder.EventType): New member to get at the type
17401         of the event, quickly.
17402
17403         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17404
17405         * assign.cs (Assign.DoResolve): Handle the case when the target
17406         is an EventExpr and perform the necessary checks.
17407
17408         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17409         interface.
17410
17411         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17412
17413         (EventExpr): Set the type in the constructor itself since we 
17414         are meant to be born fully resolved.
17415
17416         (EventExpr.Define): Revert code I wrote earlier.
17417                 
17418         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17419         instance expression is null. The instance expression is a This in that case
17420         or a null, depending on whether it is a static method or not.
17421
17422         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17423         refers to more than one method.
17424
17425         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17426         and accordingly flag errors.
17427
17428 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17429
17430         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17431
17432 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * location.cs (ToString): Provide useful rutine.
17435
17436 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17437
17438         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17439         objects, return the actual integral boxed.
17440
17441         * statement.cs (SwitchLabel): define an ILLabel for each
17442         SwitchLabel. 
17443
17444         (Switch.CheckSwitch): If the value is a Literal, extract
17445         the underlying literal.
17446
17447         Also in the unused hashtable we had, add the SwitchLabel so we can
17448         quickly look this value up.
17449
17450         * constant.cs: Implement a bunch of new constants.  Rewrite
17451         Literal based on this.  Made changes everywhere to adapt to this.
17452
17453         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17454         dereferencing array only once, and also copes with enumrations.
17455
17456         bytes are two bytes wide, not one.
17457
17458         (Cast): Perform constant conversions.
17459
17460         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17461         wrappers to the literals here.
17462
17463         * expression.cs (DoNumericPromotions): long literals can converted
17464         to ulong implicity (this is taken care of elsewhere, but I was
17465         missing this spot).
17466
17467         * ecore.cs (Expression.Literalize): Make the return type Literal,
17468         to improve type checking.
17469
17470         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17471
17472 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17473
17474         * literal.cs: Revert code from ravi that checked the bounds.  The
17475         bounds are sane by the definition of the type itself. 
17476
17477         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17478         need to actually look up in our parent hierarchy for interfaces
17479         implemented. 
17480
17481         * const.cs: Use the underlying type for enumerations
17482
17483         * delegate.cs: Compute the basename for the delegate creation,
17484         that should fix the delegate test case, and restore the correct
17485         Type Lookup semantics in rootcontext
17486
17487         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17488         referencing a nested type with the Reflection API is using the "+"
17489         sign. 
17490
17491         * cs-parser.jay: Do not require EOF token at the end.
17492
17493 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17494
17495         * rootcontext.cs (LookupType): Concatenate type names with
17496         a '.' instead of a '+' The test suite passes again.
17497
17498         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17499         field of the enumeration.
17500
17501         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17502         the case when the member is an EventExpr.
17503
17504         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17505         static has an associated instance expression.
17506
17507         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17508
17509         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17510
17511         * class.cs (Event.Define): Register event and perform appropriate checks
17512         for error #111.
17513
17514         We define the Add and Remove methods even if the use provides none because
17515         in that case, we provide default implementations ourselves.
17516
17517         Define a private field of the type of the event. This is done by the CSC compiler
17518         and we should be doing it too ;-)
17519
17520         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17521         More methods we use in code we generate.
17522
17523         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17524         is important.
17525
17526         (InitCoreTypes): Update accordingly for the above.
17527
17528         * class.cs (Event.Emit): Generate code for default accessors that we provide
17529
17530         (EmitDefaultMethod): Do the job in the above.
17531
17532         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17533         appropriate place.
17534
17535 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17536
17537         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17538         builders even if we were missing one.
17539
17540         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17541         pass the Basename as our class name instead of the Name.  The
17542         basename will be correctly composed for us.
17543
17544         * parameter.cs (Paramters): Now takes a Location argument.
17545
17546         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17547         make all the code call directly LookupType in RootContext and take
17548         this chance to pass the Location information everywhere.
17549
17550         * Everywhere: pass Location information.
17551
17552 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17553
17554         * class.cs (Constructor.Define): Updated way of detecting the
17555         length of the parameters.
17556
17557         (TypeContainer.DefineType): Use basename as the type name for
17558         nested types.
17559
17560         (TypeContainer.Define): Do not recursively define types here, as
17561         definition is taken care in order by the RootContext.
17562
17563         * tree.cs: Keep track of namespaces in a per-file basis.
17564
17565         * parameter.cs (Parameter.ComputeSignature): Update to use
17566         DeclSpace. 
17567
17568         (Parameters.GetSignature): ditto.
17569
17570         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17571         instead of a TypeContainer.
17572
17573         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17574         resolve names.  Because we need to be resolve in our context, not
17575         our parents.
17576
17577         * driver.cs: Implement response files.
17578
17579         * class.cs (TypeContainer.DefineType): If we are defined, do not
17580         redefine ourselves.
17581
17582         (Event.Emit): Emit the code for add/remove handlers.
17583         (Event.Define): Save the MethodBuilders for add/remove.
17584
17585         * typemanager.cs: Use pair here too.
17586
17587         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17588         DictionaryEntry requires the first argument to be non-null.  
17589
17590         (enum_declaration): Compute full name for registering the
17591         enumeration.
17592
17593         (delegate_declaration): Instead of using
17594         formal_parameter_list, use opt_formal_parameter_list as the list
17595         can be empty.
17596
17597         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17598         (EventParsing): New property that controls whether `add' and
17599         `remove' are returned as tokens or identifiers (for events);
17600
17601 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17602
17603         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17604         use MyEventBuilder only and let it wrap the real builder for us.
17605
17606         (MyEventBuilder): Revamp constructor etc.
17607
17608         Implement all operations that we perform on EventBuilder in precisely the same
17609         way here too.
17610
17611         (FindMembers): Update to use the EventBuilder member.
17612
17613         (Event.Emit): Update accordingly.
17614
17615 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17616
17617         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17618         by calling the appropriate methods.
17619
17620         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17621         useful.
17622
17623         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17624
17625 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17626
17627         * delegate.cs (Delegate.Populate): Check that the return type
17628         and various parameters types are indeed accessible.
17629
17630         * class.cs (Constructor.Define): Same here.
17631
17632         (Field.Define): Ditto.
17633
17634         (Event.Define): Ditto.
17635
17636         (Operator.Define): Check that the underlying Method defined itself
17637         correctly - so it's MethodBuilder should not be null.
17638
17639         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17640         expression happens to be null.
17641
17642         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17643         members but as of now we don't seem to be able to do anything really useful with it.
17644
17645         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17646         not the EventBuilder.
17647
17648 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17649
17650         * cs-tokenizer.cs: Add support for defines.
17651         Add support for #if, #elif, #else, #endif
17652
17653         (eval_var): evaluates a variable.
17654         (eval): stubbed for evaluating functions.
17655
17656         * cs-parser.jay: Pass the defines information
17657
17658         * driver.cs: Add --define command line option.
17659
17660         * decl.cs: Move MemberCore here.
17661
17662         Make it the base class for DeclSpace.  This allows us to catch and
17663         report 108 and 109 for everything now.
17664
17665         * class.cs (TypeContainer.Define): Extract all the members
17666         before populating and emit the warning 108 (new keyword required
17667         to override) instead of having each member implement this.
17668
17669         (MemberCore.Define): New abstract method, we will be using this in
17670         the warning reporting engine in Populate.
17671
17672         (Operator.Define): Adjust to new MemberCore protocol. 
17673
17674         * const.cs (Const): This does not derive from Expression, it is a
17675         temporary object we use to create fields, it is a MemberCore. 
17676
17677         * class.cs (Method.Define): Allow the entry point to be in a
17678         specific class.
17679
17680         * driver.cs: Rewrite the argument handler to clean it up a bit.
17681
17682         * rootcontext.cs: Made it just an auxiliary namespace feature by
17683         making everything static.
17684
17685         * driver.cs: Adapt code to use RootContext type name instead of
17686         instance variable.
17687
17688         * delegate.cs: Remove RootContext argument.
17689
17690         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17691         argument. 
17692
17693         * class.cs (Event.Define): The lookup can fail.
17694
17695         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17696
17697         * expression.cs: Resolve the this instance before invoking the code.
17698
17699 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * cs-parser.jay: Add a production in element_access that allows
17702         the thing to become a "type" reference.  This way we can parse
17703         things like "(string [])" as a type.
17704
17705         Note that this still does not handle the more complex rules of
17706         casts. 
17707
17708
17709         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17710
17711         * ecore.cs: (CopyNewMethods): new utility function used to
17712         assemble the list of methods from running FindMembers.
17713
17714         (MemberLookup): Rework FindMembers so that 
17715
17716 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17717
17718         * class.cs (TypeContainer): Remove Delegates who fail to be
17719         defined.
17720
17721         * delegate.cs (Populate): Verify that we dont get null return
17722         values.   TODO: Check for AsAccessible.
17723
17724         * cs-parser.jay: Use basename to emit error 574 (destructor should
17725         have the same name as container class), not the full name.
17726
17727         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17728         possible representation.  
17729
17730         Also implements integer type suffixes U and L.
17731
17732 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * expression.cs (ArrayCreation.DoResolve): We need to do the
17735         argument resolution *always*.
17736
17737         * decl.cs: Make this hold the namespace.  Hold the root context as
17738         well.
17739         (LookupType): Move here.
17740
17741         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17742
17743         * location.cs (Row, Name): Fixed the code, it was always returning
17744         references to the first file.
17745
17746         * interface.cs: Register properties defined through interfaces.
17747
17748         * driver.cs: Add support for globbing on the command line
17749
17750         * class.cs (Field): Make it derive from MemberCore as well.
17751         (Event): ditto.
17752
17753 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17754
17755         * class.cs (Event::Define): Check that the type of the event is a delegate
17756         type else flag error #66.
17757
17758         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17759         same.
17760
17761         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17762         values of EntryPoint, CharSet etc etc.
17763
17764         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17765
17766         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17767         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17768         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17769         which needs this to do its work.
17770
17771         * ../errors/cs0066.cs : Add.
17772
17773 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17776         helper functions.
17777
17778         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17779         clears out the parameters field.
17780         (MemberSignatureCompare): Cleanup
17781
17782         (MemberCore): New base class used to share code between MethodCore
17783         and Property.
17784
17785         (RegisterRequiredImplementations) BindingFlags.Public requires
17786         either BindingFlags.Instace or Static.  Use instance here.
17787
17788         (Property): Refactored code to cope better with the full spec.
17789
17790         * parameter.cs (GetParameterInfo): Return an empty array instead
17791         of null on error.
17792
17793         * class.cs (Property): Abstract or extern properties have no bodies.
17794
17795         * parameter.cs (GetParameterInfo): return a zero-sized array.
17796
17797         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17798         method modifier validation to the typecontainer so we can reuse
17799         this on properties.
17800
17801         (MethodCore.ParameterTypes): return an empty sized array of types.
17802
17803         (Property.Define): Test property modifier validity.
17804
17805         Add tests for sealed/override too.
17806
17807         (Method.Emit): abstract or extern methods have no bodies.
17808
17809 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17810
17811         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17812         thing.
17813
17814         (Method::Define, ::Emit): Modify accordingly.
17815
17816         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17817
17818         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17819
17820         * makefile: Pass in /unsafe.
17821
17822 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * class.cs (MakeKey): Kill routine.
17825
17826         * class.cs (TypeContainer.Define): Correctly define explicit
17827         method implementations (they require the full interface name plus
17828         the method name).
17829
17830         * typemanager.cs: Deply the PtrHashtable here and stop using the
17831         lame keys.  Things work so much better.
17832
17833         This of course broke everyone who depended on `RegisterMethod' to
17834         do the `test for existance' test.  This has to be done elsewhere.
17835
17836         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17837         the object stupid Equals method (because, that like fails all over
17838         the place).  We still do not use it.
17839
17840         * class.cs (TypeContainer.SetRequiredInterface,
17841         TypeContainer.RequireMethods): Killed these two routines and moved
17842         all the functionality to RegisterRequiredImplementations.
17843
17844         (TypeContainer.RegisterRequiredImplementations): This routine now
17845         registers all the implementations required in an array for the
17846         interfaces and abstract methods.  We use an array of structures
17847         which can be computed ahead of time to reduce memory usage and we
17848         also assume that lookups are cheap as most classes will not
17849         implement too many interfaces.
17850
17851         We also avoid creating too many MethodSignatures.
17852
17853         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17854         clear the "pending" bit if we find that there are problems with
17855         the declaration.
17856
17857         (TypeContainer.VerifyPendingMethods): Update to report errors of
17858         methods that look like implementations but are not.
17859
17860         (TypeContainer.Define): Add support for explicit interface method
17861         implementation. 
17862
17863 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17864
17865         * typemanager.cs: Keep track of the parameters here instead of
17866         being a feature of the TypeContainer.
17867
17868         * class.cs: Drop the registration of parameters here, as
17869         InterfaceMethods are also interface declarations.
17870
17871         * delegate.cs: Register methods with the TypeManager not only with
17872         the TypeContainer.  This code was buggy.
17873
17874         * interface.cs: Full registation here.
17875
17876 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * expression.cs: Remove reducer for binary expressions, it can not
17879         be done this way.
17880
17881         * const.cs: Put here the code that used to go into constant.cs
17882
17883         * constant.cs: Put here the code for constants, this is a new base
17884         class for Literals.
17885
17886         * literal.cs: Make Literal derive from Constant.
17887
17888 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * statement.cs (Return.Emit): Report error 157 if the user
17891         attempts to return from a finally block.
17892
17893         (Return.Emit): Instead of emitting a return, jump to the end of
17894         the function.
17895
17896         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17897         LocalBuilder to store the result of the function.  ReturnLabel is
17898         the target where we jump.
17899
17900
17901 2001-12-09  Radek Doulik  <rodo@ximian.com>
17902
17903         * cs-parser.jay: remember alias in current namespace
17904
17905         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17906         namespaces
17907
17908         * class.cs (LookupAlias): lookup alias in my_namespace
17909
17910         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17911         aliases hashtable
17912         (LookupAlias): lookup alias in this and if needed in parent
17913         namespaces
17914
17915 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * support.cs: 
17918
17919         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17920         making things static.  I need this to avoid passing the
17921         TypeContainer when calling ParameterType.
17922
17923         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17924         that did string manipulation to compute the type and then call
17925         GetType.  Use Parameter.ParameterType instead.
17926
17927         * cs-tokenizer.cs: Consume the suffix for floating values.
17928
17929         * expression.cs (ParameterReference): figure out whether this is a
17930         reference parameter or not.  Kill an extra variable by computing
17931         the arg_idx during emission.
17932
17933         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17934         function that returns whether a parameter is an out/ref value or not.
17935
17936         (Parameter.ParameterType): The type of the parameter (base,
17937         without ref/out applied).
17938
17939         (Parameter.Resolve): Perform resolution here.
17940         (Parameter.ExternalType): The full type (with ref/out applied).
17941
17942         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17943         support for expressions on the using statement.
17944
17945 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * statement.cs (Using.EmitLocalVariableDecls): Split the
17948         localvariable handling of the using statement.
17949
17950         (Block.EmitMeta): Keep track of variable count across blocks.  We
17951         were reusing slots on separate branches of blocks.
17952
17953         (Try.Emit): Emit the general code block, we were not emitting it. 
17954
17955         Check the type of the declaration to be an IDisposable or
17956         something that can be implicity converted to it. 
17957
17958         Emit conversions if required.
17959
17960         * ecore.cs (EmptyExpression): New utility class.
17961         (Expression.ImplicitConversionExists): New utility function.
17962
17963 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * statement.cs (Using): Implement.
17966
17967         * expression.cs (LocalVariableReference): Support read only variables.
17968
17969         * statement.cs: Remove the explicit emit for the Leave opcode.
17970         (VariableInfo): Add a readonly field.
17971
17972 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17973
17974         * ecore.cs (ConvCast): new class used to encapsulate the various
17975         explicit integer conversions that works in both checked and
17976         unchecked contexts.
17977
17978         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17979         properly generate the overflow opcodes.
17980
17981 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17982
17983         * statement.cs: The correct type for the EmptyExpression is the
17984         element_type, not the variable type.  Ravi pointed this out.
17985
17986 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17987
17988         * class.cs (Method::Define): Handle PInvoke methods specially
17989         by using DefinePInvokeMethod instead of the usual one.
17990
17991         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17992         above to do the task of extracting information and defining the method.
17993
17994 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17995
17996         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17997         of the condition for string type.
17998
17999         (Emit): Move that here. 
18000
18001         (ArrayCreation::CheckIndices): Keep string literals in their expression
18002         form.
18003
18004         (EmitDynamicInitializers): Handle strings appropriately.
18005
18006 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18007
18008         * codegen.cs (EmitContext): Replace multiple variables with a
18009         single pointer to the current Switch statement.
18010
18011         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18012         EmitContext.
18013
18014 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * statement.cs 
18017
18018         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18019         default'.
18020
18021         (Foreach.Emit): Foreach on arrays was not setting
18022         up the loop variables (for break/continue).
18023
18024         (GotoCase): Semi-implented.
18025
18026 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18027
18028         * attribute.cs (CheckAttribute): Handle system attributes by using
18029         Attribute.GetAttributes to examine information we need.
18030
18031         (GetValidPlaces): Same here.
18032
18033         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18034
18035         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18036
18037         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18038
18039         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18040
18041         (Method::Emit): Handle the case when we are a PInvoke method.
18042
18043 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * expression.cs: Use ResolveWithSimpleName on compound names.
18046
18047 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18048
18049         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18050         before trying to reduce it.
18051
18052         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18053
18054         * constant.cs (LookupConstantValue): Implement.
18055
18056         (EmitConstant): Use the above in emitting the constant.
18057
18058         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18059         that are user-defined by doing a LookupConstantValue on them.
18060
18061         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18062         too, like above.
18063
18064 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18065
18066         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18067
18068         (BaseAccess.DoResolve): Implement.
18069
18070         (MemberAccess.DoResolve): Split this routine into a
18071         ResolveMemberAccess routine that can be used independently
18072
18073 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18074
18075         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18076         As that share bits of the implementation.  Is returns a boolean,
18077         while As returns the Type that is being probed.
18078
18079 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18080
18081         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18082         instead of a Literal - much easier.
18083
18084         (EnumInTransit): Remove - utterly useless :-)
18085
18086         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18087
18088         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18089
18090         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18091         chain when we have no associated expression.
18092
18093 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18094
18095         * constant.cs (Define): Use Location while reporting the errror.
18096
18097         Also emit a warning when 'new' is used and there is no inherited
18098         member to hide.
18099
18100         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18101         populated.
18102
18103         (LookupEnumValue): Implement to lookup an enum member's value and define it
18104         if necessary.
18105
18106         (Populate): Re-write accordingly to use the above routine.
18107
18108 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18109
18110         * expression.cs (This): Fix prototype for DoResolveLValue to
18111         override the base class DoResolveLValue.
18112
18113         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18114         declarations) 
18115
18116         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18117         (we need to load the address of the field here).  This fixes
18118         test-22. 
18119
18120         (FieldExpr.DoResolveLValue): Call the DoResolve
18121         function to initialize the Instance expression.
18122
18123         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18124         correctly the GetEnumerator operation on a value type.
18125
18126         * cs-parser.jay: Add more simple parsing error catches.
18127
18128         * statement.cs (Switch): Add support for string switches.
18129         Handle null specially.
18130
18131         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18132
18133 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18134
18135         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18136
18137         (declare_local_constant): New helper function.
18138
18139         * statement.cs (AddConstant): Keep a separate record of constants
18140
18141         (IsConstant): Implement to determine if a variable is a constant.
18142
18143         (GetConstantExpression): Implement.
18144
18145         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18146
18147         * statement.cs (IsVariableDefined): Re-write.
18148
18149 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18150
18151         * class.cs (TypeContainer::FindMembers): Look for constants
18152         in the case when we are looking for MemberTypes.Field
18153
18154         * expression.cs (MemberAccess::DoResolve): Check that in the
18155         case we are a FieldExpr and a Literal, we are not being accessed
18156         by an instance reference.
18157
18158         * cs-parser.jay (local_constant_declaration): Implement.
18159
18160         (declaration_statement): Implement for constant declarations.
18161
18162 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18163
18164         * statement.cs (Switch): Catch double defaults.
18165
18166         (Switch): More work on the switch() statement
18167         implementation.  It works for integral values now, need to finish
18168         string support.
18169
18170
18171 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18174         integer literals into other integer literals.  To be used by
18175         switch. 
18176
18177 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18178
18179         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18180         some memory.
18181
18182         (EmitDynamicInitializers): Cope with the above since we extract data
18183         directly from ArrayData now.
18184
18185         (ExpectInitializers): Keep track of whether initializers are mandatory
18186         or not.
18187
18188         (Bounds): Make it a hashtable to prevent the same dimension being 
18189         recorded for every element in that dimension.
18190
18191         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18192         from being found.
18193
18194         Also fix bug which was causing the indices to be emitted in the reverse
18195         order.
18196
18197 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18200         unfinished.  They do not work, because the underlying code is
18201         sloppy.
18202
18203 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * cs-parser.jay: Remove bogus fixme.
18206
18207         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18208         on Switch statement.
18209
18210 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18211
18212         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18213         the same. 
18214
18215         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18216         parameter. Apparently, any expression is allowed. 
18217
18218         (ValidateInitializers): Update accordingly.
18219
18220         (CheckIndices): Fix some tricky bugs thanks to recursion.
18221
18222         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18223         I was being completely brain-dead.
18224
18225         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18226         and re-write acordingly.
18227
18228         (DelegateInvocation): Re-write accordingly.
18229
18230         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18231
18232         (MakeByteBlob): Handle types more correctly.
18233
18234         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18235         initialization from expressions but it is incomplete because I am a complete
18236         Dodo :-|
18237
18238 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18239
18240         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18241         on If.  Basically, we have to return `true' (ie, we do return to
18242         our caller) only if both branches of the if return.
18243
18244         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18245         short-circuit operators, handle them as short circuit operators. 
18246
18247         (Cast.DoResolve): Resolve type.
18248         (Cast.Cast): Take an expression as the target type.
18249
18250         * cs-parser.jay (cast_expression): Remove old hack that only
18251         allowed a limited set of types to be handled.  Now we take a
18252         unary_expression and we resolve to a type during semantic
18253         analysis.
18254
18255         Use the grammar productions from Rhys to handle casts (this is
18256         not complete like Rhys syntax yet, we fail to handle that corner
18257         case that C# has regarding (-x), but we will get there.
18258
18259 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18260
18261         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18262         field which is an array type.
18263
18264         * cs-parser.jay (declare_local_variables): Support array initialization too.
18265
18266         * typemanager.cs (MakeKey): Implement.
18267
18268         (everywhere): Use the above appropriately.
18269
18270         * cs-parser.jay (for_statement): Update for array initialization while
18271         declaring variables.
18272
18273         * ecore.cs : The error message was correct, it's the variable's names that
18274         were misleading ;-) Make the code more readable.
18275
18276         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18277         the correct type etc.
18278
18279         (ConvertExplicit): Handle Enum types by examining the underlying type.
18280
18281 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18282
18283         * parameter.cs (GetCallingConvention): Always return
18284         CallingConventions.Standard for now.
18285
18286 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18287
18288         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18289         and `r' after calling DoNumericPromotions.
18290
18291         * ecore.cs: Fix error message (the types were in the wrong order).
18292
18293         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18294         BindingFlags.Instance as well 
18295
18296         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18297         implicit int literal conversion in an empty cast so that we
18298         propagate the right type upstream.
18299
18300         (UnboxCast): new class used to unbox value types.
18301         (Expression.ConvertExplicit): Add explicit type conversions done
18302         by unboxing.
18303
18304         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18305         the target type before applying the implicit LongLiterals to ULong
18306         literal cast.
18307
18308 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18309
18310         * cs-parser.jay (for_statement): Reworked the way For works: now
18311         we declare manually any variables that are introduced in
18312         for_initializer to solve the problem of having out-of-band code
18313         emition (that is what got for broken).
18314
18315         (declaration_statement): Perform the actual variable declaration
18316         that used to be done in local_variable_declaration here.
18317
18318         (local_variable_declaration): Do not declare anything, just pass
18319         the information on a DictionaryEntry
18320
18321 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18322
18323         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18324         re-write of the logic to now make it recursive.
18325
18326         (UpdateIndices): Re-write accordingly.
18327
18328         Store element data in a separate ArrayData list in the above methods.
18329
18330         (MakeByteBlob): Implement to dump the array data into a byte array.
18331
18332 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18333
18334         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18335         into CheckIndices.
18336
18337         * constant.cs (Define): Implement.
18338
18339         (EmitConstant): Re-write fully.
18340
18341         Pass in location info.
18342
18343         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18344         respectively.
18345
18346         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18347         DictionaryEntry since we need location info too.
18348
18349         (constant_declaration): Update accordingly.
18350
18351         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18352         code into another method : UpdateIndices.
18353
18354 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18355
18356         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18357         some type checking etc.
18358
18359 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18360
18361         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18362         bits to provide dimension info if the user skips doing that.
18363
18364         Update second constructor to store the rank correctly.
18365
18366 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18367
18368         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18369         and try to implement.
18370
18371         * ../errors/cs0150.cs : Add.
18372
18373         * ../errors/cs0178.cs : Add.
18374
18375 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18376
18377         * statement.cs: Implement foreach on multi-dimensional arrays. 
18378
18379         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18380         name of the params argument.
18381
18382         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18383         initializing the array.
18384
18385         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18386         we can use this elsewhere.
18387
18388         * statement.cs: Finish implementation of foreach for single
18389         dimension arrays.
18390
18391         * cs-parser.jay: Use an out-of-band stack to pass information
18392         around, I wonder why I need this.
18393
18394         foreach_block: Make the new foreach_block the current_block.
18395
18396         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18397         function used to return a static Parameters structure.  Used for
18398         empty parameters, as those are created very frequently.
18399
18400         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18401
18402 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18403
18404         * interface.cs : Default modifier is private, not public. The
18405         make verify test passes again.
18406
18407 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18408
18409         * support.cs (ReflectionParameters): Fix logic to determine
18410         whether the last parameter is a params one. Test 9 passes again.
18411
18412         * delegate.cs (Populate): Register the builders we define with
18413         RegisterParameterForBuilder. Test 19 passes again.
18414
18415         * cs-parser.jay (property_declaration): Reference $6 instead
18416         of $$ to get at the location.
18417
18418         (indexer_declaration): Similar stuff.
18419
18420         (attribute): Ditto.
18421
18422         * class.cs (Property): Register parameters for the Get and Set methods
18423         if they exist. Test 23 passes again.
18424
18425         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18426         call to EmitArguments as we are sure there aren't any params arguments. 
18427         Test 32 passes again.
18428
18429         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18430         IndexOutOfRangeException. 
18431
18432         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18433         Test 33 now passes again.
18434
18435 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18436
18437         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18438         broke a bunch of things.  Will have to come up with a better way
18439         of tracking locations.
18440
18441         * statement.cs: Implemented foreach for single dimension arrays.
18442
18443 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18446         an error.  This removes the lookup from the critical path.
18447
18448         * cs-parser.jay: Removed use of temporary_loc, which is completely
18449         broken. 
18450
18451 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * support.cs (ReflectionParameters.ParameterModifier): Report
18454         whether the argument is a PARAMS argument or not.
18455
18456         * class.cs: Set the attribute `ParamArrayAttribute' on the
18457         parameter argument.
18458
18459         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18460         and cons_param_array_attribute (ConstructorInfo for
18461         ParamArrayAttribute)., 
18462
18463         * codegen.cs: Emit the return using the `Return' statement, that
18464         way we can report the error correctly for missing return values. 
18465
18466         * class.cs (Method.Emit): Clean up.
18467
18468         * expression.cs (Argument.Resolve): Take another argument: the
18469         location where this argument is used.  Notice that this is not
18470         part of the "Argument" class as to reduce the size of the
18471         structure (we know the approximate location anyways).
18472
18473         Test if the argument is a variable-reference, if not, then
18474         complain with a 206.
18475
18476         (Argument.Emit): Emit addresses of variables.
18477
18478         (Argument.FullDesc): Simplify.
18479
18480         (Invocation.DoResolve): Update for Argument.Resolve.
18481
18482         (ElementAccess.DoResolve): ditto.
18483
18484         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18485         method should be virtual, as this method is always virtual.
18486
18487         (NewDelegate.DoResolve): Update for Argument.Resolve.
18488
18489         * class.cs (ConstructorInitializer.DoResolve): ditto.
18490
18491         * attribute.cs (Attribute.Resolve): ditto.
18492
18493 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18494
18495         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18496
18497         * expression.cs (ParameterReference): Drop IStackStorage and implement
18498         IAssignMethod instead. 
18499
18500         (LocalVariableReference): ditto.
18501
18502         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18503         IAssignMethod instead. 
18504
18505 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18506
18507         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18508         enumerations that are used in heavily used structures derive from
18509         byte in a laughable and pathetic attempt to reduce memory usage.
18510         This is the kind of pre-optimzations that you should not do at
18511         home without adult supervision.
18512
18513         * expression.cs (UnaryMutator): New class, used to handle ++ and
18514         -- separatedly from the other unary operators.  Cleans up the
18515         code, and kills the ExpressionStatement dependency in Unary.
18516
18517         (Unary): Removed `method' and `Arguments' from this class, making
18518         it smaller, and moving it all to SimpleCall, so I can reuse this
18519         code in other locations and avoid creating a lot of transient data
18520         strucutres when not required.
18521
18522         * cs-parser.jay: Adjust for new changes.
18523
18524 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18525
18526         * enum.cs (Enum.Populate): If there is a failure during
18527         definition, return
18528
18529         * cs-parser.jay (opt_enum_base): we used to catch type errors
18530         here, but this is really incorrect.  The type error should be
18531         catched during semantic analysis.
18532
18533 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18534
18535         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18536         current_local_parameters as expected since I, in my stupidity, had forgotten
18537         to do this :-)
18538
18539         * attribute.cs (GetValidPlaces): Fix stupid bug.
18540
18541         * class.cs (Method::Emit): Perform check on applicability of attributes.
18542
18543         (Constructor::Emit): Ditto.
18544
18545         (Field::Emit): Ditto.
18546
18547         (Field.Location): Store location information.
18548
18549         (Property, Event, Indexer, Operator): Ditto.
18550
18551         * cs-parser.jay (field_declaration): Pass in location for each field.
18552
18553         * ../errors/cs0592.cs : Add.
18554
18555 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18556
18557         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18558
18559         (InitCoreTypes): Update accordingly.
18560
18561         (RegisterAttrType, LookupAttr): Implement.
18562
18563         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18564         info about the same.
18565
18566         (Resolve): Update to populate the above as necessary.
18567
18568         (Error592): Helper.
18569
18570         (GetValidPlaces): Helper to the above.
18571
18572         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18573
18574         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18575
18576 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18577
18578         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18579
18580         * ../errors/cs0617.cs : Add.
18581
18582 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18583
18584         * enum.cs (Emit): Rename to Populate to be more consistent with what
18585         we expect it to do and when exactly it is called.
18586
18587         * class.cs, rootcontext.cs : Update accordingly.
18588
18589         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18590         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18591
18592         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18593
18594         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18595         of a fieldinfo using the above, when dealing with a FieldBuilder.
18596
18597 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18598
18599         * ../errors/cs0031.cs : Add.
18600
18601         * ../errors/cs1008.cs : Add.
18602
18603         * ../errrors/cs0543.cs : Add.
18604
18605         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18606         enum type.
18607
18608         (FindMembers): Implement.
18609
18610         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18611         enums and delegates too.
18612
18613         (enum_types): Rename to builder_to_enum.
18614
18615         (delegate_types): Rename to builder_to_delegate.
18616
18617         * delegate.cs (FindMembers): Implement.
18618
18619 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18620
18621         * typemanager.cs (IsEnumType): Implement.
18622
18623         * enum.cs (Emit): Re-write parts to account for the underlying type
18624         better and perform checking etc.
18625
18626         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18627         of the underlying type.
18628
18629         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18630         value
18631
18632         * enum.cs (error31): Helper to report error #31.
18633
18634         * cs-parser.jay (enum_declaration): Store location of each member too.
18635
18636         * enum.cs (member_to_location): New hashtable. 
18637
18638         (AddEnumMember): Update location hashtable.
18639
18640         (Emit): Use the location of each member while reporting errors.
18641
18642 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * cs-parser.jay: A for_initializer if is a
18645         local_variable_declaration really ammount to have an implicit
18646         block with the variable declaration and no initializer for for.
18647
18648         * statement.cs (For.Emit): Cope with null initializers.
18649
18650         This fixes the infinite loop on for initializers.
18651
18652 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * enum.cs: More cleanup.
18655
18656         * ecore.cs: Remove dead code.
18657
18658         * class.cs (Property.Emit): More simplification.
18659         (Event.Emit): ditto.
18660
18661         Reworked to have less levels of indentation.
18662
18663 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18664
18665         * class.cs (Property): Emit attributes.
18666
18667         (Field): Ditto.
18668
18669         (Event): Ditto.
18670
18671         (Indexer): Ditto.
18672
18673         (Operator): Ditto.
18674
18675         * enum.cs (Emit): Ditto.
18676
18677         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18678         Enums too.
18679
18680         * class.cs (Field, Event, etc.): Move attribute generation into the
18681         Emit method everywhere.
18682
18683         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18684         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18685         as we had no way of defining nested enums !
18686
18687         * rootcontext.cs : Adjust code accordingly.
18688
18689         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18690
18691 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18692
18693         * expression.cs (EvalConstantExpression): Move into ecore.cs
18694
18695         * enum.cs (Enum): Rename some members and make them public and readonly
18696         according to our convention.
18697
18698         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18699         nothing else.
18700
18701         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18702
18703         (Enum::Emit): Write a simple version for now which doesn't try to compute
18704         expressions. I shall modify this to be more robust in just a while.
18705
18706         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18707
18708         (TypeContainer::CloseType): Create the Enum types too.
18709
18710         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18711
18712         * expression.cs (EvalConstantExpression): Get rid of completely.
18713
18714         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18715         user-defined values and other cases.
18716
18717         (IsValidEnumLiteral): Helper function.
18718
18719         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18720         out there in the case we had a literal FieldExpr.
18721
18722         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18723
18724         (Literalize): Revamp a bit to take two arguments.
18725
18726         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18727
18728 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18729
18730         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18731
18732         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18733
18734         (Resolve): Use the above to ensure we have proper initializers.
18735
18736 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18737
18738         * expression.cs (Expression::EvalConstantExpression): New method to 
18739         evaluate constant expressions.
18740
18741         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18742
18743 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18746         in an array.
18747
18748         (Binary.ResolveOperator): Handle operator != (object a, object b)
18749         and operator == (object a, object b);
18750
18751         (Binary.DoNumericPromotions): Indicate whether the numeric
18752         promotion was possible.
18753
18754         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18755         Implement.  
18756
18757         Made the ArrayAccess implement interface IAssignMethod instead of
18758         IStackStore as the order in which arguments are passed reflects
18759         this.
18760
18761         * assign.cs: Instead of using expr.ExprClass to select the way of
18762         assinging, probe for the IStackStore/IAssignMethod interfaces.
18763
18764         * typemanager.cs: Load InitializeArray definition.
18765
18766         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18767         static data that can be used to initialize arrays. 
18768
18769 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18770
18771         * expression.cs: Handle operator== and operator!= for booleans.
18772
18773         (Conditioal.Reduce): Implement reducer for the ?: operator.
18774
18775         (Conditional.Resolve): Implement dead code elimination.
18776
18777         (Binary.Resolve): Catch string literals and return a new
18778         concatenated string.
18779
18780         (Unary.Reduce): Implement reduction of unary expressions.
18781
18782         * ecore.cs: Split out the expression core handling here.
18783
18784         (Expression.Reduce): New method used to perform constant folding
18785         and CSE.  This is needed to support constant-expressions. 
18786
18787         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18788         targets, and optimize for !x.
18789
18790 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18791
18792         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18793         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18794         set custom atttributes.
18795
18796         * literal.cs (Literal::GetValue): New abstract method to return the actual
18797         value of the literal, cast as an object.
18798
18799         (*Literal): Implement GetValue method.
18800
18801         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18802         expressions to the arraylist but objects of type Argument.
18803
18804         * class.cs (TypeContainer::Emit): Emit our attributes too.
18805
18806         (Method::Emit, Constructor::Emit): Ditto.
18807
18808         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18809         to be ignoring earlier.
18810
18811 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18812
18813         * attribute.cs (AttributeSection::Define): Implement to do the business
18814         of constructing a CustomAttributeBuilder.
18815
18816         (Attribute): New trivial class. Increases readability of code.  
18817
18818         * cs-parser.jay : Update accordingly.
18819
18820         (positional_argument_list, named_argument_list, named_argument): New rules
18821
18822         (attribute_arguments): Use the above so that we are more correct.
18823
18824 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18825
18826         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18827         to perform all checks for a method with a params parameter.
18828
18829         (Invocation::OverloadResolve): Update to use the above method and therefore
18830         cope correctly with params method invocations.
18831
18832         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18833         params too.
18834
18835         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18836         constructors in our parent too because we can't afford to miss out on 
18837         protected ones ;-)
18838
18839         * attribute.cs (AttributeSection): New name for the class Attribute
18840
18841         Other trivial changes to improve readability.
18842
18843         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18844         use the new class names.
18845
18846 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18847
18848         * class.cs (Method::Define): Complete definition for params types too
18849
18850         (Indexer::Define): Ditto.
18851
18852         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18853         Cope everywhere with a request for info about the array parameter.
18854
18855 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18856
18857         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18858
18859         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18860         local_variable_type to extract the string corresponding to the type.
18861
18862         (local_variable_type): Fixup the action to use the new helper method.
18863
18864         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18865         go.
18866
18867         * expression.cs : Clean out code which uses the above.
18868
18869 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18870
18871         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18872         and bale out if necessary by returning a false.
18873
18874         (RegisterProperty): Ditto.
18875
18876         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18877         and print out appropriate error messages.
18878
18879         * interface.cs (everywhere): Ditto.
18880
18881         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18882         location to constructor.
18883
18884         * class.cs (Property, Event, Indexer): Update accordingly.
18885
18886         * ../errors/cs111.cs : Added.
18887
18888         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18889         of a method, as laid down by the spec.
18890
18891         (Invocation::OverloadResolve): Use the above method.
18892
18893 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18894
18895         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18896         now take a TypeContainer and a Parameters object.
18897
18898         (ParameterData): Modify return type of ParameterModifier method to be 
18899         Parameter.Modifier and not a string.
18900
18901         (ReflectionParameters, InternalParameters): Update accordingly.
18902
18903         * expression.cs (Argument::GetParameterModifier): Same here.
18904
18905         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18906         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18907         symbol in it at all so maybe this is only for now.
18908
18909 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18910
18911         * support.cs (InternalParameters): Constructor now takes an extra argument 
18912         which is the actual Parameters class.
18913
18914         (ParameterDesc): Update to provide info on ref/out modifiers.
18915
18916         * class.cs (everywhere): Update call to InternalParameters to pass in
18917         the second argument too.
18918
18919         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18920         to return the modifier info [ref/out etc]
18921
18922         (InternalParameters, ReflectionParameters): Implement the above.
18923
18924         * expression.cs (Argument::ParameterModifier): Similar function to return
18925         info about the argument's modifiers.
18926
18927         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18928         too.
18929
18930         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18931         a new SetFormalParameters object which we pass to InternalParameters.
18932
18933 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18934
18935         * expression.cs (NewArray): Merge into the ArrayCreation class.
18936
18937 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18938
18939         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18940         NewUserdefinedArray into one as there wasn't much of a use in having
18941         two separate ones.
18942
18943         * expression.cs (Argument): Change field's name to ArgType from Type.
18944
18945         (Type): New readonly property which returns the proper type, taking into 
18946         account ref/out modifiers.
18947
18948         (everywhere): Adjust code accordingly for the above.
18949
18950         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18951         whether we are emitting for a ref or out parameter.
18952
18953         * expression.cs (Argument::Emit): Use the above field to set the state.
18954
18955         (LocalVariableReference::Emit): Update to honour the flag and emit the
18956         right stuff.
18957
18958         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18959
18960         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18961
18962         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18963
18964         (ReflectionParameters, InternalParameters): Implement the above method.
18965
18966         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18967         reporting errors.
18968
18969         (Invocation::FullMethodDesc): Ditto. 
18970
18971 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18972
18973         * cs-parser.jay: Add extra production for the second form of array
18974         creation. 
18975
18976         * expression.cs (ArrayCreation): Update to reflect the above
18977         change. 
18978
18979         * Small changes to prepare for Array initialization.
18980
18981 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18982
18983         * typemanager.cs (ImplementsInterface): interface might be null;
18984         Deal with this problem;
18985
18986         Also, we do store negative hits on the cache (null values), so use
18987         this instead of calling t.GetInterfaces on the type everytime.
18988
18989 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18990
18991         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18992
18993         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18994         split functionality out into different classes.
18995
18996         (New::FormArrayType): Move into NewBuiltinArray.
18997
18998         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18999         quite useless.
19000
19001         (NewBuiltinArray): New class to handle creation of built-in arrays.
19002
19003         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19004         account creation of one-dimensional arrays.
19005
19006         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19007
19008         (NewUserdefinedArray::DoResolve): Implement.
19009
19010         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19011
19012         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19013         we maintain inside the TypeManager. This is necessary to perform lookups on the
19014         module builder.
19015
19016         (LookupType): Update to perform GetType on the module builders too.     
19017
19018         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19019
19020         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19021
19022 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19023
19024         * expression.cs (New::DoResolve): Implement guts of array creation.
19025
19026         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19027
19028 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19029
19030         * expression.cs: Fix bug I introduced lsat night that broke
19031         Delegates. 
19032
19033         (Expression.Resolve): Report a 246 error (can not resolve name)
19034         if we find a SimpleName in the stream.
19035
19036         (Expression.ResolveLValue): Ditto.
19037
19038         (Expression.ResolveWithSimpleName): This function is a variant of
19039         ResolveName, this one allows SimpleNames to be returned without a
19040         warning.  The only consumer of SimpleNames is MemberAccess
19041
19042 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19045         might arrive here.  I have my doubts that this is correct.
19046
19047         * statement.cs (Lock): Implement lock statement.
19048
19049         * cs-parser.jay: Small fixes to support `lock' and `using'
19050
19051         * cs-tokenizer.cs: Remove extra space
19052
19053         * driver.cs: New flag --checked, allows to turn on integer math
19054         checking. 
19055
19056         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19057         Threading.Monitor.Exit 
19058
19059 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19062         Expression Class to be IndexerAccess.
19063
19064         Notice that Indexer::DoResolve sets the eclass to Value.
19065
19066 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19067
19068         * class.cs (TypeContainer::Emit): Emit code for indexers.
19069
19070         * assign.cs (IAssignMethod): New interface implemented by Indexers
19071         and Properties for handling assignment.
19072
19073         (Assign::Emit): Simplify and reuse code. 
19074
19075         * expression.cs (IndexerAccess, PropertyExpr): Implement
19076         IAssignMethod, clean up old code. 
19077
19078 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19079
19080         * typemanager.cs (ImplementsInterface): New method to determine if a type
19081         implements a given interface. Provides a nice cache too.
19082
19083         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19084         method.
19085
19086         (ConvertReferenceExplicit): Ditto.
19087
19088         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19089         various methods, with correct names etc.
19090
19091         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19092         Operator.UnaryNegation.
19093
19094         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19095         we have a unary plus or minus operator.
19096
19097         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19098         UnaryMinus.
19099
19100         * everywhere : update accordingly.
19101
19102         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19103         respectively.
19104
19105         * class.cs (Method::Define): For the case where we are implementing a method
19106         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19107         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19108
19109 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19110
19111         * interface.cs (FindMembers): Implement to work around S.R.E
19112         lameness.
19113
19114         * typemanager.cs (IsInterfaceType): Implement.
19115
19116         (FindMembers): Update to handle interface types too.
19117
19118         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19119         use IsAssignableFrom as that is not correct - it doesn't work.
19120
19121         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19122         and accordingly override EmitStatement.
19123
19124         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19125         using the correct logic :-)
19126
19127 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19128
19129         * ../errors/cs-11.cs : Add to demonstrate error -11 
19130
19131 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19132
19133         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19134         then pass this as a hint to ResolveLValue.
19135
19136         * expression.cs (FieldExpr): Add Location information
19137
19138         (FieldExpr::LValueResolve): Report assignment to readonly
19139         variable. 
19140
19141         (Expression::ExprClassFromMemberInfo): Pass location information.
19142
19143         (Expression::ResolveLValue): Add new method that resolves an
19144         LValue. 
19145
19146         (Expression::DoResolveLValue): Default invocation calls
19147         DoResolve. 
19148
19149         (Indexers): New class used to keep track of indexers in a given
19150         Type. 
19151
19152         (IStackStore): Renamed from LValue, as it did not really describe
19153         what this did.  Also ResolveLValue is gone from this interface and
19154         now is part of Expression.
19155
19156         (ElementAccess): Depending on the element access type
19157
19158         * typemanager.cs: Add `indexer_name_type' as a Core type
19159         (System.Runtime.CompilerServices.IndexerNameAttribute)
19160
19161         * statement.cs (Goto): Take a location.
19162
19163 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19164
19165         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19166         if two delegates are compatible.
19167
19168         (NewDelegate::DoResolve): Update to take care of the case when
19169         we instantiate a delegate from another delegate.
19170
19171         * typemanager.cs (FindMembers): Don't even try to look up members
19172         of Delegate types for now.
19173
19174 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19175
19176         * delegate.cs (NewDelegate): New class to take care of delegate
19177         instantiation.
19178
19179         * expression.cs (New): Split the delegate related code out into 
19180         the NewDelegate class.
19181
19182         * delegate.cs (DelegateInvocation): New class to handle delegate 
19183         invocation.
19184
19185         * expression.cs (Invocation): Split out delegate related code into
19186         the DelegateInvocation class.
19187
19188 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19189
19190         * expression.cs (New::DoResolve): Implement delegate creation fully
19191         and according to the spec.
19192
19193         (New::DoEmit): Update to handle delegates differently.
19194
19195         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19196         because of which we were printing out arguments in reverse order !
19197
19198         * delegate.cs (VerifyMethod): Implement to check if the given method
19199         matches the delegate.
19200
19201         (FullDelegateDesc): Implement.
19202
19203         (VerifyApplicability): Implement.
19204
19205         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19206         delegate invocations too.
19207
19208         (Invocation::Emit): Ditto.
19209
19210         * ../errors/cs1593.cs : Added.
19211
19212         * ../errors/cs1594.cs : Added.
19213
19214         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19215
19216 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19217
19218         * typemanager.cs (intptr_type): Core type for System.IntPtr
19219
19220         (InitCoreTypes): Update for the same.
19221
19222         (iasyncresult_type, asynccallback_type): Ditto.
19223
19224         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19225         correct.
19226
19227         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19228         too.
19229
19230         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19231         the builders for the 4 members of a delegate type :-)
19232
19233         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19234         type.
19235
19236         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19237
19238         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19239
19240 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19241
19242         * statement.cs (Break::Emit): Implement.   
19243         (Continue::Emit): Implement.
19244
19245         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19246         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19247         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19248         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19249         end loop
19250
19251         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19252         properties that track the label for the current loop (begin of the
19253         loop and end of the loop).
19254
19255 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19256
19257         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19258         use of emitting anything at all.
19259
19260         * class.cs, rootcontext.cs : Get rid of calls to the same.
19261
19262         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19263
19264         (Populate): Define the constructor correctly and set the implementation
19265         attributes.
19266
19267         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19268         have been defined.
19269
19270         (AddDelegateType): Implement.
19271
19272         (IsDelegateType): Implement helper method.
19273
19274         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19275
19276         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19277         and accordingly handle it.
19278
19279         * delegate.cs (Populate): Take TypeContainer argument.
19280         Implement bits to define the Invoke method. However, I still haven't figured out
19281         how to take care of the native int bit :-(
19282
19283         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19284         Qualify the name of the delegate, not its return type !
19285
19286         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19287         conversion.
19288
19289         (StandardConversionExists): Checking for array types turns out to be recursive.
19290
19291         (ConvertReferenceExplicit): Implement array conversion.
19292
19293         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19294
19295 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19296
19297         * cs-parser.jay (delegate_declaration): Store the fully qualified
19298         name as it is a type declaration.
19299
19300         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19301         readonly.
19302
19303         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19304         as TypeContainer::DefineType.
19305
19306         (Populate): Method in which all the definition of the various methods (Invoke)
19307         etc is done.
19308
19309         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19310         see.
19311
19312         (CloseDelegate): Finally creates the delegate.
19313
19314         * class.cs (TypeContainer::DefineType): Update to define delegates.
19315         (Populate, Emit and CloseType): Do the same thing here too.
19316
19317         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19318         delegates in all these operations.
19319
19320 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19321
19322         * expression.cs: LocalTemporary: a new expression used to
19323         reference a temporary that has been created.
19324
19325         * assign.cs: Handle PropertyAccess back here, so that we can
19326         provide the proper semantic access to properties.
19327
19328         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19329         a few more explicit conversions. 
19330
19331         * modifiers.cs: `NEW' modifier maps to HideBySig.
19332
19333         * expression.cs (PropertyExpr): Make this into an
19334         ExpressionStatement, and support the EmitStatement code path. 
19335
19336         Perform get/set error checking, clean up the interface.
19337
19338         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19339         them into toplevel access objects.
19340
19341 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19344         SRE.
19345
19346         * typemanager.cs: Keep track here of our PropertyBuilders again to
19347         work around lameness in SRE.
19348
19349 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19350
19351         * expression.cs (LValue::LValueResolve): New method in the
19352         interface, used to perform a second resolution pass for LValues. 
19353
19354         (This::DoResolve): Catch the use of this in static methods.
19355
19356         (This::LValueResolve): Implement.
19357
19358         (This::Store): Remove warning, assigning to `this' in structures
19359         is 
19360
19361         (Invocation::Emit): Deal with invocation of
19362         methods on value types.  We need to pass the address to structure
19363         methods rather than the object itself.  (The equivalent code to
19364         emit "this" for structures leaves the entire structure on the
19365         stack instead of a pointer to it). 
19366
19367         (ParameterReference::DoResolve): Compute the real index for the
19368         argument based on whether the method takes or not a `this' pointer
19369         (ie, the method is static).
19370
19371         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19372         value types returned from functions when we need to invoke a
19373         method on the sturcture.
19374
19375
19376 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19377
19378         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19379         defining the type in the Modulebuilder or Typebuilder. This is to take
19380         care of nested types which need to be defined on the TypeBuilder using
19381         DefineNestedMethod.
19382
19383         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19384         methods in RootContext, only ported to be part of TypeContainer.
19385
19386         (TypeContainer::GetInterfaceOrClass): Ditto.
19387
19388         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19389
19390         * interface.cs (Interface::DefineInterface): New method. Does exactly
19391         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19392         too.
19393
19394         (Interface::GetInterfaces): Move from RootContext here and port.
19395
19396         (Interface::GetInterfaceByName): Same here.
19397
19398         * rootcontext.cs (ResolveTree): Re-write.
19399
19400         (PopulateTypes): Re-write.
19401
19402         * class.cs (TypeContainer::Populate): Populate nested types too.
19403         (TypeContainer::Emit): Emit nested members too.
19404
19405         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19406         instead just use the name argument passed in as it is already fully
19407         qualified.
19408
19409         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19410         to TypeContainer mapping to see if a type is user-defined.
19411
19412         * class.cs (TypeContainer::CloseType): Implement. 
19413
19414         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19415         the default constructor.
19416
19417         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19418         twice.
19419
19420         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19421
19422         * interface.cs (CloseType): Create the type here.
19423
19424         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19425         the hierarchy.
19426
19427         Remove all the methods which are now in TypeContainer.
19428
19429 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19430
19431         * delegate.cs (Define): Re-write bits to define the delegate
19432         correctly.
19433
19434 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19435
19436         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19437
19438         * expression.cs (ImplicitReferenceConversion): handle null as well
19439         as a source to convert to any reference type.
19440
19441         * statement.cs (Return): Perform any implicit conversions to
19442         expected return type.  
19443
19444         Validate use of return statement.  
19445
19446         * codegen.cs (EmitContext): Pass the expected return type here.
19447
19448         * class.cs (Method, Constructor, Property): Pass expected return
19449         type to EmitContext.
19450
19451 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19452
19453         * expression.cs: Make DoResolve take an EmitContext instead of a
19454         TypeContainer.
19455
19456         Replaced `l' and `location' for `loc', for consistency.
19457
19458         (Error, Warning): Remove unneeded Tc argument.
19459
19460         * assign.cs, literal.cs, constant.cs: Update to new calling
19461         convention. 
19462
19463         * codegen.cs: EmitContext now contains a flag indicating whether
19464         code is being generated in a static method or not.
19465
19466         * cs-parser.jay: DecomposeQI, new function that replaces the old
19467         QualifiedIdentifier.  Now we always decompose the assembled
19468         strings from qualified_identifier productions into a group of
19469         memberaccesses.
19470
19471 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19472
19473         * rootcontext.cs: Deal with field-less struct types correctly now
19474         by passing the size option to Define Type.
19475
19476         * class.cs: Removed hack that created one static field. 
19477
19478 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19479
19480         * statement.cs: Moved most of the code generation here. 
19481
19482 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19483
19484         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19485         seem very right.
19486
19487         (ElementAccess): Remove useless bits for now - keep checks as the spec
19488         says.
19489
19490 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19491
19492         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19493         and start performing checks according to the spec.
19494
19495 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19496
19497         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19498         rank_specifiers instead.
19499
19500         (rank_specifiers): Change the order in which the rank specifiers are stored
19501
19502         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19503
19504         * expression.cs (ElementAccess): Implement the LValue interface too.
19505
19506 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19507
19508         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19509         except that user defined conversions are not included.
19510
19511         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19512         perform the conversion of the return type, if necessary.
19513
19514         (New::DoResolve): Check whether we are creating an array or an object
19515         and accordingly do the needful.
19516
19517         (New::Emit): Same here.
19518
19519         (New::DoResolve): Implement guts of array creation.
19520
19521         (New::FormLookupType): Helper function.
19522
19523 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * codegen.cs: Removed most of the code generation here, and move the
19526         corresponding code generation bits to the statement classes. 
19527
19528         Added support for try/catch/finalize and throw.
19529
19530         * cs-parser.jay: Added support for try/catch/finalize.
19531
19532         * class.cs: Catch static methods having the flags override,
19533         virtual or abstract.
19534
19535         * expression.cs (UserCast): This user cast was not really doing
19536         what it was supposed to do.  Which is to be born in fully resolved
19537         state.  Parts of the resolution were being performed at Emit time! 
19538
19539         Fixed this code.
19540
19541 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19542
19543         * expression.cs: Implicity convert the result from UserCast.
19544
19545 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19546
19547         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19548         prevented it from working correctly. 
19549
19550         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19551         merely ConvertImplicit.
19552
19553 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19554
19555         * typemanager.cs: Make the LookupTypeContainer function static,
19556         and not per-instance.  
19557
19558         * class.cs: Make static FindMembers (the one that takes a Type
19559         argument). 
19560
19561         * codegen.cs: Add EmitForeach here.
19562
19563         * cs-parser.jay: Make foreach a toplevel object instead of the
19564         inline expansion, as we need to perform semantic analysis on it. 
19565
19566 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19567
19568         * expression.cs (Expression::ImplicitUserConversion): Rename to
19569         UserDefinedConversion.
19570
19571         (Expression::UserDefinedConversion): Take an extra argument specifying 
19572         whether we look for explicit user conversions too.
19573
19574         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19575
19576         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19577
19578         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19579         with the appropriate arguments.
19580
19581         * cs-parser.jay (cast_expression): Record location too.
19582
19583         * expression.cs (Cast): Record location info.
19584
19585         (Expression::ConvertExplicit): Take location argument.
19586
19587         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19588         to determine if we are doing explicit conversions.
19589
19590         (UserCast::Emit): Update accordingly.
19591
19592         (Expression::ConvertExplicit): Report an error if everything fails.
19593
19594         * ../errors/cs0030.cs : Add.
19595
19596 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19597
19598         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19599         virtual and newslot bits. 
19600
19601         * class.cs (TypeContainer::RegisterRequiredImplementations):
19602         Record methods we need.
19603
19604         (TypeContainer::MakeKey): Helper function to make keys for
19605         MethodBases, since the Methodbase key is useless.
19606
19607         (TypeContainer::Populate): Call RegisterRequiredImplementations
19608         before defining the methods.   
19609
19610         Create a mapping for method_builders_to_methods ahead of time
19611         instead of inside a tight loop.
19612
19613         (::RequireMethods):  Accept an object as the data to set into the
19614         hashtable so we can report interface vs abstract method mismatch.
19615
19616 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19617
19618         * report.cs: Make all of it static.
19619
19620         * rootcontext.cs: Drop object_type and value_type computations, as
19621         we have those in the TypeManager anyways.
19622
19623         Drop report instance variable too, now it is a global.
19624
19625         * driver.cs: Use try/catch on command line handling.
19626
19627         Add --probe option to debug the error reporting system with a test
19628         suite. 
19629
19630         * report.cs: Add support for exiting program when a probe
19631         condition is reached.
19632
19633 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19634
19635         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19636         we do a forcible conversion regardless of type, to check if 
19637         ForceConversion returns a null.
19638
19639         (Binary::error19): Use location to report error.
19640
19641         (Unary::error23): Use location here too.
19642
19643         * ../errors/cs0019.cs : Check in.
19644
19645         * ../errors/cs0023.cs : Check in.
19646
19647         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19648         case of a non-null MethodInfo object with a length of 0 !
19649
19650         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19651         an applicable member - according to the spec :-)
19652         Also fix logic to find members in base types.
19653
19654         (Unary::ResolveOperator): Same here.
19655
19656         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19657         as I was getting thoroughly confused between this and error19 :-)
19658
19659         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19660         (::FindMostEncompassedType): Implement.
19661         (::FindMostEncompassingType): Implement.
19662         (::StandardConversionExists): Implement.
19663
19664         (UserImplicitCast): Re-vamp. We now need info about most specific
19665         source and target types so that we can do the necessary conversions.
19666
19667         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19668         mathematical union with no duplicates.
19669
19670 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19673         in order from base classes to child classes, so that we can in
19674         child classes look up in our parent for method names and
19675         attributes (required for handling abstract, virtual, new, override
19676         constructs: we need to instrospect our base class, and if we dont
19677         populate the classes in order, the introspection might be
19678         incorrect.  For example, a method could query its parent before
19679         the parent has any methods and would determine that the parent has
19680         no abstract methods (while it could have had them)).
19681
19682         (RootContext::CreateType): Record the order in which we define the
19683         classes.
19684
19685 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * class.cs (TypeContainer::Populate): Also method definitions can
19688         fail now, keep track of this.
19689
19690         (TypeContainer::FindMembers): Implement support for
19691         DeclaredOnly/noDeclaredOnly flag.
19692
19693         (Constructor::Emit) Return the ConstructorBuilder.
19694
19695         (Method::Emit) Return the MethodBuilder. 
19696         Check for abstract or virtual methods to be public.
19697
19698         * rootcontext.cs (RootContext::CreateType): Register all the
19699         abstract methods required for the class to be complete and the
19700         interface methods that must be implemented. 
19701
19702         * cs-parser.jay: Report error 501 (method requires body if it is
19703         not marked abstract or extern).
19704
19705         * expression.cs (TypeOf::Emit): Implement.
19706
19707         * typemanager.cs: runtime_handle_type, new global type.
19708
19709         * class.cs (Property::Emit): Generate code for properties.
19710
19711 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19712
19713         * expression.cs (Unary::ResolveOperator): Find operators on base type
19714         too - we now conform exactly to the spec.
19715
19716         (Binary::ResolveOperator): Same here.
19717
19718         * class.cs (Operator::Define): Fix minor quirk in the tests.
19719
19720         * ../errors/cs0215.cs : Added.
19721
19722         * ../errors/cs0556.cs : Added.
19723
19724         * ../errors/cs0555.cs : Added.
19725
19726 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19727
19728         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19729         single integer which is really efficient
19730
19731 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19732
19733         *  expression.cs (Expression::ImplicitUserConversion): Use location
19734         even in the case when we are examining True operators.
19735  
19736         * class.cs (Operator::Define): Perform extensive checks to conform
19737         with the rules for operator overloading in the spec.
19738
19739         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19740         some of the other conversions mentioned in the spec.
19741
19742         * typemanager.cs (array_type): New static member for the System.Array built-in
19743         type.
19744
19745         (cloneable_interface): For System.ICloneable interface.
19746
19747         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19748         we start resolving the tree and populating types.
19749
19750         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19751  
19752 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * expression.cs (Expression::ExprClassFromMemberInfo,
19755         Expression::Literalize): Create literal expressions from
19756         FieldInfos which are literals.
19757
19758         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19759         type casts, because they were wrong.  The test suite in tests
19760         caught these ones.
19761
19762         (ImplicitNumericConversion): ushort to ulong requires a widening
19763         cast. 
19764
19765         Int32 constant to long requires widening cast as well.
19766
19767         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19768         for integers because the type on the stack is not i4.
19769
19770 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19771
19772         * expression.cs (report118): require location argument. 
19773
19774         * parameter.cs: Do not dereference potential null value.
19775
19776         * class.cs: Catch methods that lack the `new' keyword when
19777         overriding a name.  Report warnings when `new' is used without
19778         anything being there to override.
19779
19780         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19781
19782         * class.cs: Only add constructor to hashtable if it is non-null
19783         (as now constructors can fail on define).
19784
19785         (TypeManager, Class, Struct): Take location arguments.
19786
19787         Catch field instance initialization in structs as errors.
19788
19789         accepting_filter: a new filter for FindMembers that is static so
19790         that we dont create an instance per invocation.
19791
19792         (Constructor::Define): Catch errors where a struct constructor is
19793         parameterless 
19794
19795         * cs-parser.jay: Pass location information for various new
19796         constructs. 
19797
19798         * delegate.cs (Delegate): take a location argument.
19799
19800         * driver.cs: Do not call EmitCode if there were problesm in the
19801         Definition of the types, as many Builders wont be there. 
19802
19803         * decl.cs (Decl::Decl): Require a location argument.
19804
19805         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19806         into integers, and find the most appropiate integer for it.
19807
19808         * literal.cs: Implement ULongLiteral.
19809
19810         * rootcontext.cs: Provide better information about the location of
19811         failure when CreateType fails.
19812
19813 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19814
19815         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19816         as well.
19817
19818         * expression.cs (Binary::CheckShiftArguments): Add missing type
19819         computation.
19820         (Binary::ResolveOperator): Add type to the logical and and logical
19821         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19822         before.
19823
19824         (Binary::DoNumericPromotions): In the case where either argument
19825         is ulong (and most signed types combined with ulong cause an
19826         error) perform implicit integer constant conversions as well.
19827
19828 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * expression.cs (UserImplicitCast): Method should always be
19831         non-null. 
19832         (Invocation::BetterConversion): Simplified test for IntLiteral.
19833
19834         (Expression::ImplicitNumericConversion): Split this routine out.
19835         Put the code that performs implicit constant integer conversions
19836         here. 
19837
19838         (Expression::Resolve): Become a wrapper around DoResolve so we can
19839         check eclass and type being set after resolve.
19840
19841         (Invocation::Badness): Remove this dead function
19842
19843         (Binary::ResolveOperator): Do not compute the expensive argumnets
19844         unless we have a union for it.
19845
19846         (Probe::Emit): Is needs to do an isinst and then
19847         compare against null.
19848
19849         (::CanConvert): Added Location argument.  If the Location argument
19850         is null (Location.Null), then we do not report errors.  This is
19851         used by the `probe' mechanism of the Explicit conversion.  We do
19852         not want to generate an error for something that the user
19853         explicitly requested to be casted.  But the pipeline for an
19854         explicit cast first tests for potential implicit casts.
19855
19856         So for now, if the Location is null, it means `Probe only' to
19857         avoid adding another argument.   Might have to revise this
19858         strategy later.
19859
19860         (ClassCast): New class used to type cast objects into arbitrary
19861         classes (used in Explicit Reference Conversions).
19862
19863         Implement `as' as well.
19864
19865         Reverted all the patches from Ravi below: they were broken:
19866
19867                 * The use of `level' as a mechanism to stop recursive
19868                   invocations is wrong.  That was there just to catch the
19869                   bug with a strack trace but not as a way of addressing
19870                   the problem.
19871
19872                   To fix the problem we have to *understand* what is going
19873                   on and the interactions and come up with a plan, not
19874                   just get things going.
19875
19876                 * The use of the type conversion cache that I proposed
19877                   last night had an open topic: How does this work across
19878                   protection domains.  A user defined conversion might not
19879                   be public in the location where we are applying the
19880                   conversion, a different conversion might be selected
19881                   (ie, private A->B (better) but public B->A (worse),
19882                   inside A, A->B applies, but outside it, B->A will
19883                   apply).
19884
19885                 * On top of that (ie, even if the above is solved),
19886                   conversions in a cache need to be abstract.  Ie, `To
19887                   convert from an Int to a Short use an OpcodeCast', not
19888                   `To convert from an Int to a Short use the OpcodeCast on
19889                   the variable 5' (which is what this patch was doing).
19890
19891 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19892
19893         * expression.cs (Invocation::ConversionExists): Re-write to use
19894         the conversion cache
19895
19896         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19897         cache all conversions done, not just user-defined ones.
19898
19899         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19900         to determine if a conversion exists instead of acutually trying to 
19901         perform the conversion. It's faster too.
19902
19903         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19904         and only then attempt the implicit conversion.
19905
19906 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19907
19908         * expression.cs (ConvertImplicit): Use a cache for conversions
19909         already found. Check level of recursion and bail out if necessary.
19910
19911 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19912
19913         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19914         Export standard methods that we expect for string operations.
19915
19916         * statement.cs (Block::UsageWarning): Track usage of variables and
19917         report the errors for not used variables.
19918
19919         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19920         operator. 
19921
19922 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19923
19924         * codegen.cs: remove unnneded code 
19925
19926         * expression.cs: Removed BuiltinTypeAccess class
19927
19928         Fix the order in which implicit conversions are
19929         done.  
19930
19931         The previous fixed dropped support for boxed conversions (adding a
19932         test to the test suite now)
19933
19934         (UserImplicitCast::CanConvert): Remove test for source being null,
19935         that code is broken.  We should not feed a null to begin with, if
19936         we do, then we should track the bug where the problem originates
19937         and not try to cover it up here.
19938
19939         Return a resolved expression of type UserImplicitCast on success
19940         rather than true/false.  Ravi: this is what I was talking about,
19941         the pattern is to use a static method as a "constructor" for
19942         objects. 
19943
19944         Also, do not create arguments until the very last minute,
19945         otherwise we always create the arguments even for lookups that
19946         will never be performed. 
19947
19948         (UserImplicitCast::Resolve): Eliminate, objects of type
19949         UserImplicitCast are born in a fully resolved state. 
19950
19951         * typemanager.cs (InitCoreTypes): Init also value_type
19952         (System.ValueType). 
19953
19954         * expression.cs (Cast::Resolve): First resolve the child expression.
19955
19956         (LValue): Add new method AddressOf to be used by
19957         the `&' operator.  
19958
19959         Change the argument of Store to take an EmitContext instead of an
19960         ILGenerator, because things like FieldExpr need to be able to call
19961         their children expression to generate the instance code. 
19962
19963         (Expression::Error, Expression::Warning): Sugar functions for
19964         reporting errors.
19965
19966         (Expression::MemberLookup): Accept a TypeContainer instead of a
19967         Report as the first argument.
19968
19969         (Expression::ResolvePrimary): Killed.  I still want to improve
19970         this as currently the code is just not right.
19971
19972         (Expression::ResolveMemberAccess): Simplify, but it is still
19973         wrong. 
19974
19975         (Unary::Resolve): Catch errors in AddressOf operators.
19976
19977         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19978         index to a byte for the short-version, or the compiler will choose
19979         the wrong Emit call, which generates the wrong data.
19980
19981         (ParameterReference::Emit, ::Store): same.
19982
19983         (FieldExpr::AddressOf): Implement.
19984
19985         * typemanager.cs: TypeManager: made public variable instead of
19986         property.
19987
19988         * driver.cs: document --fatal.
19989
19990         * report.cs (ErrorMessage, WarningMessage): new names for the old
19991         Error and Warning classes.
19992
19993         * cs-parser.jay (member_access): Turn built-in access to types
19994         into a normal simplename
19995
19996 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19997
19998         * expression.cs (Invocation::BetterConversion): Fix to cope
19999         with q being null, since this was introducing a bug.
20000
20001         * expression.cs (ConvertImplicit): Do built-in conversions first.
20002
20003 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20004
20005         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20006
20007 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20008
20009         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20010         I had introduced long ago (what's new ?).
20011
20012         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20013         the work of all the checking. 
20014         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20015         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20016
20017         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20018         that is the right way. 
20019
20020         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20021         overloading resolution. Use everywhere instead of cutting and pasting code.
20022
20023         (Binary::ResolveOperator): Use MakeUnionSet.
20024
20025         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20026         we have to convert to bool types. Not complete yet.
20027
20028 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * typemanager.cs (TypeManager::CSharpName): support ushort.
20031
20032         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20033         to provide an expression that performsn an implicit constant int
20034         conversion (section 6.1.6).
20035         (Expression::ConvertImplicitRequired): Reworked to include
20036         implicit constant expression conversions.
20037
20038         (Expression::ConvertNumericExplicit): Finished.
20039
20040         (Invocation::Emit): If InstanceExpression is null, then it means
20041         that we perform a call on this.
20042
20043 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20044
20045         * expression.cs (Unary::Emit): Remove some dead code.
20046         (Probe): Implement Resolve and Emit for `is'.
20047         (Expression::ConvertImplicitRequired): Attempt to do constant
20048         expression conversions here.  Maybe should be moved to
20049         ConvertImplicit, but I am not sure.
20050         (Expression::ImplicitLongConstantConversionPossible,
20051         Expression::ImplicitIntConstantConversionPossible): New functions
20052         that tell whether is it possible to apply an implicit constant
20053         expression conversion.
20054
20055         (ConvertNumericExplicit): Started work on explicit numeric
20056         conversions.
20057
20058         * cs-parser.jay: Update operator constants.
20059
20060         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20061         (Parameters::GetSignature): Hook up VerifyArgs here.
20062         (Parameters::VerifyArgs): Verifies that no two arguments have the
20063         same name. 
20064
20065         * class.cs (Operator): Update the operator names to reflect the
20066         ones that the spec expects (as we are just stringizing the
20067         operator names).
20068
20069         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20070         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20071         previous usage did only work for our methods.
20072         (Expression::ConvertImplicit): Handle decimal implicit numeric
20073         conversions as well.
20074         (Expression::InternalTypeConstructor): Used to invoke constructors
20075         on internal types for default promotions.
20076
20077         (Unary::Emit): Implement special handling for the pre/post
20078         increment/decrement for overloaded operators, as they need to have
20079         the same semantics as the other operators.
20080
20081         (Binary::ResolveOperator): ditto.
20082         (Invocation::ConversionExists): ditto.
20083         (UserImplicitCast::Resolve): ditto.
20084
20085 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20086
20087         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20088         operator, return after emitting body. Regression tests pass again !
20089
20090         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20091         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20092         (Invocation::OverloadResolve): Ditto.
20093         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20094
20095         * everywhere : update calls to the above methods accordingly.
20096
20097 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20098
20099         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20100
20101         * expression.cs (ExpressionStatement): New base class used for
20102         expressions that can appear in statements, so that we can provide
20103         an alternate path to generate expression that do not leave a value
20104         on the stack.
20105
20106         (Expression::Emit, and all the derivatives): We no longer return
20107         whether a value is left on the stack or not.  Every expression
20108         after being emitted leaves a single value on the stack.
20109
20110         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20111         facilties of ExpressionStatement if possible.
20112
20113         * cs-parser.jay: Update statement_expression.
20114
20115 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * driver.cs: Change the wording of message
20118
20119 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20120
20121         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20122         the type of the expression to the return type of the method if
20123         we have an overloaded operator match ! The regression tests pass again !
20124         (Unary::ResolveOperator): Ditto.
20125
20126         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20127         to find "op_Implicit", not "implicit" ;-)
20128         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20129         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20130
20131         * everywhere : Correct calls to the above accordingly.
20132
20133         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20134         (ConvertImplicit): Do user-defined conversion if it exists.
20135
20136 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20137
20138         * assign.cs: track location.
20139         (Resolve): Use implicit conversions on assignment.
20140
20141         * literal.cs: Oops.  Not good, Emit of short access values should
20142         pass (Bytes) or the wrong argument will be selected.
20143
20144         * expression.cs (Unary::Emit): Emit code for -expr.
20145
20146         (Unary::ResolveOperator): Handle `Substract' for non-constants
20147         (substract from zero from the non-constants).
20148         Deal with Doubles as well. 
20149
20150         (Expression::ConvertImplicitRequired): New routine that reports an
20151         error if no implicit conversion exists. 
20152
20153         (Invocation::OverloadResolve): Store the converted implicit
20154         expressions if we make them
20155
20156 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20157
20158         * class.cs (ConstructorInitializer): Take a Location argument.
20159         (ConstructorBaseInitializer): Same here.
20160         (ConstructorThisInitializer): Same here.
20161
20162         * cs-parser.jay : Update all calls accordingly.
20163
20164         * expression.cs (Unary, Binary, New): Take location argument.
20165         Update accordingly everywhere.
20166
20167         * cs-parser.jay : Update all calls to the above to take a location
20168         argument.
20169
20170         * class.cs : Ditto.
20171
20172 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20173
20174         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20175         (Invocation::BetterConversion): Same here
20176         (Invocation::ConversionExists): Ditto.
20177
20178         (Invocation::ConversionExists): Implement.
20179
20180 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20181
20182         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20183         Also take an additional TypeContainer argument.
20184
20185         * All over : Pass in TypeContainer as argument to OverloadResolve.
20186
20187         * typemanager.cs (CSharpName): Update to check for the string type and return
20188         that too.
20189
20190         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20191         a given method.
20192
20193 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20194
20195         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20196         (Invocation::BetterFunction): Implement.
20197         (Invocation::BetterConversion): Implement.
20198         (Invocation::ConversionExists): Skeleton, no implementation yet.
20199
20200         Okay, things work fine !
20201
20202 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * typemanager.cs: declare and load enum_type, delegate_type and
20205         void_type. 
20206
20207         * expression.cs (Expression::Emit): Now emit returns a value that
20208         tells whether a value is left on the stack or not.  This strategy
20209         might be reveted tomorrow with a mechanism that would address
20210         multiple assignments.
20211         (Expression::report118): Utility routine to report mismatches on
20212         the ExprClass.
20213
20214         (Unary::Report23): Report impossible type/operator combination
20215         utility function.
20216
20217         (Unary::IsIncrementableNumber): Whether the type can be
20218         incremented or decremented with add.
20219         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20220         complemented. 
20221         (Unary::ResolveOperator): Implement ++, !, ~,
20222
20223         (Invocation::Emit): Deal with new Emit convetion.
20224
20225         * All Expression derivatives: Updated their Emit method to return
20226         whether they leave values on the stack or not.
20227
20228         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20229         stack for expressions that are statements. 
20230
20231 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20232
20233         * expression.cs (LValue): New interface.  Must be implemented by
20234         LValue objects.
20235         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20236         LValue interface.
20237
20238         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20239         interface for generating code, simplifies the code.
20240
20241 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20242
20243         * expression.cs (everywhere): Comment out return statements in ::Resolve
20244         methods to avoid the warnings.
20245
20246 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20247
20248         * driver.cs (parse): Report error 2001 if we can not open the
20249         source file.
20250
20251         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20252         not resolve it.
20253
20254         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20255         object. 
20256
20257         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20258         otherwise nested blocks end up with the same index.
20259
20260         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20261
20262         * expression.cs:  Instead of having FIXMEs in the Resolve
20263         functions, throw exceptions so it is obvious that we are facing a
20264         bug. 
20265
20266         * cs-parser.jay (invocation_expression): Pass Location information.
20267
20268         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20269         Use a basename for those routines because .NET does not like paths
20270         on them. 
20271
20272         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20273         already defined.
20274
20275 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20276
20277         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20278         are loading the correct data types (throws an exception if not).
20279         (TypeManager::InitCoreTypes): Use CoreLookupType
20280
20281         * expression.cs (Unary::ResolveOperator): return the child
20282         expression for expressions which are just +expr.
20283         (Unary::ResolveOperator): Return negative literals for -LITERAL
20284         expressions (otherwise they are Unary {Literal}).
20285         (Invocation::Badness): Take into account `Implicit constant
20286         expression conversions'.
20287
20288         * literal.cs (LongLiteral): Implement long literal class.
20289         (IntLiteral): export the `Value' of the intliteral. 
20290
20291 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20292
20293         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20294
20295         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20296         instead of 'Operator'
20297
20298         * expression.cs (Binary::ResolveOperator): Update accordingly.
20299         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20300         and 'Minus'
20301
20302         * cs-parser.jay (unary_expression): Update to use the new names.
20303
20304         * gen-treedump.cs (GetUnary): Same here.
20305
20306         * expression.cs (Unary::Resolve): Implement.
20307         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20308         operators are found instead of making noise ;-)
20309         (Unary::ResolveOperator): New method to do precisely the same thing which
20310         Binary::ResolveOperator does for Binary expressions.
20311         (Unary.method, .Arguments): Add.
20312         (Unary::OperName): Implement.   
20313         (Unary::ForceConversion): Copy and Paste !
20314
20315         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20316         a unary operator.
20317
20318         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20319         for the inbuilt operators. Only overloading works for now ;-)
20320
20321 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20322
20323         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20324         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20325
20326         * expression.cs (This::Emit): Implement. 
20327         (This::Resolve): Implement.
20328         (TypeOf:Resolve): Implement.
20329         (Expression::ResolveSimpleName): Add an implicit this to instance
20330         field references. 
20331         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20332         Bind instance variable to Field expressions.
20333         (FieldExpr::Instance): New field used to track the expression that
20334         represents the object instance.
20335         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20336         binding 
20337         (FieldExpr::Emit): Implement.
20338
20339         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20340         the last instruction contains a return opcode to avoid generating
20341         the last `ret' instruction (this generates correct code, and it is
20342         nice to pass the peverify output).
20343
20344         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20345         initializer for static and instance variables.
20346         (Constructor::Emit): Allow initializer to be null in the case of
20347         static constructors.  Only emit initializer for instance
20348         constructors. 
20349
20350         (TypeContainer::FindMembers): Return a null array if there are no
20351         matches.
20352
20353         Also fix the code for the MemberTypes.Method branch, as it was not
20354         scanning that for operators (or tried to access null variables before).
20355
20356         * assign.cs (Assign::Emit): Handle instance and static fields. 
20357
20358         * TODO: Updated.
20359
20360         * driver.cs: Stop compilation if there are parse errors.
20361
20362         * cs-parser.jay (constructor_declaration): Provide default base
20363         initializer for non-static constructors.
20364         (constructor_declarator): Do not provide a default base
20365         initializers if none was specified.
20366         Catch the fact that constructors should not have parameters.
20367
20368         * class.cs: Do not emit parent class initializers for static
20369         constructors, that should be flagged as an error.
20370
20371 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20372
20373         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20374         Move back code into TypeContainer::Populate.
20375
20376 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20377
20378         * class.cs (TypeContainer::AddConstructor): Fix the check to
20379         compare against Name, not Basename. 
20380         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20381
20382         * cs-parser.jay : Update accordingly.
20383
20384         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20385         for methods, don't forget to look into the operators too.
20386         (RegisterMethodBuilder): Helper method to take care of this for
20387         methods, constructors and operators.
20388         (Operator::Define): Completely revamp.
20389         (Operator.OperatorMethod, MethodName): New fields.
20390         (TypeContainer::Populate): Move the registering of builders into
20391         RegisterMethodBuilder.
20392         (Operator::Emit): Re-write.
20393
20394         * expression.cs (Binary::Emit): Comment out code path to emit method
20395         invocation stuff for the case when we have a user defined operator. I am
20396         just not able to get it right !
20397
20398 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20401         argument. 
20402
20403         (Expression::MemberLookup): Provide a version that allows to
20404         specify the MemberTypes and BindingFlags. 
20405
20406         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20407         so it was not fetching variable information from outer blocks.
20408
20409         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20410         Beforefieldinit as it was buggy.
20411
20412         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20413         that Ravi put here.  
20414
20415         * class.cs (Constructor::Emit): Only emit if block is not null.
20416         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20417         deal with this by semantically definining it as if the user had
20418         done it.
20419
20420         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20421         constructors as we now "emit" them at a higher level.
20422
20423         (TypeContainer::DefineDefaultConstructor): Used to define the
20424         default constructors if none was provided.
20425
20426         (ConstructorInitializer): Add methods Resolve and Emit. 
20427
20428         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20429
20430 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20431
20432         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20433         the default constructor builder with our hashtable for methodbuilders
20434         to methodcores.
20435
20436         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20437         and argument_count is 0 in which case we have a match.
20438         (Binary::ResolveOperator): More null checking and miscellaneous coding
20439         style cleanup.
20440
20441 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20442
20443         * rootcontext.cs (IsNameSpace): Compare against null.
20444
20445         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20446
20447         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20448         and Unary::Operator.
20449
20450         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20451         accordingly.
20452
20453         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20454         we have overloaded operators.
20455         (Binary::ResolveOperator): Implement the part which does the operator overload
20456         resolution.
20457
20458         * class.cs (Operator::Emit): Implement.
20459         (TypeContainer::Emit): Emit the operators we have too.
20460
20461         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20462         the case when we have a user-defined operator.
20463
20464 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20465
20466         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20467
20468 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20469
20470         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20471         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20472         (Constructor::Emit): Implement.
20473         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20474         if we have no work to do. 
20475         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20476         Emit method.
20477
20478         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20479         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20480
20481         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20482         of parent.parent.
20483
20484 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20485
20486         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20487         in the source.
20488         (Tree::RecordNamespace): Method to do what the name says ;-)
20489         (Tree::Namespaces): Property to get at the namespaces hashtable.
20490
20491         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20492         keep track.
20493
20494         * rootcontext.cs (IsNamespace): Fixed it :-)
20495
20496 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20497
20498         * class.cs (TypeContainer::FindMembers): Add support for
20499         constructors. 
20500         (MethodCore): New class that encapsulates both the shared aspects
20501         of a Constructor and a Method.  
20502         (Method, Constructor): Factored pieces into MethodCore.
20503
20504         * driver.cs: Added --fatal which makes errors throw exceptions.
20505         Load System assembly as well as part of the standard library.
20506
20507         * report.cs: Allow throwing exceptions on errors for debugging.
20508
20509         * modifiers.cs: Do not use `parent', instead use the real type
20510         container to evaluate permission settings.
20511
20512         * class.cs: Put Ravi's patch back in.  He is right, and we will
20513         have to cope with the
20514
20515 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20516
20517         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20518         FamORAssem, not FamANDAssem.
20519
20520 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * driver.cs: Added --parse option that only parses its input files
20523         and terminates.
20524
20525         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20526         incorrect.  IsTopLevel is not used to tell whether an object is
20527         root_types or not (that can be achieved by testing this ==
20528         root_types).  But to see if this is a top-level *class* (not
20529         necessarly our "toplevel" container). 
20530
20531 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20532
20533         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20534         parent instead of a direct call to GetType.
20535
20536 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20537
20538         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20539         Modifiers.TypeAttr. This should just be a call to that method.
20540
20541         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20542         object so that we can determine if we are top-level or not.
20543
20544         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20545         TypeContainer too.
20546
20547         * enum.cs (Enum::Define): Ditto.
20548
20549         * modifiers.cs (FieldAttr): Re-write.
20550
20551         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20552         (TypeContainer::HaveStaticConstructor): New property to provide access
20553         to precisely that info.
20554
20555         * modifiers.cs (MethodAttr): Re-write.
20556         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20557
20558         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20559         of top-level types as claimed.
20560
20561 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20562
20563         * expression.cs (MemberLookup): Fruitless attempt to lookup
20564         constructors.  Maybe I need to emit default constructors?  That
20565         might be it (currently .NET emits this for me automatically).
20566         (Invocation::OverloadResolve): Cope with Arguments == null.
20567         (Invocation::EmitArguments): new function, shared by the new
20568         constructor and us.
20569         (Invocation::Emit): Handle static and instance methods.  Emit
20570         proper call instruction for virtual or non-virtual invocations.
20571         (New::Emit): Implement.
20572         (New::Resolve): Implement.
20573         (MemberAccess:Resolve): Implement.
20574         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20575         to track instances.
20576         (FieldExpr::Resolve): Set type.
20577
20578         * support.cs: Handle empty arguments.
20579                 
20580         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20581         SimpleLookup): Auxiliary routines to help parse a qualifier
20582         identifier.  
20583
20584         Update qualifier_identifier rule.
20585
20586         * codegen.cs: Removed debugging messages.
20587
20588         * class.cs: Make this a global thing, this acts just as a "key" to
20589         objects that we might have around.
20590
20591         (Populate): Only initialize method_builders_to_methods once.
20592
20593         * expression.cs (PropertyExpr): Initialize type from the
20594         PropertyType. 
20595
20596         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20597         Resolve pattern.  Attempt to implicitly convert value to boolean.
20598         Emit code.
20599
20600         * expression.cs: Set the type for the int32/int32 argument case.
20601         (Binary::ResolveOperator): Set the return type to boolean for
20602         comparission operators
20603
20604         * typemanager.cs: Remove debugging print code.
20605
20606         (Invocation::Resolve): resolve type.
20607
20608         * class.cs: Allocate a MemberInfo of the correct size, as the code
20609         elsewhere depends on the test to reflect the correct contents.
20610
20611         (Method::) Keep track of parameters, due to System.Reflection holes
20612
20613         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20614         mapping here.
20615
20616         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20617         of the exact size and return that.
20618
20619         (Class::LookupMethodByBuilder): New function that maps
20620         MethodBuilders to its methods.  Required to locate the information
20621         on methods because System.Reflection bit us again.
20622
20623         * support.cs: New file, contains an interface ParameterData and
20624         two implementations: ReflectionParameters and InternalParameters
20625         used to access Parameter information.  We will need to grow this
20626         as required.
20627
20628         * expression.cs (Invocation::GetParameterData): implement a cache
20629         and a wrapper around the ParameterData creation for methods. 
20630         (Invocation::OverloadResolve): Use new code.
20631
20632 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20633
20634         * class.cs (TypeContainer::EmitField): Remove and move into 
20635         (Field::Define): here and modify accordingly.
20636         (Field.FieldBuilder): New member.
20637         (TypeContainer::Populate): Update accordingly.
20638         (TypeContainer::FindMembers): Implement.
20639
20640 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20641
20642         * statement.cs: (VariableInfo::VariableType): New field to be
20643         initialized with the full type once it is resolved. 
20644
20645 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20646
20647         * parameter.cs (GetParameterInfo): Use a type cache to compute
20648         things only once, and to reuse this information
20649
20650         * expression.cs (LocalVariableReference::Emit): Implement.
20651         (OpcodeCast::Emit): fix.
20652
20653         (ParameterReference::Resolve): Implement.
20654         (ParameterReference::Emit): Implement.
20655
20656         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20657         that are expressions need to stay as Expressions.
20658
20659         * typemanager.cs (CSharpName): Returns the C# name of a type if
20660         possible. 
20661
20662         * expression.cs (Expression::ConvertImplicit): New function that
20663         implements implicit type conversions.
20664
20665         (Expression::ImplicitReferenceConversion): Implements implicit
20666         reference conversions.
20667
20668         (EmptyCast): New type for transparent casts.
20669
20670         (OpcodeCast): New type for casts of types that are performed with
20671         a sequence of bytecodes.
20672
20673         (BoxedCast): New type used for casting value types into reference
20674         types.  Emits a box opcode.
20675
20676         (Binary::DoNumericPromotions): Implements numeric promotions of
20677         and computation of the Binary::Type.
20678
20679         (Binary::EmitBranchable): Optimization.
20680
20681         (Binary::Emit): Implement code emission for expressions.
20682
20683         * typemanager.cs (TypeManager): Added two new core types: sbyte
20684         and byte.
20685
20686 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20687
20688         * class.cs (TypeContainer::FindMembers): Method which does exactly
20689         what Type.FindMembers does, only we don't have to use reflection. No
20690         implementation yet.
20691
20692         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20693         typecontainer objects as we need to get at them.
20694         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20695
20696         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20697         typecontainer object.
20698
20699         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20700         of just a Report object.
20701
20702 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20703
20704         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20705         "remove_"
20706         (TypeContainer::Populate): Now define the delegates of the type too.
20707         (TypeContainer.Delegates): Property to access the list of delegates defined
20708         in the type.
20709
20710         * delegates.cs (Delegate::Define): Implement partially.
20711
20712         * modifiers.cs (TypeAttr): Handle more flags.
20713
20714 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20715
20716         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20717         and not <=
20718         (Operator::Define): Re-write logic to get types by using the LookupType method
20719         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20720         (Indexer::Define): Ditto.
20721         (Event::Define): Ditto.
20722         (Property::Define): Ditto.
20723
20724 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20725
20726         * class.cs (TypeContainer::Populate): Now define operators too. 
20727         (TypeContainer.Operators): New property to access the list of operators
20728         in a type.
20729         (Operator.OperatorMethodBuilder): New member to hold the method builder
20730         for the operator we are defining.
20731         (Operator::Define): Implement.
20732
20733 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20734
20735         * class.cs (Event::Define): Make the prefixes of the accessor methods
20736         addOn_ and removeOn_ 
20737
20738         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20739         of the location being passed in too. Ideally, this should go later since all
20740         error reporting should be done through the Report object.
20741
20742         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20743         (Populate): Iterate thru the indexers we have and define them too.
20744         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20745         for the get and set accessors.
20746         (Indexer::Define): Implement.
20747
20748 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20749
20750         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20751         my previous implementation, did not work.
20752
20753         * typemanager.cs: Add a couple of missing types (the longs).
20754
20755         * literal.cs: Use TypeManager.bool_type instead of getting it.
20756
20757         * expression.cs (EventExpr): New kind of expressions.
20758         (Expressio::ExprClassFromMemberInfo): finish
20759
20760 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20761
20762         * assign.cs: Emit stores to static fields differently.
20763
20764 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20765
20766         * Merge in changes and adjust code to tackle conflicts. Backed out my
20767         code in Assign::Resolve ;-) 
20768
20769 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20770
20771         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20772         instead Report.Error and also pass in the location.
20773         (CSharpParser::Lexer): New readonly property to return the reference
20774         to the Tokenizer object.
20775         (declare_local_variables): Use Report.Error with location instead of plain 
20776         old error.
20777         (CheckDef): Ditto.
20778
20779         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20780         (Operator.CheckBinaryOperator): Ditto.
20781
20782         * cs-parser.jay (operator_declarator): Update accordingly.
20783
20784         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20785         (CheckBinaryOperator): Same here.
20786
20787         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20788         on the name without any prefixes of namespace names etc. This is because we
20789         already might have something already fully qualified like 
20790         'System.Console.WriteLine'
20791
20792         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20793
20794 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20795
20796         * cs-tokenizer.cs (location): Return a string which also contains
20797         the file name.
20798
20799         * expression.cs (ElementAccess): New class for expressions of the
20800         type 'element access.'
20801         (BaseAccess): New class for expressions of the type 'base access.'
20802         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20803         respectively.
20804
20805         * cs-parser.jay (element_access): Implement action.
20806         (base_access): Implement actions.
20807         (checked_expression, unchecked_expression): Implement.
20808
20809         * cs-parser.jay (local_variable_type): Correct and implement.
20810         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20811
20812         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20813
20814         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20815         name and the specifiers.
20816
20817         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20818
20819         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20820         making them all public ;-)
20821
20822         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20823         class anyways.
20824
20825 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20828         PropertyExprs.
20829         (FieldExpr, PropertyExprs): New resolved expressions.
20830         (SimpleName::MemberStaticCheck): Perform static checks for access
20831         to non-static fields on static methods. Maybe this should be
20832         generalized for MemberAccesses. 
20833         (SimpleName::ResolveSimpleName): More work on simple name
20834         resolution. 
20835
20836         * cs-parser.jay (primary_expression/qualified_identifier): track
20837         the parameter index.
20838
20839         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20840         (EmitContext::EmitBoolExpression): Chain to expression generation
20841         instead of temporary hack.
20842         (::EmitStatementExpression): Put generic expression code generation.
20843
20844         * assign.cs (Assign::Emit): Implement variable assignments to
20845         local variables, parameters and fields.
20846
20847 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20848
20849         * statement.cs (Block::GetVariableInfo): New method, returns the
20850         VariableInfo for a variable name in a block.
20851         (Block::GetVariableType): Implement in terms of GetVariableInfo
20852
20853         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20854         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20855
20856 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20857
20858         * cs-parser.jay (operator_declaration): Continue on my quest : update
20859         to take attributes argument.
20860         (event_declaration): Ditto.
20861         (enum_declaration): Ditto.
20862         (indexer_declaration): Ditto.
20863
20864         * class.cs (Operator::Operator): Update constructor accordingly.
20865         (Event::Event): Ditto.
20866
20867         * delegate.cs (Delegate::Delegate): Same here.
20868
20869         * enum.cs (Enum::Enum): Same here.
20870
20871 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20872
20873         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20874
20875         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20876
20877         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20878         being passed around as an arraylist.
20879         (Attributes::AddAttribute): Method to add attribute sections.
20880
20881         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20882         (struct_declaration): Update accordingly.
20883         (constant_declaration): Update.
20884         (field_declaration): Update.
20885         (method_header): Update.
20886         (fixed_parameter): Update.
20887         (parameter_array): Ditto.
20888         (property_declaration): Ditto.
20889         (destructor_declaration): Ditto.
20890
20891         * class.cs (Struct::Struct): Update constructors accordingly.
20892         (Class::Class): Ditto.
20893         (Field::Field): Ditto.
20894         (Method::Method): Ditto.
20895         (Property::Property): Ditto.
20896         (TypeContainer::OptAttribute): update property's return type.
20897
20898         * interface.cs (Interface.opt_attributes): New member.
20899         (Interface::Interface): Update to take the extra Attributes argument.
20900
20901         * parameter.cs (Parameter::Parameter): Ditto.
20902
20903         * constant.cs (Constant::Constant): Ditto.
20904
20905         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20906         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20907         the attributes as a parameter.
20908         (InterfaceProperty): Update constructor call.
20909         (InterfaceEvent): Ditto.
20910         (InterfaceMethod): Ditto.
20911         (InterfaceIndexer): Ditto.
20912
20913         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20914         pass the attributes too.
20915         (interface_event_declaration): Ditto.
20916         (interface_property_declaration): Ditto.
20917         (interface_method_declaration): Ditto.
20918         (interface_declaration): Ditto.
20919
20920 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20921
20922         * class.cs (Method::Define): Track the "static Main" definition to
20923         create an entry point. 
20924
20925         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20926         EntryPoint if we find it. 
20927
20928         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20929         (EmitContext::ig): Make this variable public.
20930
20931         * driver.cs: Make the default output file be the first file name
20932         with the .exe extension.  
20933
20934         Detect empty compilations
20935
20936         Handle various kinds of output targets.  Handle --target and
20937         rename -t to --dumper.
20938
20939         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20940         methods inherited from Expression return now an Expression.  This
20941         will is used during the tree rewriting as we resolve them during
20942         semantic analysis.
20943
20944         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20945         the spec.  Missing entirely is the information about
20946         accessability of elements of it.
20947
20948         (Expression::ExprClassFromMemberInfo): New constructor for
20949         Expressions that creates a fully initialized Expression based on
20950         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20951         a Type.
20952
20953         (Invocation::Resolve): Begin implementing resolution of invocations.
20954
20955         * literal.cs (StringLiteral):  Implement Emit.
20956
20957 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20958
20959         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20960         member.
20961
20962 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20963
20964         * cs-parser.jay (attribute_arguments): Implement actions.
20965         (attribute): Fix bug in production. Implement action.
20966         (attribute_list): Implement.
20967         (attribute_target): Implement.
20968         (attribute_target_specifier, opt_target_specifier): Implement
20969         (CheckAttributeTarget): New method to check if the attribute target
20970         is valid.
20971         (attribute_section): Implement.
20972         (opt_attributes): Implement.
20973
20974         * attribute.cs : New file to handle attributes.
20975         (Attribute): Class to hold attribute info.
20976
20977         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20978         (attribute_section): Modify production to use 2 different rules to 
20979         achieve the same thing. 1 s/r conflict down !
20980         Clean out commented, useless, non-reducing dimension_separator rules.
20981
20982         * class.cs (TypeContainer.attributes): New member to hold list
20983         of attributes for a type.
20984         (Struct::Struct): Modify to take one more argument, the attribute list.
20985         (Class::Class): Ditto.
20986         (Field::Field): Ditto.
20987         (Method::Method): Ditto.
20988         (Property::Property): Ditto.
20989
20990         * cs-parser.jay (struct_declaration): Update constructor call to
20991         pass in the attributes too.
20992         (class_declaration): Ditto.
20993         (constant_declaration): Ditto.
20994         (field_declaration): Ditto.
20995         (method_header): Ditto.
20996         (fixed_parameter): Ditto.
20997         (parameter_array): Ditto.
20998         (property_declaration): Ditto.
20999
21000         * constant.cs (Constant::Constant): Update constructor similarly.
21001         Use System.Collections.
21002
21003         * parameter.cs (Parameter::Parameter): Update as above.
21004
21005 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21006
21007         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21008         (TypeContainer.delegates): New member to hold list of delegates.
21009
21010         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21011         this time as I seem to be on crack ;-)
21012
21013 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21016         tell whether an identifier represents a namespace.
21017
21018         * expression.cs (NamespaceExpr): A namespace expression, used only
21019         temporarly during expression resolution.
21020         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21021         utility functions to resolve names on expressions.
21022
21023 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * codegen.cs: Add hook for StatementExpressions. 
21026
21027         * class.cs: Fix inverted test for static flag in methods.
21028
21029 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21030
21031         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21032         to make it coincide with MS' number.
21033         (Operator::CheckBinaryOperator): Ditto.
21034
21035         * ../errors/errors.txt : Remove error numbers added earlier.
21036
21037         * ../errors/cs1019.cs : Test case for error # 1019
21038
21039         * ../errros/cs1020.cs : Test case for error # 1020
21040
21041         * cs-parser.jay : Clean out commented cruft.
21042         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21043         used anywhere - non-reducing rule.
21044         (namespace_declarations): Non-reducing rule - comment out.
21045
21046         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21047         with TypeContainer::AddEnum.
21048
21049         * delegate.cs : New file for delegate handling classes.
21050         (Delegate): Class for declaring delegates.
21051
21052         * makefile : Update.
21053
21054         * cs-parser.jay (delegate_declaration): Implement.
21055
21056 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21057
21058         * class.cs (Event::Define): Implement.
21059         (Event.EventBuilder): New member.
21060
21061         * class.cs (TypeContainer::Populate): Update to define all enums and events
21062         we have.
21063         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21064         readonly fields for all these cases ?
21065
21066 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21067
21068         * class.cs (Property): Revamp to use the convention of making fields readonly.
21069         Accordingly modify code elsewhere.
21070
21071         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21072         the Define method of the Property class.
21073
21074         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21075         trivial bug.
21076         (TypeContainer::Populate): Update to define all the properties we have. Also
21077         define all enumerations.
21078
21079         * enum.cs (Define): Implement.
21080
21081 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21082
21083         * cs-parser.jay (overloadable_operator): The semantic value is an
21084         enum of the Operator class.
21085         (operator_declarator): Implement actions.
21086         (operator_declaration): Implement.
21087
21088         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21089         validity of definitions.
21090         (Operator::CheckBinaryOperator): Static method to check for binary operators
21091         (TypeContainer::AddOperator): New method to add an operator to a type.
21092
21093         * cs-parser.jay (indexer_declaration): Added line to actually call the
21094         AddIndexer method so it gets added ;-)
21095
21096         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21097         already taken care of by the MS compiler ?  
21098
21099 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21100
21101         * class.cs (Operator): New class for operator declarations.
21102         (Operator::OpType): Enum for the various operators.
21103
21104 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21105
21106         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21107         ostensibly handle this in semantic analysis.
21108
21109         * cs-parser.jay (general_catch_clause): Comment out
21110         (specific_catch_clauses, specific_catch_clause): Ditto.
21111         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21112         (catch_args, opt_catch_args): New productions.
21113         (catch_clause): Rewrite to use the new productions above
21114         (catch_clauses): Modify accordingly.
21115         (opt_catch_clauses): New production to use in try_statement
21116         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21117         and re-write the code in the actions to extract the specific and
21118         general catch clauses by being a little smart ;-)
21119
21120         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21121         Hooray, try and catch statements parse fine !
21122
21123 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21124
21125         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21126         string from the hashtable of variables.
21127
21128         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21129         I end up making that mistake ;-)
21130         (catch_clauses): Fixed gross error which made Key and Value of the 
21131         DictionaryEntry the same : $1 !!
21132
21133 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21134
21135         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21136
21137         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21138         when the add and remove accessors are specified. 
21139
21140 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21141
21142         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21143         information about indexer_declarator.
21144         (indexer_declarator): Implement actions.
21145         (parsing_indexer): New local boolean used to keep track of whether
21146         we are parsing indexers or properties. This is necessary because 
21147         implicit_parameters come into picture even for the get accessor in the 
21148         case of an indexer.
21149         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21150
21151         * class.cs (Indexer): New class for indexer declarations.
21152         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21153         (TypeContainer::indexers): New member to hold list of indexers for the
21154         type.
21155
21156 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21157
21158         * cs-parser.jay (add_accessor_declaration): Implement action.
21159         (remove_accessor_declaration): Implement action.
21160         (event_accessors_declaration): Implement
21161         (variable_declarators): swap statements for first rule - trivial.
21162
21163         * class.cs (Event): New class to hold information about event
21164         declarations.
21165         (TypeContainer::AddEvent): New method to add an event to a type
21166         (TypeContainer::events): New member to hold list of events.
21167
21168         * cs-parser.jay (event_declaration): Implement actions.
21169
21170 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21171
21172         * cs-parser.jay (dim_separators): Implement. Make it a string
21173         concatenating all the commas together, just as they appear.
21174         (opt_dim_separators): Modify accordingly
21175         (rank_specifiers): Update accordingly. Basically do the same
21176         thing - instead, collect the brackets here.
21177         (opt_rank_sepcifiers): Modify accordingly.
21178         (array_type): Modify to actually return the complete type string
21179         instead of ignoring the rank_specifiers.
21180         (expression_list): Implement to collect the expressions
21181         (variable_initializer): Implement. We make it a list of expressions
21182         essentially so that we can handle the array_initializer case neatly too.
21183         (variable_initializer_list): Implement.
21184         (array_initializer): Make it a list of variable_initializers
21185         (opt_array_initializer): Modify accordingly.
21186
21187         * expression.cs (New::NType): Add enumeration to help us
21188         keep track of whether we have an object/delegate creation
21189         or an array creation.
21190         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21191         members to hold data about array creation.
21192         (New:New): Modify to update NewType
21193         (New:New): New Overloaded contructor for the array creation
21194         case.
21195
21196         * cs-parser.jay (array_creation_expression): Implement to call
21197         the overloaded New constructor.
21198
21199 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21200
21201         * class.cs (TypeContainer::Constructors): Return member
21202         constructors instead of returning null.
21203
21204 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21205
21206         * typemanager.cs (InitCoreTypes): Initialize the various core
21207         types after we have populated the type manager with the user
21208         defined types (this distinction will be important later while
21209         compiling corlib.dll)
21210
21211         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21212         on Expression Classification.  Now all expressions have a method
21213         `Resolve' and a method `Emit'.
21214
21215         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21216         generation from working.     Also add some temporary debugging
21217         code. 
21218
21219 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21220
21221         * codegen.cs: Lots of code generation pieces.  This is only the
21222         beginning, will continue tomorrow with more touches of polish.  We
21223         handle the fundamentals of if, while, do, for, return.  Others are
21224         trickier and I need to start working on invocations soon.
21225
21226         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21227         s.InitStatement. 
21228
21229         * codegen.cs (EmitContext): New struct, used during code
21230         emission to keep a context.   Most of the code generation will be
21231         here. 
21232
21233         * cs-parser.jay: Add embedded blocks to the list of statements of
21234         this block.  So code generation proceeds in a top down fashion.
21235
21236 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21237
21238         * statement.cs: Add support for multiple child blocks.
21239
21240 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21241
21242         * codegen.cs (EmitCode): New function, will emit the code for a
21243         Block of code given a TypeContainer and its ILGenerator. 
21244
21245         * statement.cs (Block): Standard public readonly optimization.
21246         (Block::Block constructors): Link children. 
21247         (Block::Child): Child Linker.
21248         (Block::EmitVariables): Emits IL variable declarations.
21249
21250         * class.cs: Drop support for MethodGroups here, delay until
21251         Semantic Analysis.
21252         (Method::): Applied the same simplification that I did before, and
21253         move from Properties to public readonly fields.
21254         (Method::ParameterTypes): Returns the parameter types for the
21255         function, and implements a cache that will be useful later when I
21256         do error checking and the semantic analysis on the methods is
21257         performed.
21258         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21259         and made a method, optional argument tells whether this is a class
21260         or a structure to apply the `has-this' bit.
21261         (Method::GetCallingConvention): Implement, returns the calling
21262         convention. 
21263         (Method::Define): Defines the type, a second pass is performed
21264         later to populate the methods.
21265
21266         (Constructor::ParameterTypes): implement a cache similar to the
21267         one on Method::ParameterTypes, useful later when we do semantic
21268         analysis. 
21269
21270         (TypeContainer::EmitMethod):  New method.  Emits methods.
21271
21272         * expression.cs: Removed MethodGroup class from here.
21273
21274         * parameter.cs (Parameters::GetCallingConvention): new method.
21275
21276 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21277
21278         * class.cs (TypeContainer::Populate): Drop RootContext from the
21279         argument. 
21280
21281         (Constructor::CallingConvention): Returns the calling convention.
21282         (Constructor::ParameterTypes): Returns the constructor parameter
21283         types. 
21284
21285         (TypeContainer::AddConstructor): Keep track of default constructor
21286         and the default static constructor.
21287
21288         (Constructor::) Another class that starts using `public readonly'
21289         instead of properties. 
21290
21291         (Constructor::IsDefault): Whether this is a default constructor. 
21292
21293         (Field::) use readonly public fields instead of properties also.
21294
21295         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21296         track of static constructors;  If none is used, turn on
21297         BeforeFieldInit in the TypeAttributes. 
21298
21299         * cs-parser.jay (opt_argument_list): now the return can be null
21300         for the cases where there are no arguments. 
21301
21302         (constructor_declarator): If there is no implicit `base' or
21303         `this', then invoke the default parent constructor. 
21304
21305         * modifiers.cs (MethodAttr): New static function maps a set of
21306         modifiers flags into a MethodAttributes enum
21307         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21308         MethodAttr, TypeAttr to represent the various mappings where the
21309         modifiers are used.
21310         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21311
21312 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21315         method arguments.
21316
21317         * interface.cs (PopulateIndexer): Implemented the code generator
21318         for interface indexers.
21319
21320 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21321
21322         * interface.cs (InterfaceMemberBase): Now we track the new status
21323         here.  
21324
21325         (PopulateProperty): Implement property population.  Woohoo!  Got
21326         Methods and Properties going today. 
21327
21328         Removed all the properties for interfaces, and replaced them with
21329         `public readonly' fields. 
21330
21331 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21332
21333         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21334         initialize their hashtables/arraylists only when they are needed
21335         instead of doing this always.
21336
21337         * parameter.cs: Handle refs and out parameters.
21338
21339         * cs-parser.jay: Use an ArrayList to construct the arguments
21340         instead of the ParameterCollection, and then cast that to a
21341         Parameter[] array.
21342
21343         * parameter.cs: Drop the use of ParameterCollection and use
21344         instead arrays of Parameters.
21345
21346         (GetParameterInfo): Use the Type, not the Name when resolving
21347         types. 
21348
21349 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21350
21351         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21352         and instead use public readonly fields.
21353
21354         * class.cs: Put back walking code for type containers.
21355
21356 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21357
21358         * class.cs (MakeConstant): Code to define constants.
21359
21360         * rootcontext.cs (LookupType): New function.  Used to locate types 
21361
21362
21363 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21364
21365         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21366         this System.Reflection code is.  Kudos to Microsoft
21367
21368         * typemanager.cs: Implement a type cache and avoid loading all
21369         types at boot time.  Wrap in LookupType the internals.  This made
21370         the compiler so much faster.  Wow.  I rule!
21371
21372         * driver.cs: Make sure we always load mscorlib first (for
21373         debugging purposes, nothing really important).
21374
21375         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21376         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21377
21378         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21379         on namespaces that have been imported using the `using' keyword.
21380
21381         * class.cs (TypeContainer::TypeAttr): Virtualize.
21382         (Class::TypeAttr): Return attributes suitable for this bad boy.
21383         (Struct::TypeAttr): ditto.
21384         Handle nested classes.
21385         (TypeContainer::) Remove all the type visiting code, it is now
21386         replaced with the rootcontext.cs code
21387
21388         * rootcontext.cs (GetClassBases): Added support for structs. 
21389
21390 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21391
21392         * interface.cs, statement.cs, class.cs, parameter.cs,
21393         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21394         Drop use of TypeRefs, and use strings instead.
21395
21396 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21397
21398         * rootcontext.cs: 
21399
21400         * class.cs (Struct::Struct): set the SEALED flags after
21401         checking the modifiers.
21402         (TypeContainer::TypeAttr): new property, returns the
21403         TypeAttributes for a class.  
21404
21405         * cs-parser.jay (type_list): Oops, list production was creating a
21406         new list of base types.
21407
21408         * rootcontext.cs (StdLib): New property.
21409         (GetInterfaceTypeByName): returns an interface by type name, and
21410         encapsulates error handling here.
21411         (GetInterfaces): simplified.
21412         (ResolveTree): Encapsulated all the tree resolution here.
21413         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21414         types. 
21415
21416         * driver.cs: Add support for --nostdlib, to avoid loading the
21417         default assemblies.
21418         (Main): Do not put tree resolution here. 
21419
21420         * rootcontext.cs: Beginning of the class resolution.
21421
21422 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * rootcontext.cs: Provide better error reporting. 
21425
21426         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21427
21428         * rootcontext.cs (CreateInterface): Handle the case where there
21429         are no parent interfaces.
21430
21431         (CloseTypes): Routine to flush types at the end.
21432         (CreateInterface): Track types.
21433         (GetInterfaces): Returns an array of Types from the list of
21434         defined interfaces.
21435
21436         * typemanager.c (AddUserType): Mechanism to track user types (puts
21437         the type on the global type hash, and allows us to close it at the
21438         end). 
21439
21440 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21441
21442         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21443         RecordInterface instead.
21444
21445         * cs-parser.jay: Updated to reflect changes above.
21446
21447         * decl.cs (Definition): Keep track of the TypeBuilder type that
21448         represents this type here.  Not sure we will use it in the long
21449         run, but wont hurt for now.
21450
21451         * driver.cs: Smaller changes to accomodate the new code.
21452
21453         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21454         when done. 
21455
21456         * rootcontext.cs (CreateInterface):  New method, used to create
21457         the System.TypeBuilder type for interfaces.
21458         (ResolveInterfaces): new entry point to resolve the interface
21459         hierarchy. 
21460         (CodeGen): Property, used to keep track of the code generator.
21461
21462 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21463
21464         * cs-parser.jay: Add a second production for delegate_declaration
21465         with `VOID'.
21466
21467         (enum_body): Put an opt_comma here instead of putting it on
21468         enum_body or enum_member_declarations so we can handle trailing
21469         commas on enumeration members.  Gets rid of a shift/reduce.
21470
21471         (type_list): Need a COMMA in the middle.
21472
21473         (indexer_declaration): Tell tokenizer to recognize get/set
21474
21475         * Remove old targets.
21476
21477         * Re-add the parser target.
21478
21479 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21480
21481         * cs-parser.jay: Add precendence rules for a number of operators
21482         ot reduce the number of shift/reduce conflicts in the grammar.
21483
21484 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21485
21486         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21487         and put it here.
21488
21489         Get rid of old crufty code.
21490
21491         * rootcontext.cs: Use this to keep track of the parsed
21492         representation and the defined types available to the program. 
21493
21494         * gen-treedump.cs: adjust for new convention.
21495
21496         * type.cs: Split out the type manager, and the assembly builder
21497         from here. 
21498
21499         * typemanager.cs: the type manager will live here now.
21500
21501         * cil-codegen.cs: And the code generator here. 
21502
21503 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21504
21505         * makefile: Fixed up for easy making.
21506
21507 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21508
21509         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21510         the 
21511
21512         (unary_expression): Expand pre_increment_expression and
21513         post_decrement_expression to reduce a shift/reduce.
21514
21515 2001-07-11  Simon Cozens
21516
21517         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21518
21519         Improve allow_keyword_as_indent name.
21520
21521 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21522
21523         * Adjustments for Beta2. 
21524
21525 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21526
21527         * decl.cs: Added `Define' abstract method.
21528         (InTransit): new property, used to catch recursive definitions. 
21529
21530         * interface.cs: Implement `Define'. 
21531
21532         * modifiers.cs: Map Modifiers.constants to
21533         System.Reflection.TypeAttribute flags.
21534
21535         * class.cs: Keep track of types and user-defined types.
21536         (BuilderInit): New method for creating an assembly
21537         (ResolveType): New function to launch the resolution process, only
21538         used by interfaces for now.
21539
21540         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21541         that are inserted into the name space. 
21542
21543 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * ARGH.  I have screwed up my tree so many times due to the use of
21546         rsync rather than using CVS.  Going to fix this at once. 
21547
21548         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21549         load types.
21550
21551 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21552
21553         * Experiment successful: Use System.Type rather that our own
21554         version of Type.  
21555
21556 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21557
21558         * cs-parser.jay: Removed nsAliases from here.
21559
21560         Use new namespaces, handle `using XXX;' 
21561
21562         * namespace.cs: Reimplemented namespace handling, use a recursive
21563         definition of the class.  Now we can keep track of using clauses
21564         and catch invalid using clauses.
21565
21566 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21567
21568         * gen-treedump.cs: Adapted for all the renaming.
21569
21570         * expression.cs (Expression): this class now has a Type property
21571         which returns an expression Type.
21572
21573         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21574         `Type', as this has a different meaning now in the base
21575
21576 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21577
21578         * interface.cs, class.cs: Removed from all the sources the
21579         references to signature computation, as we can not do method
21580         signature computation during the parsing time, as we are not
21581         trying to solve at that point distinguishing:
21582
21583         class X {
21584                 void a (Blah x) {}
21585                 void a (NS.Blah x) {}
21586         }
21587
21588         Which depending on the context might be valid or not, as we do not
21589         know if Blah is the same thing as NS.Blah at that point.
21590
21591         * Redid everything so the code uses TypeRefs now instead of
21592         Types.  TypeRefs are just temporary type placeholders, that need
21593         to be resolved.  They initially have a pointer to a string and the
21594         current scope in which they are used.  This is used later by the
21595         compiler to resolve the reference to an actual Type. 
21596
21597         * DeclSpace is no longer a CIR.Type, and neither are
21598         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21599         are all DeclSpaces, but no Types. 
21600
21601         * type.cs (TypeRefManager): This implements the TypeRef manager,
21602         which keeps track of all the types that need to be resolved after
21603         the parsing has finished. 
21604
21605 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21606
21607         * ARGH.  We are going to have to store `foreach' as a class rather
21608         than resolving it, as we need to verify error 1579 after name
21609         resolution.   *OR* we could keep a flag that says `This request to
21610         IEnumerator comes from a foreach statement' which we can then use
21611         to generate the error.
21612
21613 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21614
21615         * class.cs (TypeContainer.AddMethod): we now add methods to the
21616         MethodGroup instead of the method hashtable.  
21617
21618         * expression.cs: Add MethodGroup abstraction, which gets us one
21619         step closer to the specification in the way we handle method
21620         declarations.  
21621
21622         * cs-parser.jay (primary_expression): qualified_identifier now
21623         tried to match up an identifier to a local variable reference or
21624         to a parameter reference.
21625
21626         current_local_parameters is now a parser global variable that
21627         points to the current parameters for the block, used during name
21628         lookup.
21629
21630         (property_declaration): Now creates an implicit `value' argument to
21631         the set accessor.
21632
21633 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21634
21635         * parameter.cs: Do not use `param' arguments as part of the
21636         signature, per the spec.
21637
21638 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * decl.cs: Base class for classes, structs and interfaces.  This
21641         is the "Declaration Space" 
21642
21643         * cs-parser.jay: Use CheckDef for checking declaration errors
21644         instead of having one on each function.
21645
21646         * class.cs: Factor out some code for handling error handling in
21647         accordance to the "Declarations" section in the "Basic Concepts"
21648         chapter in the ECMA C# spec.
21649
21650         * interface.cs: Make all interface member classes derive from
21651         InterfaceMemberBase.
21652
21653 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * Many things: all interfaces are parsed and generated in
21656         gen-treedump.  Support for member variables, constructors,
21657         destructors, properties, constants is there.
21658
21659         Beginning of the IL backend, but very little done, just there for
21660         testing purposes. 
21661
21662 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21663
21664         * cs-parser.jay: Fix labeled statement.
21665
21666         * cs-tokenizer.cs (escape): Escape " and ' always.
21667         ref_line, ref_name: keep track of the line/filename as instructed
21668         by #line by the compiler.
21669         Parse #line.
21670
21671 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21674         to match the values in System.CodeDOM.
21675
21676         Divid renamed to Divide.
21677
21678         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21679         statements. 
21680         (Statements.set): remove.
21681
21682         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21683         statements. 
21684
21685         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21686         falseStatements always have valid values. 
21687
21688         * cs-parser.jay: Use System.CodeDOM now.
21689