*** Merged revisions from mcs: 52077, 52086, 52089
[mono.git] / mcs / gmcs / ChangeLog
1 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2
3         * anonymous.cs (AnonymousContainer): Don't crash when container
4         doesn't exist.
5
6 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7
8         * expression.cs (Binary.DoResolve): Warn when comparing same
9         values.
10
11 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
12
13         Fix #76486.
14         * expression.cs (Binary.DoResolve): It looks like there are no
15         convetsion rules in enum context.
16
17 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18
19         Add support for extern alias qualifiers.
20         * typemanager.cs: Move some LookupTypeReflection code
21         to namespace.cs, to have cleaner code. Added some methods
22         to help us keep track of the extern aliased references.
23         * driver.cs: Add suport for extern alias assemblies on command
24         line and check for their warnings/errors. Also keep track of the
25         extern aliased assemblies.
26         * namespace.cs: Move the global functionality of Namespace
27         to GlobalRootNamespace/RootNamespace. Now the global namespace
28         is GlobalRootNamespace.Globa. Also the code moved from 
29         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
30         Finally added LocalAliasEntry (AliasEntry before) and
31         ExternAliasEntry, to handle alias statements.
32         * cs-parser.jay: Add support in the grammar for extern alias
33         statement.
34         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
35         Update callings to Namespace (now in GlobalRootNamespace).
36
37 2005-10-25  Martin Baulig  <martin@ximian.com>
38
39         * convert.cs (ImplicitTypeParameterConversion): Make base
40         interfaces actually work; fixes #76557.
41
42 2005-10-25  Martin Baulig  <martin@ximian.com>
43
44         * generic.cs
45         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
46         all the type parameters; fixes #76551.
47
48 2005-10-25  Martin Baulig  <martin@ximian.com>
49
50         Fix #76472.
51
52         * generic.cs
53         (GenericMethod.ctor): Added `Expression return_type' and
54         `Parameters parameters' arguments.
55         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
56         parameter and return types to check their constraints if they're
57         generic types.
58
59         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
60         boolean field.
61
62         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
63         constraints of a generic type if `ec.ResolvingGenericMethod'.
64
65         * class.cs (MethodCore.DoDefineParameters): Set
66         `ec.ResolvingGenericMethod' if we're a generic method.
67         (MemberBase.MemberType): Likewise.
68
69 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
70
71         * typemanager.cs (TypeManager): Added 
72         TypeManager.internals_visible_attr_type to cache
73         S.R.CompilerServices.InternalsVisibleToAttribute.
74
75         * codegen.cs (AssemblyClass): Added checks for 
76         InternalsVisibleToAttribute in new method 
77         CheckInternalsVisibleAttribute () and also cache the
78         AssemblyName in AssemblyClass.Name.
79         
80 2005-10-24  Martin Baulig  <martin@ximian.com>
81
82         * typemanager.cs
83         (TypeManager.ExpandInterfaces): Added overloaded version which
84         just takes a `Type[]' array.
85
86         * generic.cs
87         (Constraints.Resolve): Don't expand the interfaces here; ie. we
88         just use the interfaces which were explicitly specified and not
89         the interfaces they inherit.  Fixes #76482.
90         (TypeParameter.FindMembers): Expand the interfaces here.
91
92 2005-10-21  Martin Baulig  <martin@ximian.com>
93
94         * generic.cs
95         (Constraints.Resolve): Also resolve the actual types here.
96         (Constraints.ResolveTypes): Just check the constraints here.
97         Fixes #76363; see gtest-218.cs.
98
99 2005-10-21  Martin Baulig  <martin@ximian.com>
100
101         * convert.cs
102         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
103         instead of a `BoxedCast'; fixes gtest-217.cs.
104
105 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
106
107         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
108           1) "new()" is specified as generic parameter constraint and 2) the
109           type is TypeBuilder and 3) the type is abstract even if it has a
110           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
111
112 2005-10-20  Martin Baulig  <martin@ximian.com>
113
114         * generic.cs
115         (GenericConstraints.TypeParameter): New public property.
116         (TypeParameter.ctor): Also take a `DeclSpace' argument.
117         (TypeParameter.DeclSpace): New public property.
118         (TypeParameter.DefineType): Inflate the constraints if our
119         `DeclSpace' is an `Iterator'.   
120
121 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
122
123         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
124           GenericMethod argument to compare methods' generic type arguments.
125           Fixed bug #76382.
126
127 2005-10-19  Martin Baulig  <martin@ximian.com>
128
129         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
130         not ResolveType() when resolving the base type, so we're not
131         checking the constraints here.
132         (TypeContainer.ResolveType): Call ResolveType() on our base_type
133         if we have any.
134
135 2005-10-19  Martin Baulig  <martin@ximian.com>
136
137         * generic.cs (ConstructedType.CheckConstraints): Committing
138         untested fix for #76441.
139
140 2005-10-18  Raja R Harinath  <rharinath@novell.com>
141
142         Fix #76371.
143         * class.cs (TypeContainer.DefineType): Move updating of
144         topological sort earlier in the code.
145         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
146
147 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
148
149         Fix #76273.
150         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
151         
152         * constant.cs (Constant.TryReduce): Moved from Cast class.
153         (Reduce): Made little bit more OO and fixed missing conversions.
154         
155         * ecore.cs (Reduce): Implemented.
156         (Binary.EnumLiftUp): New method to upgrade values to enum values.
157         
158         * literal.cs (Reduce): Implemented.
159         
160         * class.cs: Reverted Miguel's wrong commit.
161
162 2005-10-14  Miguel de Icaza  <miguel@novell.com>
163
164         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
165
166 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
167
168         * cs-parser.jay, expression.cs : CS0214 was missing error location
169           for constants. Fixed bug #76404.
170
171 2005-10-10  Raja R Harinath  <rharinath@novell.com>
172
173         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
174         InstanceExpression.
175         (PropertyExpr.EmitCall): Likewise.
176         * expression.cs (Invocation.EmitArguments): Handle case where
177         arguments == null.
178         (Invocation.EmitCall): Avoid allocating temporary variable if
179         there are no arguments.
180
181 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
182
183         Fix #76370.
184         * convert.cs (ExplicitConversionCore): Fixed object->enum
185         conversion.
186
187 2005-10-07  Raja R Harinath  <rharinath@novell.com>
188
189         Fix #76323.
190         * convert.cs (ImplicitConversionStandard): Move conversion of
191         void* to arbitrary pointer types ...
192         (ExplicitConversionStandard): .. here.
193         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
194         error to always print typenames.
195
196 2005-10-07  Raja R Harinath  <rharinath@novell.com>
197
198         * convert.cs (GetConversionOperator): Rename from
199         GetConversionOperators.  Move operator selection code from ...
200         (UserDefinedConversion): ... here.
201
202 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
203
204         * convert.cs (ExplicitConversionCore): Removed duplicate enum
205         conversion.
206
207 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
208
209         * assign.cs (Assign.DoResolve): Error method changed.
210
211         * cfold.cs (DoConstantNumericPromotions): Error method changed.
212         
213         * const.cs (ResolveValue): Reset in_transit immediately.
214         
215         * constant.cs: Error method changed.
216         
217         * convert.cs: Removed useless location parameter.
218         (ExplicitNumericConversion): Don't do double enum check.
219         (ExplicitConversionCore): Renamed from ExplicitConversion.
220         (ExplicitUnsafe): Extracted from ExplicitConversion.
221         (ExplicitConversion): Uses for error reporting.
222         
223         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
224         error messages.
225         (ResolveBoolean): Uses common error method.
226         (CastToDecimal): Get rid of ec.
227         (CastFromDecimal): Optimized.
228         (ConvCast): Get rid of ec.
229         
230         * enum.cs (ResolveValue): Reset in_transit immediately.
231         (Emit): Return after first error.
232         
233         * expression.cs: Convert changes.
234         
235         * literal.cs: Error method changed.
236         
237         * statement.cs: Error method changed.
238
239 2005-10-06  Raja R Harinath  <rharinath@novell.com>
240
241         Fix gtest-131.cs and gtest-211.cs.
242         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
243         Only emit code for a label if it is used.  Unreachable code can
244         violate ECMA evaluation stack invariants.
245
246 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
247
248         * anonymous.cs: Implemented ExprClassName.
249         
250         * assign.cs (Assign.DoResolve): Don't chrash when type is not
251         delegate.
252         
253         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
254         check.
255         
256         * class.cs (StaticClass.DefineContainerMembers): Report protected
257         members as error.
258         
259         * codegen.cs: if(ed) PRODUCTION.
260         
261         * convert.cs (Error_CannotImplicitConversion): Better error
262         distinction.
263         
264         * cs-parser.jay: More error checks.
265         
266         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
267         
268         * driver.cs (CSCParseOption): Enabled wrong option check.
269         
270         * ecore.cs (Expression.ExprClassName): Turned to property.
271         (MemberExpr.CheckIntermediateModification): For checking boxed
272         value types     modification.
273         
274         * statement.cs (Fixed.Resolve): Expression type must be
275         convertible to fixed type.
276         (CollectionForeach.GetEnumeratorFilter,TryType):
277         Small refactoring for easier error checking.
278
279 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
280
281         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
282         attributes.
283         
284         * class.cs (GeneratedBaseInitializer): New class for customization
285         compiler generated initializers.
286         (MemberBase.DoDefine): Check Obsolete attribute here.
287         (FieldMember.DoDefine): Ditto.
288         
289         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
290         constants.
291         
292         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
293         (MemberCore.GetObsoleteAttribute): Removed argument.
294         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
295         (MemberCore.CheckObsoleteType): New helper.
296         
297         * delegate.cs,
298         * enum.cs,
299         * statement.cs: Updates after MemberCore changes.
300         
301         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
302         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
303         
304         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
305         obsolete attribute for compiler construct.
306         (As.DoResolve): Cache result.
307         
308         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
309
310 2005-10-01  Miguel de Icaza  <miguel@novell.com>
311
312         * expression.cs (Probe): instead of having a "Type probe_type"
313         keep the extra information as a TypeExpr probe_type_expr since the
314         "As" operator needs to perform some type checks.
315
316         * (As.DoResolve): If the type is a type parameter, ensure that it
317         is constrained by a class.
318
319 2005-09-22  Miguel de Icaza  <miguel@novell.com>
320
321         * statement.cs (Lock): Use the TemporaryVariable class instead of
322         manually using local variables as those do not work when variables
323         are captured.
324
325         * ecore.cs: Moved the TemporaryVariable class from being a nested
326         class inside Foreach to be a public class that can be employed in
327         other places. 
328
329 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
330
331         * cs-parser.jay: interface_accessors replaced by
332         accessor_declarations.
333
334         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
335         location.
336         
337         * statement.cs (GotoCase.Resolve): Convert null constant to
338         null case.
339         (SwitchLabel.ResolveAndReduce): Ditto.
340         (SwitchLabel.NullStringCase): Custom null stamp.
341         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
342         
343         typemanager.cs (CSharpSignature): Don't skip first argument
344         for full names.
345
346 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
347
348         * cfold.cs, constant.cs, convert.cs, ecore.cs,
349         expression.cs, iterators.cs, literal.cs: Store constants and
350         literals location.
351         
352         * class.cs (MemberBase.ShortName): Pass location.
353         
354         * cs-parser.jay: Some location fixes.
355         
356         * ecore.cs (Expression.Location): Made virtual.
357
358 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
359
360         Fix #72930.
361         * const.cs (Const.ResolveValue): Check for assigning non-null
362         value to reference type.
363
364 2005-09-26  Raja R Harinath  <rharinath@novell.com>
365
366         Fix #76133.
367         * expression.cs (This.VerifyFixed): In a value type T, the type of
368         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
369         value type R, 'this' is treated as a value parameter.
370
371 2005-09-05  Miguel de Icaza  <miguel@novell.com>
372
373         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
374         if the underlying types are the same, otherwise we need to produce
375         code that will do the proper cast.
376
377         This was exposed by Marek's constant rewrite which produced
378         invalid code for the call site:
379
380         enum X : long { a }
381         void Method (X v) {}
382
383         Method ((X) 5)
384
385         This fixes test-49.cs
386
387 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
388
389         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
390           Type/Object should be allowed as well. Fixed bug #75968.
391
392 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
393
394         * expression.cs : (Binary.DoResolve): when one is enum constant and
395           another is constant 0, then return enum one *as enum type*.
396           Fixed bug 74846.
397
398 2005-10-04  Martin Baulig  <martin@ximian.com>
399
400         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
401         `SetMemberIsUsed()' work for generics, too.
402
403 2005-10-04  Martin Baulig  <martin@ximian.com>
404
405         * expression.cs (DelegateInvocation.EmitStatement): Make this work
406         for corlib.  Fixes #75691.
407
408 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
409
410         Fix #76255.
411         * driver.cs: Fix compilation files with full root path.
412
413 2005-09-25  Miguel de Icaza  <miguel@novell.com>
414
415         * report.cs (SymbolRelatedToPreviousError): Format the output so
416         it does not use an open parenthesis that is never closed. 
417
418         * driver.cs: Follow coding guidelines
419
420 2005-09-18  Miguel de Icaza  <miguel@novell.com>
421
422         * driver.cs: Set InEmacs based on the environment variable EMACS. 
423
424         * location.cs (InEmacs): in this mode, do not report column
425         location as it confuses Emacs.
426
427 2005-10-03  Raja R Harinath  <rharinath@novell.com>
428
429         * support.cs (SeekableStreamReader.Position): Don't error out when
430         the requested position is just beyond the end of the current
431         buffered data.
432
433 2005-09-28  Raja R Harinath  <rharinath@novell.com>
434
435         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
436         try to keep in sync with the byte count of the underlying Stream.
437         However, this limits us to a window size of 2048 characters: i.e.,
438         the maximum lookahead of our lexer/parser can be 2048 characters.
439
440 2005-09-22  Martin Baulig  <martin@ximian.com>
441
442         * driver.cs: Removed a debugging FIXME.
443
444 2005-09-21  Raja R Harinath  <rharinath@novell.com>
445
446         * cs-parser.jay (type_arguments): Add CS1644 check.
447         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
448
449 2005-09-15  Raja R Harinath  <rharinath@novell.com>
450
451         * Makefile (PROGRAM): Make profile specific.
452         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
453         the current directory.
454
455         Fix test-455.cs.
456         * expression.cs (Invocation.EmitCall): Remove optimization on
457         this_call since it doesn't handle 'this' being a value type.
458
459 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
460
461         * driver.cs: Ensure file handles are closed after parsing
462
463 2005-09-05  Miguel de Icaza  <miguel@novell.com>
464
465         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
466         if the underlying types are the same, otherwise we need to produce
467         code that will do the proper cast.
468
469         This was exposed by Marek's constant rewrite which produced
470         invalid code for the call site:
471
472         enum X : long { a }
473         void Method (X v) {}
474
475         Method ((X) 5)
476
477         This fixes test-49.cs
478
479 2005-09-05  Martin Baulig  <martin@ximian.com>
480
481         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
482         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
483
484         * cs-parser.jay (delegate_declaration): Small fix for #75852.
485
486 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
487
488         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
489           to be a pointer type due to the spec 25.2, so check if declaring
490           type is generic type definition. Fixed bug #75772.
491
492 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
493
494         Fixed bug #75957.
495         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
496           both types are not defined by methods.
497         * expression.cs : (Invocation.IsApplicable): it should work when
498           the argument type is equal to the parameter type, not only when
499           ImplicitConversionExists() returns true.
500
501 2005-09-02  Raja R Harinath  <rharinath@novell.com>
502
503         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
504         internal.
505
506         Fix #75941.
507         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
508         flow-branching for LocalVariableReferences in case we were invoked
509         from a MemberAccess.
510         * expression.cs (LocalVariableReference.VerifyAssigned): New.
511         Carved out of ...
512         (LocalVariableReference.DoResolveBase): ... this.
513         (MemberAccess.Resolve): Do the check that was disabled during
514         SimpleNameResolve.
515
516 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
517
518         * class.cs :
519           (PartialContainer.Create): check abstract/sealed/static strictly
520           but abstract/sealed can exist only at one side. Fixed bug #75883.
521
522 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
523
524         Fix #75945.
525         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
526         specified, don't default to UnmanagedType.I4.
527
528 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
529
530         * expression.cs : conditional operator should check possibly
531           incorrect assign expression. Fixed bug #75946.
532
533 2005-08-30  Raja R Harinath  <rharinath@novell.com>
534
535         Fix #75934.
536         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
537         (ScopeInfo.EmitScopeType): Use it to construct field names from
538         names of captured locals.
539
540         Fix #75929.
541         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
542         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
543         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
544         (ExplicitConversion): Remove enum cases already handled by
545         implicit conversion.  Move implicit conversion check to the beginning.
546         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
547         * expression.cs (ArrayCreation.EmitDynamicInitializers):
548         Don't treat System.Enum as a struct.
549
550 2005-08-30  Jb Evain  <jbevain@gmail.com>
551
552         * attribute.cs: handles as expression in parameters.
553
554 2005-08-30  Raja R Harinath  <rharinath@novell.com>
555
556         Fix #75802.
557         * class.cs (TypeContainer.VerifyClsName): Don't use a
558         PartialContainer when verifying CLS compliance.
559         (AbstractPropertyEventMethod): Set Parent here, ...
560         (PropertyMethod): ... not here.
561
562 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
563
564         * attribute.cs : escaped attribute name should not be allowed to be
565           resolved (e.g. @class as classAttribute). Fixed bug #75930.
566
567 2005-08-29  Raja R Harinath  <rharinath@novell.com>
568
569         Fix #75927.
570         * convert.cs (ImplicitStandardConversionExists): Allow zero also
571         when converting a long constant to unsigned long.
572         * expression.cs (Invocation.OverloadResolve): Add sanity check to
573         detect where IsApplicable and VerifyArgumentsCompat disagree.
574
575 2005-08-29  Raja R Harinath  <rharinath@novell.com>
576         and Carlos Alberto Cortez  <carlos@unixmexico.org>
577
578         Fix #75848.
579         * class.cs (TypeContainer.CanElideInitializer): New helper.
580         (TypeContainer.EmitFieldInitializers): Use it to determine if we
581         can safely emitting the initializer of a field.
582
583 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
584
585         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
586           allowed inside a switch (without loop). Fixed bug #75433.
587
588 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
589
590         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
591         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
592
593 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
594
595         * driver.cs : kinda reverting the default encoding changes (not exact 
596           revert since I noticed that "codepage:reset" might not work fine).
597
598 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
599
600         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
601           Location. Now getter and setter store location correctly.
602           (errors/cs0111-12.cs now reports the expected location.)
603
604 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
605
606         * driver.cs : Use default encoding on the environment.
607           Removed (now that) extra parameter for SeekableStreamReader.
608         * support.cs : (SeekableStreamReader) third .ctor() argument for
609           StreamReader is not required (always true). preamble size could
610           be acquired in simpler and safe way.
611
612 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
613
614         * cs-parser.jay: report CS0642 at warning level 3
615           and report CS0642 for an if else statement also
616           fixes bug #74745. Patch by John Luke (and a bit
617           modified by me).
618           Removed extra CS0642 warning check for "while",
619           "for" and "fixed".
620         * statement.cs: In Block.Resolve(), CS0642 check
621           is reimplemented to check a sequence of an empty
622           statement and a block.
623
624           Both fix bug #66777.
625
626 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
627
628         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
629         detection until I fix it.
630         
631         * cs-tokenizer.cs: Changed error message.
632         
633         * cs-parser.jay: Fixed 2 error locations.
634         
635         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
636         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
637         properties.
638         
639         * enum.cs (GetSignatureForError): Fixed.
640         
641         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
642         method detection.
643         
644         * class.cs,
645         * typemanager.cs (RegisterProperty): Removed.
646         
647         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
648
649 2005-08-24  Raja R Harinath  <rharinath@novell.com>
650
651         Fix #75874.
652         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
653         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
654
655 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
656
657         * expression.cs : tiny fix is required for not warning positive ulong.
658           See test-441.cs.
659
660 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
661
662         * expression.cs : add CS0652 check for constant and integral
663           expression. Fixed bug #53974.
664
665 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
666
667         * expression.cs : in DoNumericPromotions(), check if there is implicit
668           conversion overload for string (to check CS0034). Fixed bug #52492.
669
670 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
671
672         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
673
674 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
675
676         * ecore.cs : report location when it is *not* Null.
677
678 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
679
680         * codegen.cs,
681           ecore.cs,
682           flowanalysis.cs,
683           expression.cs:
684           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
685           correctly. Fixed bug #75721.
686
687 2005-08-23  Raja R Harinath  <rharinath@novell.com>
688
689         * support.cs (SeekableStreamReader.Position): Avoid an expensive
690         loop that performs 'min (pos, char_count)'.
691
692         Fix #75862.
693         * expression.cs (Unary.ResolveOperator): Don't discard implicit
694         converted value in Operator.OnesComplement.
695
696 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
697
698         * anonymous.cs: If the anon method is pulled into a helper class,
699         it needs to be `internal' not `private'. Fixes runtime behavior on
700         msft. bug #75704
701
702 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
703
704         Fix #75803
705         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
706         is a partial class.
707
708 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
709
710         The big constants rewrite
711         Fix #75746, #75685 and more
712         As a side effect saved 1MB for MWF ;-)
713         
714         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
715         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
716         enum based for corlib compilation.
717         
718         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
719         subtractions.
720         
721         * class.cs (FixedField.Define): Use ResolveAsConstant.
722         
723         * const.cs (IConstant): Interface constants and enums.
724         (Const.ResolveValue): New method for constant resolvning.
725         (ExternalConstant): Constants from imported assemblies.
726         
727         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
728         conversion; like enums.
729         (Constant.ToType): Converts this constant to different type.
730         (Constant.Increment): Adds 1.
731         
732         * convert.cs (ImplicitConversionRequired): Simplified.
733         
734         * cs-parser.jay: Create EnumMember directly.
735         
736         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
737         
738         * doc.cs (GenerateEnumDocComment): Removed.
739         
740         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
741         (ConvertIntLiteral): Removed.
742         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
743         
744         * enum.cs (EnumMember): Implement IConstant.
745         (Enum.IsValidEnumConstant): Removed.
746         (Enum.GetNextDefaultValue): Removed.
747         (Enum.FindMembers): Updated.
748         (Enum.GenerateDocComment): Iterate enum members.
749         
750         * expression.cs (Cast.TryReduce): Handle enums correctly.
751         (New.Constantify): Made public.
752         (MemberAccess.DoResolve): Removed contant specific if(s).
753         
754         * literal.cs (NullLiteral): Implement new abstract methods.
755         
756         * statement.cs (GotoCase.Resolve): Use new constant methods.
757         (SwitchLabel.ResolveAndReduce): Use new constant methods.
758         
759         * typemanager.cs (LookupEnum): Removed.
760         (IsEnumType): Fixed to work with corlib.
761         (RegisterConstant): Removed.
762         (LookupConstant): Removed.
763         (GetConstant): Changed to work with IConstant.
764
765 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
766
767         * location.cs : Fixed overflown (>255) column number.
768
769 2005-08-03  Raja R Harinath  <rharinath@novell.com>
770
771         First cut of the qualified-alias-member feature.
772         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
773         token.
774         * cs-parser.jay (DOUBLE_COLON): New token.
775         (namespace_or_type_name): Add rule for recognizing
776         qualified-alias-members.
777         (primary_expression): Likewise.
778         (element_access): Allow QualifiedAliasMember as a possible
779         type-bearing expression.
780         (local_variable_type, local_variable_pointer_type): Likewise.
781         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
782         aliases in the current and enclosing namespace declarations.
783         (NamespaceEntry.UsingAlias): Add CS0440 warning.
784         * decl.cs (MemberName.is_double_colon): New.
785         (MemberName.MemberName): Add new constructor for alias-member.
786         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
787         * expression.cs (QualifiedAliasMember): New expression type.
788
789 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
790
791         * location.cs : it borked when no argument was specified.
792
793 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
794
795         * location.cs : tiny ToString() format fix.
796
797 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
798
799         * statement.cs : oops, it was missing.
800
801 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
802
803         A set of fixes for precise line/column location.
804
805         * location.cs :
806           "token" field now holds a file/line "delta", a line number offset 
807           from the segment, and a column number. See also:
808           http://lists.ximian.com/pipermail/mono-devel-list/2004-
809           December/009508.html
810           Removed static IsNull. Use instance IsNull property instead.
811         * cs-tokenizer.cs :
812           For some tokens it stores Location. For Identifier it stores
813           LocatedToken which is a pair of string name and location.
814           Column numbers are adjusted only at getChar().
815         * report.cs :
816           Use Location.ToString() for reporting (it now contains column).
817         * cs-parser.jay :
818           Largely modified to use LocatedToken instead of
819           string (IDENTIFIER), and to acquire Location from some tokens.
820         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
821           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
822           codegen.cs :
823           Now MemberName holds Location. DeclSpace.ctor() receives Location
824           as a parameter. Removed extra parameters to all derived classes.
825           Replaced Location.IsNull() with instance property.
826         * assign.cs, expression.cs :
827           Added .ctor() overload that omits Location.
828         * attribute.cs :
829           Added "nameEscaped" flag that indicates the identifier was escaped
830           in the source file. This fixes bug #57047.
831
832 2005-09-02  Martin Baulig  <martin@ximian.com>
833
834         * class.cs: Make CS3005 a warning, not an error.
835
836 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
837
838         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
839         New method, looking for lo-case imported cls type.
840
841         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
842         here.
843
844         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
845
846         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
847
848         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
849         all_imported_types.
850         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
851
852         Optimized to save 3.5 MB for SWF compilation.
853
854 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
855
856         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
857         (PartialContainer.Create): Moved logic AddToContainer.
858         (PartialContainer.MarkForDuplicationCheck): Shares name.
859         
860         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
861         place.
862         
863         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
864         initialization.
865         (Namespace.GetSignatureForError): New method.
866         
867         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
868         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
869
870 2005-08-01  Raja R Harinath  <rharinath@novell.com>
871
872         Fix #75669.
873         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
874         member lookup rather than qualifier_type, since qualifier_type can
875         be null.
876
877 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
878
879         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
880         enum member.
881
882 2005-07-31  Miguel de Icaza  <miguel@novell.com>
883
884         * statement.cs: Copy the local exception into the exception
885         captured local.  Fixes 75674
886
887 2005-07-31  Raja R Harinath  <harinath@gmail.com>
888
889         Fix #75658.
890         * expression.cs (Invocation.OverloadResolve): Don't report error
891         CS1501 if error CS1502 has been reported.
892         (New.DoResolve): Delegate CS1501 reporting to
893         Invocation.OverloadResolve.
894
895         Fix #75656.
896         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
897         invariant-meaning-in-block property in an enclosing block if
898         necessary.
899
900 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
901
902         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
903         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
904         (Switch.CheckSwitch): Just save 50kb for SWF.
905
906 2005-07-27  Martin Baulig  <martin@ximian.com>
907
908         * anonymous.cs (CaptureContext.AddField): Added
909         `AnonymousContainer am' argument; compute its toplevel scope if
910         it's not already computed.  Fixes #75649.
911
912 2005-07-26  Raja R Harinath  <rharinath@novell.com>
913
914         Fix #75628.
915         * class.cs (Constructor.Emit): Reset block to null if the block
916         resolve fails.
917
918 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
919
920         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
921
922 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
923
924         * class.cs (MethodData.Define): Check whether accessor implementing
925         interface is public.
926
927         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
928
929 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
930
931         Fix #57245
932         * namespace.cs (LookupType): Moved same type check to...
933         
934         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
935         with the same name.
936
937 2005-07-21  Raja R Harinath  <rharinath@novell.com>
938
939         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
940         already found a typebuilder.
941         * class.cs (MethodCore.IsDuplicateImplementation): Compare
942         MemberNames, not strings.
943
944         * const.cs (Error_ExpressionMustBeConst): 
945         Rename from Error_EpressionMustBeConst.
946         * const.cs, class.cs, statement.cd: Update.
947
948 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
949
950         Fix #65573
951
952         * const.cs (Const.LookupConstantValue): Report missing contant expression
953         everytime.
954         (Error_EpressionMustBeConstant): Only one error method.
955
956         * class.cs, statement.c: Updated.
957
958 2005-07-20  Raja R Harinath  <rharinath@novell.com>
959
960         * statement.cs (Block.Flags): Add back HasVarargs.
961         (Block.flags): Make protected.
962         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
963
964         * typemanager.cs (types, typecontainers, user_types): Remove.
965         (UserTypes, TypeContainers): Likewise.
966         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
967         (CleanUp, Reset): Update.
968         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
969         (GetNestedType): Use Type.GetNestedType.
970         (CoreLookupType): Take two arguments, the namespace and the
971         basename of the type.  Update to use the Namespace.Lookup
972         mechanism.
973         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
974         (RealMemberLookup): Use IsNestedChildOf instead of playing with
975         string concatenation and substring matches.
976         * class.cs, enum.cs, delegate.cs: Update to changes.
977
978 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
979
980         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
981         Expression and made virtual.
982
983         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
984         (ImplicitStandardConversionExists): Fixed `byte' typo ?
985
986         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
987
988         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
989         error message.
990
991         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
992         change.
993
994 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
995
996         Fix #57707
997         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
998         AssemblyCultureAttribute is not used on executable.
999
1000         * rootcontext.cs,
1001         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1002
1003 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1004
1005         Fix #60638.
1006         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1007         New.  Reports CS0252/CS0253.
1008         Mostly taken from preliminary patch by Duncak Mak.
1009         (Binary.DoResolveOperator): Store results of operator lookup.
1010         Use them to detect if we need to warn about unintended reference
1011         comparisons.
1012
1013 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1014
1015         Fix #72969.
1016         * namespace.cs (Namespace.Lookup): Add back location parameter.
1017         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1018         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1019
1020         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1021         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1022         (Namespace.LookupType): ... this.
1023         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1024         of namespaces.
1025         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1026         purported to handle pointers.
1027         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1028         CoreLookupType.
1029
1030 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1031
1032         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1033         type as namespace.
1034
1035 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1036
1037         * namespace.cs (Namespace.Lookup): Drop location parameter.
1038         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1039         (NamespaceEntry.Lookup): ... this.
1040         (NamespaceEntry.Error_AmbiguousTypeReference):
1041         Move here from DeclSpace.
1042         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1043         names ...
1044         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1045         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1046         Move to NamespaceEntry.
1047         * delegate.cs, expression.cs: Update to changes.
1048
1049 2005-08-31  Martin Baulig  <martin@ximian.com>
1050
1051         Committing a patch from Atsushi Enomoto for #75850.
1052
1053         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1054         Prefer a generic enumerator over a non-generic one.
1055
1056 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1057
1058         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1059         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1060
1061 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1062
1063         * driver.cs : reverting default encoding change as well as mcs.
1064
1065 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1066
1067         * driver.cs, support.cs : merged r48826.
1068           Marek Safer wrote:
1069           > could you integrate your mcs changes to gmcs otherwise
1070           > gmcs cannot compile some files.
1071
1072 2005-08-20  Martin Baulig  <martin@ximian.com>
1073
1074         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1075         scope if we don't already have it.
1076
1077         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1078         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1079         fixes #75867.
1080
1081 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1082
1083         * statement.cs: Copy the local exception into the exception
1084         captured local.  Fixes 75674
1085
1086 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1087
1088         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1089         type as namespace.
1090
1091 2005-08-12  Martin Baulig  <martin@ximian.com>
1092
1093         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1094         for nested types here to avoid hitting the cache too early.
1095
1096 2005-08-09  Miguel de Icaza  <miguel@novell.com>
1097
1098         * enum.cs: On the new compiler CLS error 3005 is now a warning not
1099         an error. 
1100
1101 2005-08-03  Martin Baulig  <martin@ximian.com>
1102
1103         Make iterators in generic methods work; see gtest-191.cs.
1104
1105         * generic.cs
1106         (Constraints.Resolve): Protect against being called twice.
1107
1108         * class.cs
1109         (TypeContainer.GetClassBases): Make this `protected virtual'.
1110
1111         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1112         (Iterator.GetClassBases): Override this and compute the base
1113         classes here.
1114         (Iterator.DefineNestedTypes): If we're a generic method, all our
1115         method type parameters become class type parameters on the proxy
1116         class.
1117
1118         * statement.cs
1119         (ToplevelBlock.Parameters): Make this a property, not a field.
1120         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1121
1122 2005-08-03  Martin Baulig  <martin@ximian.com>
1123
1124         * typemanager.cs (TypeManager.IsSubclassOf): Use
1125         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1126         (TypeManager.GetFullName_recursed): Improved.
1127
1128 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1129
1130         Fix #75417
1131         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1132         Private accessor case, using TypeManager.IsPrivateAccessible instead of
1133         invocation_type == mi.DeclaringType, since the first one also checks
1134         other condition used by generic instances.
1135         
1136 2005-07-27  Martin Baulig  <martin@ximian.com>
1137
1138         * anonymous.cs (CaptureContext.AddField): Added
1139         `AnonymousContainer am' argument; compute its toplevel scope if
1140         it's not already computed.  Fixes #75649.
1141
1142 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1143
1144         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1145         CheckAttributeType and refactored.
1146         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1147         ResolveAsTypeTerminal error handling.
1148         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1149         handling.
1150         (GetSignatureForError): Print errors in same way.
1151
1152         * class.cs,
1153         * codegen.cs: Reflect attribute GetSignatureForError change.
1154
1155         * ecore.cs,
1156         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1157
1158         * namespace.cs (UsingEntry): Refactored to make fields private.
1159
1160         * assign.cs,
1161         statement.cs: Error_UnexpectedKind has extra parameter.
1162
1163 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1164
1165         * ecore.cs (IAlias): Remove.
1166         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1167         that implement the interface.
1168         * namespace.cs (Namespace): Likewise.
1169         (Namespace.declspaces): Renamed from 'defined_names'.
1170         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1171         DeclSpace instead of an IAlias.
1172         * tree.cs (Tree.AddDecl): Update.
1173
1174 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1175
1176         * statement.cs (Block.Flags); Remove HasVarargs.
1177         (Block.HasVarargs): Move to ToplevelBlock.
1178         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1179         (Block.Variables): Make protected.  Initialize variable hashtable
1180         if necessary.
1181         (Block.AddVariable): Update.
1182         (Block.Resolve): Update to changes.
1183         (ToplevelBlock.HasVarargs): New boolean.
1184         (ToplevelBlock.ThisVariable): Move here from Block.
1185         (ToplevelBlock.AddThisVariable): Likewise.
1186         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1187         * expression.cs (This.ResolveBase): Update to changes.
1188         (ArglistAccess.DoResolve): Likewise.
1189
1190 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1191
1192         Fix #75321
1193         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1194
1195         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1196         not used and not used & assigned.
1197         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1198
1199 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1200
1201         Fix #75053
1202         * expression.cs (Is.DoResolve): null is never provided type.
1203
1204 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1205
1206         Fix #52496
1207         * cs-parser.jay: Less strict event error rule to catch more errors.
1208
1209 2005-07-11  Martin Baulig  <martin@ximian.com>
1210
1211         * generic.cs (ConstructedType.CheckConstraints): Improve the check
1212         for the constructor constraint: we do not only have to check
1213         whether the class has a public constructor, but also ensure that
1214         it's parameterless.  Fixes #75492.
1215
1216 2005-07-11  Martin Baulig  <martin@ximian.com>
1217
1218         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1219         between type parameters if they either have the reference type
1220         constraint or the class constraint.
1221
1222 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
1223
1224         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1225
1226 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1227
1228         Fix #74975
1229         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1230         (ExtractSecurityPermissionSet): Cope with self referencing security
1231         attributes properly.
1232
1233         * driver.cs (SetOutputFile): Made public property OutputFile.
1234
1235 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1236
1237         Fix #75486.
1238         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1239         has_nonstatic_fields.  Make into a FieldBase pointer.
1240         (TypeContainer.AddField): Add CS0282 check.
1241         (TypeContainer.EmitType): Update.
1242
1243 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1244
1245         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1246         compare if they start with __.
1247
1248 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1249
1250         * statement.cs (Switch.SwitchGoverningType): Only look at
1251         UserCasts that don't need implicit standard conversions to one of
1252         the allowed switch types (Fixes test-322.cs).
1253         (LocalInfo.Resolve): Re-enable sanity-test.
1254
1255 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1256
1257         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1258         
1259         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1260         
1261         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1262
1263 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1264
1265         Fix #75472.
1266         * ecore.cs (SimpleName.GetSignatureForError): Add.
1267         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1268         (MemberAccess.GetSignatureForError): Add.
1269
1270 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1271  
1272         The big error and warning messages review.
1273         
1274         * anonymous.cs,
1275         * assign.cs,
1276         * attribute.cs,
1277         * class.cs,
1278         * codegen.cs,
1279         * convert.cs,
1280         * cs-parser.jay,
1281         * cs-tokenizer.cs,
1282         * decl.cs,
1283         * delegate.cs,
1284         * doc.cs,
1285         * driver.cs,
1286         * ecore.cs,
1287         * enum.cs,
1288         * expression.cs,
1289         * flowanalysis.cs,
1290         * iterators.cs,
1291         * literal.cs,
1292         * location.cs,
1293         * modifiers.cs,
1294         * namespace.cs,
1295         * parameter.cs,
1296         * pending.cs,
1297         * report.cs,
1298         * rootcontext.cs,
1299         * statement.cs,
1300         * support.cs,
1301         * tree.cs,
1302         * typemanager.cs: Updated.
1303         
1304         * class.cs: (MethodCore.SetYields): Moved here to share.
1305         (PropertyMethod.Define): Moved iterator setup here.
1306         
1307         * iterators.cs: Add orig_method to have full access to parent
1308         container.
1309
1310 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1311
1312         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1313         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1314         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1315         variable of struct type.
1316         * expression.cs (Unary.ResolveOperator): Update to change.
1317         (Indirection.VerifyFixed): Likewise.
1318         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1319         (ParameterReference.VerifyFixed): Value parameters are fixed.
1320         (This.VerifyFixed): Treat 'this' as a value parameter.
1321         * statement.cs (LocalInfo.IsFixed): Remove.
1322
1323 2005-07-01  Martin Baulig  <martin@ximian.com>
1324
1325         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1326         `ec.EmitThis ()' to get the correct scope.
1327
1328 2005-07-01  Martin Baulig  <martin@ximian.com>
1329
1330         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1331         instance is a ParameterReference; fixes #75299.
1332
1333 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1334
1335         Fix #75412.
1336         * expression.cs (Indexers.map): Remove.
1337         (Indexers.Append): Filter out inaccessible setters and getters.
1338         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1339
1340         Fix #75283.
1341         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1342         Refactored from ...
1343         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1344         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1345         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1346         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1347
1348 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1349
1350         Fix #75322
1351         * class.cs (FieldBase.GetInitializerExpression): One more field
1352         for backup.
1353
1354 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1355
1356         * pending.cs: Do not define a proxy if the base method is virtual,
1357         it will be picked up by the runtime (bug 75270).
1358
1359 2005-07-08  Martin Baulig  <martin@ximian.com>
1360
1361         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1362         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1363
1364 2005-07-07  Martin Baulig  <martin@ximian.com>
1365
1366         * generic.cs (ConstructedType.CheckConstraint): Use
1367         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1368         called recursively; fixes #75329.
1369
1370 2005-07-06  Martin Baulig  <martin@ximian.com>
1371
1372         * generic.cs (TypeManager.InferTypeArguments): Added support for
1373         anonymous methods; fixes #75461.
1374
1375 2005-07-01  Martin Baulig  <martin@ximian.com>
1376
1377         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1378         `ec.EmitThis ()' to get the correct scope.
1379
1380 2005-07-01  Martin Baulig  <martin@ximian.com>
1381
1382         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1383         instance is `This'; fixes #75299.
1384
1385 2005-06-30  Martin Baulig  <martin@ximian.com>
1386
1387         * class.cs (Indexer): Implement IIteratorContainer; added support
1388         for iterators in indexers.
1389
1390         * codegen.cs
1391         (EmitContext.CurrentIterator): Make this a property, not a field.
1392
1393         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1394
1395 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1396
1397         * pending.cs: Do not define a proxy if the base method is virtual,
1398         it will be picked up by the runtime (bug 75270).
1399
1400 2005-06-28  Martin Baulig  <martin@ximian.com>
1401
1402         * cs-parser.jay (interface_method_declaration): Avoid a
1403         reduce/reduce conflict by moving some of the code into a separate
1404         `interface_method_declaration_body' rule; fixes #75368.
1405
1406 2005-06-28  Martin Baulig  <martin@ximian.com>
1407
1408         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1409         array check after the check for TypeBuilder's.
1410
1411 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1412
1413         * convert.cs (FindMostEncompassedType): Add two trivial special
1414         cases (number_of_types == 0 || number_of_types == 1).
1415         (FindMostEncompasingType): Likewise.
1416
1417 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1418
1419         Some cleanups preparing for the fix of #75283.
1420         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1421         error testing.
1422         (EventExpr.InstanceResolve): Likewise.
1423         (EventExpr.DoResolve): Remove redundant checks.
1424
1425 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1426
1427         * class.cs: Small fix.
1428
1429 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1430
1431         Fix #75160.
1432         * class.cs (GetPartialBases): Fix return value check of
1433         part.GetClassBases.
1434
1435 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1436
1437         Ensure that partial classes are registered in their enclosing
1438         namespace.  Initial part of fix of #75160.
1439         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1440         Register declspace with namespace here, not in
1441         DeclSpace.RecordDecl.
1442         * cs-parser.jay: Pass namespace to RecordDecl.
1443         * class.cs (PartialContainer.Create): Likewise.
1444         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1445         called.
1446         * decl.cs (Declspace.RecordDecl): Remove.
1447         * namespace.cs (NamespaceEntry.DefineName): Remove.
1448
1449 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1450
1451         * rootcontext.cs: Reset TargetExt as well.
1452
1453 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1454
1455         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1456         -langversion:ISO-1.
1457
1458 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1459
1460         Fix #75080, cs0119.cs.
1461         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1462         of ...
1463         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1464         allowing ExprClass.Type and ExprClass.Namespace for
1465         ResolveFlags.VariableOrValue.
1466         (Expression.Resolve) [1-argument variant]: Change default resolve
1467         flags based on language version.
1468         (Expression.Error_UnexpectedKind): Use a simple string array
1469         rather than an ArrayList.
1470         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1471         not ExprClass.Type.
1472         (TypeOfVoid.DoResolve): Likewise.
1473         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1474         flags argument -- it always has the same value.
1475
1476 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1477
1478         Fix #75081.
1479         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1480         Use it in the error message.
1481         * assign.cs, expression.cs, statement.cs: Update.
1482
1483 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1484
1485         Fix #75088.
1486         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1487         the "almostMatchedMember" case too.
1488         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1489         that failed the accessibility checks to 'almost_match'.
1490
1491 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1492
1493         * attribute.cs: Use internal MethodBuilder methods to set
1494         ExactSpelling and SetLastError on PInvoke methods, instead
1495         of passing them via charset.  Fixes #75060.
1496
1497 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1498
1499         * parameter.cs (Parameter): Remove TODO comment.
1500         (Parameter.DefineParameter): Remove Location parameter.
1501         (Parameters.LabelParameters): Likewise.
1502         * class.cs (Constructor.Emit): Update to change.
1503         (MethodData.Emit): Likewise.
1504         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1505         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1506
1507 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1508
1509         * parameter.cs,
1510           Removed Parameters.Location and added Parameter.Location instead.
1511           Removed Location parameter from Emit() and GetSignature().
1512         * anonymous.cs,
1513           class.cs,
1514           cs-parser.jay,
1515           delegate.cs,
1516           iterators.cs,
1517           statement.cs :
1518           Modified all related calls.
1519
1520 2005-06-21  Martin Baulig  <martin@ximian.com>
1521
1522         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1523         left-hand side is not a nullable type; fixes #75328.
1524
1525 2005-06-21  Martin Baulig  <martin@ximian.com>
1526
1527         * typemanager.cs
1528         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1529         (TypeManager.GetFullNameSignature): Likewise.
1530
1531         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1532         `source.FullName' and `target.FullName' to check whether there are
1533         two conflicting definitions.
1534
1535 2005-06-21  Martin Baulig  <martin@ximian.com>
1536
1537         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1538         a BoxedCast - also for reference types - to be compatible with csc.
1539
1540 2005-06-21  Martin Baulig  <martin@ximian.com>
1541
1542         * expression.cs (MemberAccess.DoResolve): Add support for nested
1543         types in a generic instance; fixes #75320.
1544
1545 2005-06-20  Martin Baulig  <martin@ximian.com>
1546
1547         * generic.cs (TypeManager.InferType): Also walk the class
1548         hierarchy for generic instances; fixes #75261.
1549
1550 2005-06-17  Martin Baulig  <martin@ximian.com>
1551
1552         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1553         to make things work for corlib.
1554
1555 2005-06-15  Martin Baulig  <martin@ximian.com>
1556
1557         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1558         obsolete `SecurityAction' values.
1559
1560 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1561
1562         * rootcontext.cs: Reset TargetExt as well.
1563         
1564 2005-06-09  Martin Baulig  <martin@ximian.com>
1565
1566         * delegate.cs (Delegate.VerifyMethod): Added
1567         `MethodGroupExpr old_mg' argument; inherit its
1568         `HasTypeParameters'; fix #75085.
1569
1570 2005-06-09  Martin Baulig  <martin@ximian.com>
1571
1572         * expression.cs (Invocation.OverloadResolve): Correctly handle
1573         generic methods for the SetMemberIsUsed(); fix #75064.
1574
1575 2005-06-09  Martin Baulig  <martin@ximian.com>
1576
1577         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1578         fixes #75062.
1579
1580 2005-06-08  Martin Baulig  <martin@ximian.com>
1581
1582         * cs-parser.jay (nullable_type_or_conditional): If we put the
1583         nullable back and our `type' is a `ComposedCast', remove the
1584         nullable from it.  Fixes #75156.
1585
1586         * expression.cs (ComposedCast.RemoveNullable): New public method.
1587
1588 2005-06-08  Martin Baulig  <martin@ximian.com>
1589
1590         The big Iterators rewrite :-)
1591
1592         * iterators.cs: Rewrite this to use the anonymous methods framework.
1593
1594         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1595         before the TypeContainers; see 2test-21.cs.
1596
1597         * class.cs
1598         (TypeContainer.DefineType): Don't create a new EmitContext if we
1599         already have one (this only happens if we're an Iterator).
1600         (TypeContainer.Define): Also call Define() on all our iterators.
1601         (Method.CreateEmitContext): Added support for iterators.
1602
1603         * anonymous.cs
1604         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1605         (AnonymousContainer.CreateMethodHost): Moved here from
1606         AnonymousMethod and made abstract.
1607         (AnonymousContainer.CreateScopeType): New abstract method.
1608         (AnonymousContainer.IsIterator): New public property.
1609         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1610         get the ScopeTypeBuilder rather than manually defining it here. 
1611         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1612         iterators here.
1613
1614         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1615         before RootContext.DefineTypes().
1616
1617         * codegen.cs (EmitContext.RemapToProxy): Removed.
1618         (EmitContext.CurrentAnonymousMethod): Changed type from
1619         AnonymousMethod -> AnonymousContainer.
1620         (EmitContext.ResolveTopBlock): Protect from being called twice.
1621         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1622         (EmitContext.EmitThis): Removed the iterators hacks; use the
1623         anonymous methods framework for that.
1624
1625         * statement.cs
1626         (ToplevelBlock.Container): Make this a property, not a field.
1627         (ToplevelBlock.ReParent): New public method; move the
1628         ToplevelBlock into a new container.
1629         (Foreach.TemporaryVariable): Simplify.
1630
1631 2005-06-05  Martin Baulig  <martin@ximian.com>
1632
1633         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1634         (Block.AddTemporaryVariable): New public method; creates a new
1635         `LocalInfo' for a temporary variable.
1636         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1637         variables here.
1638         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1639         non-iterator variables.
1640
1641 2005-06-05  Martin Baulig  <martin@ximian.com>
1642
1643         * statement.cs (Foreach.TemporaryVariable): Create the
1644         LocalBuilder in the Emit phase and not in Resolve since in some
1645         situations, we don't have an ILGenerator during Resolve; see
1646         2test-19.cs for an example.
1647
1648 2005-06-04  Martin Baulig  <martin@ximian.com>
1649
1650         The big Foreach rewrite - Part II.
1651
1652         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1653         with `PropertyInfo ienumerator_getcurrent'.
1654
1655         * codegen.cs (VariableStorage): Removed.
1656
1657         * statement.cs
1658         (Foreach): Derive from Statement, not ExceptionStatement.
1659         (Foreach.CollectionForeach): New nested class.  Moved all the code
1660         dealing with collection foreach here.
1661         (Foreach.ForeachHelperMethods): Removed.
1662         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1663
1664 2005-05-23  Martin Baulig  <martin@ximian.com>
1665
1666         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1667         don't need to.  Fix #75014.
1668
1669 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1670
1671         Improve user-defined conversion handling.
1672         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1673         applicable operators.
1674         (AddConversionOperators): New.  Helper for GetConversionOperators.
1675         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1676         there is only one most encompassed/encompassing type.
1677         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1678         "applicable operator" handling.
1679         (UserConversion): Move cache here from GetConversionOperators.
1680         Directly cache the chosen operator, rather than the whole
1681         MethodGroup.
1682         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1683         case.  Allow conversion of decimal to sbyte and byte too.
1684         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1685         New static methods.  Used to avoid allocating EmptyExpressions in
1686         convert.cs.
1687
1688 2005-05-24  Duncan Mak  <duncan@novell.com>
1689
1690         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1691         another class, used in Convert.ExplicitNumericConversion.
1692         (CastToDecimal): New class, similar to above, but casts to
1693         System.Decimal, used in Convert.ImplicitNumericConversion and also
1694         in explicit convesion from double/float to decimal.
1695
1696         * convert.cs (ImplicitNumericConversion): Handle implicit
1697         conversions to System.Decimal.
1698         (ExplicitNumericConversion): handle explicit conversions to
1699         System.Decimal.
1700
1701         This fixes #68711.
1702         
1703 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1704
1705         * typemanager.cs: Do not throw an exception in the TypeBuilder
1706         case, we take care of it on the TypeCode.
1707
1708 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1709         
1710         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1711         is back.
1712         
1713         * cs-parser.jay: Catch more lexical errors.
1714         
1715         * report.cs: Add one more Error method.
1716         
1717         * rootcontext.cs,
1718         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1719
1720 2005-05-20  Martin Baulig  <martin@ximian.com>
1721
1722         * class.cs (TypeContainer.CircularDepException): Removed.
1723         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1724         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1725         (CS0146) and interface (CS0529) dependencies here.
1726
1727 2005-05-20  Martin Baulig  <martin@ximian.com>
1728
1729         * expression.cs (New.DoResolve): Move the CS0712 check above the
1730         CS0144 check; otherwise it can never be reached.
1731
1732 2005-05-20  Martin Baulig  <martin@ximian.com>
1733
1734         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1735
1736 2005-05-20  Martin Baulig  <martin@ximian.com>
1737
1738         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1739
1740         * typemanager.cs (TypeManager.IsAttributeType): New public method.
1741
1742 2005-05-19  Martin Baulig  <martin@ximian.com>
1743
1744         * delegate.cs
1745         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1746         to disable error reporting.
1747
1748         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1749         here since we don't want to report an error; see the new test-336.cs.
1750
1751 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1752
1753         * statement.cs (ToplevelBlock.GetParameterReference)
1754         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1755         Move here from class Block.
1756         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1757         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1758
1759 2005-05-18  Martin Baulig  <martin@ximian.com>
1760
1761         Fix #74978.
1762
1763         * flowanalysis.cs
1764         (FlowBranching.Reachability): Add non-static public And() and Or()
1765         methods.
1766         (FlowBranchingSwitch): New class; do the `break_origins' thing
1767         like in FlowBranchingLoop.
1768         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1769         reachability, not just locals and parameters.
1770         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1771         switch; MergeBreakOrigins() now takes care of that.
1772
1773 2005-05-18  Martin Baulig  <martin@ximian.com>
1774
1775         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1776         a loop and may leave it, reset the barrier; fixes #74974.
1777
1778 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1779
1780         Fix test-382.cs.  Emit values of decimal constants.
1781         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1782         Carved out of ...
1783         (TypeContainer.AddField): ... this.
1784         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1785         with initializers to include 'Const's.
1786         (ClassPart.RegisterFieldForInitialization): Forward to
1787         PartialContainer.
1788         * const.cs (Const.Const): Pass initializer to base class.
1789         (Const.Define): In case of decimal constants, register them for
1790         initialization in a static constructor.
1791
1792 2005-05-14  Martin Baulig  <martin@ximian.com>
1793
1794         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1795         do not call ResolveUnreachable() on unreachable statements in
1796         here, see the comment in the source code.
1797
1798 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1799
1800         Fix #74934.
1801         * expression.cs (BinaryResolveOperator): If one of the operands of
1802         an equality comparison is 'null' and the other is a pointer type,
1803         convert the null to a NullPointer.
1804         * convert.cs (ImplicitReferenceConversion): If the expression is a
1805         NullLiteral and the target type is a pointer type, return a
1806         NullPointer instead.
1807         (ImplicitConversionStandard): Likewise.
1808
1809 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1810         
1811         * cs-parser.jay: Set readonly context based on special constructs.
1812         
1813         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1814         readonly variable error handling.
1815         
1816         * rootcontext.cs (EmitCode): Don't verify members when error
1817         occurred.
1818         
1819         * statement.cs (LocalInfo): Add reaodnly context information.
1820         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1821
1822 2005-05-17  Martin Baulig  <martin@ximian.com>
1823
1824         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1825         #70970. 
1826
1827 2005-05-13  Martin Baulig  <martin@ximian.com>
1828
1829         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1830         handle unreachable blocks.
1831
1832 2005-05-13  Martin Baulig  <martin@ximian.com>
1833
1834         * class.cs
1835         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1836         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1837         #74905. 
1838
1839 2005-05-13  Martin Baulig  <martin@ximian.com>
1840
1841         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1842         instance variable, not a local.  Fix #74873.
1843         (Block.ResolveUnreachable): Set it to true here.
1844
1845 2005-05-12  Martin Baulig  <martin@ximian.com>
1846
1847         * cs-parser.jay (property_declaration): Pass the `current_class',
1848         not the `current_container' to Property's .ctor.  Fixes #74912.
1849
1850 2005-05-11  Martin Baulig  <martin@ximian.com>
1851
1852         * typemanager.cs (Closure): Copy this from MCS and merge all the
1853         GMCS-specific changes into it.
1854
1855 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1856
1857         Fix #74920.
1858         * typemanager.cs (unmanaged_enclosing_types): New.
1859         (IsUnmanagedType): Avoid infloops by using
1860         'unmanaged_enclosing_types' to talk with recursive invocations.
1861
1862 2005-05-11  Duncan Mak  <duncan@novell.com>
1863
1864         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1865         continuing to process for 'arg'.
1866         (handle_preprocessing_directive): Check the argument of the #endif
1867         directive and report error CS1025 if there are any trailing
1868         characters.
1869
1870         According to the C# spec, having even whitespace after the #endif
1871         directive is illegal; however, because we call arg.TrimEnd ()
1872         beforehand, we have the same behavior as csc, allowing whitespace
1873         after the directive.
1874
1875         Fixes #74892.
1876
1877 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1878
1879         Fix #74863.
1880         
1881         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1882         (Constructor.GetObsoleteAttribute): Implemented correctly.
1883
1884 2005-05-10  Martin Baulig  <martin@ximian.com>
1885
1886         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1887         resolve the type; fixes #74864.
1888         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1889         in DoResolve(); fixes #74862.
1890
1891 2005-05-10  Martin Baulig  <martin@ximian.com>
1892
1893         * support.cs (ReflectionParameters.ParameterModifier): Use
1894         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1895         and `ParameterAttributes.In'.  Fixes #74884.
1896
1897 2005-05-10  Martin Baulig  <martin@ximian.com>
1898
1899         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1900         the cache if we're just looking for `MemberTypes.NestedType' in a
1901         generic instance.
1902
1903         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1904         constraints if we're still resolving the type tree.
1905         (Expression.MemberLookup): If we're resolving the type tree, only
1906         look for `MemberTypes.NestedType' since we're only interested in
1907         getting types.
1908
1909         * class.cs (TypeContainer.DefineType): Don't resolve the type
1910         parameters here; do this later in ResolveType() after the type
1911         tree has been resolved.
1912         (TypeContainer.ResolveType): New public method; this is called
1913         after the type tree is resolved and before the types are being
1914         populated.  We resolve the generic constraints here.
1915         (TypeContainer.DoDefineMember): Check the constraints on our base
1916         class and interfaces.
1917
1918         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1919         set the `ResolvingTypeTree' flag on the EmitContext.
1920
1921         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1922
1923 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1926         
1927         * expression.cs (Argument.GetParameterModifier): Turned to property.
1928         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1929         
1930         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1931         its C# equivalent.
1932         
1933 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1934
1935         Fix #74852.
1936         * decl.cs (MemberCache.AddMethods): Register override methods,
1937         rather than non-override methods.
1938         * typemanager.cs (RegisterOverride): New.
1939         (IsOverride): Update.
1940
1941 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1942
1943         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1944
1945 2005-05-06  Martin Baulig  <martin@ximian.com>
1946
1947         * attribute.cs
1948         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1949         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1950
1951 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1952
1953         Fix #73105.
1954         
1955         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1956         recursive declaration.
1957         
1958         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1959         
1960 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1961
1962         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1963         
1964         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1965
1966 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1967
1968         Fix #74797.
1969         * decl.cs (DeclSpace.FamilyAccessible): 
1970         Use TypeManager.IsNestedFamilyAccessible.
1971
1972         Fix reopened #64812.
1973         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1974         internal'.
1975
1976 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1977             Abin Thomas  <projectmonokochi@rediffmail.com>
1978             Anoob V E  <projectmonokochi@rediffmail.com>
1979             Harilal P R  <projectmonokochi@rediffmail.com>
1980
1981         Fix #64812.
1982         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1983         allow access to all static members.
1984
1985 2005-05-04  Martin Baulig  <martin@ximian.com>
1986
1987         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1988
1989 2005-05-04  Martin Baulig  <martin@ximian.com>
1990
1991         Fix #74655.
1992
1993         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1994         section at the end; make things work if `default' is not the last
1995         section.        
1996
1997 2005-05-04  Martin Baulig  <martin@ximian.com>
1998
1999         Fix #70400.
2000
2001         * statement.cs (Switch): Replaced the `got_default' field with a
2002         `default_section' one.
2003         (Switch.CheckSwitch): Set `default_section' here.
2004         (Switch.Resolve): If we're a constant switch and the constant is
2005         not found, use the default section.
2006
2007 2005-05-03  Martin Baulig  <martin@ximian.com>
2008
2009         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2010
2011         * statement.cs (Foreach.ArrayForeach): New nested class.
2012         (Foreach.TemporaryVariable): New nested class.
2013         (Foreach.EmitArrayForeach): Removed; this is now in the new
2014         ArrayForeach class.
2015
2016 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2017
2018         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2019         more conservative.
2020         (VerifyPendingMethods): Revert change below.
2021
2022         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2023         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2024         that used to trigger warning -28.  Remove warning -28.
2025         * expression.cs (Invocation.OverloadResolve): Use
2026         TypeManager.IsOverride to distinguish override methods.
2027
2028         Fix #74773.
2029         * pending.cs (VerifyPendingMethods): If a base type implements the
2030         requested interface, don't bother checking individual methods of
2031         the base type.  As a side-effect, this prevents the creation of
2032         unnecessary proxies.
2033
2034 2005-05-02  Martin Baulig  <martin@ximian.com>
2035
2036         Fix #70182.
2037
2038         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2039         Also `And' the locals if the old vector is null.
2040         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2041         null; in this case we basically reset all the variables.        
2042
2043 2005-05-02  Martin Baulig  <martin@ximian.com>
2044
2045         Fix #74529.
2046
2047         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2048         Added `FlowBranching branching' argument; always `and' the
2049         variables instead of `or'ing them unless we're an infinite loop.
2050
2051         * statement.cs (While.Resolve): Create a new sibling unless we're
2052         infinite.       
2053
2054 2005-05-02  Martin Baulig  <martin@ximian.com>
2055
2056         Fix #70140.
2057
2058         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2059         arguments; use it instead of creating a new TopLevelBlock.
2060         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2061         our ConstructorInitializer.
2062
2063         * statement.cs
2064         (TopLevelBlock.TopLevelBranching): New public property.
2065         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2066         and create our `TopLevelBranching'.
2067
2068         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2069         anonymous method host, use `block.TopLevelBranching' rather than
2070         creating a new branching.
2071
2072 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2073
2074         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2075         a ScopeInfo, if any of the current children is a child of the new
2076         entry, move those children there.
2077
2078 2005-04-30  Martin Baulig  <martin@ximian.com>
2079
2080         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2081         at the beginning of a SwitchSection.  Fix #73335.
2082
2083 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2084
2085         Fix #74378
2086         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2087         
2088         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2089         (FieldExpr.DoResolve): Obsolete members are ignored for field
2090         initializers.
2091         
2092 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2093
2094         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2095         of arrays detection.
2096
2097         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2098         verification.
2099         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2100
2101         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2102         arrays report.
2103
2104 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2105
2106         * cs-parser.jay: Use the prefered version of -unsafe in error
2107         message.
2108
2109 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2110
2111         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2112         circumstances.
2113
2114 2005-04-20  John Luke  <john.luke@gmail.com>
2115
2116         * driver.cs: fix typo in error message, --outout to --output
2117
2118 2005-04-30  Martin Baulig  <martin@ximian.com>
2119
2120         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2121         handle the .NET 2.x security attributes.
2122
2123 2005-04-30  Martin Baulig  <martin@ximian.com>
2124
2125         * typemanager.cs
2126         (TypeManager.ExpandInterfaces): Don't add things twice.
2127
2128         * class.cs
2129         (TypeContainer.VerifyClsCompliance): Allow generic instances.
2130
2131 2005-04-29  Martin Baulig  <martin@ximian.com>
2132
2133         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2134
2135         * anonymous.cs: Added support for anonymous generic methods.
2136
2137 2005-04-29  Martin Baulig  <martin@ximian.com>
2138
2139         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2140         generic instances.
2141
2142 2005-04-29  Martin Baulig  <martin@ximian.com>
2143
2144         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2145
2146         * expression.cs (New.DoResolve): Fix the CS0304 check.
2147
2148 2005-04-29  Martin Baulig  <martin@ximian.com>
2149
2150         * typemanager.cs (TypeManager.GetFullName): Updated to the new
2151         naming schema.
2152
2153         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2154         explicit interface implementation, compare the interface types.
2155         (MethodData.Define): Use the new naming scheme from the latest
2156         .NET 2.x beta2.
2157         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2158
2159         * decl.cs (MemberName.GetMemberName): Removed.
2160         (MemberName.MethodName, FullName): New properties.
2161
2162 2005-04-25  Raja R Harinath  <rharinath@novell.com>
2163
2164         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2165
2166 2005-04-22  Martin Baulig  <martin@ximian.com>
2167
2168         * generic.cs (GenericMethod): Create the EmitContext in the
2169         `Define()'; in `Define(MethodBuilder)', create the type parameters
2170         before calling `Define()'.  Fixes #73933.
2171
2172 2005-04-22  Martin Baulig  <martin@ximian.com>
2173
2174         * generic.cs
2175         (Constraints.Resolve): Make things work wrt. the new type lookup system.
2176         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2177
2178         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2179         ConstructedType, check its constraints.
2180
2181 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2182
2183         * codegen.cs (InRefOutArgumentResolving): New field.
2184         
2185         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2186         fields outside contructor.
2187         
2188         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2189         
2190 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2191
2192         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2193         parameter code was not completed ever, so it was not as up-to-date
2194         as local variables.  Must finish it.
2195
2196         The bug fix was to compare the Toplevel of the block, not the
2197         current block.  Thanks for Ben for pointing this out. 
2198
2199 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2200
2201         * decl.cs (AddMethods): Use the declaring type of the problem
2202         method to determine if we want to squash a warning.
2203
2204 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2205
2206         * attribute.cs: Removed debug output.
2207
2208         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2209         
2210         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2211         Report.Stderr.
2212         
2213 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2214
2215         Fix #74481.
2216         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2217         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2218         all null comparisons against reference types.
2219
2220 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2221
2222         Fix# 74565
2223         * class.cs (TypeContainer.CircularDepException) New nested
2224         exception class.
2225         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2226         (TypeContainer.DefineType): Removed error, reset InTransit before
2227         exit.
2228         (Class.DefineType): Throw exception when is in Transit.
2229         Catch exception and report error.
2230         (Struct.DefineType): Throw exception when is in Transit.
2231         Catch exception and report error.
2232         (Interface.DefineType): Throw exception when is in Transit.
2233         Catch exception and report error.
2234
2235         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2236         handle nested exception handlers.
2237
2238         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2239         a catch.
2240
2241         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2242         InFinally and InCatch storage.
2243
2244         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2245         (Catch.Resolve): Set and Restore ec.InCatch.
2246         (Try.Resolve): Set and Restore ec.InFinally.
2247         (Try.HasCatch): True when try has catch.
2248
2249 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2250
2251         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2252           for the same event member, so exclude such cases from warning 419.
2253           Fixed bug #74633.
2254
2255 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2256
2257         * expression.cs (Binary.ResolveOperator): Apply patch from John
2258         Luke to fix bug 59864: operators &, | and ^ on enumerations
2259         require that the same enum type on both sides.
2260
2261         * driver.cs: Add warnings to old flag usage, this is to assist
2262         people who produce Makefiles and hope that the Makefiles will be
2263         used on Windows.
2264
2265         * class.cs (TypeContainer.EmitType): Moved the definition of the
2266         special $PRIVATE$ field from the resolve phase to the Emit phase.
2267         During resolve we do not know if we are a struct with
2268         HasExplicitLayout, we know this only after the attributes for the
2269         type are emitted.
2270
2271         Set the FieldOffset to zero on the dummy field that we create for
2272         the class.   Fixes 74590.
2273
2274 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2275
2276         Fix #73834.
2277         * ecore.cs (PropertyExpr.resolved): New.
2278         (DoResolve): Use it to handle a case of double resolution here.
2279         Handle a case of identical-name-and-type-name.
2280         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2281         resolution by storing the results of expression resolution back
2282         into the "probes" array.
2283
2284 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2285
2286         Fix cs0208-7.cs and cs0208-8.cs.
2287         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2288         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2289         error reporting to point out the reason a struct is not unmanaged.
2290
2291 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2292
2293         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2294           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2295
2296 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2297
2298         Fix #74528.
2299         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2300         IdenticalNameAndTypeName here.
2301         (EventExpr.InstanceResolve): Likewise.
2302
2303 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2304
2305         C# 2.0 DefaultCharSetAttribute implementation
2306         
2307         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2308         which allows us to set GlobalNamespace for every resolve.
2309         (Attribute.ResolveArguments): Cut from Resolve.
2310         (Attribute.GetCharSetValue): Returns CharSet named argument.
2311         (Attribute.DefinePInvokeMethod): Gets default charset from
2312         module settings.
2313         (GlobalAttribute.ResolveAsTypeStep): Override.
2314         (GlobalAttribute.ResolveArguments): Override.
2315         
2316         * class.cs (TypeAttr): Is protected.
2317         
2318         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2319         (ModuleClass.DefaultCharSetType): New memeber.
2320         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2321         
2322         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2323         charset from module.
2324         
2325         * delegate.cs (TypeAttr): Override.
2326         (Delegate.DefineType): Use this TypeAttr.
2327         
2328         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2329         at very early stage (before types are defined) to resolve model
2330         module attributes. It will probably not work with corlib but it
2331         should be ok.
2332         
2333         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2334         charset from module.
2335         
2336         * typemanager.cs (default_charset_type): New type.
2337
2338 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2339
2340         * decl.cs (MemberCache.AddMethods): Don't warn if
2341         System.Object.Finalize has buggy MethodAttributes.
2342
2343         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2344         removed below.
2345
2346 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2347
2348         * doc.cs : detect ambiguous reference to overloaded members.
2349           Fixed bug #71603. MS 1.1 csc does not detect it.
2350
2351 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2352
2353         * doc.cs : delegates must not be referenced with parameters.
2354           Fixed bug #71605.
2355
2356 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2357
2358         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2359
2360 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2361
2362         * driver.cs (MainDriver): Stop processing if the CLS stage found
2363         errors. 
2364
2365         (CompilerCallableEntryPoint.InvokeCompiler): Always
2366         reset after execution;   Take a TextWriter argument for the
2367         output.
2368
2369         * report.cs: Use the error stream instead of hardcoding stderr. 
2370
2371 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2372
2373         * class.cs: Reduce code paths to test, too small of an
2374         optimization to make it worth the extra testing.  Always perform
2375         it. 
2376
2377 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2378
2379         Fix #74510.
2380         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2381         operators that had errors reported on them.
2382
2383 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2384
2385         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2386         argument types.
2387         (Attribute.Resolve): Add named argument type checking.
2388         
2389         * class.cs (FixedField.Define): Use IsPrimitiveType
2390         
2391         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2392         
2393         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2394         unsafe parameter types.
2395         
2396         * statement.cs (Using.ResolveExpression): Add better error description.
2397         
2398         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2399         
2400 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2401
2402         Fix #74484.
2403         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2404         AttributeUsageAttribute in the emitcontext of the attribute class,
2405         not in the emitcontext of the attributable entity it was attached to.
2406         * cs-parser.jay: Use 'current_class', not 'current_container',
2407         when creating a GlobalAttribute.
2408
2409 2005-04-08  Alp Toker  <alp@atoker.com>
2410
2411         * pending.cs: The fix to #58413 failed to compile methods implementing
2412         interfaces with/without params modifiers and vice versa, even though
2413         params modifiers aren't part of the signature. Make the modifier check
2414         less strict as in csc.
2415
2416 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2417             Anoob V E  <projectmonokochi@rediffmail.com>
2418             Harilal P R  <projectmonokochi@rediffmail.com>
2419
2420         Fix #58413.
2421         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2422         modifiers of pending methods.
2423         (PendingImplementation.PendingImplementation): Initialize it.
2424         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2425         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2426         with ParameterData.  Add check for modifiers.
2427         * class.cs (MethodData.Define): Update to changes.
2428
2429 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2430
2431         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2432
2433 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2434
2435         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2436         property.
2437         
2438         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2439         
2440         * rootcontext.cs,
2441         * typemanager.cs: Registered RequiredAttributeAttribute.
2442         
2443 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2444
2445         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2446         Warning CS0169 is back at level 3.
2447         (IMethodData.SetMemberIsUsed): New method.
2448         
2449         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2450         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2451         
2452         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2453
2454         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2455         contants.
2456         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2457         is used.
2458         
2459         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2460         is used.
2461         
2462         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2463         to avoid the problems with nested types.
2464
2465 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2466             Anoob V.E  <projectmonokochi@rediffmail.com>
2467             Harilal P.R  <projectmonokochi@rediffmail.com>
2468             Raja R Harinath  <rharinath@novell.com>
2469
2470         Fix #73820.
2471         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2472         attribute.
2473         * typemanager (GetConstructor): Make public.
2474
2475 2005-04-05  John Luke  <john.luke@gmail.com>
2476             Raja R Harinath  <rharinath@novell.com>
2477
2478         Fix #62232.
2479         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2480         struct too.  Return false quicker in a few cases.
2481         (VerifyUnManaged): Use it.
2482
2483 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2484
2485         Fix #74041.
2486         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2487         not 'unreachable_seen'.
2488
2489 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2490
2491         * attribute.cs (Attribute.GetValue): Removed unused.
2492         
2493         * codegen.cs (CodeGen.TrimExt): Removed unused.
2494         
2495         * cs-parser.jay (output): Removed unused.
2496         
2497         * cs-tokenizer.cs (hex_digits): Removed unused.
2498         
2499         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2500         
2501         * expression.cs (Indirection.LoadExprValue): Removed unused.
2502         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2503         
2504         * iterators.cs (Iterator.param_types): Removed unused.
2505         
2506         * statement.cs (Goto.block): Removed unused.
2507         (ToplevelBlock.did): Removed unused.
2508         (Switch.ResolveConstantSwitch): Removed unused.
2509
2510 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2511
2512         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2513         resetting thingy.
2514
2515 2005-04-19  Martin Baulig  <martin@ximian.com>
2516
2517         Merged r42462 from MCS and made it work for GMCS.
2518
2519         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2520
2521         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2522
2523 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2524
2525         Fix #74232 and cs0208-3.cs.
2526         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2527         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2528         unmanaged type.  Don't use FieldBuilders when 't' is a
2529         TypeBuilder.  Use ModFlags and MemberType fields.
2530         * class.cs (MemberBase.member_type): Rename from MemberType.
2531         (MemberBase.MemberType): New property.  Determines member_type on
2532         demand.
2533         (MemberBase.DoDefine): Don't initialize MemberType here.
2534         (FieldMember.Define): Likewise.
2535
2536 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2537
2538         Fix #74241
2539         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2540         Attributes are emitted there.
2541         
2542 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2543
2544         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2545         keyword in 'partial enum' too.
2546         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2547         is not allowed).
2548         Report from Kamil Skalski <nazgul@omega.pl>.
2549
2550         Fix #74309.
2551         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2552         have partial containers too.
2553
2554         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2555         in block' checks to Block.CheckInvariantMeaningInBlock.
2556         * statement.cs (Block.GetKnownVariableInfo): Make private.
2557         (Block.IsVariableUsedInChildBlock): Remove.
2558         (Block.IsVariableUsedInBlock): Likewise.
2559         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2560         conflicting declaration.
2561         (Block.AddVariable): Make error messages less long-winded and more
2562         specific.  Show location of conflicting declaration.
2563         * parameter.cs (Parameters.Location): New readonly property.
2564
2565 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2566
2567         Clean up semantics of invoking ResolveMemberAccess.
2568         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2569         can have an instance, ensure that we pass in a non-TypeExpression
2570         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2571         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2572         argument.  Update to changes and simplify.
2573         (FieldExpr.Emitinstance): Remove CS0120 check.
2574         (PropertyExpr.EmitInstance): Likewise.
2575         * expression.cs (Argument.Resolve): Likewise.
2576         (Invocation.DoResolve): Update to changes in semantics of
2577         InstanceExpression.
2578
2579 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2580
2581         Fix #74241
2582         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2583         customization.
2584         
2585         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2586
2587 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2588
2589         Fix difference in behaviour with commandline invocation.
2590         * driver.cs (Driver.Reset): New.
2591         (CompilerCallableEntryPoint): Call it.
2592
2593         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2594         variable" warnings if the boolean expression failed to resolve.
2595
2596 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2597
2598         * attribute.cs: Fix the union of several permissions when some of them
2599         are unrestricted (so the result isn't an unrestricted permission set).
2600         Fix #74036.
2601
2602 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2603
2604         * ecore.cs (MemberExpr): New class.  Convert from interface
2605         IMemberExpr.
2606         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2607         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2608         error checks.
2609         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2610         (MethodGroupExpr.IsExplicitImpl): Remove.
2611         (Expression.GetFieldFromEvent): Remove.
2612         (SimpleName.MemberStaticCheck): Remove.
2613         (SimpleName.DoSimpleNameResolve): Update to changes.
2614         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2615         (MemberAccess.IdenticalNameAndTypeName): Remove.
2616         (MemberAccess.error176): Move to MemberExpr.
2617         (MemberAccess.DoResolve): Update to changes.
2618         (BaseAccess.DoResolve): Likewise.
2619
2620 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2621
2622         C# 2.0 Conditional attribute class implementation
2623         
2624         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2625         Analyzes class whether it has attribute which has ConditionalAttribute
2626         and its condition is not defined.
2627         
2628         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2629         (Class.IsExcluded): New method. Search for at least one defined
2630         condition in ConditionalAttribute of attribute class.
2631
2632 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2633
2634         * ecore.cs (PropertyExpr): Derive from Expression, not
2635         ExpressionStatement.
2636         (PropertyExpr.EmitStatement): Remove.
2637
2638 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2639
2640         Fix #74060.
2641         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2642         internal field "value__" of an enum be private.  The examples for
2643         "value__" that I found on MSDN all used FieldAttributes.Private.
2644
2645         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2646         Don't mention IL method attribute names.
2647
2648         Fix #47991.  Remove a TODO.
2649         * statement.cs (Block.Toplevel): Make into a field.
2650         (Block.Parameters): Move into ToplevelBlock.
2651         (Block.known_variables): Rename from child_variable_names.
2652         (Block.Block): Remove variants that take Parameters.  Initialize
2653         'Toplevel' with the immediately surrounding toplevel block.
2654         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2655         LocalInfo parameter.
2656         (Block.GetKnownVariableInfo): New.
2657         (Block.IsVariableNameUsedInChildBlock): Update.
2658         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2659         the block, even though it may not be in scope.
2660         (Block.AddVariable): Remove Parameters parameter.  Use
2661         Toplevel.Parameters instead.
2662         (Block.AddConstant): Remove Parameters parameter.
2663         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2664         (Block.IsParamaterReference): Likewise.
2665         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2666         (ToplevelBlock.Parameters): New.  Moved from Block.
2667         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2668         initialize Parameters to a non-null value.
2669         * cs-parser.jay: Update to changes.
2670         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2671         simple names that mean different things in the same block.  Use
2672         Block.IsVariableNameUsedInBlock.
2673
2674 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2675
2676         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2677
2678 2005-03-26  Raja R Harinath  <harinath@acm.org>
2679
2680         Fix #73038.
2681         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2682         fails to resolve, ensure that the LHS is still resolved as an
2683         lvalue.
2684
2685 2005-03-25  Raja R Harinath  <harinath@acm.org>
2686
2687         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2688         ec.ContainerType.
2689         (Enum.current_ec): Remove.
2690         (Enum.LookupEnumValue): Remove EmitContext argument.
2691         Just uses the one created during DefineType.
2692         (Enum.FindMembers): Update.
2693         * expression.cs (MemberAccess.DoResolve): Update.
2694
2695 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2696
2697         * assign.cs (Assign.DoResolve): Check for CS1717 when
2698         source and target are same (uses Equals).
2699
2700         * expression.cs (LocalVariableReference, ParameterReference,
2701         This): Implemented Equals, GetHashCode.
2702
2703         * statement.cs (Block.GetParameterReference): Removed useless
2704         local variable.
2705
2706 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2707
2708         Fix cs0128.cs
2709         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2710         blocks before deciding whether the error is cs0136 or cs0128.
2711
2712         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2713         (using_alias_directive, using_namespace_directive): Pass
2714         MemberName, not an expression to Namespace.UsingAlias and
2715         Namespace.Using.
2716         (MakeName): Use the MemberName of the namespace.
2717         * namespace.cs (Namespace.MemberName): New.
2718         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2719         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2720         Likewise.
2721         * decl.cs (MemberName.Name): Make readonly.
2722         (MemberName.FromDotted): New "constructor".
2723         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2724         (MemberCore.Name): Compute from MemberName on demand.
2725         (MemberCore.SetMemberName): Provide a way to change the
2726         MemberName.
2727         (MemberCore.AddToContainer): Don't take a fullname parameter.
2728         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2729         fully qualified name of the container to the member name.
2730         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2731         only if the type is a member of the root container.
2732         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2733         MemberName.Left rather than searching for an embedded ".".
2734         (PartialContainer.CreatePart): Update to changes in RootContext.
2735         (MemberBase.ShortName): Turn into a property.  Use
2736         MemberCore.SetMemberName.
2737         (MemberBase.ExplicitInterfaceName): Remove.
2738         (MemberBase.UpdateMemberName): Remove.
2739         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2740         (PropertyBase.SetMemberName): New override.
2741         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2742         (Tree.GetDecl): New.
2743         (Tree.AllDecls): Rename from Decls.
2744         * attribute.cs, enum.cs, report.cs: Update to changes.
2745         * driver.cs (MainDriver): Use MemberName.FromDotted on
2746         RootContext.MainClass.
2747
2748 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2749
2750         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2751         checks.
2752
2753         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2754
2755 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2756
2757         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2758         property accessor modifiers.
2759
2760         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2761         fixed buffer attribute (CS1716).
2762         (PropertyMethod.HasCustomAccessModifier): When property accessor
2763         has custom modifier.
2764
2765         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2766         modifiers.
2767         (PropertyExpr.DoResolveLValue): Add CS0272.
2768
2769 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2770
2771         * convert.cs: When converting to a pointer, use the proper Conv.U
2772         or Conv.I depending on the source data type.
2773
2774         * cs-tokenizer.cs: Make the size for large decimal constants,
2775         fixes #72957.
2776
2777 2005-03-17  Martin Baulig  <martin@ximian.com>
2778
2779         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2780         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2781
2782 2005-03-17  Martin Baulig  <martin@ximian.com>
2783
2784         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2785         to bool so we can return an error condition.
2786         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2787         returned an error.
2788
2789 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2790
2791         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2792         attributes.
2793
2794 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2795
2796         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2797         Refactor to avoid traversing the list of assemblies, and to avoid
2798         string concatenation.
2799         * typemanager.cs (guid_attr_type): Remove.
2800         (negative_hits, pointers, references): Remove hashes.
2801         (type_hash): New.
2802         (GetConstructedType): New.  Uses type_hash to handle constructed
2803         types (arrays, references, pointers).
2804         (GetReferenceType, GetPointerType): Use it.
2805         (GetNestedType): New.  Uses type_hash to handle nested types of
2806         reflected types.
2807         (LookupType, LookupTypeDirect): Remove.
2808         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2809         'types' hash and LookupTypeReflection directly.
2810         (params_string, params_object): Use GetConstructedType.
2811         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2812         top-level types.
2813         (Namespace.Lookup): Use cached_types.
2814         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2815         provided by old TypeManager.LookupType.
2816         * rootcontext.cs (MakeFQN): Remove.
2817         * decl.cs (DeclSpace.MakeFQN): Likewise.
2818         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2819         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2820         TypeManager.GetConstructedType.
2821         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2822
2823 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
2824
2825         * cs-parser.jay: Fix build.
2826
2827 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2828
2829         * class.cs (TypeContainer.CircularDepException) New nested
2830         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2831
2832         * cs-parser.jay: Reports CS1527 for any namespace element.
2833
2834         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2835         Added CS0407.
2836
2837         * expression.cs (ParameterReference.IsAssigned): Changed error to
2838         CS0269.
2839         (Error_WrongNumArguments): Moved CS0245 detection here.
2840
2841         * statement.cs (Return.Resolve): Add CS1622 report.
2842
2843 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2844
2845         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2846
2847 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2848
2849         * attribute.cs expression.cs: Get rid of some allocations.
2850
2851 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2852
2853         * doc.cs : just eliminate the latest change.
2854
2855 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2856
2857         * doc.cs : commented out the latest change. It breaks xml-030.cs
2858
2859 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2860
2861         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2862           fail. So invoke CreateType() in FindDocumentedType().
2863
2864 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2865
2866         * cs-tokenizer.cs : added IsKeyword().
2867         * doc.cs : Detect keyword incorrectly used as identifier.
2868           Allow identifiers prefixed by @.
2869
2870 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2871
2872         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2873         It caused exception in namespace resolving (again!).
2874         
2875         * class.cs (Class.ctor): Removed exit.
2876         (PropertyMethod.ctor): ditto.
2877         
2878         * codegen.cs (Codegen.Reset): Reset static data.
2879         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2880         
2881         * cs-tokenizer.cs (Cleanup): Removed.
2882         
2883         * driver.cs (GetSystemDir): Rewrote to one line command.
2884         It caused problem with unloaded dynamic modules.
2885         (UnixParseOption): Removed Exit.
2886         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2887         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2888         Now can be mcs used as library.
2889         
2890         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2891         empty location.
2892         
2893         * location.cs (Reset): Reset static data.
2894         
2895         * namespace.cs (Reset): Reset static data.
2896         
2897         * report.cs (Report.Reset): Reset static data.
2898         
2899         * rootcontext.cs (RootContext.Reset): Reset static data.
2900         
2901         * tree.cs (RootTypes.ctor): Use Location.Null
2902         
2903         * typemanager.cs (TypeManager.Reset): Reset static data.
2904         (CoreLookupType): Removed Exit.
2905         (TypeHandle.Reset): Reset static data.
2906         
2907 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2908
2909         Fix #73516.
2910         * typemanager.cs (ComputeNamespaces): Import namespaces from
2911         referenced modules too.
2912
2913 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2914
2915         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2916         than '.'.
2917
2918 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2919
2920         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2921         enclosing DeclSpace.  This ensures that a name-lookup populates
2922         more caches and there are fewer 'TypeExpression's.  Carve out
2923         nested type lookup into ...
2924         (LookupNestedTypeInHierarchy): ... this.
2925
2926 2005-04-15  Martin Baulig  <martin@ximian.com>
2927
2928         Merged r41590 from MCS and make it work in the generics land.
2929
2930         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2931         `check' argument.
2932
2933         * class.cs (PartialContainer.UpdateConstraints): Removed.
2934         (PartialContainer.CheckConstraints): Removed.
2935         (PartialContainer.SetParameterInfo): Store the constraints here.
2936         (PartialContainer.DefineTypeParameters): New public method;
2937         resolve the type parameter's constraints here.  Note that the
2938         PartialContainer doesn't have an EmitContext anymore, so we must
2939         do this in the ClassPart.
2940
2941 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2942
2943         Clean up a few partial-class semantics.  
2944         Fixes test-357.cs and cs1618-2.cs.
2945         * cs-parser.jay (struct_declaration): Use 'current_class' as
2946         parent of newly-created struct.  Remove call to Register ().
2947         Use 'pop_current_class' to complete handing the current struct.
2948         (interface_declaration): Likewise.
2949         (class_declaration): Likewise.
2950         (enum_declaration): Use 'current_class' as parent of newly created
2951         enum.
2952         (delegate_declaration): Likewise.
2953         (pop_current_class): New function.  This is used to handle closing
2954         up the 'current_class' and 'current_container', and pointing them
2955         to the enclosing class/container.
2956         (CSharpParser): Initialize 'current_class' too.
2957         * decl.cs (MemberCore): Add check for invariant: a partial
2958         container is not a parsed entity, and thus does not enclose any
2959         parsed members.
2960         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2961         (DeclSpace.BaseTypeExpr): Use it.
2962         (DeclSpace.LookupType): Add check for invariant.
2963         * class.cs (TypeContainer): Add check for invariant: a nested
2964         class should have the same NamespaceEntry as its enclosing class.
2965         (TypeContainer.EmitFieldInitializers): Make virtual.
2966         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2967         MemberCore.
2968         (TypeContainer.Register): Remove.
2969         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2970         null.  Use TypeResolveEmitContext for resolving base types and
2971         interfaces.  Move initialization of Parts.TypeBuilder here from
2972         ...
2973         (TypeContainer.DefineNestedTypes): ... here.
2974         (PartialContainer): Take a Namespace not a NamespaceEntry.
2975         (PartialContainer.Create): Don't use Register.  Call the
2976         appropriate Add... function directly.
2977         (ClassPart): Take both the PartialContainer and the enclosing
2978         class as constructor arguments.
2979         (ClassPart.EmitFieldInitializers): Override.
2980         (ClassPart.PartFindNestedTypes): Remove.
2981         (FieldBase.GetInitializerExpression): Resolve the initializer
2982         expression in the emit context of the enclosing class.
2983         * tree.cs (RootTypes): Remove Register ().
2984         
2985 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2986
2987         * cs-parser.jay: Removed CS0134.
2988         
2989         * driver.cs: Removed CS1901.
2990         
2991         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2992         for predefined types.
2993
2994 2005-03-07  Duncan Mak  <duncan@novell.com>
2995
2996         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2997         well. Fixes bug #73454.
2998
2999 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3000
3001         * cs-tokenizer.cs (xtoken): Add CS1035.
3002         
3003         * class.cs (MethodData.Define): Add CS0683.
3004         (FieldMember.ctor): Add CS0681.
3005
3006 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3007
3008         * ecore.cs (SimpleName.DoResolve): Rename from
3009         SimpleName.DoResolveAllowStatic.
3010         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3011         Pass 'intermediate' flag to MemberStaticCheck.
3012         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3013         of "intermediate" lookups via MemberAccess.
3014         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3015         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3016
3017 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3018
3019         Fix #73394.
3020         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3021         slipped in because of variable names that are identical to a
3022         builtin type's BCL equivalent ('string String;', 'int Int32;').
3023         (PropertyExpr.EmitInstance): Likewise.
3024
3025 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3026
3027         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3028         
3029         * report.cs (warning_ignore_table): Made public.
3030
3031 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3032
3033         Fix #73282.
3034         * class.cs (MethodData.Emit): Pass 'container' to
3035         container.GetObsoleteAttribute instead of 'container.Parent'.
3036
3037 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3038
3039         * cs-parser.jay: Add 1534 error test.
3040
3041         * iterators.cs (Yield.CheckContext): Add error 1629.
3042         (Iterator.ctor): Save unsafe modifier.
3043         (MoveNextMethod.DoEmit): Restore unsafe context.
3044
3045         * namespace.cs (UsingAlias): Better error message.
3046
3047 2005-03-03  Dan Winship  <danw@novell.com>
3048
3049         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3050         the warning message [#73219]
3051
3052 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3053
3054         Fix compile with MCS 1.0.0.0.
3055         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3056         w_restore to not depend on string constant folding.
3057
3058 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3059
3060         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3061         CS0246 check to users who passed 'silent = false'.
3062         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3063         check.
3064         (SimpleName.SimpleNameResolve): Update.
3065         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3066         (MemberAccess.IdenticalNameAndTypeName): Update.
3067         * doc.cs (FindDocumentedTypeNonArray): Update.
3068
3069 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3070
3071         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3072         * parameters.cs (ComputeAndDefineParameters): Remove.
3073         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3074         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3075         Use GetParameterInfo.
3076
3077 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3078
3079         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3080
3081 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3082
3083         Unify DeclSpace.LookupType and DeclSpace.FindType.
3084         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3085         is in charge of defining nested types on demand.
3086         (DeclSpace.LookupType): Use it when the current_type is a
3087         TypeBuilder.  Use LookupTypeDirect for reflected types.
3088         (DeclSpace.FindType): Remove.
3089         (DeclSpace.LookupInterfaceOrClass): Likewise.
3090         (DeclSpace.DefineTypeAndParents): Likewise.
3091         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3092         DeclSpace.LookupType.
3093         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3094         * typemanager.cs (LookupType): Simplify.
3095         (AddUserType): Remove type from negative_hits.
3096         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3097         * class.cs (TypeContainer.FindMembers): Move handling of nested
3098         types ...
3099         (TypeContainer.FindMembers_NestedTypes): ... here.
3100         (TypeContainer.FindNestedType): Implement override.
3101         (ClassPart.FindNestedType): Delegate to PartialContainer.
3102         (ClassPart.PartFindNestedType): Looks up the nested types of the
3103         part alone.
3104
3105 2005-04-14  Martin Baulig  <martin@ximian.com>
3106
3107         * generic.cs (ConstructedType): Moved all the type lookup and
3108         nested class logic into SimpleName.
3109         (ConstructedType.ResolveConstructedType): Our underlying type is
3110         already fully resolved; all the type lookup stuff is in
3111         SimpleName.
3112
3113         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3114         constructed types here instead of in ConstructedType.
3115
3116         * decl.cs (MemberName.GetTypeExpression): Always create a
3117         SimpleName, not a ConstructedType.
3118         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3119
3120 2005-03-02  Martin Baulig  <martin@ximian.com>
3121
3122         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3123         static constructor in static classes.
3124
3125 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3126
3127         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3128         sizeParamIndex is not specified.
3129
3130 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fix #73117
3133         * report.cs (WarningMessage.IsEnabled): Missing null check.
3134
3135 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3136
3137         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3138         in the fields and not in the properties.
3139
3140 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3141
3142         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3143         fields as well.
3144
3145 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3146
3147         * attribute.cs: Small refactoring (improved robustness).
3148         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3149         (ValidateGuid): Removed.
3150         (Resolve): Removed referenced to above mentioned.
3151         (GetAttributeUsage): Made private and changed to work without
3152         class assistance.
3153         (GetIndexerAttributeValue): Don't crash.
3154         (GetConditionalAttributeValue): Ditto.
3155         (GetClsCompliantAttributeValue): Ditto.
3156         (ExtractSecurityPermissionSet): All attributes exceptions are
3157         error 648.
3158         (GetPropertyValue): New helper.
3159         (GetMethodImplOptions): New method.
3160         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3161         some missing properties.
3162         
3163         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3164         (Method.ApplyAttributeBuilder): Updated.
3165         
3166         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3167         exception.
3168
3169 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3170
3171         Fix #73052.
3172         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3173         non-simple types (array, pointer, reference).
3174
3175 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3176
3177         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3178
3179         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3180         for operators.
3181         (Method.CheckBase): Catch wrong destructor here.
3182         (MethodData.Define): Add errors 550, 668.
3183
3184         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3185
3186         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3187
3188         * pending.cs (VerifyPendingMethods): Add error 551.
3189
3190         * typemanager.cs (CSharpName): Next error report helper.
3191
3192 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3193
3194         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3195         attributes. Removed useless attribute double check.
3196         It saves almost 2MBs for corlib.
3197
3198 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3199
3200         Fix #72924.
3201         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3202         called twice in case of error.
3203
3204 2005-02-23  Chris Toshok  <toshok@ximian.com>
3205
3206         Fix compiler portions of #72827.
3207         * statement.cs (Block.Emit): call Begin/EndScope on the
3208         EmitContext instead of the ILGenerator.
3209
3210         * codegen.cs (EmitContext.BeginScope): new method, call
3211         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3212         we have one.)
3213         (EmitContext.BeginScope): same, but EndScope and CloseScope
3214
3215         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3216         offset and call the superclass's OpenScope(int) with it.
3217         (SymbolWriter.CloseScope): get the current il
3218         offset and call superclass's CloseScope(int) with it.
3219
3220 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3221
3222         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3223         CS1677 for out and ref as well.
3224
3225         * class.cs (Method.Define): Add error CS1599 detection.
3226         
3227         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3228         
3229         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3230         
3231         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3232         
3233         * support.cs.cs (ModifierDesc): New helper method.
3234
3235 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3236             Abin Thomas  <projectmonokochi@rediffmail.com>
3237             Anoob V E  <projectmonokochi@rediffmail.com>
3238             Harilal P R  <projectmonokochi@rediffmail.com>
3239
3240         Fix #57851, #72718.
3241         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3242         MemberLookup (used for error reporting) actually returns a result.
3243         Fix error report number (122, not 112).
3244
3245 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3246             Anoob V E  <projectmonokochi@rediffmail.com>
3247             Harilal P R  <projectmonokochi@rediffmail.com>
3248
3249         Fix #71134.
3250         * pending.cs (PendingImplementation.GetAbstractMethods):
3251         Find NonPublic members too.
3252
3253 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3254
3255         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3256         Fixed error 217.
3257         
3258         * class.cs (MethodCore.CheckMethodAgainstBase):
3259         Add error 239 report.
3260
3261 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3262
3263         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3264         
3265         * class.cs (Operator.Define): Add error 217 report.
3266         
3267 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3268
3269         Fix #68955.
3270         * expression.cs (Invocation.IsApplicable): Make public.
3271         (Invocation.IsParamsMethodApplicable): Likewise.
3272         * delegate.cs (Delegate.VerifyApplicability): Don't use
3273         Invocation.VerifyArgumentCompat for parameter applicability
3274         testing.  Use Invocation.IsApplicable and
3275         Invocation.IsParamsMethodApplicable.
3276
3277 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3278
3279         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3280         
3281         * class.cs (Operator.Define): Add error 217 report.
3282         
3283 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3284
3285         * namespace.cs (UsingEntry.Resolve): Undo change below.
3286
3287 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3288
3289         Fix #72756.
3290         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3291         disable the error message when the extended MemberLookup also
3292         fails.
3293         (Expression.MemberLookupFinal): Update.
3294         (SimpleName.DoSimpleNameResolve): Update.
3295         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3296         Don't use MemberLookupFinal.
3297         (New.DoResolve): Update.
3298         (BaseAccess.CommonResolve): Update.
3299
3300 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3301
3302         Fix #72732.
3303         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3304         occured previously, don't resolve again.
3305
3306 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3307
3308         Fix #69949
3309         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3310         argument. Call ResolveAttributeUsage for unresolved.
3311         when types doesn't match ctor arguments.
3312         
3313         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3314         for nested attribute classes.
3315         (Class.attribute_usage): Removed.
3316         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3317         for attribute class.
3318         
3319         * ecore.cs (IsAttribute): Removed.
3320         
3321         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3322         
3323         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3324         now normal types.
3325         (attribute_types): Removed.
3326         (EmitCode): Global attributes are emited as the latest.
3327
3328 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3329
3330         * class.cs (EmitFieldInitializers): Don't emit field initializer
3331         for default values when optimilization is on.
3332         
3333         * constant.cs (Constant.IsDefaultValue): New property.
3334         
3335         * driver.cs: Add /optimize handling.
3336         
3337         * constant.cs,
3338         * ecore.cs,
3339         * literal.cs: Implement new IsDefaultValue property.
3340         
3341         * rootcontext.cs (Optimize): New field, holds /optimize option.
3342
3343 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3344
3345         Fix crasher in re-opened #72347.
3346         * namespace.cs (Namespace.Lookup): Return null if
3347         DeclSpace.DefineType returns null.
3348
3349         Fix #72678.
3350         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3351
3352 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3353
3354         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3355         now returns null if it cannot resolve to an lvalue.
3356         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3357         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3358         returned null.  Remove check for SimpleName.
3359         (EventExpr.DoResolveLValue): New.
3360         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3361         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3362         error from ...
3363         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3364         avoid CS0131 error.
3365         (Unary.ResolveOperator): Move CS0211 check ...
3366         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3367         CS0131 error.
3368         (Unary.DoResolveLValue): Simplify.
3369         (AddressOf.DoResolveLValue): New.
3370         (ArrayAccess.DoResolveLValue): New.
3371
3372 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3373
3374         * attribute.cs (Attribute.Resolve): Add arguments casting for
3375         when types doesn't match ctor arguments.
3376
3377 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3378
3379         Fix parts of #63202.
3380         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3381         lookup of operator in base type.  Ensure that all checks happen
3382         when the operator resolves to an "op_..." method.
3383
3384 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix #71992.
3387         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3388         'ignore_cs0104' parameter.  Pass it to ...
3389         (NamespaceEntry.Lookup): ... this.
3390         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3391         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3392         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3393         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3394         Update.  Request that cs0104 errors be ignored.
3395         (ComposedCast.ResolveAsTypeStep): Update.
3396
3397 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3398
3399         Fix #59209.
3400         * expression.cs (Invocation.BetterFunction): Remove support for
3401         comparing virtual functions and their overrides.
3402         (Invocation.IsOverride): New.
3403         (Invocation.OverloadResolve): Don't consider 'override' functions
3404         during candidate selection.  Store them in a lookaside list.
3405         If the selected method is a 'virtual' function, use the list to
3406         find any overrides that are closer to the LHS type.
3407
3408 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3409
3410         * expression.cs (New.DoResolve): Add complex core type reduction.
3411         (New.Constantify): Converts complex core type syntax like 'new int ()'
3412         to simple constant.
3413         
3414 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3415
3416         * decl.cs (EntryType.EntryType): New constructor to create an
3417         updated copy of a cache entry.
3418         (MemberCache.AddMethods): Use it.
3419         (MemberCache.ClearDeclaredOnly): Remove.
3420         (MemberCache.MemberCache): Update.
3421
3422 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3423
3424         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3425         variable.  This one is represents the actual low-level declaration
3426         of the method, as opposed to the semantic level `IsStatic'.   
3427
3428         An anonymous method which is hosted into a static method might be
3429         actually an instance method.  IsStatic would reflect the
3430         container, while MethodIsStatic represents the actual code
3431         generated.
3432
3433         * expression.cs (ParameterReference): Use the new MethodIsStatic
3434         instead of IsStatic.
3435
3436         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3437         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3438         set on the current EmitContext. 
3439
3440         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3441         resolve our casted expression as an LValue.  This triggers the
3442         proper LValue processing that is later required by Assign.
3443
3444         This fixes 72347.
3445
3446         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3447
3448 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3449
3450         C# 2.0 Fixed buffer implementation
3451
3452         * anonymous.cs: Update after RegisterHelperClass renaming.
3453
3454         * attribute.cs (AttributeTester.fixed_buffer_cache):
3455         Cache of external fixed buffers.
3456         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3457         implementation if field is fixed buffer else null.
3458
3459         * class.cs
3460         (TypeContainer.AddField): Accept FieldMember instead of Field.
3461         (FieldBase.IsFieldClsCompliant): Extracted code from
3462         VerifyClsCompliance descendant customization.
3463         (FixedField): New class handles fixed buffer fields.
3464         (FixedFieldExternal): Keeps information about imported fixed
3465         buffer.
3466         (IFixedField): Make access to internal or external fixed buffer
3467         same.
3468
3469         * cs-parser.jay: Add fixed buffer parsing.
3470
3471         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3472         buffer.
3473
3474         * expression.cs (Indirection): Extended implementation to accept
3475         fixed buffer field.
3476         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3477         (ElementAccess.MakePointerAccess): Get type as parameter.
3478         (DoResolve): Add fixed buffer field expression conversion.
3479         (DoResolveLValue): Ditto.
3480         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3481         (ArrayPtr): Derives from FixedBufferPtr.
3482         (ArrayPtr.Emit): Add extra emit for array elements.
3483
3484         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3485
3486         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3487         for compiler generated types.
3488         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3489
3490         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3491         and consume less memory.
3492         (Fixed.Resolve): Add fixed buffer case.
3493
3494         * typemanager.cs (compiler_generated_attr_ctor,
3495         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3496         (HasElementType): Add our own implementation to work on every
3497         runtime.
3498
3499 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3500
3501         * anonymous.cs (CaptureContext): Track whether `this' has been
3502         referenced.   
3503
3504         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3505         only captured `this' if it was implicitly done (instance
3506         methods/variables were used). 
3507
3508         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3509         `this' must be captured.
3510
3511 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3512  
3513         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3514         is null it means that there has been no need to capture anything,
3515         so we just create a sibling.
3516
3517         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3518
3519         Just a partial fix.  The other half is fairly elusive.
3520         
3521 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3522
3523         Fix #52586, cs0121-4.cs.
3524         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3525         and return a hashtable.
3526         (MemberCache.ClearDeclaredOnly): New.
3527         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3528         the method_hash of a base type too.
3529         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3530         type methods.  Overwrite entries with the same MethodHandle so
3531         that the ReflectedType is correct.  The process leaves in base
3532         virtual functions and their overrides as distinct entries.
3533         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3534         matters since it was boxed in a ArrayList before.
3535         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3536         modifier.
3537         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3538         case of a virtual function and its override (choose the overload
3539         as better).
3540         (Invocation.OverloadResolve): Avoid 'override' members during
3541         'applicable_type' calculation.
3542
3543 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3544
3545         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3546         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3547         GetTypeHandle.  It is possible for a reflected type to derive from
3548         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3549         System.Array during mscorlib compilation).
3550         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3551         contain a method_hash, don't create one either.  Don't create a
3552         deep copy of the base cache's method_hash.
3553         (MemberCache.SetupCache): Rename back from DeepCopy.
3554         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3555         already initialized.  If we see an override function, add its
3556         underlying base virtual function to the member_hash too.
3557
3558 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3559
3560         Combine two near-redundant caches.
3561         * typemanager.cs (method_params): Rename from method_internal_params.
3562         (TypeManager.GetParameterData): New.  Replace
3563         Invocation.GetParameterData.
3564         (TypeManager.LookupParametersByBuilder): Remove.
3565         * expression.cs (Invocation.method_parameter_cache): Remove.
3566         (Invocation.GetParameterData): Remove.
3567         Update to changes.
3568         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3569         Update to changes.
3570
3571 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3572
3573         Fix #72015.
3574         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3575         TypeManager.multicast_delegate_type is null, resolve it by looking
3576         up "System.MulticastDelegate".
3577         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3578
3579 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3580             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3581             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3582
3583         Fix cs0164.cs.
3584         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3585         (LabeledStatement.AddReference): New.  Set 'referenced'.
3586         (Goto.Resolve): Use it.
3587
3588 2005-02-05  John Luke  <john.luke@gmail.com>
3589
3590         * driver.cs: remove duplicate -doc line in Usage ()
3591
3592 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3593
3594         * location.cs (Location.AddFile): Fix CS2002 error report.
3595
3596 2005-02-02  Martin Baulig  <martin@ximian.com>
3597
3598         * delegate.cs (Delegate.DefineType): Report an internal error if
3599         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3600         details.        
3601
3602 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3603
3604         Fix a crasher in a variant of #31984.
3605         * const.cs (Constant.CheckBase): New override that defers the
3606         new-or-override check in case the base type hasn't been populated
3607         yet.
3608         (Constant.Define): Ensure the new-or-override check is performed.
3609
3610 2005-02-01  Duncan Mak  <duncan@ximian.com>
3611
3612         * const.cs (LookupConstantValue): Check that `ce' is not null
3613         before calling GetValue ().
3614
3615 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3616
3617         Fix test-334.cs (#69519).
3618         * cs-parser.jay (using_alias_directive): Pass in an expression to
3619         NamespaceEntry.UsingAlias.
3620         (using_namespace_directive): Pass in an expression to
3621         NamespaceEntry.Using.
3622         (namespace_name): Don't flatten to a string.
3623         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3624         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3625         ResolveAsTypeStep.
3626         (NamespaceEntry.UsingEntry): Likewise.
3627         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3628         changes.
3629         (NamespaceEntry.LookupForUsing): Remove.
3630         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3631         names.
3632         (NamespaceEntry.Lookup): Remove support for dotted names.
3633
3634 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3635
3636         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3637         split into two.
3638         (NamespaceEntry.ImplicitParent): Compute on demand.
3639         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3640         parallels the current.
3641         (NamespaceEntry.LookupForUsing): Use it.
3642         (NamespaceEntry.Lookup): If the current namespace-entry is
3643         implicit, don't search aliases and using tables.
3644
3645 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3646
3647         Fix #31984.
3648         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3649         BaseCache here.
3650         (TypeContainer.BaseCache): Compute on demand.
3651         (TypeContainer.FindMembers): Define constants and types if they're
3652         not already created.
3653         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3654         check.
3655         * const.cs (Constant.Define): Make idempotent.
3656
3657 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3658
3659         * pending.cs: Produce better code (no nops produced by using Ldarg
3660         + value).
3661         
3662         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3663         i - 1' it should be arg + 1.
3664
3665         Fixes bug #71819.
3666
3667 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3668
3669         * attribute.cs (Attribute.CheckAttributeType): Make private
3670         non-virtual.
3671         (Attribute.ResolveType): Make virtual.
3672         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3673         handling of RootContext.Tree.Types.
3674
3675 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3676
3677         Update attribute-handling to use the SimpleName/MemberAccess
3678         mechanisms.
3679         * cs-parser.jay (attribute): Pass in an expression to the
3680         constructors of Attribute and GlobalAttribute.
3681         * attribute.cs (Attribute): Take an expression for the name.
3682         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3683         passed in attribute name expression.
3684         (Attribute.CheckAttributeType): Use it.
3685         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3686         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3687         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3688         argument to prevent error messages if the lookup fails.
3689
3690 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3691
3692         * expression.cs (Indirection): Implemented IVariable interface
3693         to support indirection in AddressOf operator.
3694         (PointerArithmetic.Emit): Add optimalization for case where
3695         result can be precomputed.
3696
3697 2005-01-26  Martin Baulig  <martin@ximian.com>
3698
3699         * class.cs (TypeContainer.AttributeTargets): Return the correct
3700         AttributeTargets depending on our `Kind' instead of throwing an
3701         exception; fixes #71632.
3702
3703 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3704
3705         Fix #71257
3706         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3707         constant members.
3708
3709 2005-03-17  Martin Baulig  <martin@ximian.com>
3710
3711         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3712         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3713
3714 2005-03-17  Martin Baulig  <martin@ximian.com>
3715
3716         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3717         to bool so we can return an error condition.
3718         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3719         returned an error.
3720
3721 2005-03-17  Martin Baulig  <martin@ximian.com>
3722
3723         * generic.cs (TypeMananager.IsIEnumerable): New public method.
3724
3725         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3726         converting from an array-type of T to `IEnumerable<T>'.
3727
3728 2005-03-16  Martin Baulig  <martin@ximian.com>
3729
3730         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3731         (Nullable.LiftedUnaryMutator): New public class.
3732
3733         * expression.cs (UnaryMutator.DoResolve): Added support for
3734         Nullable Types.
3735
3736 2005-03-14  Martin Baulig  <martin@ximian.com>
3737
3738         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3739
3740 2005-03-14  Martin Baulig  <martin@ximian.com>
3741
3742         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3743         the comparision operators `<', `>', `<=' and `>='.
3744
3745 2005-03-13  Martin Baulig  <martin@ximian.com>
3746
3747         * generic.cs
3748         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3749         avoid confusion with the `NullLiteral'.
3750         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3751
3752 2005-03-13  Martin Baulig  <martin@ximian.com>
3753
3754         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3755         comparing arbitrary types with the null literal.
3756
3757 2005-03-13  Martin Baulig  <martin@ximian.com>
3758
3759         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3760         boolean operators '&&', '||', '&' and '|'.
3761         (Nullable.OperatorTrueOrFalse): New public class.
3762
3763         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3764         instead of a `StaticCallExpr'; added support for nullables.
3765
3766 2005-03-10  Martin Baulig  <martin@ximian.com>
3767
3768         * expression.cs
3769         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3770         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
3771
3772 2005-03-07  Martin Baulig  <martin@ximian.com>
3773
3774         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3775         it work if `expr' is not an IMemoryLocation.
3776         (Nullable.Lifted): Implement IMemoryLocation.
3777         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3778         target type.
3779
3780 2005-03-05  Martin Baulig  <martin@ximian.com>
3781
3782         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3783         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3784         (Nullable): Added support for lifted unary and binary operators.
3785
3786         * expression.cs (Unary.DoResolve): Added support for nullable types.
3787         (Binary.DoResolve): Likewise.
3788         (Conditional.DoResolve): Likewise.
3789
3790 2005-03-02  Martin Baulig  <martin@ximian.com>
3791
3792         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3793
3794         * class.cs (ClassPart.SetParameterInfo): Override this.
3795         (PartialContainer.SetParameterInfo): Override this.
3796         (TypeContainer.CheckConstraints): New protected method.
3797         (PartialContainer.CheckConstraints): Override this and check
3798         whether the same contraints were specified in all parts of a
3799         partial generic type definition.
3800         (PartialContainer.UpdateConstraints): New public method.
3801
3802         * generic.cs (TypeParameter.UpdateConstraints): New public method.
3803
3804 2005-03-02  Martin Baulig  <martin@ximian.com>
3805
3806         Committing a patch from Carlos Alberto Cortez to fix #72887.
3807
3808         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3809         casts from `T []' to `int []'.
3810
3811 2005-03-02  Martin Baulig  <martin@ximian.com>
3812
3813         * generic.cs (TypeManager.IsEqual): Make this symmetric.
3814
3815         * expression.cs (Binary.ResolveOperator): When resolving a
3816         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3817         `=='.  Fixes #71866.  See gen-127.cs.
3818
3819 2005-03-02  Martin Baulig  <martin@ximian.com>
3820
3821         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3822         static constructor in static classes.
3823
3824 2005-03-02  Martin Baulig  <martin@ximian.com>
3825
3826         * generic.cs
3827         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3828         (Nullable.LiftedConversion): Added support for user-defined
3829         conversions.
3830
3831         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3832
3833         * cs-parser.jay: Use ComposedCast everywhere instead of
3834         NullableType, so we don't need to check for NullableType
3835         everywhere.
3836         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3837         case where we'll be resolved into a `parenthesized_expression_0'
3838         afterwards.
3839
3840         * convert.cs
3841         (Convert.UserDefinedConversion): Added nullable conversions.
3842
3843 2005-02-28  Martin Baulig  <martin@ximian.com>
3844
3845         * generic.cs (TypeManager.IsNullableType): New static method.
3846         (Nullable): New abstract class.
3847         (Nullable.NullLiteral): New public class.
3848         (Nullable.LiftedConversion): New public class.
3849
3850         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3851         `builtin_types opt_nullable'.
3852
3853         * convert.cs
3854         (Convert.ImplicitConversionStandard): Added nullable conversions.
3855         (Convert.ExplicitConversionStandard): Likewise.
3856         (Convert.ExplicitConversion): Likewise.
3857
3858 2005-02-26  Martin Baulig  <martin@ximian.com>
3859
3860         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3861         begin with a "?", for instance "?[]".  Don't do a type lookup if
3862         `dim' is empty.
3863
3864 2005-02-25  Martin Baulig  <martin@ximian.com>
3865
3866         The first part of Nullable Types :-)
3867
3868         * generic.cs (NullableType): New public class.
3869         (NullCoalescingOperator): New public class.
3870         (TypeArguments.Resolve): Add a CS0306 check.
3871
3872         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3873         (opt_nullable): New rule.
3874         (type): Added `opt_nullable' to `namespace_or_type_name',
3875         `builtin_types' and `pointer_type'.
3876         (array_type): Added `opt_nullable'.
3877         (opt_rank_specifier_or_nullable): New rule; this is the
3878         combination of `opt_rank_specifier' and `opt_nullable'.
3879         (opt_error): New rule; catch errors here.
3880         (nullable_type_or_conditional): New rule; we use this to check for
3881         nullable and still detect the conditional operator.
3882         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3883         instead `opt_rank_specifier'.
3884
3885         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3886         for nullables.
3887
3888 2005-02-24  Martin Baulig  <martin@ximian.com>
3889
3890         * README, README.Changes: Removed; they're old and obsolete.
3891
3892 2005-02-22  Martin Baulig  <martin@ximian.com>
3893
3894         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3895         returned an error, set `constraints' to null to avoid a crash
3896         later on.
3897         (TypeParameter.ResolveType): Likewise.
3898
3899 2005-02-22  Martin Baulig  <martin@ximian.com>
3900
3901         * generic.cs
3902         (Constraints.ResolveTypes): Protect against being called twice.
3903         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3904         (TypeParameter.ResolveType): New public method; calls
3905         constraints.ResolveTypes().
3906         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3907         into the new ResolveType().
3908         (GenericMethod.Define): Call ResolveType() on all our
3909         TypeParameter's.        
3910
3911 2005-02-21  Martin Baulig  <martin@ximian.com>
3912
3913         * generic.cs
3914         (TypeManager.generic_nullable_type): New static public field.
3915         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3916
3917         * rootcontext.cs
3918         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3919
3920 2005-02-15  Martin Baulig  <martin@ximian.com>
3921
3922         * generic.cs (ConstructedType.Constraints): Correctly check
3923         constraints if the argument type is a type parameter; fixes
3924         #72326. 
3925
3926 2005-02-02  Martin Baulig  <martin@ximian.com>
3927
3928         * delegate.cs (Delegate.DefineType): Report an internal error if
3929         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3930         details.        
3931
3932 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3933
3934         * pending.cs: Produce better code (no nops produced by using Ldarg
3935         + value).
3936         
3937         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3938         i - 1' it should be arg + 1.
3939
3940         Fixes bug #71819.
3941         
3942 2005-01-26  Martin Baulig  <martin@ximian.com>
3943
3944         * cs-parser.jay (indexer_declarator): Don't report an error if we
3945         have type parameters since we can be an explicit interface
3946         implementation; fixes #71449.
3947
3948 2005-01-26  Martin Baulig  <martin@ximian.com>
3949
3950         * class.cs (TypeContainer.AttributeTargets): Return the correct
3951         AttributeTargets depending on our `Kind' instead of throwing an
3952         exception; fixes #71632.
3953
3954 2005-01-26  Martin Baulig  <martin@ximian.com>
3955
3956         * delegate.cs (Delegate.DefineType): Correctly define our type
3957         parameters.  Fixes #71483.
3958
3959 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3960
3961         Fix #71602.
3962         * expression.cs (MemberAccess.DoResolve): Don't complain with
3963         cs0572 when the LHS of a member access has identical name and type
3964         name.
3965
3966 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3967
3968         Fix #71651, #71675
3969         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3970         CreatePermission.
3971         Create custom PermissionSet only for PermissionSetAttribute.
3972
3973 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3974
3975         Fix #71649
3976         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3977         delegates in static class.
3978
3979 2005-01-24  Martin Baulig  <martin@ximian.com>
3980
3981         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3982         merging an implicit block, just use its reachability.
3983
3984         * statement.cs (Block.Resolve): Make the unreachable code check
3985         work wrt. implicit blocks; see test-337 from #63842.
3986
3987 2005-01-21  Alp Toker  <alp@atoker.com>
3988  
3989         * cs-parser.jay: destructor_declaration's container is PartialContainer
3990         not Class when partial types are used, so use Kind prop instead of
3991         'is'.
3992         
3993 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3994
3995         * cs-parser.jay: Improve error reporting when an interface
3996         declares new types.
3997
3998 2005-01-20  Dick Porter  <dick@ximian.com>
3999
4000         * support.cs: SeekableStreamReader fix from Sandor Dobos
4001         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4002         chars are read.  Fixes bug 70369.
4003
4004 2005-01-20  Raja R Harinath  <rharinath@novell.com>
4005
4006         * cs-parser.jay (catch_clause): Simplify current_block handling
4007         somewhat.
4008
4009 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
4010
4011         * convert.cs (ImplicitStandardConversionExists): Synchronize the
4012         code with ImplicitStandardConversion to handle the implicit
4013         conversion of method groups into valid delegate invocations. 
4014
4015         The problem is that in parameter handling we were using this code
4016         path.  Fixes bug #64698
4017
4018 2005-01-19  Raja R Harinath  <rharinath@novell.com>
4019
4020         * cs-parser.jay: Fix several infelicities.
4021         - Avoid assigning to the parser value stack.  Code like 
4022           '$3 = null' is unclean.  Synthesize a value for the code block
4023           instead. 
4024         - Avoid using oob_stack for storing location information.  Use ...
4025         (_mark_): ... this.  New (empty) rule.  Saves the current location
4026         in $$.
4027         (foreach_statement): Avoid using oob_stack for current_block
4028         handling.  Use technique used in for_statement and
4029         using_statement.  Synthesize a value for the code block to store
4030         additional intermediate information.
4031
4032 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
4033
4034         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4035         of a different type is only allowed to private fields of a
4036         containing type, not on fields of a base class.
4037
4038         See test-174.cs and error cs0122-9.cs
4039
4040 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4041
4042         Fix test-335.cs (bug #58126).
4043         * cs-parser.jay (argument): Split out non-expression parts of the
4044         rule into 'non_simple_argument'.
4045         (invocation_expression): Support parenthesized invocations with
4046         multiple arguments, and with single non-simple arguments.
4047
4048 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4049
4050         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4051         places.
4052
4053 2005-01-12  Raja R Harinath  <rharinath@novell.com>
4054
4055         Fix cs0038-1.cs, cs1640-6.cs.
4056         * ecore.cs (Expression.Resolve): Remove special-case for
4057         SimpleName in error-handling.
4058         (Expression.almostMatchedMembers): Relax access permission to
4059         protected.
4060         (Expression.MemberLookupFailed): Handle duplicates in
4061         almostMatchedMembers list.
4062         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4063         * expression.cs (New.DoResolve): Report CS1540 for more cases.
4064         * typemanager.cs (GetFullNameSignature): Use the MethodBase
4065         overload if the passed in MemberInfo is a MethodBase.
4066
4067 2005-01-25  Martin Baulig  <martin@ximian.com>
4068
4069         * doc.cs
4070         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4071
4072 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4073
4074         Fix #70749
4075         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4076         for non-CAS & merge permission sets properly.
4077
4078 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4079
4080         Improve standard-compliance of simple name and member access 
4081         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4082         * ecore.cs (FullNamedExpression): New abstract base class 
4083         for Namespaces and TypeExpressions.
4084         (ResolveFlags.SimpleName): Remove.
4085         (SimpleName): Remove support for dotted names.
4086         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4087         DeclSpace.FindType and DeclSpace.LookupType.
4088         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4089         (Expression.ExprClassName): Make member function.
4090         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4091         a namespace.  Remove creation of dotted "SimpleName"s.
4092         (MemberAccess.DoResolve): Likewise.
4093         * decl.cs (DeclSpace.Cache): Make private.
4094         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4095         (DeclSpace.FindType): Update.
4096         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4097         FullNamedExpression.
4098         * namespace.cs (Namespace): Derive from FullNamedExpression
4099         so that it can be part of expression resolution.
4100         (Namespace.Lookup): Return an FullNamedExpression.
4101         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4102         namespace.
4103         * rootcontext.cs (NamespaceLookup): Remove.
4104         (LookupType): Move to DeclSpace.
4105         * attribute.cs (CheckAttributeType): Update.
4106         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4107         (FindDocumentedTypeNonArray): Likewise.
4108
4109 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4110
4111         Fix cs0509.cs, cs1632.cs.
4112         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4113         is the same as IsInterface.
4114         (TypeContainer.GetClassBases): Likewise.
4115         * statement.cs (LabeledStatement.ig): New field.
4116         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4117         label.
4118         (LabeledStatement.DoEmit): Check that the label was created with
4119         the same ILGenerator.
4120
4121 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4122
4123         Fix #71058
4124         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4125         accessors to its properties.
4126
4127         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4128         from accessors to property.
4129         
4130 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4131
4132         Fix #70722
4133         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4134         only for overrides.
4135         
4136 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4137
4138         * attribute.cs: Check for null and empty strings.  
4139
4140         I have lost another battle to Paolo.
4141
4142 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4143
4144         Fix #70942
4145         * class.cs (PropertyMethod): Set Parent field in ctors.
4146         (SetMethod.InternalParameters): Add unsafe switch hack.
4147         Override MarkForDuplicationCheck where it is appropriate.
4148
4149         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4150         It says whether container allows members with the same name.
4151         Base default is no.
4152         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4153         Removed is_method parameter.
4154
4155 2005-01-06  Duncan Mak  <duncan@ximian.com>
4156
4157         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4158         because the previous change led to incorrect reporting of CS1032
4159         ("Cannot define/undefine preprocessor symbols after first token in
4160         file"). Instead of using `tokens_seen' as the only flag that
4161         triggers CS1040, introduce `comments_seen'. This new flag is used
4162         to signify having seen comments on the current line, so it is
4163         unset after a newline.
4164
4165 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4166
4167         * doc.cs : When searching for a type, find nested type too.
4168           This fixes bug #71040.
4169
4170 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4171
4172         * doc.cs :
4173           - Warn missing member comment on those classes which also does not
4174             have doc comments. Fixed bug #71041.
4175           - Don't warn missing doc comment on default constructor.
4176             Fixed bug #71042.
4177
4178 2005-01-06  Duncan Mak  <duncan@ximian.com>
4179
4180         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4181         comments, set `tokens_seen' to true. This allows us to detect
4182         misplaced preprocessor directives (i.e. not at the beginning of
4183         the a line, nor after whitespaces). In that case, report error
4184         CS1040. This fixes bug #56460.
4185
4186         * cs-parser.jay (interface_member_declaration): Add checks for
4187         IsExplicitImpl, and report CS0541 error if an interface member is
4188         defined as an explicit interface declaration.
4189
4190 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4191
4192         Fix #70817
4193         * class.cs (PropertyMethod): Set Parent field in ctors.
4194         (SetMethod.InternalParameters): Add unsafe switch hack.
4195         
4196         * decl.cs (MemberCore.Parent): Cannot be readonly.
4197
4198 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4199
4200         * decl.cs (DeclSpace.ResolveType): Remove.
4201         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4202         Merge in code from ...
4203         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4204         * class.cs, enum.cs: Update to changes.
4205
4206 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4207
4208         * anonymous.cs: Ensure that we init the scope of our parent if it
4209         has not been initialized yet.
4210
4211 2004-12-30  Duncan Mak  <duncan@ximian.com>
4212
4213         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4214         if field.FieldBuilder is null. Fixes #70758.
4215
4216         * convert.cs: Fixed some typos and updated some of the comments.
4217         (ImplicitStandardConversionExists):
4218         (TryImplicitIntConversion): If `target_type' is an interface and
4219         the type of `ic' implements this interface, return true or a new
4220         BoxedCast instead of null. This fixes #70468.
4221
4222 2004-12-29  Duncan Mak  <duncan@ximian.com>
4223
4224         * expression.cs (Argument.Emit): Check that Expr is
4225         IMemoryLocation before casting to it, and report CS1510 otherwise.
4226
4227         This fixes #70402.
4228
4229 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4230
4231         * statement.cs (Block.ThisVariable): remove the recursion here, to
4232         make the --profile more sane.
4233
4234 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4235
4236         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4237         assembly, by JB Evain.
4238
4239 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4240
4241         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4242           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4243         "parent" refers to enclosing type/class.  "base" refers to superclass.
4244
4245 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4246
4247         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4248         Ensure that we only have GlobalAttributes.
4249         * attribute.cs (Attribute.Emit): Make non-virtual.
4250         (GlobalAttribute.Emit): Remove.
4251         (Attribute.Resolve): Make virtual.
4252         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4253         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4254         the argument. Don't create one.
4255         (Attribute.GetObsoleteAttribute): Likewise.
4256         (Attribute.GetClsCompliantAttributeValue): Likewise.
4257         * class.cs, decl.cs: Update to changes.
4258
4259 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4260
4261         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4262         
4263         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4264         
4265         * statement.cs (Foreach.Resolve): Add error 186 report.
4266
4267 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4268
4269         * expression.cs (Conditional.DoResolve): Add warning 429.
4270         
4271         * statement.cs (If.Resolve): Add warning 665.
4272
4273 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4274
4275         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4276         except when in the parser, and in GlobalAttribute.
4277         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4278         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4279         RootContext.Tree.Types.NamespaceEntry once work is done.
4280         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4281         and resets RootContext.Tree.Types.NamespaceEntry.
4282
4283 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4284
4285         * cs-parser.jay: Don't create a block for every variable.
4286
4287 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4288
4289         * location.cs: Provide extra information.
4290
4291         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4292         variables from the captured environment, it is the ldarg_0.
4293
4294 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4295
4296         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4297         find a conclusion.
4298         
4299         * class.cs: Changed warning level for 169 to avoid developer
4300         displeasure from warning flooding. It will be changed back when they
4301         fix most of current BCL warnings.
4302         
4303         * RootContext.cs: Pushed default WarningLevel to 3.
4304         
4305         * statement.cs: Removed unused variable.
4306
4307 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4308
4309         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4310         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4311         Add error 502 report.
4312         (StaticClass.DefineType): Add error 441 report.
4313         (Class.AllowedModifiersProp): New virtual property as temporary
4314         extension to AllowedModifiers.
4315         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4316         to share implementation with StaticClass and don't call virtual
4317         methods from ctor.
4318         
4319         * driver.cs (MainDriver): Add error 1558 test.
4320
4321         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4322         report. Moved error 36 test here.
4323
4324         * statement.cs (Throw.Resolve): Add error 724 report.
4325
4326         * typemanager.cs: Add out_attribute_type core type.
4327         
4328 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4329
4330         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4331         3018 report.
4332         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4333
4334         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4335         3017 report.
4336         
4337         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4338
4339         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4340         Add error 3023 report.
4341         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4342
4343         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4344         implementation.
4345
4346 2004-12-12  John Luke  <john.luke@gmail.com>
4347
4348         * driver.cs (AddArgs): take -- into account when
4349         adding arguments, fixes bug 65710 
4350
4351 2004-12-12  Martin Baulig  <martin@ximian.com>
4352
4353         * expression.cs (Unary.TryReduceNegative): Added support for
4354         SByteConstant and ByteConstant.
4355         (Unary.Reduce): Check error values from TryReduceNegative().
4356
4357 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4358
4359         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4360         and report exception as error 182.
4361
4362 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4363
4364         * driver.cs (Main): Fix message when there are warnings.
4365
4366 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4367
4368         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4369
4370 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4371
4372         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4373         Reduced number of warnings.
4374         
4375         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4376
4377 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4378
4379         * driver.cs: Removed message.
4380
4381         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4382
4383 2004-12-08    <vargaz@freemail.hu>
4384
4385         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4386
4387 2004-12-08  Martin Baulig  <martin@ximian.com>
4388
4389         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4390         instead of a CS3002 for properties and indexer.
4391
4392 2004-12-08  Martin Baulig  <martin@ximian.com>
4393
4394         * decl.cs (MemberName.ToString): Make this work again.
4395
4396 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4397
4398         * attribute.cs (Resolve): Add error 591 detection.
4399
4400         * class.cs (FieldMember.Define): Add error 1547 detection.
4401         (Indexer.Define): Add error 620 detection.
4402         (Operator.Define): Add error 590 detection.
4403
4404         * ecore.cs: Missing argument for error 79.
4405
4406         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4407         detection.
4408
4409 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4410
4411         Fix #70106
4412         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4413         only.
4414
4415 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4416
4417         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4418           Some operator comments were suppressed.
4419         * doc.cs : Implicit/explicit operator name in doc comments are like
4420           "op_Explicit(type)~returnType", so added suffix handling.
4421
4422 2005-01-21  Alp Toker  <alp@atoker.com>
4423
4424         * cs-parser.jay: destructor_declaration's container is PartialContainer
4425         not Class when partial types are used, so use Kind prop instead of 'is'.
4426
4427 2004-12-12  Martin Baulig  <martin@ximian.com>
4428
4429         * expression.cs (Unary.TryReduceNegative): Added support for
4430         SByteConstant and ByteConstant.
4431         (Unary.Reduce): Check error values from TryReduceNegative().
4432
4433 2004-12-11  Martin Baulig  <martin@ximian.com>
4434
4435         * support.cs (ReflectionParameters.ParameterName): If we have a
4436         `gpd', call `ParameterName' on it.
4437
4438         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4439
4440         * pending.cs (PendingImplementation.DefineProxy): Call
4441         DefineParameter() for all of the MethodBuilder's arguments.
4442
4443 2004-12-09  Martin Baulig  <martin@ximian.com>
4444
4445         * doc.cs (DocUtil): Make this a static class.
4446
4447 2004-12-09  Martin Baulig  <martin@ximian.com>
4448
4449         * expression.cs (Invocation.InferType): Moved the type inference
4450         implementation into TypeManager.
4451
4452         * generics.cs (TypeManager): Moved the type inference
4453         implementation here.
4454
4455 2004-12-09  Martin Baulig  <martin@ximian.com>
4456
4457         * typemanager.cs (TypeManager): Make this a partial class.
4458
4459         * generics.cs
4460         (TypeManager): Move the generics part of `TypeManager' here.
4461
4462 2004-12-08  Martin Baulig  <martin@ximian.com>
4463
4464         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4465         instead of a CS3002 for properties and indexer.  Added CS3024
4466         check for generic interfaces.
4467
4468         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4469         instances are not CLS-compliant.
4470
4471 2004-12-08  Martin Baulig  <martin@ximian.com>
4472
4473         * cs-parser.jay
4474         (void_pointer_expression): New rule for `void*', `void**' etc.
4475         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4476
4477 2004-12-08  Martin Baulig  <martin@ximian.com>
4478
4479         * expression.cs (Invocation.InferType): Removed the hack for
4480         MethodCore.MayUnify().  
4481
4482         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4483         this actually work.
4484
4485         * class.cs (MethodCore.MayUnify): Use
4486         TypeManager.MayBecomeEqualGenericTypes().       
4487
4488 2004-12-08  Martin Baulig  <martin@ximian.com>
4489
4490         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4491         parameter, box it.  Fixes #69233.
4492
4493 2004-12-08  Martin Baulig  <martin@ximian.com>
4494
4495         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4496         have the ctor constraint.  Fixes #68326.
4497
4498 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4499
4500         * cs-parser.jay : interface comment was not consumed because of
4501           extra opt_semicolon before doc handling.
4502
4503 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4504
4505         Fix test-327.cs, test-328.cs, and put in early infrastructure
4506         for eventually fixing #52697.
4507         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4508         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4509         from other methods.
4510         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4511         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4512         (VerifyUsing, error246): Update.
4513         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4514         'NamespaceEntry.LookupNamespaceOrType'.
4515
4516 2004-12-07  Martin Baulig  <martin@ximian.com>
4517
4518         * driver.cs: Call it "BETA SOFTWARE" :-)
4519
4520 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4521
4522         Fix crash on cs0657-17.cs.
4523         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4524         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4525         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4526         the case where the NamespaceEntry gets overwritten.
4527
4528 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4529
4530         Fixed #69195, #56821
4531         * ecore.cs (ResolveBoolean): Tiny refactoring.
4532
4533         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4534         of right expression resolving when left is false constant and
4535         operator is LogicalAnd OR true constant and operator is LogicalOr.
4536
4537         * statement.cs (ResolveUnreachable): Always reports warning.
4538
4539 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4540
4541         * class.cs: Distinguish between 1721 and 1722 (just a little help
4542         for the programmer).
4543
4544 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4545
4546         * delegate.cs: Only allow this on new versions of the language. 
4547
4548 2004-12-02  Duncan Mak  <duncan@ximian.com>
4549
4550         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4551         Expression class.
4552         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4553         here as a static method. Take an additional bool out parameter
4554         `must_do_cs1540_check' for signaling to InstanceResolve.
4555         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4556         member field from PropertyExpr class and made it an argument of
4557         the method instead.
4558         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4559         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4560         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4561         and `remove_accessor' as well as InstanceResolve: report CS0122
4562         where applicable.
4563
4564         Fixes #70129.
4565
4566 2004-12-07  Martin Baulig  <martin@ximian.com>
4567
4568         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4569         and CS0692 where appropriate.
4570
4571 2004-12-06  Martin Baulig  <martin@ximian.com>
4572
4573         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4574         IsDuplicateImplementation() and improved it.
4575
4576         * expression.cs (Invocation.InferTypeArguments): Added
4577         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4578         and removed the "ref" modifier from `infered_types'.
4579
4580         * decl.cs (MemberName.ToString): Removed the exception.
4581
4582 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4583
4584         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4585           comments are allowed.
4586
4587 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4588
4589         * delegate.cs: Add checks for subtypes in paramaters and return values
4590         in VerifyMethod () to add support for Covariance/Contravariance
4591         in delegates.
4592         
4593 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4594
4595         * report.cs: Remove extra closing parenthesis.
4596
4597         * convert.cs (Error_CannotImplicitConversion): If the name of the
4598         types are the same, provide some extra information.
4599
4600 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4601
4602         Fix bug #70102
4603         * attribute.cs (Resolve): Improved implementation of params
4604         attribute arguments.
4605
4606         * support.cs (ParameterData): Add HasParams to be faster.
4607
4608 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4609
4610         all things are for /doc support:
4611
4612         * doc.cs: new file that supports XML documentation generation.
4613         * mcs.exe.sources: added doc.cs.
4614         * driver.cs:
4615           Handle /doc command line option.
4616           Report error 2006 instead of 5 for missing file name for /doc.
4617           Generate XML documentation when required, after type resolution.
4618         * cs-tokenizer.cs:
4619           Added support for picking up documentation (/// and /** ... */),
4620           including a new XmlCommentState enumeration.
4621         * cs-parser.jay:
4622           Added lines to fill Documentation element for field, constant,
4623           property, indexer, method, constructor, destructor, operator, event
4624           and class, struct, interface, delegate, enum.
4625           Added lines to warn incorrect comment.
4626         * rootcontext.cs :
4627           Added Documentation field (passed only when /doc was specified).
4628         * decl.cs:
4629           Added DocComment, DocCommentHeader, GenerateDocComment() and
4630           OnGenerateDocComment() and some supporting private members for
4631           /doc feature to MemberCore.
4632         * class.cs:
4633           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4634         * delegate.cs:
4635           Added overriden DocCommentHeader.
4636         * enum.cs:
4637           Added overriden DocCommentHeader and GenerateDocComment().
4638
4639 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4640
4641         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4642         unwrapping the enumeration values, chain to
4643         DoConstantNumericPromotions again, so we can promote things to the
4644         fundamental types (takes care of enums that are bytes, sbytes).
4645
4646         Fixes bug #62054.
4647
4648 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4649
4650         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4651         Fix long-standing bug in type-lookup.  Use FindType instead of
4652         LookupType when ec.ResolvingTypeTree.
4653         (Attribute.ResolveType, Attribute.Resolve)
4654         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4655         Update to changes.
4656         (Attributes.Search): Remove internal version.  Update.
4657         (Attributes.SearchMulti): Update.
4658         (Attributes.GetClsCompliantAttribute): Remove.
4659         (Attributes.GetIndexerNameAttribute): Remove.
4660         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4661         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4662         * class.cs (Indexer.Define): Likewise.
4663
4664 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4665
4666         Fix bug #68790
4667         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4668         MarshallByReference members access.
4669
4670         * expression.cs: Use CheckMarshallByRefAccess;
4671         Better error CS0197 message.
4672
4673         * report.cs: Print whole related error message.
4674
4675 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4676
4677         * class (GetClassBases): Better error 60 report.
4678         (EventProperty): Disabled warning 67 detection.
4679
4680 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4681
4682         Fix bug #60324
4683         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4684
4685         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4686         precise values.
4687
4688 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4689
4690         Fix bug #49488
4691         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4692
4693         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4694
4695 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4696
4697         * attribute.cs (Attribute.Resolve): Refine error reporting and
4698         report a cs0117 if the identifier does not exist, to distinguish
4699         from 0617 which is a miss-use of the actual identifier.
4700
4701         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4702         between cs0070 and cs0079.
4703
4704         * class.cs (MemberBase.DoDefine): When reporting a wrong
4705         accessibility level, we use MethodCore to compare instead of
4706         Method (this was a regression in some refactoring effort).
4707
4708         So now we correctly report cs0056 again.
4709
4710         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4711         testing the target_type (which was known to be object_type) and
4712         not the source type (which is anonymous_method).
4713
4714         Fixed reporting of error cs1660.
4715
4716         * expression.cs (UserCast.Source): Expose the underlying cast.
4717
4718         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4719         allowed types to find a match to int32 first (most common).
4720
4721         In addition, it ignores any ImplicitUserConversions that did an
4722         internal implicit conversion (as the switch statement allows only
4723         one integral conversion to exist).
4724
4725         * class.cs (PartialContainer.Create): rename `name' to
4726         `member_name' for clarity.  Then replace the string calls with a
4727         call to MemberName.GetPartialName, as now using
4728         MemberName.ToString is an error (this is due to the side effects
4729         it had, that were fixed in the past).
4730
4731         This will restore the error reporting on a number of partial class
4732         errors that were missusing this (and getting an exception as a
4733         results, which is now just a plain textual warning, because
4734         yyparse debug output would crash otherwise).
4735
4736 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4737
4738         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4739
4740 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4741
4742         * rootcontext.cs (LookupType): Make sure to cache lookups that
4743         don't give us a negative result. This saves about 5% of corlib
4744         compilation time.
4745
4746 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4747
4748         * report.cs (AbstractMessage.Print): messages are sent to stderr
4749
4750         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4751         non-interface in the list of interfaces (at this point, either
4752         parent was properly set, or a base class is being listed in the
4753         interfaces section).
4754
4755         This flags error 1722, and resolves the crash from bug 69259.
4756
4757 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4758
4759         * statement.cs (Using.EmitExpressionFinally): make this work right
4760         for valuetypes. Fixes 69926.
4761
4762 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4763
4764         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4765         converted to an enum" here, before we try to change the underlying
4766         type.  This code exists, but it is a different code path than the
4767         one used while encoding constants.
4768
4769         (ImplicitReferenceConversionExists): In addition, resynchronized
4770         the code here, so it matches the same code in
4771         ImplicitReferenceConversionExists for the `from any class-type S
4772         to any interface-type T'.       
4773
4774 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4775
4776         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4777
4778 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4779
4780         * cs-parser.jay: Use verbosity accordingly. 
4781
4782 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4783
4784         * expression.cs (Unary.ResolveOperator): Do not report warning;
4785         AddressOf reads from variable.
4786         
4787         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4788
4789 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4790
4791         Fix bug #69462
4792
4793         * attribute.cs (Attributable): Removed CheckTargets.
4794         (Attributes.Emit): Explicit attribute targets are tested here.
4795
4796         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4797         not enabled for interfaces.
4798
4799         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4800         (GetAssemblyName): Ouch next bug there.
4801
4802 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4803
4804         * expression.cs: Error 275 added.
4805         
4806 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4807
4808         Fix bug #69177 (Implemented decimal constant support)
4809
4810         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4811         (BinaryFold): Add DecimalConstant.
4812
4813         * const.cs (Define): Decimal constant 
4814         (is not constant.
4815         (ChangeType): Add decimal type handling.
4816         (LookupConstantValue): Don't set value for decimal type but
4817         emit DecimalConstantAttribute. Needed for constant optimization.
4818
4819         * constant.cs (ToDecimal): New method.
4820         (ConvertToDecimal): New method.
4821         (IntConstant): Implemented ConvertToDecimal.
4822         (DecimalConstant.Emit): Emit optimized version for decimals in
4823         int range.
4824
4825         * expression.cs (ResolveOperator): Changed order of constant
4826         reduction to work correctly with native types which have
4827         overloaded operators.
4828         (ResolveMemberAccess): Extract constant value from attribute
4829         for decimal type.
4830
4831         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4832
4833         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4834         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4835         (ChangeType): Decimal is special.
4836         (TypeToCoreType): Add decimal type.
4837
4838 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4839
4840         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4841         decimal types.
4842
4843 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4844
4845         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4846         test cs1667-5.cs.
4847
4848 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4849
4850         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4851
4852         * pending.cs (PendingImplementation): Grab only interfaces.
4853
4854 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4855
4856         * statement.cs (ForeachHelperMethods): Add location member and
4857         error 202 detection.
4858
4859 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4860
4861         * expression.cs (DoResolveBase): Fixed wrong warning for out
4862         variables.
4863
4864 2004-12-04  Martin Baulig  <martin@ximian.com>
4865
4866         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4867         to check whether the conversion is ok.
4868
4869         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4870         `Type.EmptyTypes' if we're not a generic TypeContainer.
4871
4872 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4873
4874         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4875         old bug: when converting from the null literal to a pointer,
4876         return an EmptyCast, not the NullLiteral.
4877
4878         This fixes #69921, the recent null_type changes probably made this
4879         bug more prominent.
4880
4881 2004-12-03  Martin Baulig  <martin@ximian.com>
4882
4883         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4884         method as our child, call AnonymousMethod.Compatible() on it.
4885
4886 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4887
4888         * class.cs (FieldBase): Use an unused bit field from the field to
4889         encode the `has_offset' property from the FieldMember.  This saves
4890         a couple of Ks on bootstrap compilation.
4891
4892         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4893         method as our child, return the AnonymousMethod resolved
4894         expression.
4895
4896         * expression.cs (New.DoResolve): Allow return values from
4897         NewDelegate to also include AnonymousMethods.
4898
4899         Fixes #70150.
4900
4901 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4902
4903         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4904         cs1648 report.
4905         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4906         System.Runtime.InteropServices._Exception, since it's a base
4907         interface of the core type System.Exception in the net_2_0 profile.
4908
4909 2004-11-27  Martin Baulig  <martin@ximian.com>
4910
4911         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4912
4913 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4914
4915         * Makefile: Convert to use executable.make.
4916         * gmcs.exe.sources: New.
4917
4918 2004-11-25  Martin Baulig  <martin@ximian.com>
4919
4920         * expression.cs (Invocation.InferType): Added support for byref types.
4921
4922 2004-11-25  Martin Baulig  <martin@ximian.com>
4923
4924         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4925         in TypeManager.TypeToCoreType().
4926
4927 2004-11-25  Martin Baulig  <martin@ximian.com>
4928
4929         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4930         "Dispose" method from the `current_type'.
4931         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4932         DoDefineMembers() instead of using the MethodBuilder; this is
4933         required for generic iterators.
4934
4935         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4936
4937 2004-11-24  Martin Baulig  <martin@ximian.com>
4938
4939         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4940
4941 2004-11-20  Martin Baulig  <martin@ximian.com>
4942
4943         * expression.cs (Invocation.InferType): Correctly infer generic
4944         instances; see gen-103.cs.
4945         (Invocation.InferTypeArguments): If a generic method doesn't have
4946         any unbound type parameters, we don't need to infer anything.
4947
4948 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4949
4950         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4951
4952 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4953
4954         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4955         (TypeHandle.GetMemberCache): New.
4956         (TypeHandle.TypeHandle): Update.
4957         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4958         (TypeManager.LookupParentInterfacesCache):
4959         Rename from LookupInterfaceCache.  Optimize slightly.
4960         (TypeManager.MemberLookup_FindMembers): Update.
4961         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4962         multi-type variant.
4963         (AddCacheContents): Rename from AddHashtable.
4964         * class.cs (TypeContainer.parent_container): Remove.
4965         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4966         (TypeContainer.DoDefineMembers): Don't initialize it.
4967         Update to name changes.
4968         
4969 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4970
4971         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4972         that factors the code to check access modifiers on override.  
4973
4974         (PropertyBase): Use the code here.
4975
4976         Patch from Lluis S'anchez, fixes bug #69361.
4977
4978 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4979
4980         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4981         routine that is used to report the use of a captured variable
4982         whose address has been taken.
4983
4984         There are two checks: one when variables are being captured and
4985         the other check is when the address of a variable is taken. 
4986         
4987         (because an anonymous methods might be resolved before *or* after
4988         the address has been taken) and 
4989
4990         * expression.cs (Conditional.DoResolve): Remove the special
4991         casing that Martin added to trueExpr and falseExpr being both
4992         NullLiteral.  We get the right behavior now just by introducing
4993         the null_type into the compiler. 
4994
4995         * convert.cs (ExplicitConversion): Change the code to use
4996         null_type instead of testing `expr is NullLiteral'.
4997         (ImplicitConversionStandard): use null_type too.
4998         (ImplicitReferenceConversionExists): use null_type too.
4999         (ImplicitReferenceConversion): use null_type too.
5000
5001         * literal.cs: The type of `NullLiteral' is now null_type instead
5002         of object_type. 
5003         (Resolve): Set the type here.
5004
5005         * typemanager.cs: Introduce null_type.
5006
5007 2004-11-18  Martin Baulig  <martin@ximian.com>
5008
5009         * rootcontext.cs
5010         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5011
5012 2004-11-18  Martin Baulig  <martin@ximian.com>
5013
5014         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5015
5016 2004-11-18  Martin Baulig  <martin@ximian.com>
5017
5018         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5019         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
5020         call ResolveConstructedType() on it to resolve it without checking
5021         constraints.
5022         (Constraints.ResolveTypes): Check them here.
5023         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5024         but don't check constraints.
5025         (ConstructedType.ResolveAsTypeTerminal): Override this and also
5026         check constraints here.
5027         (ConstructedType.ResolveConstructedType): New public method.  This
5028         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5029         resolve ourselves without checking constraints.
5030
5031         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5032
5033 2004-11-18  Martin Baulig  <martin@ximian.com>
5034
5035         * decl.cs
5036         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5037
5038         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5039
5040 2004-11-18  Martin Baulig  <martin@ximian.com>
5041
5042         * ecore.cs (TypeExpr.ResolveType): Removed.
5043         (Expression.ResolveAsTypeTerminal): We always return a fully
5044         resolved `TypeExpr', so we can just access its `Type'.
5045
5046         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5047
5048 2004-11-17  Martin Baulig  <martin@ximian.com>
5049
5050         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5051         sure we don't return any unresolved TypeExpr's.
5052         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5053         a `TypeExpr'.
5054         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5055
5056         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5057         unresolved `ConstructedType's.
5058
5059 2004-11-17  Martin Baulig  <martin@ximian.com>
5060
5061         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5062
5063 2004-11-17  Martin Baulig  <martin@ximian.com>
5064
5065         * ecore.cs
5066         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5067
5068         * decl.cs (DeclSpace.ResolveType): Removed.
5069         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5070
5071 2004-11-17  Martin Baulig  <martin@ximian.com>
5072
5073         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5074         direction, like FindMembers() does.  Fixes #69546, testcase is in
5075         test-315.cs.    
5076
5077 2004-11-16  Martin Baulig  <martin@ximian.com>
5078
5079         This is based on a patch from Marek Safar, see bug #69082.
5080         Fixes bugs #63705 and #67130.
5081
5082         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5083         method; create a MemberCache for an interface type and cache the
5084         result.
5085
5086         * decl.cs (IMemberContainer.ParentContainer): Removed.
5087         (IMemberContainer.ParentCache): New property.
5088         (MemberCache.SetupCacheForInterface): Removed.
5089         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5090         to create a cache for an interface's "parent".
5091
5092         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5093         interfaces too.
5094
5095 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
5096
5097         * statement.cs: Avoid adding bools to a hashtable.
5098
5099 2004-11-15  Martin Baulig  <martin@ximian.com>
5100
5101         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5102
5103 2004-11-11  Martin Baulig  <martin@ximian.com>
5104
5105         * typemanager.cs (TypeManager.GetMethodName): New method.
5106
5107         * class.cs (MethodData.Define): Include the generic arity in the
5108         name of an explicit interface; also add it to the method name.
5109
5110         * pending.cs (PendingImplementation.InterfaceMethod): The method
5111         name now includes the generic arity.
5112
5113 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
5114
5115         * expression.cs (Invocation.OverloadResolve): Flag error if we are
5116         calling an unsafe method from a safe location.
5117
5118 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
5119
5120         Fix #69167
5121         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5122
5123 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
5124
5125         * namespace.cs (VerifyUsing): use GetPartialName instead of
5126         ToString. 
5127
5128 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
5129
5130         * statement.cs (Return.Resolve): Fix regression in typo: if
5131         `in_exc', we have to request a NeedReturnLabel, this was a typo
5132         introduced in the anonymous method check-in.  Fixes #69131.
5133
5134         * Indexers were using the ShortName when defining themselves,
5135         causing a regression in the compiler bootstrap when applying the
5136         patch from 2004-11-02 (first part), now they use their full name
5137         and the bug is gone.
5138
5139 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
5140
5141         * driver.cs: Strip the path from the names of embedded resources. Fixes
5142         #68519.
5143
5144 2004-11-04  Raja R Harinath  <rharinath@novell.com>
5145
5146         Fix error message regression: cs0104-2.cs.
5147         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5148         (AliasEntry.Resolve): Update.
5149         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
5150         'silent' flag.
5151         (RootContext.LookupType): Update.
5152
5153 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5154
5155         * cs-parser.jay: Add support for handling accessor modifiers
5156         * class: Add support port accessor modifiers and error checking,
5157         define PropertyMethod.Define as virtual (not abstract anymore)
5158         * ecore.cs: Add checking for proeprties access with access modifiers
5159         * iterators.cs: Modify Accessor constructor call based in the modified
5160         constructor
5161 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5162
5163         * expression.cs (StringConcat): Handle being called twice,
5164         as when we have a concat in a field init with more than two
5165         ctors in the class
5166
5167 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5168
5169         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5170         special case explicit implementations, we should always produce
5171         the .property or .event declaration.
5172         
5173         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5174         since it will not return correct data if people use this
5175         unresolved in the presence of using statements (see test-313).
5176
5177         * class.cs (MethodData.Define): If we are an explicit interface
5178         implementation, set the method name to the full name of the
5179         interface plus the name of the method.  
5180
5181         Notice that using the method.MethodName.GetFullName() does not
5182         work, as it will only contain the name as declared on the source
5183         file (it can be a shorthand in the presence of using statements)
5184         and not the fully qualifed type name, for example:
5185
5186         using System;
5187
5188         class D : ICloneable {
5189                 object ICloneable.Clone ()  {
5190                 }
5191         }
5192
5193         Would produce a method called `ICloneable.Clone' instead of
5194         `System.ICloneable.Clone'.
5195
5196         * namespace.cs (Alias.Resolve): Use GetPartialName.
5197         
5198 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5199
5200         * cs-parser.jay: Add error 1055 report.
5201
5202 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5203
5204         * assign.cs (Assign.DoResolve): Only do the transform of
5205         assignment into a New if the types are compatible, if not, fall
5206         through and let the implicit code deal with the errors and with
5207         the necessary conversions. 
5208
5209 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5210
5211         * cs-parser.jay: Add error 1031 report.
5212
5213         * cs-tokenizer.cs: Add location for error 1038.
5214
5215 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5216
5217         * cs-parser.jay: Add error 1016 report.
5218
5219 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5220
5221         * cs-parser.jay: Add errors 1575,1611 report.
5222
5223 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5224
5225         * cs-parser.jay: Add error 1001 report.
5226
5227 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5228
5229         Fix #68850
5230         * attribute.cs (GetMarshal): Add method argument for
5231         caller identification.
5232
5233         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5234         agument for GetMarshal and RuntimeMissingSupport.
5235
5236 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5237
5238         * attribute.cs (ExtractSecurityPermissionSet): Removed
5239         TypeManager.code_access_permission_type.
5240
5241         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5242
5243 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5244
5245         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5246         for obsolete use of a variable here.   Fixes regression on errors
5247         cs0619-25 and cs0619-26.
5248
5249 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5250
5251         Fix #62358, implemented security attribute encoding.
5252
5253         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5254         Tests permitted SecurityAction for assembly or other types.
5255         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5256         data from SecurityPermissionAttribute to PermisionSet class.
5257
5258         * class.cs (ApplyAttributeBuilder): Added special handling
5259         for System.Security.Permissions.SecurityAttribute based types.
5260
5261         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5262         special handling for System.Security.Permissions.SecurityAttribute
5263         based types.
5264
5265         * enum.cs (ApplyAttributeBuilder): Added special handling
5266         for System.Security.Permissions.SecurityAttribute based types.
5267
5268         * parameter.cs (ApplyAttributeBuilder): Added special handling
5269         for System.Security.Permissions.SecurityAttribute based types.
5270
5271         * rootcontext.cs: Next 2 core types.
5272
5273         * typemanager.cs (TypeManager.security_permission_attr_type):
5274         Built in type for the SecurityPermission Attribute.
5275         (code_access_permission_type): Build in type.
5276
5277 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5278
5279         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5280         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5281         all of this information into
5282         EmitContext.EmitCapturedVariableInstance.
5283         
5284         * codegen.cs (EmitCapturedVariableInstance): move here the
5285         funcionality of emitting an ldarg.0 in the presence of a
5286         remapping.   This centralizes the instance emit code.
5287
5288         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5289         then emit a load of this: it means that we have reached the
5290         topmost ScopeInfo: the one that contains the pointer to the
5291         instance of the class hosting the anonymous method.
5292
5293         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5294         captures to the topmost CaptureContext.
5295
5296 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5297
5298         * expression.cs (LocalVariableReference): Move the knowledge about
5299         the iterators into codegen's EmitCapturedVariableInstance.
5300
5301 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5302
5303         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5304         all code paths return a value from an anonymous method (it is the
5305         same as the 161 error, but for anonymous methods).
5306
5307 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5308
5309         The introduction of anonymous methods in the compiler changed
5310         various ways of doing things in the compiler.  The most
5311         significant one is the hard split between the resolution phase
5312         and the emission phases of the compiler.
5313
5314         For instance, routines that referenced local variables no
5315         longer can safely create temporary variables during the
5316         resolution phase: they must do so from the emission phase,
5317         since the variable might have been "captured", hence access to
5318         it can not be done with the local-variable operations from the runtime.
5319         
5320         * statement.cs 
5321
5322         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5323         is a toplevel block.
5324
5325         (ToplevelBlock): A new kind of Block, these are the blocks that
5326         are created by the parser for all toplevel method bodies.  These
5327         include methods, accessors and anonymous methods.
5328
5329         These contain some extra information not found in regular blocks:
5330         A pointer to an optional CaptureContext (for tracking captured
5331         local variables and parameters).  A pointer to the parent
5332         ToplevelBlock.
5333         
5334         (Return.Resolve): Catch missmatches when returning a value from an
5335         anonymous method (error 1662).
5336         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5337         phase.
5338
5339         (Break.Resolve): ditto.
5340
5341         (SwitchLabel): instead of defining the labels during the
5342         resolution phase, we now turned the public ILLabel and ILLabelCode
5343         labels into methods called GetILLabelCode() and GetILLabel() that
5344         only define the label during the Emit phase.
5345
5346         (GotoCase): Track the SwitchLabel instead of the computed label
5347         (its contained therein).  Emit the code by using
5348         SwitchLabel.GetILLabelCode ().
5349
5350         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5351         whether the Local has been captured or not.
5352
5353         (LocalInfo.IsCaptured): New property, used to tell whether the
5354         local has been captured.
5355         
5356         * anonymous.cs: Vastly updated to contain the anonymous method
5357         support.
5358
5359         The main classes here are: CaptureContext which tracks any
5360         captured information for a toplevel block and ScopeInfo used to
5361         track the activation frames for various local variables.   
5362
5363         Each toplevel block has an optional capture context associated
5364         with it.  When a method contains an anonymous method both the
5365         toplevel method and the anonymous method will create a capture
5366         context.   When variables or parameters are captured, they are
5367         recorded on the CaptureContext that owns them, for example:
5368
5369         void Demo () {
5370              int a;
5371              MyDelegate d = delegate {
5372                  a = 1;
5373              }
5374         }
5375
5376         Here `a' will be recorded as captured on the toplevel
5377         CapturedContext, the inner captured context will not have anything
5378         (it will only have data if local variables or parameters from it
5379         are captured in a nested anonymous method.
5380
5381         The ScopeInfo is used to track the activation frames for local
5382         variables, for example:
5383
5384         for (int i = 0; i < 10; i++)
5385                 for (int j = 0; j < 10; j++){
5386                    MyDelegate d = delegate {
5387                         call (i, j);
5388                    }
5389                 }
5390
5391         At runtime this captures a single captured variable `i', but it
5392         captures 10 different versions of the variable `j'.  The variable
5393         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5394         recorded on a child.  
5395
5396         The toplevel ScopeInfo will also track information like the `this'
5397         pointer if instance variables were referenced (this is necessary
5398         as the anonymous method lives inside a nested class in the host
5399         type of the method). 
5400
5401         (AnonymousMethod): Expanded to track the Toplevel, implement
5402         `AnonymousMethod.Compatible' to tell whether an anonymous method
5403         can be converted to a target delegate type. 
5404
5405         The routine now also produces the anonymous method content
5406
5407         (AnonymousDelegate): A helper class that derives from
5408         DelegateCreation, this is used to generate the code necessary to
5409         produce the delegate for the anonymous method that was created. 
5410
5411         * assign.cs: API adjustments for new changes in
5412         Convert.ImplicitStandardConversionExists.
5413
5414         * class.cs: Adjustments to cope with the fact that now toplevel
5415         blocks are of type `ToplevelBlock'. 
5416
5417         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5418         insteda of standard blocks.
5419
5420         Flag errors if params arguments are passed to anonymous methods.
5421
5422         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5423         `CurrentAnonymousMethod' which points to the current Anonymous
5424         Method.  The variable points to the AnonymousMethod class that
5425         holds the code being compiled.  It is set in the new EmitContext
5426         created for the anonymous method.
5427
5428         (EmitContext.Phase): Introduce a variable and an enumeration to
5429         assist in enforcing some rules about when and where we are allowed
5430         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5431         only one that enfonces this right now).
5432
5433         (EmitContext.HaveCaptureInfo): new helper method that returns
5434         whether we have a CapturedContext initialized.
5435
5436         (EmitContext.CaptureVariable): New method used to register that a
5437         LocalInfo must be flagged for capturing. 
5438
5439         (EmitContext.CapturedParameter): New method used to register that a
5440         parameters must be flagged for capturing. 
5441         
5442         (EmitContext.CapturedField): New method used to register that a
5443         field must be flagged for capturing. 
5444
5445         (EmitContext.HaveCapturedVariables,
5446         EmitContext.HaveCapturedFields): Return whether there are captured
5447         variables or fields. 
5448
5449         (EmitContext.EmitMethodHostInstance): This is used to emit the
5450         instance for the anonymous method.  The instance might be null
5451         (static methods), this (for anonymous methods that capture nothing
5452         and happen to live side-by-side with the current method body) or a
5453         more complicated expression if the method has a CaptureContext.
5454
5455         (EmitContext.EmitTopBlock): Routine that drives the emission of
5456         code: it will first resolve the top block, then emit any metadata
5457         and then emit the code.  The split is done so that we can extract
5458         any anonymous methods and flag any captured variables/parameters.
5459         
5460         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5461         during this phase, the ILGenerator should not be used as labels
5462         and local variables declared here might not be accessible to any
5463         code that is part of an anonymous method.  
5464
5465         Exceptions to this include the temporary variables that are
5466         created by some statements internally for holding temporary
5467         variables. 
5468         
5469         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5470         metadata for a cb
5471
5472         (EmitContext.TemporaryReturn): This method is typically called
5473         from the Emit phase, and its the only place where we allow the
5474         ReturnLabel to be defined other than the EmitMeta.  The reason is
5475         that otherwise we would have to duplicate a lot of logic in the
5476         Resolve phases of various methods that today is on the Emit
5477         phase. 
5478
5479         (EmitContext.NeedReturnLabel): This no longer creates the label,
5480         as the ILGenerator is not valid during the resolve phase.
5481
5482         (EmitContext.EmitThis): Extended the knowledge in this class to
5483         work in anonymous methods in addition to iterators. 
5484
5485         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5486         code is necessary on the stack to access the instance to a local
5487         variable (the variable will be accessed as a field).
5488
5489         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5490         EmitContext.EmitAddressOfParameter): Routines to support
5491         parameters (not completed at this point). 
5492         
5493         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5494         will also remove the parameters.
5495
5496         * convert.cs (Convert): Define a `ConstantEC' which points to a
5497         null.  This is just to prefity some code that uses
5498         ImplicitStandardConversion code and do not have an EmitContext
5499         handy.
5500
5501         The idea is to flag explicitly that at that point in time, it is
5502         known that the conversion will not trigger the delegate checking
5503         code in implicit conversions (which requires a valid
5504         EmitContext). 
5505
5506         Everywhere: pass new EmitContext parameter since
5507         ImplicitStandardConversionExists now requires it to check for
5508         anonymous method conversions. 
5509
5510         (Convert.ImplicitStandardConversionExists): If the type of an
5511         expression is the anonymous_method_type, and the type is a
5512         delegate, we invoke the AnonymousMethod.Compatible method to check
5513         whether an implicit conversion is possible. 
5514
5515         (Convert.ImplicitConversionStandard): Only do implicit method
5516         group conversions if the language level is not ISO_1.
5517
5518         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5519         MethodInfo for the Invoke method.  used by Delegate and
5520         AnonymousDelegate.
5521
5522         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5523         method conversions if the target type is a delegate.
5524
5525         Removed extra debugging nops.
5526
5527         (LocalVariableReference): Turn the `local_info' into a public
5528         field. 
5529
5530         Add `prepared' field, the same hack used for FieldExprs to cope
5531         with composed assignments, as Local variables do not necessarily
5532         operate purely on the stack as they used to: they can be captured
5533         fields. 
5534
5535         Add `temp' for a temporary result, like fields.
5536
5537         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5538
5539         It now copes with Local variables that are captured and emits the
5540         proper instance variable to load it from a field in the captured
5541         case. 
5542
5543         (ParameterReference.DoResolveBase): During the resolve phase,
5544         capture parameters if we are in an anonymous method.
5545
5546         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5547         anonymous method, use the EmitContext helper routines to emit the
5548         parameter reference.
5549
5550         * iterators.cs: Set RemapToProxy to true/false during the
5551         EmitDispose class.
5552
5553         * parameters.cs (GetParameterByName): New helper method. 
5554
5555         * typemanager.cs (anonymous_method_type) a new type that
5556         represents an anonyous method.  This is always an internal type,
5557         used as a fencepost to test against the anonymous-methodness of an
5558         expression. 
5559         
5560 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5561
5562         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5563         561 report.
5564         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5565
5566 2004-11-10  Martin Baulig  <martin@ximian.com>
5567
5568         * expression.cs (Invocation.BetterFunction): If two methods have
5569         equal parameter types, but only one of them is generic, the
5570         non-generic one wins.
5571         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5572         instance; just use `Type.IsValueType' to determine whether
5573         something is a struct or not.
5574         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5575         so we can be called multiple times.
5576
5577 2004-11-10  Martin Baulig  <martin@ximian.com>
5578
5579         * generic.cs (TypeParameter.DefineConstraints): New public method.
5580         (TypeParameter.CheckAccessLevel): Override this and return true.
5581         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5582         override ResolveType() anymore.
5583         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5584
5585 2004-11-10  Martin Baulig  <martin@ximian.com>
5586
5587         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5588         call DeclSpace.ResolveNestedType() on it.
5589
5590 2004-11-10  Martin Baulig  <martin@ximian.com>
5591
5592         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5593         non-null, call ParameterModifier() on it.
5594
5595 2004-11-10  Martin Baulig  <martin@ximian.com>
5596
5597         * iterators.cs
5598         (Iterators): Added `current_type' and `this_type' fields.
5599         (Iterators.DefineIterator): Create a new EmitContext and store it
5600         in `ec'; compute `this_type'.
5601
5602 2004-11-10  Martin Baulig  <martin@ximian.com>
5603
5604         * typemanager.cs
5605         (TypeManager.IsPrivateAccessible): New public method.
5606         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5607
5608 2004-11-10  Martin Baulig  <martin@ximian.com>
5609
5610         * class.cs (TypeContainer.DefineType): Call
5611         TypeBuilder.DefineGenericParameters() before resolving the type
5612         parameters.
5613         (MethodData.parent_method): New protected field.
5614         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5615         (MethodData.Define): Compute `parent_method'.
5616
5617         * decl.cs
5618         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5619         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5620         (DeclSpace.ec): New protected field; store the EmitContext here.
5621         (DeclSpace.EmitContext): New public property.
5622         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5623         (DeclSpace.ResolveNestedType): New public method.
5624         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5625         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5626         (DeclSpace.FamilyAccessible): Likewise.
5627         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5628         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5629         EmitContext.
5630
5631         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5632         field.
5633
5634         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5635         (Enum.Emit): Don't create a new EmitContext.
5636
5637 2004-10-18  Martin Baulig  <martin@ximian.com>
5638
5639         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5640         `Type' directly, but call ResolveType() on it.
5641         (Catch.Resolve): Likewise.
5642         (Foreach.Resolve): Likewise.
5643
5644 2004-10-18  Martin Baulig  <martin@ximian.com>
5645
5646         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5647         `Type' directly, but call ResolveType() on it.
5648         (Probe.DoResolve): Likewise.
5649         (ArrayCreation.LookupType): Likewise.
5650         (TypeOf.DoResolve): Likewise.
5651         (SizeOf.DoResolve): Likewise.
5652
5653 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5654
5655         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5656         the ResolveType.
5657
5658 2004-10-17  John Luke  <john.luke@gmail.com>
5659
5660         * class.cs (Operator.GetSignatureForError): use CSharpName
5661
5662         * parameter.cs (Parameter.GetSignatureForError): Returns
5663         correct name even if was not defined.
5664
5665 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5666
5667         Fix #65816.
5668         * class.cs (TypeContainer.EmitContext): New property.
5669         (DefineNestedTypes): Create an emitcontext for each part.
5670         (MethodCore.DoDefineParameters): Use container's emitcontext.
5671         Pass type array to InternalParameters.
5672         (MemberBase.DoDefine): Use container's emitcontext.
5673         (FieldMember.Define): Likewise.
5674         (Event.Define): Likewise.
5675         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5676         Pass type array to InternalParameters.
5677         (SetIndexerMethod.GetParameterInfo): Likewise.
5678         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5679         * delegate.cs (Define): Pass emitcontext to
5680         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5681         array to InternalParameters.
5682         * expression.cs (ParameterReference.DoResolveBase): Pass
5683         emitcontext to GetParameterInfo.
5684         (ComposedCast.DoResolveAsTypeStep): Remove check on
5685         ec.ResolvingTypeTree.
5686         * parameter.cs (Parameter.Resolve): Change argument to
5687         EmitContext.  Use ResolveAsTypeTerminal.
5688         (Parameter.GetSignature): Change argument to EmitContext.
5689         (Parameters.ComputeSignature): Likewise.
5690         (Parameters.ComputeParameterTypes): Likewise.
5691         (Parameters.GetParameterInfo): Likewise.
5692         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5693         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5694         * support.cs (InternalParameters..ctor): Remove variant that takes
5695         a DeclSpace.
5696         * typemanager.cs (system_intptr_expr): New.
5697         (InitExpressionTypes): Initialize it.
5698
5699 2004-10-12  Chris Toshok  <toshok@ximian.com>
5700
5701         * cs-parser.jay: fix location for try_statement and catch_clause.
5702
5703 2004-10-18  Martin Baulig  <martin@ximian.com>
5704
5705         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5706         `Type' directly, but call ResolveType() on it.
5707         (MemberBase.DoDefine): Likewise.
5708
5709         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5710         `Type' directly, but call ResolveType() on it.
5711         (ComposedCast.DoResolveAsTypeStep): Likewise.
5712
5713         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5714         `Type' directly, but call ResolveType() on it.
5715
5716 2004-10-17  John Luke  <john.luke@gmail.com>
5717
5718         * class.cs (Operator.GetSignatureForError): use CSharpName
5719
5720         * parameter.cs (Parameter.GetSignatureForError): Returns
5721         correct name even if was not defined.
5722
5723 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5724
5725         Fix #65816.
5726         * class.cs (TypeContainer.EmitContext): New property.
5727         (DefineNestedTypes): Create an emitcontext for each part.
5728         (MethodCore.DoDefineParameters): Use container's emitcontext.
5729         Pass type array to InternalParameters.
5730         (MemberBase.DoDefine): Use container's emitcontext.
5731         (FieldMember.Define): Likewise.
5732         (Event.Define): Likewise.
5733         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5734         Pass type array to InternalParameters.
5735         (SetIndexerMethod.GetParameterInfo): Likewise.
5736         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5737         * delegate.cs (Define): Pass emitcontext to
5738         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5739         array to InternalParameters.
5740         * expression.cs (ParameterReference.DoResolveBase): Pass
5741         emitcontext to GetParameterInfo.
5742         (ComposedCast.DoResolveAsTypeStep): Remove check on
5743         ec.ResolvingTypeTree.
5744         * parameter.cs (Parameter.Resolve): Change argument to
5745         EmitContext.  Use ResolveAsTypeTerminal.
5746         (Parameter.GetSignature): Change argument to EmitContext.
5747         (Parameters.ComputeSignature): Likewise.
5748         (Parameters.ComputeParameterTypes): Likewise.
5749         (Parameters.GetParameterInfo): Likewise.
5750         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5751         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5752         * support.cs (InternalParameters..ctor): Remove variant that takes
5753         a DeclSpace.
5754         * typemanager.cs (system_intptr_expr): New.
5755         (InitExpressionTypes): Initialize it.
5756
5757 2004-10-12  Chris Toshok  <toshok@ximian.com>
5758
5759         * cs-parser.jay: fix location for try_statement and catch_clause.
5760
5761 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5762
5763         More DeclSpace.ResolveType avoidance.
5764         * decl.cs (MemberCore.InUnsafe): New property.
5765         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5766         with newly created EmitContext.
5767         (FieldMember.Define): Likewise.
5768         * delegate.cs (Delegate.Define): Likewise.
5769         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5770         only if normal name-lookup fails.
5771         (TypeExpr.DoResolve): Enable error-checking.
5772         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5773         (SizeOf.DoResolve): Likewise.
5774         (ComposedCast.DoResolveAsTypeStep): Likewise.
5775         (StackAlloc.DoResolve): Likewise.
5776         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5777         (Block.Unsafe): New property.
5778         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5779         (Unsafe): Set 'unsafe' flag of contained block.
5780         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5781         (Fixed.Resolve): Likewise.
5782         (Catch.Resolve): Likewise.
5783         (Using.ResolveLocalVariableDecls): Likewise.
5784         (Foreach.Resolve): Likewise.
5785
5786 2004-10-05  John Luke <john.luke@gmail.com>
5787
5788         * cs-parser.jay: add location to error CS0175
5789
5790 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5791
5792         * ecore.cs (Expression.Constantity): Add support for turning null
5793         into a constant.
5794
5795         * const.cs (Const.Define): Allow constants to be reference types
5796         as long as the value is Null.
5797
5798 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5799
5800         * namespace.cs (NamespaceEntry.Using): No matter which warning
5801         level is set, check if this namespace name has already been added.
5802
5803 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5804
5805         * expression.cs: reftype [!=]= null should always use br[true,false].
5806         # 67410
5807
5808 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5809
5810         Fix #67108
5811         * attribute.cs: Enum conversion moved to 
5812         GetAttributeArgumentExpression to be applied to the all
5813         expressions.
5814
5815 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5816
5817         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5818         * class.c (TypeContainer.DefineType): Flag error if
5819         base types aren't accessible due to access permissions.
5820         * decl.cs (DeclSpace.ResolveType): Move logic to
5821         Expression.ResolveAsTypeTerminal.
5822         (DeclSpace.ResolveTypeExpr): Thin layer over
5823         Expression.ResolveAsTypeTerminal.
5824         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5825         Refactor code into NestedAccess.  Use it.
5826         (DeclSpace.NestedAccess): New.
5827         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5828         argument to silence errors.  Check access permissions.
5829         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5830         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5831         (Cast.DoResolve): Likewise.
5832         (New.DoResolve): Likewise.
5833         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5834         (TypeOf.DoResolve): Likewise.
5835
5836         * expression.cs (Invocation.BetterConversion): Return the Type of
5837         the better conversion.  Implement section 14.4.2.3 more faithfully.
5838         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5839         section 14.4.2.2 explicit.
5840         (Invocation.OverloadResolve): Update.
5841         (Invocation): Remove is_base field.
5842         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5843         (Invocation.Emit): Likewise.
5844
5845 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5846
5847         * cs-parser.jay: Reverted 642 warning fix.
5848
5849 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5850
5851         Fix bug #66615
5852         * decl.cs (FindMemberWithSameName): Indexer can have more than
5853         1 argument.
5854
5855 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5856
5857         * expression.cs (LocalVariableReference.DoResolveLValue):
5858         Do not report warning 219 for out values.
5859         (EmptyExpression.Null): New member to avoid extra allocations.
5860
5861 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5862
5863         * cs-parser.jay: Fix wrong warning 642 report.
5864
5865         * cs-tokenizer.cs (CheckNextToken): New helper;
5866         Inspect next character if is same as expected.
5867
5868 2004-09-23  Martin Baulig  <martin@ximian.com>
5869
5870         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5871         (Convert.ImplicitReferenceConversionExists): Likewise.
5872
5873 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5874
5875         * Makefile (DISTFILES): Comment out a few missing files.
5876
5877 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5878
5879         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5880         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5881         (gmcs.exe): Invoke bootstrap-libs.
5882         (clean-local): Clean the net_2_0_bootstrap profile too.
5883         (PROGRAM_INSTALL_DIR): New.
5884         (install-local): Use it.
5885
5886 2004-10-13  Martin Baulig  <martin@ximian.com>
5887
5888         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5889         (TypeParameter.DefineType): If we're a method type parameter and
5890         that method is overriding something, "inflate" its constraints.
5891
5892 2004-10-12  Martin Baulig  <martin@ximian.com>
5893
5894         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5895         and have type arguments, create and resolve a ConstructedType.
5896
5897 2004-10-12  Martin Baulig  <martin@ximian.com>
5898
5899         * decl.cs (MemberCache.FindMemberToOverride): Use
5900         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5901         to compare the invocationType.
5902
5903         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5904         When comparing two type parameters, only do the signature-only
5905         comparision for method type parameters.
5906
5907 2004-10-11  Martin Baulig  <martin@ximian.com>
5908
5909         * report.cs: Don't make --fatal abort on warnings, we have
5910         -warnaserror for that.
5911
5912 2004-10-11  Martin Baulig  <martin@ximian.com>
5913
5914         * typemanager.cs
5915         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5916         (TypeManager.IsEqual): Call ourself recursively instead of using
5917         Type.IsEqual(). 
5918
5919 2004-10-11  Martin Baulig  <martin@ximian.com>
5920
5921         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5922         on our own type parameters, not on the ones we inherit from a containing
5923         class.
5924
5925         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5926         the comparision.
5927
5928         * generic.cs (TypeParameter.Define): We may only be called once.
5929
5930         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5931         instead of TypeManager.IsEqual().
5932
5933 2004-09-28  Martin Baulig  <martin@ximian.com>
5934
5935         * generic.cs
5936         (GenericConstraints.EffectiveBaseClass): New public property.
5937         (TypeParameter.GenericConstraints): New public property.
5938         (ConstructedType.CheckConstraints): Improved.
5939
5940         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5941         (Convert.TypeParameterConversion): New private method; use this in
5942         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5943         for all conversions related to type parameters.
5944
5945 2004-09-24  Martin Baulig  <martin@ximian.com>
5946
5947         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5948         type parameter conversions for type parameters which are known to
5949         be reference types.
5950
5951 2004-09-24  Martin Baulig  <martin@ximian.com>
5952
5953         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5954         `IsValueType' properties.
5955
5956         * support.cs (ReflectionConstraints): Use
5957         Type.GetGenericParameterConstraints() instead of the old hack.
5958
5959 2004-09-24  Martin Baulig  <martin@ximian.com>
5960
5961         * generic.cs (GenericConstraints): Moved here and made it an
5962         abstract class.
5963
5964         * support.cs (GenericConstraints): Moved to generic.cs.
5965
5966 2004-09-24  Martin Baulig  <martin@ximian.com>
5967
5968         * support.cs
5969         (ReflectionConstraints): Un-nested this class and made it public.
5970
5971         * typemanager.cs
5972         (TypeManager.GetTypeParameterConstraints): New public method.
5973         (TypeManager.HasConstructorConstraint): Use the attributes.
5974
5975 2004-09-24  Martin Baulig  <martin@ximian.com>
5976
5977         * support.cs (GenericConstraints): Replaced `HasConstructor',
5978         `IsReferenceType' and `IsValueType' with `Attributes'.
5979         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5980         method and made the .ctor public.
5981
5982         * generic.cs (Constraints.Attributes): New public property.
5983         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5984         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5985         `IsValueType' -> `HasValueTypeConstraint'.
5986
5987 2004-09-23  Martin Baulig  <martin@ximian.com>
5988
5989         * generic.cs (Constraints): Reflect latest runtime changes.
5990
5991 2004-09-23  Martin Baulig  <martin@ximian.com>
5992
5993         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5994         (Convert.ImplicitReferenceConversionExists): Likewise.
5995
5996 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5997
5998         * class.cs (Operator.Define): Add error 448 and 559 report.
5999         
6000 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6001
6002         * class.cs (MemberBase.IsTypePermitted): New protected
6003         method for checking error CS0610.
6004
6005 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6006
6007         * class.cs (TypeContainer.HasExplicitLayout): New property
6008         Returns whether container has StructLayout attribute set Explicit.
6009         (FieldMember): New abstract class for consts and fields.
6010         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6011         (Field): Reuse FieldMember.
6012
6013         * const.cs (Const): Reuse FieldMember.
6014
6015         * rootcontext.cs: EmitConstants call moved to class.
6016
6017 2004-09-22  Martin Baulig  <martin@ximian.com>
6018
6019         Marek and me just fixed one of our oldest bugs: #28562 :-)
6020
6021         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6022
6023         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6024         we're an EnumConstant, just return that.
6025         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6026         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6027         to get the value which'll actually be written into the attribute.
6028         However, we have to use GetValue() to access the attribute's value
6029         in the compiler.        
6030
6031 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6032
6033         * constant.cs (Constant.IsNegative): New abstract property
6034         IsNegative.
6035
6036         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6037         (StackAlloc.DoResolve): Reused IsNegative.
6038
6039 2004-09-22  Martin Baulig  <martin@ximian.com>
6040
6041         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6042         public method; like LookupTypeContainer, but also works for
6043         generic instances.
6044
6045         * report.cs (Report.SymbolRelatedToPreviousError): Use
6046         TypeManager.LookupGenericTypeContainer().       
6047
6048 2004-09-22  Martin Baulig  <martin@ximian.com>
6049
6050         Thanks to Peter Sestoft for this bug report.
6051
6052         * expression.cs (Conditional): If both the `trueExpr' and the
6053         `falseExpr' is a NullLiteral, return a NullLiteral.
6054
6055 2004-09-22  Martin Baulig  <martin@ximian.com>
6056
6057         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6058         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6059         for the "get_Current" call.
6060
6061 2004-09-21  Martin Baulig  <martin@ximian.com>
6062
6063         * convert.cs (Convert.ImplicitReferenceConversion): When
6064         converting to an interface type, first check whether we're
6065         converting from a reference type.
6066
6067 2004-09-14  Martin Baulig  <martin@ximian.com>
6068
6069         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6070
6071 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6072
6073         Fixed bug #61902
6074         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6075         called and is obsolete then this member suppress message
6076         when call is inside next [Obsolete] method or type.
6077
6078         * expression.cs: Use TestObsoleteMethodUsage member.
6079
6080 2004-09-14  Martin Baulig  <martin@ximian.com>
6081
6082         * genericparser.cs: Removed.
6083
6084 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6085
6086         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6087
6088 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6089
6090         * attribute.cs (Attribute.Resolve): Add error 653 report.
6091
6092         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6093         report.
6094         (Method.ApplyAttributeBuilder): Add error 685 report.
6095         (Operator.Define): Add error 564 report.
6096
6097         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6098
6099         * expression.cs (Invocation.DoResolve): Add error
6100         245 and 250 report.
6101
6102         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6103         error 674 report.
6104
6105 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6106
6107         * class.cs (ConstructorInitializer.Resolve):
6108         Wrong error number (515->516).
6109
6110 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6111
6112         * class.cs (Indexer.Define): Add error 631 report.
6113
6114 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6117
6118 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6119
6120         * expression.cs (Probe.DoResolve): Add error CS0241 report.
6121
6122 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
6123
6124         * cs-parser.jay: Added error CS0241 report.
6125
6126 2004-09-10  Raja R Harinath  <rharinath@novell.com>
6127
6128         * cs-parser.jay (fixed_statement): Introduce a scope for the
6129         declaration in the 'fixed' statement.
6130
6131 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6132
6133         * cs-parser.jay: Added CS0230 error report.
6134
6135 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6136
6137         * cs-parser.jay: Added errors CS0231 and CS0257 report.
6138
6139 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6140
6141         * expression.cs (Argument.Resolve): Added error CS0192 and
6142         CS0199 report.
6143
6144 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6145
6146         C# 2.0 #pragma warning feature
6147
6148         * cs-tokenizer.cs (PreProcessPragma): New method; 
6149         Handles #pragma directive.
6150
6151         * report.cs (WarningRegions): New class; Support
6152         class for #pragma warning directive. It tests whether
6153         warning is enabled for a given line.
6154
6155 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
6156
6157         * const.cs: Add more descriptive error report, tahnks to
6158         Sebastien. 
6159
6160 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6163
6164 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
6165
6166         * expression.cs: Apply patch from Ben: Remove dead code from
6167         ArrayCreation, and remove the TurnintoConstant call in const.cs,
6168         as that code just threw an exception anwyays.
6169
6170         * const.cs: Remove the call to the turnintoconstant, for details
6171         see bug: #63144
6172         
6173         * literal.cs: The type of the null-literal is the null type;  So
6174         we use a placeholder type (literal.cs:System.Null, defined here)
6175         for it.
6176
6177         * expression.cs (Conditional.DoResolve): Remove some old code that
6178         is no longer needed, conversions have been fixed.
6179
6180         (ArrayCreationExpression.DoResolve): Return false if we fail to
6181         resolve the inner expression.
6182
6183 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6184
6185         Fix test-290.cs.
6186         * cs-parser.jay (delegate_declaration): Record a delegate
6187         declaration as a type declaration.
6188         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6189
6190 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6191
6192         * parameter.cs: Do not crash if the type can not be resolved. 
6193
6194         * expression.cs: Report errors with unsafe pointers, fixes #64896
6195
6196 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6197
6198         * expression.cs: Pointer arith always needs to do a conv.i
6199         if the operand is a long. fix 65320
6200
6201 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6202
6203         Fixed cs0619-37.cs, cs0619-38.cs
6204
6205         * enum.cs (GetObsoleteAttribute): Removed.
6206
6207         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6208         on Enum member is double staged. The first is tested member
6209         and then enum.
6210
6211 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6212
6213         Fixed #56986, #63631, #65231
6214
6215         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6216         adds member to name container.
6217         (TypeContainer.AddToTypeContainer): New method, adds type to
6218         name container.
6219         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6220         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6221         AddOperator): Simplified by reusing AddToMemberContainer.
6222         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6223         instead of field.
6224         (Method.CheckForDuplications): Fixed implementation to test all
6225         possibilities.
6226         (MemberBase): Detection whether member is explicit interface
6227         implementation is now in constructor.
6228         (MemberBase.UpdateMemberName): Handles IndexerName.
6229         (Accessor): Changed to keep also location information.
6230         (AbstractPropertyEventMethod): Is derived from MemberCore.
6231         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6232         will be emited or not.
6233         (PropertyBase.AreAccessorsDuplicateImplementation):
6234         Tests whether accessors are not in collision with some method.
6235         (Operator): Is derived from MethodCore to simplify common
6236         operations.
6237
6238         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6239         must be performed.
6240         (DeclSpace.AddToContainer): Adds the member to defined_names
6241         table. It tests for duplications and enclosing name conflicts.
6242
6243         * enum.cs (EnumMember): Clean up to reuse the base structures
6244
6245 2004-09-03  Martin Baulig  <martin@ximian.com>
6246
6247         Merged latest changes into gmcs.  Please keep this comment in
6248         here, it makes it easier for me to see what changed in MCS since
6249         the last time I merged.
6250
6251 2004-09-03  Martin Baulig  <martin@ximian.com>
6252
6253         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6254         into TypeContainer, to make partial classes work again.
6255
6256 2004-09-03  Martin Baulig  <martin@ximian.com>
6257
6258         * rootcontext.cs (RootContext.V2): Removed.
6259
6260 2004-03-23  Martin Baulig  <martin@ximian.com>
6261
6262         * expression.cs (Invocation.OverloadResolve): Added `bool
6263         may_fail' argument and use it instead of the Location.IsNull() hack.
6264
6265 2004-09-09  Martin Baulig  <martin@ximian.com>
6266
6267         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6268
6269 2004-09-09  Martin Baulig  <martin@ximian.com>
6270
6271         * generic.cs (TypeParameter.DefineType): Added support for
6272         explicit interface methods.
6273
6274 2004-09-09  Martin Baulig  <martin@ximian.com>
6275
6276         * README.Changes: New document.  Started to list important changes
6277         between MCS and GMCS here.
6278
6279 2004-09-08  Martin Baulig  <martin@ximian.com>
6280
6281         * class.cs
6282         (TypeContainer.CheckRecursiveDefinition): New protected method.
6283         (TypeContainer.DefineType): Move the CS0146 check into
6284         CheckRecursiveDefinition().     
6285
6286 2004-09-06  Martin Baulig  <martin@ximian.com>
6287
6288         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6289         types for the constructor constraint.
6290
6291 2004-09-03  Martin Baulig  <martin@ximian.com>
6292
6293         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6294         into TypeContainer, to make partial classes work again.
6295
6296 2004-09-03  Martin Baulig  <martin@ximian.com>
6297
6298         * rootcontext.cs (RootContext.V2): Removed.
6299
6300 2004-03-23  Martin Baulig  <martin@ximian.com>
6301
6302         * expression.cs (Invocation.OverloadResolve): Added `bool
6303         may_fail' argument and use it instead of the Location.IsNull() hack.
6304
6305 2004-09-03  Martin Baulig  <martin@ximian.com>
6306
6307         Merged latest changes into gmcs.  Please keep this comment in
6308         here, it makes it easier for me to see what changed in MCS since
6309         the last time I merged.
6310
6311 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6312
6313         Fix #61128.
6314         * expression.cs (BetterConversion): Don't allow either conversion 
6315         to be null.  Remove redundant implicit conversion test when 'q ==
6316         null' -- when this function is invoked, we already know that the
6317         implicit conversion exists.
6318         (BetterFunction): Assume that 'best' is non-null.  Remove
6319         redundant reimplementation of IsApplicable when 'best' is null.
6320         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6321         number of arguments.
6322         (IsAncestralType): Extract from OverloadResolve.
6323         (OverloadResolve): Make robust to the MethodGroupExpr being
6324         unsorted.  Implement all the logic of Section 14.5.5.1, and
6325         support overloading of methods from multiple applicable types.
6326         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6327
6328         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6329         (RealError, Warning): Append type of report to related symbol.
6330
6331 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6332
6333         * enum.cs: Fixed CLS-Compliance checks for enum members.
6334         Error tests cs3008-8.cs, cs3014-8.cs
6335
6336 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6337
6338         Fixed bug #62342, #63102
6339         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6340         like ImplementMethod.
6341
6342 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6345         Fixed bug #65170.
6346
6347 2004-09-02  Martin Baulig  <martin@ximian.com>
6348
6349         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6350         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6351         on the MethodBase.
6352
6353 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6354
6355         C# 2.0 Static classes implemented
6356
6357         * class.cs (TypeContainer): instance_constructors,
6358         initialized_fields, initialized_static_fields,
6359         default_constructor, base_inteface_types are protected to be
6360         accessible from StaticClass.
6361         (TypeContainer.DefineDefaultConstructor): New virtual method
6362         for custom default constructor generating
6363         (StaticClass): New class to handle "Static classes" feature.
6364
6365         * cs-parser.jay: Handle static keyword on class like instance
6366         of StaticClass.
6367
6368         * driver.cs: Added "/langversion" command line switch with two
6369         options (iso-1, default).
6370
6371 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6372
6373         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6374
6375 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6376
6377         * delegate.cs: Style.
6378
6379 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6380
6381         * delegate.cs: Add seperate instance expr field for miguel.
6382
6383 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6384
6385         * PointerArithmetic (Resolve): make sure we are not doing
6386         pointer arith on void*. Also, make sure we are resolved
6387         by not setting eclass until resolve.
6388
6389         All callers: Make sure that PointerArithmetic gets resolved.
6390
6391 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6392
6393         * ArrayCreation (LookupType): If the type does not resolve 
6394         to an array, give an error.
6395
6396 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6397
6398         * statement.cs (Try.Resolve): Fixed bug #64222
6399
6400 2004-08-27  Martin Baulig  <martin@ximian.com>
6401
6402         * class.cs
6403         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6404         crash here.     
6405
6406 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6407
6408         * ecore.cs (Constantify): Get underlying type via
6409         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6410         Windows in special cases.
6411
6412 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6413
6414         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6415         for obtaining also private methods.
6416         (GetRemoveMethod): Used GetRemoveMethod (true)
6417         for obtaining also private methods.
6418
6419 2004-09-02  Martin Baulig  <martin@ximian.com>
6420
6421         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6422         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6423         on the MethodBase.
6424
6425 2004-08-27  Martin Baulig  <martin@ximian.com>
6426
6427         * class.cs
6428         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6429         crash here.     
6430
6431 2004-08-25  Martin Baulig  <martin@ximian.com>
6432
6433         * support.cs (ReflectionParameters..ctor): If this is a generic
6434         method, retrieve and store its type parameters.
6435         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6436         (ReflectionParameters.GenericConstraints): The argument specifies
6437         the type parameter, not the method parameter.
6438         (InternalParameters.GenericConstraints): Likewise.
6439
6440         * generic.cs (TypeParameter.DefineType): Correctly handle
6441         constraints wrt. generic methods in interfaces and their
6442         implementations.        
6443
6444 2004-08-24  Martin Baulig  <martin@ximian.com>
6445
6446         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6447         (Constraints.IsSubclassOf): New internal method.
6448
6449         * typemanager.cs (TypeManager.FindMembers): Added special support
6450         for GenericTypeParameterBuilder's.      
6451         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6452         type parameters.
6453
6454 2004-08-24  Martin Baulig  <martin@ximian.com>
6455
6456         * typemanager.cs
6457         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6458         this for accessibility checks.
6459         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6460         IsNestedFamilyAccessible.
6461         (TypeManager.IsSubclassOf): New method, do what the name actually
6462         says.   
6463
6464 2004-08-24  Martin Baulig  <martin@ximian.com>
6465
6466         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6467         as a SimpleName, include the generic arity.
6468
6469 2004-08-24  Martin Baulig  <martin@ximian.com>
6470
6471         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6472         MethodAttributes.HideBySig for operators.
6473
6474 2004-08-23  Martin Baulig  <martin@ximian.com>
6475
6476         Back to the old error reporting system :-)
6477
6478         * report.cs (Message): Removed.
6479         (Report.MessageData, ErrorData, WarningData): Removed.
6480         (Report.Error, Warning): Back to the old system.
6481
6482 2004-08-23  Martin Baulig  <martin@ximian.com>
6483
6484         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6485
6486         * class.cs (TypeContainer.ParentContainer): New public virtual
6487         method; replaces the explicit interface implementation.
6488         (ClassPart.ParentContainer): Override.
6489
6490 2004-08-23  Martin Baulig  <martin@ximian.com>
6491
6492         * statement.cs (Switch): Added support for constant switches; see
6493         #59428 or test-285.cs.
6494
6495 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6496
6497         Fixed bug #62740.
6498         * statement.cs (GetEnumeratorFilter): Removed useless
6499         logic because C# specs is strict. GetEnumerator must be
6500         public.
6501
6502 2004-08-22  Martin Baulig  <martin@ximian.com>
6503
6504         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6505         a switch and may break, reset the barrier.  Fixes #59867.
6506
6507 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6508
6509         CLS-Compliance speed up (~5% for corlib)
6510
6511         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6512         New method. Tests container for CLS-Compliant names
6513
6514         * class.cs (TypeContainer.VerifyClsName): New method.
6515         Checks whether container name is CLS Compliant.
6516         (Constructor): Implements IMethodData.
6517
6518         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6519         low-case table for CLS Compliance test.
6520         (MemberCache.VerifyClsParameterConflict): New method.
6521         Checks method parameters for CS3006 error.
6522
6523         * enum.cs (EnumMember): Is derived from MemberCore.
6524         (Enum.VerifyClsName): Optimized for better performance.
6525
6526 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6527
6528         * report.cs: Renamed Error_T to Error and changed all
6529         references.
6530
6531 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6532
6533         * class.cs (TypeContainer.IndexerArrayList): New inner class
6534         container for indexers.
6535         (TypeContainer.DefaultIndexerName): New constant for default
6536         indexer name. Replaced all "Item" with this constant.
6537         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6538
6539         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6540         DefaultMemberAttribute constructor.
6541
6542 2004-08-05  Martin Baulig  <martin@ximian.com>
6543
6544         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6545         Fix bug #59429.
6546
6547 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6548
6549         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6550         multi platforms problem.
6551
6552         * compiler.csproj: Included shared files.
6553
6554 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6555
6556         Fix bug 60333, 55971 in the more general way
6557         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6558         Added arg_type argument for constant conversion.
6559         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6560
6561 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6562
6563         Fix bug #59760
6564         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6565         OperatorArrayList, MethodCoreArrayList for typecontainer
6566         containers. Changed class member types to these new types.
6567         (MethodArrayList.DefineMembers): Added test for CS0659.
6568
6569 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6570
6571         * cfold.cs: Synchronize the folding with the code in expression.cs
6572         Binary.DoNumericPromotions for uint operands.
6573
6574         * attribute.cs: Revert patch from Raja, it introduced a regression
6575         while building Blam-1.2.1 (hard to isolate a test case).
6576
6577 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6578
6579         Fix for #55382
6580         * class.cs:
6581         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6582         name collision.
6583         (MethodCore.parent_method): New member. The method we're overriding
6584         if this is an override method.
6585         (MethodCore.CheckBase): Moved from Method class and made common.
6586         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6587         private.
6588         (MethodCore.CheckForDuplications): New abstract method. For custom
6589         member duplication search in a container
6590         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6591         method and its return type.
6592         (Event.conflict_symbol): New member. Symbol with same name in the
6593         parent class.
6594
6595         * decl.cs:
6596         (MemberCache.FindMemberWithSameName): New method. The method
6597         is looking for conflict with inherited symbols.
6598
6599 2004-08-04  Martin Baulig  <martin@ximian.com>
6600
6601         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6602
6603         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6604
6605 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6606
6607         * report.cs (Message): New enum for better error, warning reference in
6608         the code.
6609         (MessageData): New inner abstract class. It generally handles printing of
6610         error and warning messages.
6611         Removed unused Error, Warning, Message methods.
6612
6613 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6614
6615         Fix for cs0592-8.cs test
6616         * attribute.cs
6617         (Attributable.ValidAttributeTargets): Made public.
6618         (Attribute.ExplicitTarget): New member for explicit target value.
6619         (Attribute.CheckTargets): Now we translate explicit attribute
6620         target to Target here.
6621
6622 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6623
6624         * ecore.cs (MethodGroupExpr): new IsBase property.
6625
6626         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6627
6628         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6629         rather than an instance expr.
6630
6631         (DelegateCreation.Emit): Use the method group rather than
6632         the instance expression. Also, if you have base.Foo as the
6633         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6634
6635         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6636
6637         (NewDelegate.DoResolve): Only check for the existance of Invoke
6638         if the method is going to be needed. Use MethodGroupExpr.
6639
6640         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6641
6642         * expression.cs: For pointer arith., make sure to use
6643         the size of the type, not the size of the pointer to
6644         the type.
6645
6646 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6647
6648         Fix for #60722
6649         * class.cs (Class): Added error CS0502 test.
6650
6651 2004-08-03  John Luke  <jluke@cfl.rr.com>
6652             Raja R Harinath  <rharinath@novell.com>
6653
6654         Fix for #60997.
6655         * attribute.cs (Attribute.complained_before): New flag.
6656         (Attribute.ResolveType, Attribute.Resolve),
6657         (Attribute.DefinePInvokeMethod): Set it.
6658         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6659         
6660 2004-08-03  Martin Baulig  <martin@ximian.com>
6661
6662         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6663         use a user-defined operator; we still need to do numeric
6664         promotions in case one argument is a builtin type and the other
6665         one has an implicit conversion to that type.  Fixes #62322.
6666
6667 2004-08-18  Martin Baulig  <martin@ximian.com>
6668
6669         * class.cs (Method.Define): Use the correct method name when
6670         creating the MethodBuilder for a generic method.
6671
6672 2004-08-17  Martin Baulig  <martin@ximian.com>
6673
6674         * generic.cs (Constraints): Support type parameter constraints.
6675
6676 2004-08-16  Martin Baulig  <martin@ximian.com>
6677
6678         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6679         (Token.GENERIC_DIMENSION): New token; this is returned if we
6680         encounter an unbound generic type in a typeof() expression.
6681
6682         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6683         this token is only generated while parsing a typeof() expression.
6684         (typeof_expression): Removed the old unbound_type hack.
6685
6686         * generic.cs (TypeArguments.IsUnbound): New public property.
6687
6688         * decl.cs (MemberName): Added support for unbound types.
6689
6690 2004-08-14  Martin Baulig  <martin@ximian.com>
6691
6692         * typemanager.cs
6693         (TypeManager.IsEqualGenericInstance): New static method.
6694         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6695         just used to check accessibility, so follow the rules of 26.1.6.        
6696
6697         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6698         ConstructedType instead of a TypeExpression if we have type arguments.
6699
6700         * cs-parser.jay (typeof_expression): Support unbound generic types.
6701
6702         * ecore.cs (UnboundTypeExpression): New public class.
6703
6704 2004-08-12  Martin Baulig  <martin@ximian.com>
6705
6706         * typemanager.cs (TypeManager.IsNestedChildOf): Use
6707         TypeManager.IsEqual() rather than `=='.
6708
6709         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6710         generic instances as well.
6711
6712 2004-08-12  Martin Baulig  <martin@ximian.com>
6713
6714         * expression.cs (Invocation.InferType): We can only infer method
6715         type parameters.  Fixes #62647.
6716
6717 2004-08-11  Martin Baulig  <martin@ximian.com>
6718
6719         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6720         before resolving the base classes.
6721
6722 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6723
6724         * Makefile: install .mdb file too.
6725
6726 2004-08-05  Martin Baulig  <martin@ximian.com>
6727
6728         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6729         initializer, the current type is just the TypeBuilder, not the
6730         instantiated generic type.
6731         (FieldExpr.IsFieldInitializer): New public property.
6732
6733 2004-08-04  Martin Baulig  <martin@ximian.com>
6734
6735         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6736
6737         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6738
6739 2004-08-03  Martin Baulig  <martin@ximian.com>
6740
6741         * class.cs (MethodData.Define): If we're an explicit
6742         implementation, remove the generic arity from the type name.
6743
6744 2004-08-03  Martin Baulig  <martin@ximian.com>
6745
6746         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6747         use a user-defined operator; we still need to do numeric
6748         promotions in case one argument is a builtin type and the other
6749         one has an implicit conversion to that type.  Fixes #62322.
6750
6751 2004-08-02  Martin Baulig  <martin@ximian.com>
6752
6753         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6754         `TypeExpr[]' array.
6755         (TypeContainer.GetClassBases): Return the unexpanded list of
6756         interfaces; we expand them later.
6757         (TypeContainer.DefineType): After creating the TypeBuilder, call
6758         TypeManager.ExpandInterfaces() to get an expanded and resolved
6759         list of interfaces.
6760
6761         * ecore.cs (TypeExpr.GetInterfaces): Removed
6762
6763         * generics.cs (Constraints.InterfaceConstraints): Remove.
6764         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6765         register the interface constraints.
6766
6767         * typemanager.cs
6768         (TypeManager.AddUserType): Removed the `ifaces' argument.
6769         (TypeManager.AddTypeParameter): Likewise.
6770         (TypeManager.AddUserInterface): Removed, was unused.
6771         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6772         `TypeExpr[]' array for the interfaces.
6773         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6774         has been defined, returns a list of the resolved interfaces types.
6775         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6776         (TypeManager.GetExplicitInterfaces): Likewise.  
6777
6778 2004-08-02  Martin Baulig  <martin@ximian.com>
6779
6780         * expression.cs (Invocation.EmitCall): If we're invoking a method
6781         on a type parameter, use the new `Constrained' prefix opcode.
6782
6783 2004-08-02  Martin Baulig  <martin@ximian.com>
6784
6785         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6786         (LocalInfo.IsThis): New public property.
6787         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6788
6789 2004-08-01  Martin Baulig  <martin@ximian.com>
6790
6791         * class.cs (TypeContainer.GetClassBases): Don't set the default
6792         here since we may get called from GetPartialBases().
6793         (TypeContainer.DefineType): If GetClassBases() didn't return a
6794         parent, use the default one.
6795
6796 2004-07-30  Martin Baulig  <martin@ximian.com>
6797
6798         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6799
6800         * class.cs (SourceMethod): New public class, derive from the
6801         symbol writer's ISourceMethod.
6802         (Method): Use the new symbol writer API.
6803
6804         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6805         as argument and use the new symbol writer.
6806
6807         * location.cs
6808         (SourceFile): Implement the symbol writer's ISourceFile.
6809         (Location.SymbolDocument): Removed.
6810         (Location.SourceFile): New public property.
6811
6812         * symbolwriter.cs: Use the new symbol writer API.
6813
6814 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6815
6816         * Makefile (install-local): Remove.  Functionality moved to
6817         executable.make.
6818
6819 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6820
6821         * Makefile: Install mcs.exe.config file together with mcs.exe.
6822         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6823         correct runtime version.
6824         
6825 2004-07-25  Martin Baulig  <martin@ximian.com>
6826
6827         * class.cs
6828         (TypeContainer.RegisterOrder): Removed, this was unused.
6829         (TypeContainer, interface_order): Removed.
6830         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6831         TypeContainer as argument since we can also be called with a
6832         `PartialContainer' for a partial class/struct/interface.
6833         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6834         of checking whether we're an `Interface' - we could be a
6835         `PartialContainer'.
6836         (PartialContainer.Register): Override; call
6837         AddClass()/AddStruct()/AddInterface() on our parent.
6838
6839         * cs-parser.jay (interface_member_declaration): Add things to the
6840         `current_container', not the `current_class'.
6841
6842         * rootcontext.cs (RegisterOrder): The overloaded version which
6843         takes an `Interface' was unused, removed.
6844
6845         * typemanager.cs (TypeManager.LookupInterface): Return a
6846         `TypeContainer', not an `Interface'.
6847         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6848         contain a `PartialContainer' for an interface, so check it's
6849         `Kind' to figure out what it is.
6850
6851 2004-07-25  Martin Baulig  <martin@ximian.com>
6852
6853         * class.cs (Class.DefaultTypeAttributes): New public constant.
6854         (Struct.DefaultTypeAttributes): Likewise.
6855         (Interface.DefaultTypeAttributes): Likewise.
6856         (PartialContainer.TypeAttr): Override this and add the
6857         DefaultTypeAttributes.
6858
6859 2004-07-25  Martin Baulig  <martin@ximian.com>
6860
6861         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6862         we can just use the `Parent' field instead.
6863
6864 2004-07-25  Martin Baulig  <martin@ximian.com>
6865
6866         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6867
6868 2004-07-25  Martin Baulig  <martin@ximian.com>
6869
6870         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6871         our parts before defining any methods.
6872         (TypeContainer.VerifyImplements): Make this virtual.
6873         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6874         on our PartialContainer.
6875
6876 2004-07-25  Martin Baulig  <martin@ximian.com>
6877
6878         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6879
6880         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6881         argument, we can just use the `Parent' field instead.
6882
6883         * class.cs
6884         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6885         (MemberBase.DoDefine): Likewise.
6886
6887 2004-07-24  Martin Baulig  <martin@ximian.com>
6888
6889         * decl.cs (MemberCore.Parent): New public field.
6890         (DeclSpace.Parent): Moved to MemberCore.
6891
6892         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6893         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6894         parent's .ctor.
6895         (FieldBase, Field, Operator): Likewise.
6896         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6897         (EventField, Event): Likewise.
6898
6899 2004-07-23  Martin Baulig  <martin@ximian.com>
6900
6901         * class.cs (PartialContainer): New public class.
6902         (ClassPart): New public class.
6903         (TypeContainer): Added support for partial classes.
6904         (TypeContainer.GetClassBases): Splitted some of the functionality
6905         out into GetNormalBases() and GetPartialBases().
6906
6907         * cs-tokenizer.cs (Token.PARTIAL): New token.
6908         (Tokenizer.consume_identifier): Added some hacks to recognize
6909         `partial', but only if it's immediately followed by `class',
6910         `struct' or `interface'.
6911
6912         * cs-parser.jay: Added support for partial clases.
6913
6914 2004-07-23  Martin Baulig  <martin@ximian.com>
6915
6916         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6917         a `DeclSpace' and also made it readonly.
6918         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6919         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6920         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6921
6922         * cs-parser.jay: Pass the `current_class', not the
6923         `current_container' (at the moment, this is still the same thing)
6924         to a new Method, Property, Event, Indexer or Constructor.
6925
6926 2004-07-23  Martin Baulig  <martin@ximian.com>
6927
6928         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6929         and removed the `current_interface' one.
6930         (struct_declaration, class_declaration, interface_declaration):
6931         Set `current_class' to the newly created class/struct/interface;
6932         set their `Bases' and call Register() before parsing their body.
6933
6934 2004-07-23  Martin Baulig  <martin@ximian.com>
6935
6936         * class.cs (Kind): New public enum.
6937         (TypeContainer): Made this class abstract.
6938         (TypeContainer.Kind): New public readonly field.
6939         (TypeContainer.CheckDef): New public method; moved here from
6940         cs-parser.jay.
6941         (TypeContainer.Register): New public abstract method.
6942         (TypeContainer.GetPendingImplementations): New public abstract
6943         method.
6944         (TypeContainer.GetClassBases): Removed the `is_class' and
6945         `is_iface' parameters.
6946         (TypeContainer.DefineNestedTypes): Formerly known as
6947         DoDefineType().
6948         (ClassOrStruct): Made this class abstract.
6949
6950         * tree.cs (RootTypes): New public type. 
6951
6952 2004-07-20  Martin Baulig  <martin@ximian.com>
6953
6954         * tree.cs (Tree.RecordNamespace): Removed.
6955         (Tree.Namespaces): Removed.
6956
6957         * rootcontext.cs (RootContext.IsNamespace): Removed.
6958
6959         * cs-parser.jay (namespace_declaration): Just create a new
6960         NamespaceEntry here.
6961
6962 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6963
6964         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6965         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6966         entry to make sure it runs in the correct runtime version.
6967         
6968 2004-07-18  Martin Baulig  <martin@ximian.com>
6969
6970         * generic.cs (ConstructedType.CheckConstraints): Improved
6971         constraints checking.
6972
6973 2004-07-18  Martin Baulig  <martin@ximian.com>
6974
6975         * expression.cs (Invocation.BetterMethod): Call
6976         TypeManager.TypeToCoreType() on all types and removed my previous
6977         hack; we're already doig the right thing here.
6978
6979 2004-07-17  Martin Baulig  <martin@ximian.com>
6980
6981         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6982
6983 2004-07-16  Martin Baulig  <martin@ximian.com>
6984
6985         * iterators.cs: Added generics support.
6986
6987 2004-07-16  Martin Baulig  <martin@ximian.com>
6988
6989         * iterators.cs: Rewrote this.  We're now using one single Proxy
6990         class for both the IEnumerable and the IEnumerator interface and
6991         `Iterator' derives from Class so we can use the high-level API.
6992
6993         * class.cs (TypeContainer.AddIterator): New method.
6994         (TypeContainer.DoDefineType): New protected virtual method, which
6995         is called from DefineType().
6996         (TypeContainer.DoDefineMembers): Call DefineType() and
6997         DefineMembers() on all our iterators.
6998         (TypeContainer.Emit): Call Emit() on all our iterators.
6999         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7000
7001         * codegen.cs (EmitContext.CurrentIterator): New public field.
7002
7003 2004-07-15  Martin Baulig  <martin@ximian.com>
7004
7005         * typemanager.cs
7006         (TypeManager.not_supported_exception_type): New type.   
7007
7008 2004-07-14  Martin Baulig  <martin@ximian.com>
7009
7010         * typemanager.cs
7011         (TypeManager.generic_ienumerable_type): New type.
7012         (TypeManager.generic_ienumerator_type): New type.
7013
7014         * rootcontext.cs
7015         (RootContext.interfaces_first_stage): Added
7016         "System.Collections.Generic.IEnumerator`1" and
7017         "System.Collections.Generic.IEnumerable`1".     
7018
7019 2004-07-14  Martin Baulig  <martin@ximian.com>
7020
7021         * iterators.cs: Use real error numbers.
7022
7023 2004-07-14  Martin Baulig  <martin@ximian.com>
7024
7025         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7026         requires this to be a System.Collection.IEnumerable and not a
7027         class implementing that interface.
7028         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7029
7030 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7031
7032         * class.cs: Fixed previous fix, it broke some error tests.
7033
7034 2004-07-12  Martin Baulig  <martin@ximian.com>
7035
7036         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7037         Fixes #61293.
7038
7039 2004-07-14  Martin Baulig  <martin@ximian.com>
7040
7041         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7042         an exclamation mark (!) for the generic arity to reflect the
7043         latest spec changes; ie. use "System.Collections.Generic.IList`1".
7044
7045 2004-07-13  Martin Baulig  <martin@ximian.com>
7046
7047         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7048         specifiers being part of a type argument.
7049
7050 2004-07-13  Martin Baulig  <martin@ximian.com>
7051
7052         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7053         name for generic types.
7054
7055 2004-07-13  Martin Baulig  <martin@ximian.com>
7056
7057         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7058         bit to fix #60119.
7059
7060 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7061
7062         * assign.cs (LocalTemporary): Add new argument: is_address,If
7063         `is_address' is true, then the value that we store is the address
7064         to the real value, and not the value itself.
7065         
7066         * ecore.cs (PropertyExpr): use the new local temporary
7067         stuff to allow us to handle X.Y += z (where X is a struct)
7068
7069 2004-07-08  Martin Baulig  <martin@ximian.com>
7070
7071         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7072         not always return, just like we're doing in Using.Resolve().
7073
7074 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7075
7076         * cs-parser.jay (fixed_statement): flag this as Pinned.
7077
7078 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7079
7080         * typemanager.cs (TypeManager): Removed MakePinned method, this
7081         mechanism is replaced with the .NET 2.x compatible mechanism of
7082         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7083
7084         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7085         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7086         `IsFixed' property which has a different meaning.
7087
7088 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7089
7090         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7091         visible from inside a nested class, not just the names of the
7092         immediately enclosing class.
7093         Fix for bug #60730.
7094
7095 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7096
7097         * expression.cs (BetterConversion): Remove buggy special-case
7098         handling of "implicit constant expression conversions".  At this
7099         point, we already know that the conversion is possible -- we're
7100         only checking to see which is better.
7101
7102 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7103
7104         * cs-parser.jay: Added error CS0210 test.
7105
7106 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7107
7108         * cs-parser.jay: Added error CS0134 test.
7109
7110 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7111
7112         Fix bug #52507
7113         * cs-parser.jay: Added error CS0145 test.
7114
7115 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7116
7117         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7118
7119 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7120         
7121         * expression.cs (StackAlloc.Resolve): The argument may not
7122         be a constant; deal with this case.
7123         
7124 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7125
7126         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7127         GetIndexerAttributeValue.
7128         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7129
7130         * class.cs (Indexer.Define): Added error tests for CS0415,
7131         CS0609.
7132
7133 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7134
7135         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7136         property code.
7137
7138 2004-06-23  Martin Baulig  <martin@ximian.com>
7139
7140         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7141         neither return nor throw, reset the barrier as well.  Fixes #60457.
7142
7143 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7144
7145         * class.cs : EventAttributes is now set to None by default.
7146           This fixes bug #60459.
7147
7148 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7149
7150         Fix bug #60219
7151         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7152         Don't throw exception but return null (it's sufficient now).
7153
7154 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7155
7156         * typemanager.cs (GetArgumentTypes): Faster implementation.
7157
7158 2004-06-18  Martin Baulig  <martin@ximian.com>
7159
7160         * attribute.cs (Attribute.Resolve): Check whether we're an
7161         EmptyCast which a Constant child.  Fixes #60333.
7162
7163 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7164
7165         * statement.cs (EmitCollectionForeach): Account for the fact that
7166         not all valuetypes are in areas which we can take the address of.
7167         For these variables, we store to a temporary variable. Also, make
7168         sure that we dont emit a `callvirt' on a valuetype method.
7169
7170 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7171
7172         * expression.cs (StackAlloc.DoReSolve): Added test for
7173         negative parameter (CS0247).
7174
7175 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7176
7177         Fix bug #59792
7178         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7179
7180 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7181
7182         Fix bug #59781
7183         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7184         ulong.
7185
7186 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7187
7188         Fix bug #58254 & cs1555.cs, cs1556.cs
7189         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7190
7191 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7192
7193         * cs-parser.jay: Added error CS1669 test for indexers.
7194
7195 2004-06-18  Martin Baulig  <martin@ximian.com>
7196
7197         * generics.cs (GenericMethod.ctor): Don't take an Attributes
7198         argument.  Fixes #60441.
7199
7200 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
7201         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7202         The name needs to have the actual name of the method in order
7203         for other tests (such as the one in OverloadResolve for Invoke
7204         on a delegate) to work. As well, it does not really help
7205         error reporting because the method group had multiple methods.
7206         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7207         Make profiling work.
7208         
7209 2004-06-13  Martin Baulig  <martin@ximian.com>
7210
7211         * cs-parser.jay: Don't allow generic attributes.
7212
7213 2004-06-13  Martin Baulig  <martin@ximian.com>
7214
7215         * class.cs (MemberBase.DoDefineBase): New protected method.
7216         (MemberBase.DoDefine): Compute the `flags' in the new
7217         DoDefineBase() which must be called first.
7218         (Method.Define): Call DoDefineBase() first so we have the flags
7219         when defining the generic method.
7220
7221         * cs-parser.jay (interface_method_declaration): Support generic methods.
7222
7223 2004-06-13  Martin Baulig  <martin@ximian.com>
7224
7225         * decl.cs (TypeName): Removed.
7226         (MemberName): Removed TypeName and MemberNow; now we just have
7227         MemberName.
7228
7229         * cs-parser.jay: Don't distinguish between type arguments and type
7230         parameters in the grammar and simplified the rules a bit.  The
7231         reduce/reduce conflicts are now gone (except the one we inherited
7232         from mcs).
7233
7234 2004-06-11  Martin Baulig  <martin@ximian.com>
7235
7236         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7237         call this twice: for params and varargs methods.
7238
7239 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7240
7241         * class.cs:
7242         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7243
7244 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7245
7246         * attribute.cs (Attribute.GetValidTargets): Made public.
7247
7248         * class.cs: 
7249         (AbstractPropertyEventMethod): New class for better code sharing.
7250         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7251         CS1667 report.
7252         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7253
7254 2004-06-09  Martin Baulig  <martin@ximian.com>
7255
7256         * cs-parser.jay: Removed a reduce/reduce conflict.
7257
7258 2004-06-03  Martin Baulig  <martin@ximian.com>
7259
7260         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7261         GetSimpleName() and return a SimpleName.
7262
7263         * ecore.cs (SimpleName.Arguments): New public field.
7264         (SimpleName): Added overloaded ctor which takes an additional
7265         TypeArguments argument.
7266         (SimpleName.SimpleNameResolve): Added support for generic methods.
7267         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7268         formerly in MemberAccess.DoResolve(), but we also need it in
7269         SimpleNameResolve().
7270
7271         * expression.cs (MemberAccess.DoResolve): Use the new
7272         MethodGroupExpr.ResolveGeneric().       
7273
7274 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7275
7276         * decl.cs: If possible, use lookuptypedirect here. We can only do
7277         this if there is no `.' after the namespace. Avoids using
7278         LookupType, which does lots of slow processing.
7279         (FindNestedType) New method, does what it says :-).
7280         * namespace.cs: use LookupTypeDirect.
7281         * rootcontext.cs: use membercache, if possible.
7282         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7283
7284 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7285
7286         * expression.cs:
7287         According to the spec, 
7288
7289         In a member access of the form E.I, if E is a single identifier,
7290         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7291         field, property, localvariable, or parameter with the same type as
7292         the meaning of E as a type-name (§3.8), then both possible
7293         meanings of E are permitted.
7294
7295         We did not check that E as a simple-name had the same type as E as
7296         a type name.
7297
7298         This trivial check gives us 5-7% on bootstrap time.
7299
7300 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7301
7302         * expression.cs (Invocation.OverloadResolve): Avoid the
7303         use of hashtables and boxing here by allocating on demand.
7304
7305 2004-05-30  Martin Baulig  <martin@ximian.com>
7306
7307         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7308         we're doing a silent lookup.  Don't try to lookup nested types in
7309         TypeManager.object_type (thanks to Ben Maurer).
7310
7311 2004-05-30  Martin Baulig  <martin@ximian.com>
7312
7313         Committing a patch from Ben Maurer.
7314
7315         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7316
7317 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7318
7319         * convert.cs: add a trivial cache for overload operator resolution.
7320
7321 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * attribute.cs
7324         (AttributeTester.GetObsoleteAttribute): Returns instance of
7325         ObsoleteAttribute when type is obsolete.
7326
7327         * class.cs
7328         (TypeContainer.VerifyObsoleteAttribute): Override.
7329         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7330         (MethodCode.VerifyObsoleteAttribute): Override.
7331         (MemberBase.VerifyObsoleteAttribute): Override.
7332
7333         * decl.cs
7334         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7335         and report proper error.
7336
7337         *delegate.cs
7338         (Delegate.VerifyObsoleteAttribute): Override.
7339
7340         * ecore.cs
7341         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7342         and report proper error.
7343         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7344
7345         * enum.cs
7346         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7347         and enum member.
7348
7349         * expression.cs
7350         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7351         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7352         Added test for ObsoleteAttribute.
7353
7354         * statement.cs
7355         (Catch): Derived from Statement.
7356
7357 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7358
7359         * decl.cs: If possible, use lookuptypedirect here. We can only do
7360         this if there is no `.' after the namespace. Avoids using
7361         LookupType, which does lots of slow processing.
7362         (FindNestedType) New method, does what it says :-).
7363         * namespace.cs: use LookupTypeDirect.
7364         * rootcontext.cs: use membercache, if possible.
7365         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7366
7367 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7368
7369         * expression.cs:
7370         According to the spec, 
7371
7372         In a member access of the form E.I, if E is a single identifier,
7373         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7374         field, property, localvariable, or parameter with the same type as
7375         the meaning of E as a type-name (§3.8), then both possible
7376         meanings of E are permitted.
7377
7378         We did not check that E as a simple-name had the same type as E as
7379         a type name.
7380
7381         This trivial check gives us 5-7% on bootstrap time.
7382
7383 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7384
7385         Fixed bug #59071 & cs0160.cs
7386         * statement.cs (Try.Resolve): Check here whether order of catch
7387         clauses matches their dependencies.
7388
7389 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7390
7391         Fixed bug #58624
7392         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7393         unsafe type.
7394
7395 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7396
7397         * expression.cs (Invocation.OverloadResolve): Avoid the
7398         use of hashtables and boxing here by allocating on demand.
7399
7400 2004-05-30  Martin Baulig  <martin@ximian.com>
7401
7402         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7403         we're doing a silent lookup.  Don't try to lookup nested types in
7404         TypeManager.object_type (thanks to Ben Maurer).
7405
7406 2004-05-30  Martin Baulig  <martin@ximian.com>
7407
7408         Committing a patch from Ben Maurer.
7409
7410         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7411
7412 2004-05-29  Martin Baulig  <martin@ximian.com>
7413
7414         * class.cs (IMethodData.ShouldIgnore): New method.
7415
7416         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7417         `Location' argument, we don't need it anywhere.  Use
7418         `IMethodData.ShouldIgnore ()' instead of
7419         `MethodData.GetMethodFlags ()'.
7420         (TypeManager.AddMethod): Removed.
7421         (TypeManager.AddMethod2): Renamed to AddMethod.
7422
7423 2004-05-29  Martin Baulig  <martin@ximian.com>
7424
7425         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7426
7427         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7428         converting from a class type S to an interface type and we already
7429         have an object on the stack, don't box it again.  Fixes #52578.
7430
7431 2004-05-29  Martin Baulig  <martin@ximian.com>
7432
7433         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7434         Added support for `params' parameters.  Fixes #59267.
7435
7436 2004-05-29  Martin Baulig  <martin@ximian.com>
7437
7438         * literal.cs (NullPointer): Provide a private .ctor which sets
7439         `type' to TypeManager.object_type.  Fixes #59048.
7440
7441 2004-05-29  Martin Baulig  <martin@ximian.com>
7442
7443         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7444         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7445
7446         * ecore.cs (EventExpr.instance_expr): Make the field private.
7447
7448 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7449
7450         Fixed bug #50080 & cs0214-2.cs
7451         * expression.cs (Cast.DoResolve): Check unsafe context here.
7452         
7453         * statement.cs (Resolve.DoResolve): Likewise.
7454
7455 2004-05-26  Martin Baulig  <martin@ximian.com>
7456
7457         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7458
7459         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7460         (RootContext.LookupType): Pass down the `silent' flag.
7461
7462 2004-05-25  Martin Baulig  <martin@ximian.com>
7463
7464         * expression.cs
7465         (MethodGroupExpr.IdenticalTypeName): New public property.
7466         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7467         expression actually refers to a type.
7468
7469 2004-05-25  Martin Baulig  <martin@ximian.com>
7470
7471         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7472         for #56176 and made it actually work.
7473
7474 2004-05-25  Martin Baulig  <martin@ximian.com>
7475
7476         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7477         (FieldExpr, PropertyExpr): Override and implement
7478         CacheTemporaries.  Fixes #52279.
7479
7480 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * location.cs: In the new compiler listing a file twice is a
7483         warning, not an error.
7484
7485 2004-05-24  Martin Baulig  <martin@ximian.com>
7486
7487         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7488         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7489
7490 2004-05-24  Martin Baulig  <martin@ximian.com>
7491
7492         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7493         walking the `using' list.  Fixes #53921.
7494
7495 2004-05-24  Martin Baulig  <martin@ximian.com>
7496
7497         * const.cs (Const.LookupConstantValue): Added support for
7498         EmptyCast's; fixes #55251.
7499
7500 2004-05-24  Martin Baulig  <martin@ximian.com>
7501
7502         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7503         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7504         which does the CS0135 check.  The reason is that we first need to
7505         check whether the variable actually exists.
7506
7507 2004-05-24  Martin Baulig  <martin@ximian.com>
7508
7509         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7510         than RootContext.LookupType() to find the explicit interface
7511         type.  Fixes #58584.
7512
7513 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7514
7515         * Makefile: Simplify.  Use executable.make.
7516         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7517
7518 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7519
7520         * decl.cs:
7521         * enum.cs:
7522         Use the invariant culture when doing String.Compare for CLS case
7523         sensitivity.
7524         
7525 2004-05-23  Martin Baulig  <martin@ximian.com>
7526
7527         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7528         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7529
7530         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7531
7532 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7533
7534         * class.cs (MemberBase.Define): Reuse MemberType member for 
7535         resolved type. Other methods can use it too.
7536
7537 2004-05-23  Martin Baulig  <martin@ximian.com>
7538
7539         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7540         the variable also exists in the current block (otherwise, we need
7541         to report a CS0103).  Fixes #58670.
7542
7543 2004-05-23  Martin Baulig  <martin@ximian.com>
7544
7545         * flowanalysis.cs (Reachability.Reachable): Compute this
7546         on-the-fly rather than storing it as a field.
7547
7548 2004-05-23  Martin Baulig  <martin@ximian.com>
7549
7550         * flowanalysis.cs (Reachability.And): Manually compute the
7551         resulting `barrier' from the reachability.      
7552        
7553 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7554
7555         Fix bug #57835
7556         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7557         instance of ObsoleteAttribute when symbol is obsolete.
7558
7559         * class.cs
7560         (IMethodData): Extended interface for ObsoleteAttribute support.
7561
7562 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7563
7564         * attribute.cs: Fix bug #55970
7565
7566 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7567
7568         Fix bug #52705
7569         * attribute.cs
7570         (GetObsoleteAttribute): New method. Creates the instance of
7571         ObsoleteAttribute.
7572         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7573         ObsoleteAttribute when member is obsolete.
7574         (AttributeTester.Report_ObsoleteMessage): Common method for
7575         Obsolete error/warning reporting.
7576
7577         * class.cs
7578         (TypeContainer.base_classs_type): New member for storing parent type.
7579
7580         * decl.cs
7581         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7582         for this MemberCore.
7583
7584 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7585
7586         * attribute.cs, const.cs: Fix bug #58590
7587
7588 2004-05-21  Martin Baulig  <martin@ximian.com>
7589
7590         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7591         out parameters if the end of the method is unreachable.  Fixes
7592         #58098. 
7593
7594 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7595
7596         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7597         Hari was right, why extra method.
7598
7599 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7600
7601         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7602
7603 2004-05-20  Martin Baulig  <martin@ximian.com>
7604
7605         * delegate.cs: Convert this file to Unix mode - like the original
7606         version in mcs is.
7607
7608 2004-05-20  Martin Baulig  <martin@ximian.com>
7609
7610         * attribute.cs: Convert this file to Unix mode - like the original
7611         version in mcs is.
7612
7613 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7614
7615        Fix bug #58688 (MCS does not report error when the same attribute
7616        is assigned twice)
7617
7618        * attribute.cs (Attribute.Emit): Distinction between null and default.
7619
7620 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7621
7622        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7623        of a top-level attribute without an attribute target.
7624        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7625        Make non-static.
7626        (Attribute.Conditional_GetConditionName), 
7627        (Attribute.Obsolete_GetObsoleteMessage): Update.
7628        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7629        part of ScanForIndexerName.
7630        (Attribute.CanIgnoreInvalidAttribute): New function.
7631        (Attribute.ScanForIndexerName): Move to ...
7632        (Attributes.ScanForIndexerName): ... here.
7633        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7634        (Attributes.Search): New internal variant that can choose not to
7635        complain if types aren't resolved.  The original signature now
7636        complains.
7637        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7638        complaints suppressed.
7639        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7640        only if it not useful.
7641        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7642        top-level for attributes that are shared between the assembly
7643        and a top-level class.
7644        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7645        * class.cs: Update to reflect changes.
7646        (DefineIndexers): Fuse loops.
7647        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7648        a couple more variants of attribute names.
7649
7650 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7651
7652         Fix bug #52585 (Implemented explicit attribute declaration)
7653
7654         * attribute.cs:
7655         (Attributable.ValidAttributeTargets): New abstract method. It gets
7656         list of valid attribute targets for explicit target declaration.
7657         (Attribute.Target): It holds target itself.
7658         (AttributeSection): Removed.
7659         (Attribute.CheckTargets): New method. It checks whether attribute
7660         target is valid for the current element.
7661
7662         * class.cs:
7663         (EventProperty): New class. For events that are declared like
7664         property (with add and remove accessors).
7665         (EventField): New class. For events that are declared like field.
7666         class.cs
7667
7668         * cs-parser.jay: Implemented explicit attribute target declaration.
7669
7670         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7671         Override ValidAttributeTargets.
7672
7673         * parameter.cs:
7674         (ReturnParameter): Class for applying custom attributes on 
7675         the return type.
7676         (ParameterAtribute): New class. Class for applying custom
7677         attributes on the parameter type.
7678
7679 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7680
7681         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7682         definitions. 
7683
7684         (Method): Allow UNSAFE here.
7685
7686         * modifiers.cs: Support unsafe reporting.
7687
7688 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7689
7690         * decl.cs: Fix bug #58478.
7691
7692 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7693
7694         * statement.cs: When checking for unreachable code on an EmptyStatement,
7695         set the location. Fixes bug #58488.
7696
7697 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7698
7699         * driver.cs: Add -pkg handling.
7700
7701         From Gonzalo: UseShelLExecute=false
7702
7703 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7704
7705         * attribute.cs:
7706         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7707         for attribute.
7708         (Attribute.IsClsCompliaceRequired): Moved to base for better
7709         accesibility.
7710         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7711         when attribute is AttributeUsageAttribute.
7712         (Attribute.GetValidTargets): Simplified.
7713         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7714         attribute for this type.
7715         (Attribute.ApplyAttributes): Method renamed to Emit and make
7716         non-static.
7717         (GlobalAttributeSection): New class for special handling of global
7718         attributes (assembly, module).
7719         (AttributeSection.Emit): New method.
7720
7721         * class.cs: Implemented Attributable abstract methods.
7722         (MethodCore.LabelParameters): Moved to Parameter class.
7723         (Accessor): Is back simple class.
7724         (PropertyMethod): Implemented Attributable abstract class.
7725         (DelegateMethod): Implemented Attributable abstract class.
7726         (Event): New constructor for disctintion between normal Event
7727         and Event with accessors.
7728
7729         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7730
7731         * codegen.cs, const.cs, decl.cs, delegate.cs:
7732         (CommonAssemblyModulClass): Implemented Attributable abstract class
7733         and simplified.
7734
7735         * enum.cs: Implement IAttributeSupport interface.
7736         (EnumMember): New class for emum members. Implemented Attributable
7737         abstract class
7738
7739         * parameter.cs:
7740         (ParameterBase): Is abstract.
7741         (ReturnParameter): New class for easier [return:] attribute handling.
7742
7743         * typemanager.cs: Removed builder_to_attr.
7744
7745 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7746
7747         Fix bug #57151.
7748         * attribute.cs (Attribute.GetPositionalValue): New function.
7749         * class.cs (TypeContainer.VerifyMembers): New function.
7750         (TypeContainer.Emit): Use it.
7751         (ClassOrStruct): New base class for Class and Struct.
7752         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7753         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7754         class.
7755         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7756         then each non-static field should have a FieldOffset attribute.
7757         Otherwise, none of the fields should have a FieldOffset attribute.
7758         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7759         and FieldOffset attributes.
7760         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7761         (TypeManager.field_offset_attribute_type): New core types.
7762         (TypeManager.InitCoreTypes): Initialize them.
7763
7764 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7765
7766         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7767         Return correct type.
7768         From bug #58270.
7769
7770 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7771
7772         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7773         be implicitly converted to ulong.
7774         
7775         * expression.cs: The logic for allowing operator &, | and ^ worked
7776         was wrong, it worked before because we did not report an error in
7777         an else branch.  Fixes 57895.
7778
7779         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7780         allow volatile fields to be reference types.
7781
7782 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7783
7784         * driver.cs: Add support for /debug-
7785
7786 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7787
7788         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7789         Add a 'complain' parameter to silence errors.
7790         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7791         silently overlooked type-resolutions.
7792         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7793         to reflect changes.
7794         (Attributes.Search): New function.
7795         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7796         (Attributes.GetAttributeFullName): Remove hack.
7797         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7798         Update to reflect changes.
7799         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7800         Use Attributes.Search instead of nested loops.
7801
7802 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7803
7804         * decl.cs:
7805         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7806         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7807         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7808
7809         * report.cs: (Report.Warning): Renamed to Warning_T because of
7810         parameter collision.
7811
7812 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7813
7814         * expression.cs (MemberAccess.ResolveMemberAccess):
7815         Exit with non-zero status after Report.Error.
7816         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7817         Likewise.
7818         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7819
7820 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7821
7822         * support.cs: Don't hang when the file is empty.
7823
7824 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7825
7826         * support.cs: In SeekableStreamReader, compute the preamble size of the
7827           underlying stream. Position changes should take into account that initial
7828           count of bytes.
7829
7830 2004-05-03  Todd Berman  <tberman@sevenl.net>
7831
7832         * driver.cs: remove unused GetSysVersion function.
7833
7834 2004-05-03  Todd Berman  <tberman@sevenl.net>
7835
7836         * driver.cs: Remove the hack from saturday, as well as the hack
7837         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7838         link_paths to get that bit proper.
7839
7840 2004-05-01  Todd Berman  <tberman@sevenl.net>
7841
7842         * driver.cs: Try a LoadFrom before a Load, this checks the current
7843         path. This is currently a bug in mono that is be fixed, however, this
7844         provides a workaround for now. This will be removed when the bug
7845         is fixed.
7846
7847 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7848
7849         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7850         incomplete key pairs (#57941).
7851
7852 2004-05-01  Todd Berman  <tberman@sevenl.net>
7853
7854         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7855         from the GAC
7856
7857 2004-04-30  Jackson Harper  <jackson@ximian.com>
7858
7859         * codegen.cs: Open keys readonly.
7860         
7861 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7862
7863         * typemanager.cs: don't report cyclic struct layout when a struct
7864         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7865         which has 2 Pango.Rectangle fields.
7866
7867 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7868
7869         * expression.cs: Handle IntPtr comparisons with IL code
7870         rather than a method call.
7871
7872 2004-04-29  Martin Baulig  <martin@ximian.com>
7873
7874         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7875         the list of PropertyInfo's in class hierarchy and find the
7876         accessor.  Fixes #56013.
7877
7878 2004-04-29  Martin Baulig  <martin@ximian.com>
7879
7880         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7881
7882 2004-04-29  Martin Baulig  <martin@ximian.com>
7883
7884         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7885
7886         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7887
7888 2004-04-29  Martin Baulig  <martin@ximian.com>
7889
7890         * class.cs (ConstructorInitializer.Resolve): Check whether the
7891         parent .ctor is accessible.  Fixes #52146.
7892
7893 2004-04-29  Martin Baulig  <martin@ximian.com>
7894
7895         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7896
7897         * statement.cs (Using.EmitLocalVariableDecls): Use
7898         TypeManager.idisposable_type, not typeof (IDisposable).
7899         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7900
7901 2004-04-29  Martin Baulig  <martin@ximian.com>
7902
7903         * class.cs (Event.Define): Don't emit the field and don't set
7904         RTSpecialName and SpecialName for events on interfaces.  Fixes
7905         #57703. 
7906
7907 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7908
7909         Refactor Attribute.ApplyAttributes.
7910         * attribute.cs (Attributable): New base class for objects that can
7911         have Attributes applied on them.
7912         (Attribute): Make AttributeUsage fields public.
7913         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7914         (Attribute.IsInternalCall): New property.
7915         (Attribute.UsageAttr): Convert to a public read-only property.
7916         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7917         (Attribute.ResolveType, Attribute.Resolve)
7918         (Attribute.ScanForIndexerName): Update to reflect changes.
7919         (Attribute.CheckAttributeTarget): Re-format.
7920         (Attribute.ApplyAttributes): Refactor, to various
7921         Attributable.ApplyAttributeBuilder methods.
7922         * decl.cs (MemberCore): Make Attributable.
7923         * class.cs (Accessor): Make Attributable.
7924         (MethodData.ApplyAttributes): Use proper attribute types, not
7925         attribute names.
7926         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7927         (TypeContainer.ApplyAttributeBuilder)
7928         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7929         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7930         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7931         (Operator.ApplyAttributeBuilder): New factored-out methods.
7932         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7933         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7934         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7935         * parameter.cs (ParameterBase): New Attributable base class
7936         that can also represent Return types.
7937         (Parameter): Update to the changes.
7938
7939 2004-04-29  Jackson Harper  <jackson@ximian.com>
7940
7941         * driver.cs: Prefer the corlib system version when looking for
7942         assemblies in the GAC. This is still a hack, but its a better hack
7943         now.
7944         
7945 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7946
7947         * decl.cs, enum.cs: Improved error 3005 reporting.
7948   
7949         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7950         (related_symbols): New private member for list of symbols
7951         related to reported error/warning.
7952         
7953         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7954
7955 2004-04-29  Martin Baulig  <martin@ximian.com>
7956
7957         * ecore.cs (Expression.Constantify): If we're an enum and
7958         TypeManager.TypeToCoreType() doesn't give us another type, use
7959         t.UnderlyingSystemType.  Fixes #56178.  
7960
7961 2004-04-29  Martin Baulig  <martin@ximian.com>
7962
7963         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7964         interfaces and for each interface, only add members directly
7965         declared in that interface.  Fixes #53255.
7966
7967 2004-04-28  Martin Baulig  <martin@ximian.com>
7968
7969         * expression.cs (ConditionalLogicalOperator): Use a temporary
7970         variable for `left' to avoid that we evaluate it more than once;
7971         bug #52588.
7972
7973 2004-04-28  Martin Baulig  <martin@ximian.com>
7974
7975         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7976         `void[]' (CS1547).
7977
7978 2004-04-28  Martin Baulig  <martin@ximian.com>
7979
7980         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7981         void (CS1547).
7982
7983         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7984         whether the type is not void (CS1547).
7985
7986 2004-04-28  Martin Baulig  <martin@ximian.com>
7987
7988         * expression.cs (Unary.DoResolveLValue): Override this and report
7989         CS0131 for anything but Operator.Indirection.
7990
7991 2004-04-28  Martin Baulig  <martin@ximian.com>
7992
7993         Committing a patch from Ben Maurer; see bug #50820.
7994
7995         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7996         check for classes.
7997
7998         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7999         classes.        
8000
8001 2004-04-28  Martin Baulig  <martin@ximian.com>
8002
8003         Committing a patch from Ben Maurer; see bug #50820.
8004
8005         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8006         check for classes.
8007
8008         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8009         classes.        
8010
8011 2004-04-28  Martin Baulig  <martin@ximian.com>
8012
8013         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8014         (Block.AddLabel): Call DoLookupLabel() to only search in the
8015         current block.
8016
8017 2004-04-28  Martin Baulig  <martin@ximian.com>
8018
8019         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8020         comparing StringConstants and NullLiterals in Equality and Inequality.
8021
8022 2004-04-28  Jackson Harper  <jackson@ximian.com>
8023
8024         * driver.cs: Attempt to load referenced assemblies from the
8025         GAC. This is the quick and dirty version of this method that
8026         doesnt take into account versions and just takes the first
8027         canidate found. Will be good enough for now as we will not have more
8028         then one version installed into the GAC until I update this method.
8029
8030 2004-04-28  Martin Baulig  <martin@ximian.com>
8031
8032         * typemanager.cs (TypeManager.CheckStructCycles): New public
8033         static method to check for cycles in the struct layout.
8034
8035         * rootcontext.cs (RootContext.PopulateTypes): Call
8036         TypeManager.CheckStructCycles() for each TypeContainer.
8037         [Note: We only need to visit each type once.]
8038
8039 2004-04-28  Martin Baulig  <martin@ximian.com>
8040
8041         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8042
8043         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8044         success and added `out object value'.  Use a `bool resolved' field
8045         to check whether we've already been called rather than
8046         `ConstantValue != null' since this breaks for NullLiterals.
8047
8048 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8049
8050         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8051         setting of this flag, since the 'set' method may be non-public.
8052
8053 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8054
8055         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8056         check on current_vector.Block.
8057
8058 2004-04-27  Martin Baulig  <martin@ximian.com>
8059
8060         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8061         a field initializer.  Fixes #56459.
8062
8063 2004-04-27  Martin Baulig  <martin@ximian.com>
8064
8065         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8066         we're not attempting to use an indexer.  Fixes #52154.
8067
8068 2004-04-27  Martin Baulig  <martin@ximian.com>
8069
8070         * statement.cs (Return): Don't create a return label if we don't
8071         need it; reverts my change from January 20th.  Thanks to Ben
8072         Maurer for this.
8073
8074 2004-04-27  Martin Baulig  <martin@ximian.com>
8075
8076         According to the spec, `goto' can only leave a nested scope, but
8077         never enter it.
8078
8079         * statement.cs (Block.LookupLabel): Only lookup in the current
8080         block, don't recurse into parent or child blocks.
8081         (Block.AddLabel): Check in parent and child blocks, report
8082         CS0140/CS0158 if we find a duplicate.
8083         (Block): Removed this indexer for label lookups.
8084         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8085         this already does the error reporting for us.
8086
8087         * flowanalysis.cs
8088         (FlowBranching.UsageVector.Block): New public variable; may be null.
8089         (FlowBranching.CreateSibling): Added `Block' argument.
8090         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8091         label for the target of a `goto' and check whether we're not
8092         leaving a `finally'.
8093
8094 2004-04-27  Martin Baulig  <martin@ximian.com>
8095
8096         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8097         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8098         just for returns).
8099
8100 2004-04-27  Martin Baulig  <martin@ximian.com>
8101
8102         * statement.cs (Block.AddLabel): Also check for implicit blocks
8103         and added a CS0158 check.
8104
8105 2004-04-27  Martin Baulig  <martin@ximian.com>
8106
8107         * flowanalysis.cs (FlowBranchingLoop): New class.
8108         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8109         UsageVector's instead of an ArrayList.
8110         (FlowBranching.Label): Likewise.
8111         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8112         (FlowBranching.AddBreakVector): New method.
8113
8114 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8115
8116         * attribute.cs: Small regression fix: only convert the type if we
8117         the type is different, fixes System.Drawing build.
8118
8119 2004-04-27  Martin Baulig  <martin@ximian.com>
8120
8121         * attribute.cs (Attribute.Resolve): If we have a constant value
8122         for a named field or property, implicity convert it to the correct
8123         type.
8124
8125 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8126
8127         * statement.cs (Block.Block): Implicit blocks share
8128         'child_variable_names' fields with parent blocks.
8129         (Block.AddChildVariableNames): Remove.
8130         (Block.AddVariable): Mark variable as "used by a child block" in
8131         every surrounding block.
8132         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8133         been used in a child block, complain about violation of "Invariant
8134         meaning in blocks" rule.
8135         * cs-parser.jay (declare_local_variables): Don't use
8136         AddChildVariableNames.
8137         (foreach_statement): Don't create an implicit block: 'foreach'
8138         introduces a scope.
8139
8140 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8141
8142         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8143         converting from 0L to ulong.  Fixes 57522.
8144
8145 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8146
8147         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8148         derived class hides via 'new' keyword field from base class (test-242.cs).
8149         TODO: Handle this in the more general way.
8150         
8151         * class.cs (CheckBase): Ditto.
8152
8153 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8154
8155         * decl.cs (caching_flags): New member for storing cached values
8156         as bit flags.
8157         (MemberCore.Flags): New enum where bit flags for caching_flags
8158         are defined.
8159         (MemberCore.cls_compliance): Moved to caching_flags.
8160         (DeclSpace.Created): Moved to caching_flags.
8161
8162         * class.cs: Use caching_flags instead of DeclSpace.Created
8163         
8164 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8165
8166         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8167         if we are only a derived class, not a nested class.
8168
8169         * typemanager.cs: Same as above, but do this at the MemberLookup
8170         level (used by field and methods, properties are handled in
8171         PropertyExpr).   Allow for the qualified access if we are a nested
8172         method. 
8173
8174 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8175
8176         * class.cs: Refactoring.
8177         (IMethodData): New inteface; Holds links to parent members
8178         to avoid member duplication (reduced memory allocation).
8179         (Method): Implemented IMethodData interface.
8180         (PropertyBase): New inner classes for get/set methods.
8181         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8182         (Event): New inner classes for add/remove methods.
8183         (Event.DelegateMethod): Implemented IMethodData interface.
8184
8185         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8186         EmitContext (related to class.cs refactoring).
8187
8188 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8189
8190         * delegate.cs (Delegate.VerifyApplicability): If the number of
8191         arguments are the same as the number of parameters, first try to
8192         verify applicability ignoring  any 'params' modifier on the last
8193         parameter.
8194         Fixes #56442.
8195
8196 2004-04-08  Martin Baulig  <martin@ximian.com>
8197
8198         Merged latest changes into gmcs.  Please keep this comment in
8199         here, it makes it easier for me to see what changed in MCS since
8200         the last time I merged.
8201
8202 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8203
8204         * class.cs (TypeContainer.AddIndexer): Use
8205         'ExplicitInterfaceName' to determine if interface name was
8206         explicitly specified.  'InterfaceType' is not initialized at this time.
8207         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8208         Indexers array is already in the required order.  Initialize
8209         'IndexerName' only if there are normal indexers.
8210         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8211         (TypeContainer.Emit): Emit DefaultMember attribute only if
8212         IndexerName is initialized.
8213         Fixes #56300.
8214
8215 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8216
8217         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8218         Fixes #57007
8219
8220 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8221
8222         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8223         attributes.
8224         Fix for #56456.
8225
8226         * attribute.cs (Attribute.Resolve): Check for duplicate named
8227         attributes.
8228         Fix for #56463.
8229
8230 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8231
8232         * iterators.cs (MarkYield): track whether we are in an exception,
8233         and generate code accordingly.  Use a temporary value to store the
8234         result for our state.
8235
8236         I had ignored a bit the interaction of try/catch with iterators
8237         since their behavior was not entirely obvious, but now it is
8238         possible to verify that our behavior is the same as MS .NET 2.0
8239
8240         Fixes 54814
8241
8242 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8243
8244         * iterators.cs: Avoid creating temporaries if there is no work to
8245         do. 
8246
8247         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8248         Enumerations, use TypeManager.EnumToUnderlying and call
8249         recursively. 
8250
8251         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8252         bug #57013
8253
8254         (This.Emit): Use EmitContext.EmitThis to emit our
8255         instance variable.
8256
8257         (This.EmitAssign): Ditto.
8258
8259         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8260         codepaths, we will move all the functionality into
8261         Mono.CSharp.This 
8262
8263         (FieldExpr.EmitAssign): Ditto.
8264
8265         This fixes several hidden bugs that I uncovered while doing a code
8266         review of this today.
8267
8268         * codegen.cs (EmitThis): reworked so the semantics are more clear
8269         and also support value types "this" instances.
8270
8271         * iterators.cs: Changed so that for iterators in value types, we
8272         do not pass the value type as a parameter.  
8273
8274         Initialization of the enumerator helpers is now done in the caller
8275         instead of passing the parameters to the constructors and having
8276         the constructor set the fields.
8277
8278         The fields have now `assembly' visibility instead of private.
8279
8280 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8281
8282         * expression.cs (Argument.Resolve): Check if fields passed as ref
8283         or out are contained in a MarshalByRefObject.
8284
8285         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8286         another compiler type.
8287
8288 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8289
8290         * class.cs (Indexer.Define): use the new name checking method.
8291         Also, return false on an error.
8292         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8293         (is_identifier_[start/part]_character): make static.
8294
8295 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * expression.cs (Binary.ResolveOperator): Do no append strings
8298         twice: since we can be invoked more than once (array evaluation)
8299         on the same concatenation, take care of this here.  Based on a fix
8300         from Ben (bug #56454)
8301
8302 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8303
8304         * codegen.cs: Fix another case where CS1548 must be reported (when 
8305         delay-sign isn't specified and no private is available #56564). Fix
8306         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8307         error when MCS is used on the MS runtime and we need to delay-sign 
8308         (which seems unsupported by AssemblyBuilder - see #56621).
8309
8310 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8311
8312         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8313         (TypeManager.ComputeNamespaces): Faster implementation for
8314         Microsoft runtime.
8315
8316         * compiler.csproj: Updated AssemblyName to mcs.
8317
8318 2004-05-11  Jackson Harper  <jackson@ximian.com>
8319
8320         * Makefile: Preserve MONO_PATH
8321         
8322 2004-05-11  Jackson Harper  <jackson@ximian.com>
8323
8324         * Makefile: Use mono and mcs to build gmcs
8325         
8326 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8327
8328         * codegen.cs: Add patch from Robert Shade
8329         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8330         sync with mcs.
8331
8332 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8333
8334         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8335         incomplete key pairs (#57941).
8336
8337 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8338
8339         * codegen.cs: Fix another case where CS1548 must be reported (when 
8340         delay-sign isn't specified and no private is available #56564). Fix
8341         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8342         error when MCS is used on the MS runtime and we need to delay-sign 
8343         (which seems unsupported by AssemblyBuilder - see #56621).
8344
8345 2004-04-29  Jackson Harper  <jackson@ximian.com>
8346
8347         * Makefile: Set MONO_PATH to use the bootstrap corlib
8348         * driver.cs: Check the GAC for referenced assemblies.
8349                 
8350 2004-04-29  Martin Baulig  <martin@ximian.com>
8351
8352         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8353
8354 2004-04-07  Martin Baulig  <martin@ximian.com>
8355
8356         * expression.cs (Binary.ResolveOperator): Added special case for
8357         Equality/Inequality between a type parameter and a null literal.
8358
8359 2004-04-07  Martin Baulig  <martin@ximian.com>
8360
8361         * convert.cs: Check null literal -> type parameter conversions.
8362
8363 2004-04-07  Martin Baulig  <martin@ximian.com>
8364
8365         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8366         `class' and `struct' constraints.
8367
8368 2004-04-07  Martin Baulig  <martin@ximian.com>
8369
8370         * generic.cs (SpecialConstraint): New public enum.
8371         (Constraints.Resolve): Added support for the `class' and `struct'
8372         constraints.
8373
8374         * cs-parser.jay (type_parameter_constraint): Added support for the
8375         `class' and `struct' constraints.
8376
8377 2004-04-07  Martin Baulig  <martin@ximian.com>
8378
8379         * support.cs (GenericConstraints): Replaced `Types' by
8380         `ClassConstraint' and `InterfaceConstraints'; added
8381         `HasClassConstraint'.   
8382
8383 2004-04-07  Martin Baulig  <martin@ximian.com>
8384
8385         * generic.cs
8386         (Constraints.InterfaceConstraints): New public property.
8387         (Constraints.Types): Make this property public
8388         (TypeParameter): Implement IMemberContainer.
8389         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8390         instead of a TypeBuilder/MethodBuilder; pass the interface
8391         constraints to TypeManager.AddTypeParameter().
8392         (TypeParameter.DefineType): Just take an EmitContext and no
8393         TypeBuilder/MethodBuilder.  Use the new public API.
8394
8395         * typemanager.cs (TypeManager.AddTypeParameter): Added
8396         `TypeExpr[]' argument; add the interfaces to the
8397         `builder_to_ifaces' hash.
8398         (TypeManager.LookupMemberContainer): For
8399         GenericTypeParameterBuilders, get the TypeParameter from the
8400         `builder_to_type_param'.
8401         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8402         the TypeParameter and call FindMembers on it.
8403
8404 2004-04-07  Martin Baulig  <martin@ximian.com>
8405
8406         * class.cs
8407         (MethodCore.GenericMethod): Moved this field here from Method.
8408         (MethodCore.IsDuplicateImplementation): Take the number of type
8409         parameters into account if we're a generic method.
8410
8411         * expression.cs (Invocation.InferTypeArguments): Don't return true
8412         if `arguments' is null; we still need to check whether we actually
8413         don't need to infer anything in this case.
8414         (MemberAccess): Merged the functionality from GenericMemberAccess
8415         into this class.
8416
8417         * generic.cs (GenericMemberAccess): Removed.
8418
8419 2004-04-05  Martin Baulig  <martin@ximian.com>
8420
8421         * decl.cs (MemberCore): For generic classes, interfaces and
8422         structs, `Name' now includes the number of type parameters
8423         ("Stack!1.Node!1").
8424         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8425         encode the number of type arguments in the type name.
8426
8427         * expression.cs (Expression.MemberLookup): Removed the
8428         `num_type_args' argument; we now encode the number of type
8429         arguments in the type name.
8430
8431         * ecore.cs (SimpleName): Encode the number of type arguments in
8432         the type name itself.
8433
8434         * generic.cs (ConstructedType): Likewise.
8435
8436         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8437         `MemberName'; we now include the number of type parameters in the
8438         type name.
8439
8440         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8441         (TypeManager.MemberLookup): Removed the
8442         `num_type_args' argument; we now encode the number of type
8443         arguments in the type name.     
8444
8445 2004-04-03  Martin Baulig  <martin@ximian.com>
8446
8447         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8448         (MemberCore.MemberName): Moved here from MemberBase.
8449         (DeclSpace.SetParameterInfo): Just take the constraints as an
8450         ArrayList; we already have the type parameters in our
8451         `MemberName'; also do the CS0080 reporting here.
8452
8453         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8454         `IDENTIFIER opt_type_parameter_list'; when constructing our
8455         `MemberName', it'll already include our type parameters.
8456         (class_declaration, interface_declaration): Likewise.
8457         (delegate_declaration): Likewise.
8458         (MakeName): Take a MemberName and return a MemberName.
8459         The following two changes are required to avoid shift/reduce conflicts:
8460         (member_name): Don't include a TypeName anymore; ie. this is now
8461         just 'IDENTIFIER opt_type_parameter_list'.
8462         (property_declaration, event_declaration): Use a
8463         `namespace_or_type_name' instead of a `member_name'.            
8464
8465 2004-04-03  Martin Baulig  <martin@ximian.com>
8466
8467         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8468         `MemberName' class.
8469         (TypeName): Formerly known as MemberName.
8470
8471         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8472         instead of a `MemberName'.
8473
8474         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8475         (member_name): New rule; create a MemberName.
8476
8477 2004-04-02  Martin Baulig  <martin@ximian.com>
8478
8479         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8480         (CS0305 and CS0308).
8481
8482 2004-04-02  Martin Baulig  <martin@ximian.com>
8483
8484         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8485         support for nested types.
8486
8487 2004-04-02  Martin Baulig  <martin@ximian.com>
8488
8489         * ecore.cs (IAlias): New public interface.
8490         (TypeExpr, TypeExpression): Implement IAlias.
8491         (TypeAliasExpression): New public class.
8492
8493         * namespace.cs (Namespace): Implement IAlias.
8494         (Namespace.Lookup): Return an IAlias instead on an object.
8495         (Namespace.DefineName): Take an IAlias instead of an object.
8496         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8497         an object.
8498         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8499         Expression.
8500         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8501         object.
8502         (NamespaceEntry.Lookup): Likewise.
8503
8504         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8505         instead of a Type.      
8506
8507         * decl.cs (DeclSpace): Implement IAlias.
8508         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8509
8510         * generic.cs (ConstructedType): Improved error checking.
8511
8512 2004-04-02  Martin Baulig  <martin@ximian.com>
8513
8514         * convert.cs: Added type parameter conversions.
8515
8516         * ecore.cs
8517         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8518         (ClassCast.Emit): If the source type is a type parameter, box it.
8519         If the target type is a type parameter, emit an `unbox.any'
8520         instead of a `classcast'.1      
8521
8522 2004-04-01  Martin Baulig  <martin@ximian.com>
8523
8524         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8525
8526 2004-04-01  Martin Baulig  <martin@ximian.com>
8527
8528         * generic.cs (ConstructedType.CheckConstraints): Use
8529         Convert.ImplicitStandardConversionExists(); user-defined implicit
8530         conversions are not allowed according to the spec.
8531
8532 2004-03-30  Martin Baulig  <martin@ximian.com>
8533
8534         * expression.cs (New): Added support for type parameters.
8535
8536         * typemanager.cs
8537         (TypeManager.activator_type): New public static field.
8538         (TypeManager.activator_create_instance): Likewise.
8539
8540 2004-03-30  Martin Baulig  <martin@ximian.com>
8541
8542         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8543         public method.
8544
8545 2004-03-30  Martin Baulig  <martin@ximian.com>
8546
8547         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8548         the spec here: the argument type must be convertible to the
8549         constraints.
8550
8551 2004-03-30  Martin Baulig  <martin@ximian.com>
8552
8553         * generic.cs
8554         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8555         TypeManager.AddTypeParameter().
8556         (ConstructedType.CheckConstraints): Re-enable this and actually
8557         check whether we have a constructor constraint.
8558
8559         * typemanager.cs
8560         (TypeManager.builder_to_type_param): New static field.
8561         (TypeManager.AddTypeParameter): New static method.
8562         (TypeManager.LookupTypeParameter): New public method.
8563
8564 2004-03-30  Martin Baulig  <martin@ximian.com>
8565
8566         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8567         the new API to actually define the constructor constraint.
8568
8569         * typemanager.cs
8570         (TypeManager.new_constraint_attr_type): New static field.
8571         (TypeManager.InitCoreTypes): Initialize it.
8572
8573 2004-03-30  Martin Baulig  <martin@ximian.com>
8574
8575         * generic.cs (Constraints): Completed error checking, use correct
8576         error numbers.
8577
8578 2004-03-29  Martin Baulig  <martin@ximian.com>
8579
8580         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8581
8582         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8583         public version which takes a `ParameterData pd' instead of an
8584         `ArrayList args'.
8585
8586 2004-03-29  Martin Baulig  <martin@ximian.com>
8587
8588         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8589         not a MethodInfo.       
8590
8591 2004-03-29  Martin Baulig  <martin@ximian.com>
8592
8593         * expression.cs (Argument.ResolveMethodGroup): If we're a
8594         ConstructedType, call GetMemberAccess() on it.  
8595
8596 2004-03-29  Martin Baulig  <martin@ximian.com>
8597
8598         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8599         (MethodCore.CheckGenericOverride): When overriding a generic
8600         method, check whether the constraints match.
8601
8602         * support.cs (GenericConstraints): New public interface.
8603         (ParameterData.GenericConstraints): New public method.
8604
8605         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8606         method parameter and compute our constraints if appropriate.
8607         (Parameter.GenericConstraints): New public property.
8608
8609         * generic.cs (Constraints): Implement GenericConstraints.
8610
8611 2004-03-29  Martin Baulig  <martin@ximian.com>
8612
8613         * decl.cs (MemberCache.FindMemberToOverride): Use
8614         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8615
8616 2004-03-29  Martin Baulig  <martin@ximian.com>
8617
8618         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8619
8620 2004-03-29  Martin Baulig  <martin@ximian.com>
8621
8622         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8623         not allowed on non-generic declarations").
8624
8625 2004-03-29  Martin Baulig  <martin@ximian.com>
8626
8627         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8628         public version of this method.
8629
8630         * class.cs (MethodCore.IsDuplicateImplementation): Use
8631         Invocation.InferTypeArguments() to check this.
8632
8633 2004-03-29  Martin Baulig  <martin@ximian.com>
8634
8635         * convert.cs: Use TypeManager.IsDelegateType() instead of
8636         comparing types correctly.
8637
8638 2004-03-29  Martin Baulig  <martin@ximian.com>
8639
8640         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8641         types directly to make it work for generic instances.
8642
8643         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8644
8645 2004-03-29  Martin Baulig  <martin@ximian.com>
8646
8647         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8648         support for arrays.     
8649
8650 2004-03-24  Martin Baulig  <martin@ximian.com>
8651
8652         * decl.cs (DeclSpace.FindType): Also use
8653         TypeManager.CheckGeneric() for types from the using clauses.
8654
8655 2004-03-23  Martin Baulig  <martin@ximian.com>
8656
8657         * expression.cs (Invocation.OverloadResolve): Added `bool
8658         may_fail' argument and use it instead of the Location.IsNull() hack.
8659
8660 2004-03-23  Martin Baulig  <martin@ximian.com>
8661
8662         * expression.cs (Invocation.InferType): Use correct type inference
8663         rules here.     
8664
8665 2004-03-23  Martin Baulig  <martin@ximian.com>
8666
8667         * ecore.cs (MethodGroupExpr.Name): Use
8668         TypeManager.CSharpSignature() instead of just the name.
8669
8670         * expression.cs (Invocation.OverloadResolve): Provide better error
8671         reporting.
8672         (Invocation.DoResolve): OverloadResolve() never returns null
8673         without reporting an error, so removed the error -6 reporting here.
8674
8675 2004-03-23  Martin Baulig  <martin@ximian.com>
8676
8677         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8678         generic methods.
8679
8680         * cs-parser.jay (delegate_declaration): Support generic delegates.
8681
8682         * delegate.cs: Support generic delegates.
8683
8684 2004-03-22  Martin Baulig  <martin@ximian.com>
8685
8686         * expression.cs (Invocation.InferParamsTypeArguments): New static
8687         method; does type inference for params arguments.
8688
8689 2004-03-21  Martin Baulig  <martin@ximian.com>
8690
8691         * typemanager.cs (TypeManager.IsGenericMethod): New public static
8692         method; checks whether a method is a generic method.    
8693
8694         * expression.cs (Invocation.InferTypeArguments): New static method;
8695         infer type arguments for generic method invocation.
8696
8697         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8698         property; we set this to true if we're resolving a generic method
8699         invocation and the user specified type arguments, ie. we're not
8700         doing type inference.
8701
8702 2004-03-20  Martin Baulig  <martin@ximian.com>
8703
8704         * class.cs (MethodData.DeclaringType): New public property.
8705         (MethodData.Define): Set DeclaringType here.
8706         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8707         instead of OperatorMethodBuilder.DeclaringType.
8708
8709 2004-03-20  Martin Baulig  <martin@ximian.com>
8710
8711         * cs-tokenizer.cs (xtoken): Return a special
8712         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8713
8714         * cs-parser.jay (default_value_expression): Switch to the new
8715         syntax (14.5.13).
8716
8717 2004-03-19  Martin Baulig  <martin@ximian.com>
8718
8719         * decl.cs (MemberName): New class.  We use this to "construct"
8720         namespace_or_type_name's.
8721
8722         * generics.cs (TypeArguments.GetDeclarations): New public method;
8723         returns the type arguments as a string[] and reports a CS0081 if
8724         one of them is not an identifier.
8725
8726         * class.cs (MemberBase): The .ctor now takes the name as a
8727         MemberName instead of a string.
8728         (MemberBase.ExplicitInterfaceName): Changed type from string to
8729         Expression.
8730         (MemberBase.DoDefine): If we're an explicit implementation, the
8731         InterfaceType may be a generic instance.
8732
8733         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8734         (namespace_name): Call MemberName.GetName () to transform the
8735         MemberName into a string and ensure we don't have any type
8736         arguments.
8737         (type_name): Call MemberName.GetTypeExpression() to transfrom the
8738         MemberName into an expression.
8739         (method_header): Use namespace_or_type_name instead of member_name.     
8740
8741 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8742
8743         * rootcontext.cs: Add new types to the boot resolution.
8744
8745         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8746         MulticastDelegate is not allowed.
8747
8748         * typemanager.cs: Add new types to lookup: System.TypedReference
8749         and ArgIterator.
8750
8751         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8752         check for TypedReference or ArgIterator, they are not allowed. 
8753
8754         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8755         makes us properly catch 1510 in some conditions (see bug 56016 for
8756         details). 
8757
8758 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8759
8760         * CryptoConvert.cs: update from corlib version
8761         with endian fixes.
8762
8763 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * class.cs (Indexer.Define): Check indexername declaration
8766
8767 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8768
8769         * attribute.cs (IsClsCompliant): Fixed problem with handling
8770         all three states (compliant, not-compliant, undetected).
8771
8772 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8773
8774         * attribute.cs (Attribute): Location is now public.
8775         (Resolve): Store resolved arguments (pos_values) in attribute class.
8776         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8777         (GetClsCompliantAttributeValue): New method that gets
8778         CLSCompliantAttribute value.
8779         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8780         if exists else null.
8781         (AttributeTester): New class for CLS-Compliant verification routines.
8782
8783         * class.cs (Emit): Add CLS-Compliant verification.
8784         (Method.GetSignatureForError): Implemented.
8785         (Constructor.GetSignatureForError): Implemented
8786         (Constructor.HasCompliantArgs): Returns if constructor has
8787         CLS-Compliant arguments.
8788         (Constructor.Emit): Override.
8789         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8790         is needed to test only parameters.
8791         (FieldBase.GetSignatureForError): Implemented.
8792         (TypeContainer): New member for storing base interfaces.
8793         (TypeContainer.FindMembers): Search in base interfaces too.
8794
8795         * codegen.cs (GetClsComplianceAttribute): New method that gets
8796         assembly or module CLSCompliantAttribute value.
8797         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8798         for assembly.
8799         (ModuleClass.Emit): Add error 3012 test.
8800
8801         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8802
8803         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8804         state for all decl types.
8805         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8806         if CLS-Compliant tests are required.
8807         (IsClsCompliaceRequired): New method. Analyze whether code
8808         must be CLS-Compliant.
8809         (IsExposedFromAssembly): New method. Returns true when MemberCore
8810         is exposed from assembly.
8811         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8812         value or gets cached value.
8813         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8814         is explicitly marked with CLSCompliantAttribute.
8815         (IsIdentifierClsCompliant): New abstract method. This method is
8816         used to testing error 3005.
8817         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8818         for identifier and parameters CLS-Compliant testing.
8819         (VerifyClsCompliance): New method. The main virtual method for
8820         CLS-Compliant verifications.
8821         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8822         null. I don't know why is null (too many public members !).
8823         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8824         and get value of first CLSCompliantAttribute that found.
8825
8826         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8827         (VerifyClsCompliance): Override and add extra tests.
8828
8829         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8830         clscheck- disable CLS-Compliant verification event if assembly is has
8831         CLSCompliantAttribute(true).
8832
8833         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8834         ApllyAttribute is now called in emit section as in the other cases.
8835         Possible future Emit integration.
8836         (IsIdentifierClsCompliant): New override.
8837         (VerifyClsCompliance): New override.
8838         (GetEnumeratorName): Returns full enum name.
8839
8840         * parameter.cs (GetSignatureForError): Implemented.
8841
8842         * report.cs (WarningData): New struct for Warning message information.
8843         (LocationOfPreviousError): New method.
8844         (Warning): New method. Reports warning based on the warning table.
8845         (Error_T): New method. Reports error based on the error table.
8846
8847         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8848         verifications are done here.
8849
8850         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8851
8852         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8853         CLSCompliantAttribute.
8854         (all_imported_types): New member holds all imported types from other
8855         assemblies.
8856         (LoadAllImportedTypes): New method fills static table with exported types
8857         from all referenced assemblies.
8858         (Modules): New property returns all assembly modules.
8859
8860 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8863         throwing a parser error.
8864
8865         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8866         which removes the hardcoded get_/set_ prefixes for properties, as
8867         IL allows for the properties to be named something else.  
8868
8869         Bug #56013
8870
8871         * expression.cs: Do not override operand before we know if it is
8872         non-null.  Fix 56207
8873
8874 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8875
8876         * typemanager.cs: support for pinned variables.
8877
8878 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8879
8880         * decl.cs, typemanager.cs: Avoid using an arraylist
8881         as a buffer if there is only one result set.
8882
8883 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8884
8885         * expression.cs: Make sure you cant call a static method
8886         with an instance expression, bug #56174.
8887
8888 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * class.cs (IsDuplicateImplementation): Improve error reporting to
8891         flag 663 (method only differs in parameter modifier).
8892
8893         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8894         in preprocessor directives.
8895
8896         * location.cs (LookupFile): Allow for the empty path.
8897
8898         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8899         better approach for some of that patch, but its failing with the
8900         CharSet enumeration.  For now try/catch will do.
8901
8902         * typemanager.cs: Do not crash if a struct does not have fields.
8903         Fixes 56150.
8904
8905 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8906
8907         * expression.cs: cs0213, cant fix a fixed expression.
8908         fixes 50231.
8909
8910 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8911
8912         * cs-parser.jay: detect invalid embeded statements gracefully.
8913         bug #51113.
8914
8915 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8916
8917         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8918         As a regex:
8919         s/
8920         the invocation type may not be a subclass of the tye of the item/
8921         The type of the item must be a subclass of the invocation item.
8922         /g
8923
8924         Fixes bug #50820.
8925
8926 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8927
8928         * attribute.cs: Added methods to get a string and a bool from an
8929         attribute. Required to information from AssemblyKeyFileAttribute,
8930         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8931         * codegen.cs: Modified AssemblyName creation to include support for
8932         strongnames. Catch additional exceptions to report them as CS1548.
8933         * compiler.csproj: Updated include CryptoConvert.cs.
8934         * compiler.csproj.user: Removed file - user specific configuration.
8935         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8936         Mono.Security assembly. The original class is maintained and tested in
8937         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8938         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8939         like CSC 8.0 (C# v2) supports.
8940         * Makefile: Added CryptoConvert.cs to mcs sources.
8941         * rootcontext.cs: Added new options for strongnames.
8942
8943 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8944
8945         * driver.cs: For --expect-error, report error code `2'
8946         if the program compiled with no errors, error code `1' if
8947         it compiled with an error other than the one expected.
8948
8949 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8950
8951         * compiler.csproj: Updated for Visual Studio .NET 2003.
8952         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8953         * compiler.sln: Updated for Visual Studio .NET 2003.
8954
8955 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8956
8957         * expression.cs: Fix bug #47234. We basically need to apply the
8958         rule that we prefer the conversion of null to a reference type
8959         when faced with a conversion to 'object' (csc behaviour).
8960
8961 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8962
8963         * statement.cs: Shorter form for foreach, eliminates
8964         a local variable. r=Martin.
8965
8966 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8967
8968         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8969         checks if we can use brtrue/brfalse to test for 0.
8970         * expression.cs: use the above in the test for using brtrue/brfalse.
8971         cleanup code a bit.
8972
8973 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8974
8975         * expression.cs: Rewrite string concat stuff. Benefits:
8976
8977         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8978         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8979         rather than a concat chain.
8980
8981         * typemanager.cs: Add lookups for more concat overloads.
8982
8983 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8984
8985         * expression.cs: Emit shorter il code for array init.
8986
8987         newarr
8988         dup
8989         // set 1
8990
8991         // set 2
8992
8993         newarr
8994         stloc.x
8995
8996         ldloc.x
8997         // set 1
8998
8999         ldloc.x
9000         // set 2
9001
9002 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9003
9004         * statement.cs: Before, two switch blocks would be merged if the
9005         total size of the blocks (end_item - begin_item + 1) was less than
9006         two times the combined sizes of the blocks.
9007
9008         Now, it will only merge if after the merge at least half of the
9009         slots are filled.
9010
9011         fixes 55885.
9012
9013 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9014
9015         * class.cs : csc build fix for GetMethods(). See bug #52503.
9016
9017 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9018
9019         * expression.cs: Make sure fp comparisons work with NaN.
9020         This fixes bug #54303. Mig approved this patch a long
9021         time ago, but we were not able to test b/c the runtime
9022         had a related bug.
9023
9024 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9025
9026         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9027
9028 2004-03-19  Martin Baulig  <martin@ximian.com>
9029
9030         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9031         two overloads may unify for some type parameter substitutions and
9032         report a CS0408 if appropriate.
9033
9034 2004-03-19  Martin Baulig  <martin@ximian.com>
9035
9036         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9037         error here and not in our caller.
9038
9039 2004-03-19  Martin Baulig  <martin@ximian.com>
9040
9041         * interface.cs: Completely killed this file.
9042         (Interface): We're now a TypeContainer and live in class.cs.
9043
9044         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9045         argument; we're now also called for interfaces.
9046         (TypeContainer.DefineMembers): Allow this method being called
9047         multiple times.
9048         (TypeContainer.GetMethods): New public method; formerly known as
9049         Interface.GetMethod().  This is used by PendingImplementation.
9050         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9051         it's now private and non-static.
9052         (Interface): Moved this here; it's now implemented similar to
9053         Class and Struct.
9054         (Method, Property, Event, Indexer): Added `bool is_interface'
9055         argument to their .ctor's.
9056         (MemberBase.IsInterface): New public field.
9057
9058         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9059         instances instead of InterfaceMethod, InterfaceProperty, etc.
9060         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9061         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9062
9063 2004-03-19  Martin Baulig  <martin@ximian.com>
9064
9065         * class.cs (MethodCore.IsDuplicateImplementation): New private
9066         method which does the CS0111 checking.
9067         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9068         Use IsDuplicateImplementation().
9069
9070 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9071
9072         * decl.cs (FindMemberToOverride): New method to find the correct
9073         method or property to override in the base class.
9074         * class.cs
9075             - Make Method/Property use the above method to find the
9076               version in the base class.
9077             - Remove the InheritableMemberSignatureCompare as it is now
9078               dead code.
9079
9080         This patch makes large code bases much faster to compile, as it is
9081         O(n) rather than O(n^2) to do this validation.
9082
9083         Also, it fixes bug 52458 which is that nested classes are not
9084         taken into account when finding the base class member.
9085
9086         Reviewed/Approved by Martin.
9087
9088 2004-03-17  Martin Baulig  <martin@ximian.com>
9089
9090         * expression.cs (MemberAccess.DoResolve): Take the parent's number
9091         of type arguments into account; use the `real_num_type_args'
9092         approach like in DoResolveAsTypeStep().
9093
9094         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9095         nested types.
9096
9097 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9098
9099         * interface.cs: In all interface classes removed redundant
9100         member initialization.
9101
9102 2004-03-16  Martin Baulig  <martin@ximian.com>
9103
9104         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9105
9106 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9107
9108         * decl.cs (DefineTypeAndParents): New helper method to define a
9109         type's containers before the type itself is defined;  This is a
9110         bug exposed by the recent changes to Windows.Forms when an
9111         implemented interface was defined inside a class that had not been
9112         built yet.   
9113
9114         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9115
9116         (Check): Loop correctly to report errors modifiers
9117         (UNSAFE was not in the loop, since it was the same as TOP).
9118
9119         * interface.cs: Every interface member now takes a ModFlags,
9120         instead of a "is_new" bool, which we set on the base MemberCore. 
9121
9122         Every place where we called "UnsafeOk" in the interface, now we
9123         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9124         the unsafe settings from the member declaration instead of the
9125         container interface. 
9126
9127         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9128
9129         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9130         `set_indexer_name' to the pending bits (one per type).
9131
9132         We fixed a bug today that was picking the wrong method to
9133         override, since for properties the existing InterfaceMethod code
9134         basically ignored the method name.  Now we make sure that the
9135         method name is one of the valid indexer names.
9136
9137 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9138  
9139         * support.cs (SeekableStreamReader): Keep track of stream byte
9140         positions and don't mix them with character offsets to the buffer.
9141
9142         Patch from Gustavo Giráldez
9143
9144 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9145
9146         * interface.cs (InterfaceSetGetBase): Removed double member
9147         initialization, base class does it as well.
9148
9149 2004-03-13  Martin Baulig  <martin@ximian.com>
9150
9151         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9152         when compiling corlib.
9153
9154 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9155
9156         * convert.cs (ExplicitConversion): We were reporting an error on
9157         certain conversions (object_type source to a value type, when the
9158         expression was `null') before we had a chance to pass it through
9159         the user defined conversions.
9160
9161         * driver.cs: Replace / and \ in resource specifications to dots.
9162         Fixes 50752
9163
9164         * class.cs: Add check for duplicate operators.  Fixes 52477
9165
9166 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9167
9168         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9169         that are in the middle of the statements, not only at the end.
9170         Fixes #54987
9171
9172         * class.cs (TypeContainer.AddField): No longer set the
9173         `HaveStaticConstructor' flag, now we call it
9174         `UserDefineStaticConstructor' to diferentiate the slightly
9175         semantic difference.
9176
9177         The situation is that we were not adding BeforeFieldInit (from
9178         Modifiers.TypeAttr) to classes that could have it.
9179         BeforeFieldInit should be set to classes that have no static
9180         constructor. 
9181
9182         See:
9183
9184         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9185
9186         And most importantly Zoltan's comment:
9187
9188         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9189
9190         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9191          before its static fields are used', i.e. initialization does not need
9192          to be triggered by the first access to the type. Setting this flag
9193          helps the JIT to compile better code, since it can run the static
9194          constructor at JIT time, and does not need to generate code to call it
9195          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9196          this flag for lots of classes like String. 
9197          
9198          csc sets this flag if the type does not have an explicit static 
9199          constructor. The reasoning seems to be that if there are only static
9200          initalizers for a type, and no static constructor, then the programmer
9201          does not care when this initialization happens, so beforefieldinit
9202          can be used.
9203          
9204          This bug prevents the AOT compiler from being usable, since it 
9205          generates so many calls to mono_runtime_class_init that the AOT code
9206          is much slower than the JITted code. The JITted code is faster, 
9207          because it does not generate these calls if the vtable is type is
9208          already initialized, which is true in the majority of cases. But the
9209          AOT compiler can't do this."
9210
9211 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9212
9213         * class.cs (MethodData.Emit): Refactor the code so symbolic
9214         information is generated for destructors;  For some reasons we
9215         were taking a code path that did not generate symbolic information
9216         before. 
9217
9218 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9219
9220         * class.cs: Create a Constructor.CheckBase method that
9221         takes care of all validation type code. The method
9222         contains some code that was moved from Define.
9223
9224         It also includes new code that checks for duplicate ctors.
9225         This fixes bug #55148.
9226
9227 2004-03-09  Joshua Tauberer <tauberer@for.net>
9228
9229         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9230         a { ... }-style array creation invokes EmitStaticInitializers
9231         which is not good for reference-type arrays.  String, decimal
9232         and now null constants (NullCast) are not counted toward
9233         static initializers.
9234
9235 2004-03-05  Martin Baulig  <martin@ximian.com>
9236
9237         * location.cs (SourceFile.HasLineDirective): New public field;
9238         specifies whether the file contains or is referenced by a "#line"
9239         directive.
9240         (Location.DefineSymbolDocuments): Ignore source files which
9241         either contain or are referenced by a "#line" directive.        
9242
9243 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9244
9245         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9246         direct access to our parent, so check the method inline there.
9247
9248 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9249
9250         * expression.cs (Invocation.EmitCall): Miguel's last commit
9251         caused a regression. If you had:
9252
9253             T t = null;
9254             t.Foo ();
9255
9256         In Foo the implict this would be null.
9257
9258 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9259
9260         * expression.cs (Invocation.EmitCall): If the method is not
9261         virtual, do not emit a CallVirt to it, use Call.
9262
9263         * typemanager.cs (GetFullNameSignature): Improve the method to
9264         cope with ".ctor" and replace it with the type name.
9265
9266         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9267         as an argument the ConstructorBuilder where it is being defined,
9268         to catch the recursive constructor invocations.
9269
9270 2004-03-16  Martin Baulig  <martin@ximian.com>
9271
9272         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9273         ConstructedType, call ResolveType() on it to get the type rather
9274         than just using `expr.Type'.
9275
9276 2004-03-16  Martin Baulig  <martin@ximian.com>
9277
9278         * generics.cs (ConstructedType.GetMemberAccess): Take the
9279         EmitContext instead on the TypeExpr and use
9280         ec.TypeContainer.CurrentType/ec.ContainerType.
9281
9282 2004-03-16  Martin Baulig  <martin@ximian.com>
9283
9284         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9285         parameters before aliases.
9286
9287 2004-03-16  Martin Baulig  <martin@ximian.com>
9288
9289         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9290         New oublic function; checks whether two generic instances may become
9291         equal under some instantiations (26.3.1).
9292
9293         * class.cs (TypeContainer.Define): Call
9294         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9295         error.
9296
9297 2004-03-16  Martin Baulig  <martin@ximian.com>
9298
9299         * class.cs (TypeContainer.GetClassBases): Moved
9300         Error_TypeParameterAsBase() here and also check whether the base
9301         class is not an attribute.
9302
9303 2004-03-16  Martin Baulig  <martin@ximian.com>
9304
9305         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9306
9307 2004-03-16  Martin Baulig  <martin@ximian.com>
9308
9309         * class.cs (Error_TypeParameterAsBase): Use correct error number
9310         here (CS0689).  
9311
9312 2004-03-16  Martin Baulig  <martin@ximian.com>
9313
9314         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9315         for generics.
9316
9317         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9318         error reporting.
9319
9320 2004-03-15  Martin Baulig  <martin@ximian.com>
9321
9322         * typemanager.cs (TypeManager.GetFullName): New public method.
9323         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9324         argument; only return members with the correct number of type
9325         arguments.
9326         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9327         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9328         whether the number of type arguments matches.
9329
9330         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9331         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9332
9333         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9334         field; it's set by the protected .ctor when we're actually a
9335         GenericMemberAccess.
9336         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9337         arguments and pass it to MemberLookupFinal ().
9338
9339         * ecore.cs (Expression.MemberLookup): Added `int
9340         num_type_arguments' argument; only return members with the correct
9341         number of type arguments.
9342         (Expression.MemberLookupFailed): Check whether the MemberLookup
9343         failed because we did not have the correct number of type
9344         arguments; report CS0305 in this case.
9345
9346         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9347         `e.ResolveAsTypeTerminal()' already did so.
9348
9349 2004-03-15  Martin Baulig  <martin@ximian.com>
9350
9351         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9352         we're a ConstructedType; in this case, the caller must report an
9353         error (for instance CS0131).
9354
9355         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9356         (TypeArguments.Resolve): Actually report errors here.
9357
9358 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9361         `set_indexer_name' to the pending bits (one per type).
9362
9363         We fixed a bug today that was picking the wrong method to
9364         override, since for properties the existing InterfaceMethod code
9365         basically ignored the method name.  Now we make sure that the
9366         method name is one of the valid indexer names.
9367
9368 2004-03-15  Martin Baulig  <martin@ximian.com>
9369
9370         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9371         for generic instances.
9372
9373 2004-03-13  Martin Baulig  <martin@ximian.com>
9374
9375         * class.cs (TypeContainer.DefineType): Call
9376         TypeManager.AddUserType() immediately after creating the
9377         TypeBuilder; pass all type parameters when creating the
9378         CurrentType.
9379
9380         * decl.cs (DeclSpace.FindNestedType): New public method.
9381         (DeclSpace.FindType): Added `int num_type_args' argument; only
9382         return types with the correct number of type parameters.
9383         (DeclSpace.CountTypeParams): New public property.
9384
9385         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9386         the number of type parameters; defaults to zero.
9387
9388         * generic.cs (TypeArguments.Count): New public property.
9389         (ConstructedType.DoResolveAsTypeStep): First call
9390         ds.FindNestedType() to find out whether we're nested in the
9391         current generic type; in this case, we inherit all type parameters
9392         from the current class.
9393
9394         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9395         num_type_args' argument.
9396         (RootContext.LookupType): Added overloaded version which takes the
9397         number of type arguments; only return types with the correct
9398         number of type arguments.
9399
9400         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9401         checks whether `Type t' has `int num_type_args'.
9402
9403 2004-03-13  Martin Baulig  <martin@ximian.com>
9404
9405         * generic.cs (GenericMethod.DefineType): New method; calls
9406         DefineType() on all the type parameters.
9407
9408         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9409         (MethodData.Define): If we're a generic method, call
9410         GenericMethod.DefineType() to define the type parameters.       
9411
9412 2004-03-10  Martin Baulig  <martin@ximian.com>
9413
9414         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9415         instead of IsAssignableFrom.    
9416
9417 2004-03-10  Martin Baulig  <martin@ximian.com>
9418
9419         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9420
9421         * support.cs (ParameterData.HasArrayParameter): New property.
9422         (ReflectionParameters.ctor): Take a MethodBase instead of a
9423         ParameterInfo[].  If we have any type parameters, get the generic
9424         method definition and ask it whether we have variable arguments.
9425
9426 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9429         routines to check if a type is an enumerable/enumerator allow
9430         classes that implement the IEnumerable or IEnumerator interfaces.
9431
9432         * class.cs (Property, Operator): Implement IIteratorContainer, and
9433         implement SetYields.
9434
9435         (Property.Define): Do the block swapping for get_methods in the
9436         context of iterators.   We need to check if Properties also
9437         include indexers or not.
9438
9439         (Operator): Assign the Block before invoking the
9440         OperatorMethod.Define, so we can trigger the Iterator code
9441         replacement. 
9442
9443         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9444         Property and Operator classes are not created when we parse the
9445         declarator but until we have the block completed, so we use a
9446         singleton SimpleIteratorContainer.Simple to flag whether the
9447         SetYields has been invoked.
9448
9449         We propagate this setting then to the Property or the Operator to
9450         allow the `yield' to function.
9451
9452 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9453
9454         * codegen.cs: Implemented attribute support for modules.
9455         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9456         Assembly/Module functionality.
9457
9458         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9459         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9460         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9461
9462 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9463
9464         * interface.cs (FindMembers): The operation is performed on all base
9465         interfaces and not only on the first. It is required for future CLS Compliance patch.
9466
9467 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9468
9469         * statement.cs, codegen.cs:
9470         This patch deals with patterns such as:
9471
9472         public class List : IEnumerable {
9473
9474                 public MyEnumerator GetEnumerator () {
9475                         return new MyEnumerator(this);
9476                 }
9477
9478                 IEnumerator IEnumerable.GetEnumerator () {
9479                         ...
9480                 }
9481                 
9482                 public struct MyEnumerator : IEnumerator {
9483                         ...
9484                 }
9485         }
9486
9487         Before, there were a few things we did wrong:
9488         1) we would emit callvirt on a struct, which is illegal
9489         2) we emited ldarg when we needed to emit ldarga
9490         3) we would mistakenly call the interface methods on an enumerator
9491         type that derived from IEnumerator and was in another assembly. For example:
9492
9493         public class MyEnumerator : IEnumerator
9494
9495         Would have the interface methods called, even if there were public impls of the
9496         method. In a struct, this lead to invalid IL code.
9497
9498 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9499
9500         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9501           renamed to Emit.
9502
9503         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9504
9505 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9506
9507         * cs-parser.jay: Fix small regression: we were not testing V2
9508         compiler features correctly.
9509
9510         * interface.cs: If the emit context is null, then create one
9511
9512 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9513
9514         * decl.cs (GetSignatureForError): New virtual method to get full name
9515           for error messages.
9516
9517         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9518           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9519
9520         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9521           Duplicated members and code in these classes has been removed.
9522           Better encapsulation in these classes.
9523
9524 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9525
9526         * assign.cs (Assign.DoResolve): When dealing with compound
9527         assignments, there is a new rule in ECMA C# 2.4 (might have been
9528         there before, but it is documented here) that states that in:
9529
9530         a op= b;
9531
9532         If b is of type int, and the `op' is a shift-operator, then the
9533         above is evaluated as:
9534
9535         a = (int) a op b 
9536
9537         * expression.cs (Binary.ResolveOperator): Instead of testing for
9538         int/uint/long/ulong, try to implicitly convert to any of those
9539         types and use that in pointer arithmetic.
9540
9541         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9542         method to print information for from the type, not from the
9543         null-method we were given.
9544
9545 2004-02-01  Duncan Mak  <duncan@ximian.com>
9546
9547         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9548         parsing for cmd, fixes bug #53694.
9549
9550 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9551
9552         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9553         in the member name duplication tests. Property and operator name duplication
9554         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9555
9556 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9557
9558         * interface.cs (PopulateMethod): Fixed crash when interface method
9559         returns not existing type (error test cs0246-3.cs).
9560
9561 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9562
9563         * cs-parser.jay (interface_accessors): Re-write actions to also
9564         store attributes attached to get and set methods. Fix spelling
9565         while at it.
9566
9567         (inteface_property_declaration): Modify accordingly.
9568
9569         (InterfaceAccessorInfo): New helper class to store information to pass
9570         around between rules that use interface_accessors.
9571
9572         * interface.cs (Emit): Apply attributes on the get and set
9573         accessors of properties and indexers too.
9574
9575         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9576         right MethodBuilder when applying attributes to the get and set accessors.
9577
9578 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9579
9580         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9581
9582 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9583
9584         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9585
9586 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9587
9588         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9589         changes that treat `yield' specially when present before `break'
9590         or `return' tokens.
9591
9592         * cs-tokenizer.cs: yield is no longer a keyword.
9593
9594 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9595
9596         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9597         setting for default constructors.
9598         For default constructors are almost every time set wrong Modifier. The
9599         generated IL code has been alright. But inside mcs this values was
9600         wrong and this was reason why several of my CLS Compliance tests
9601         failed.
9602
9603 2004-02-27  Martin Baulig  <martin@ximian.com>
9604
9605         * generics.cs (ConstructedType.ResolveType): Make the nested type
9606         stuff actually work.
9607
9608 2004-02-25  Martin Baulig  <martin@ximian.com>
9609
9610         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9611         property; returns the type parameters just from the current type,
9612         ie. with the ones from outer classes.
9613         (DeclSpace.LookupGeneric): First search in the current class, then
9614         in outer classes.
9615         (DeclSpace.initialize_type_params): When hiding a type parameter
9616         from an outer class, put it into the `type_param_list' anyways.
9617
9618         * expression.cs (MemberAccess.expr): Made this field protected.
9619
9620         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9621         the type parameters from the current class.
9622
9623         * generic.cs (ConstructedType.ResolveType): Support nested generic
9624         types by taking the type parameters which we inherit from outer
9625         classes into account.
9626         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9627         support for nested generic types.
9628
9629 2004-02-23  Martin Baulig  <martin@ximian.com>
9630
9631         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9632         field and check whether we're nested inside a generic type.
9633         (DeclSpace.ResolveType): If we're resolving to a generic type
9634         definition, create a ConstructedType and return its resolved type.
9635         (DeclSpace.initialize_type_params): New private method;
9636         initializes the `type_param_list' field from the type parameters
9637         from this and all enclosing classes.
9638         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9639         we're already initialized.
9640
9641 2004-02-23  Martin Baulig  <martin@ximian.com>
9642
9643         * class.cs (Method.Define): Create the generic method before
9644         calling DoDefine().
9645         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9646         the TypeContainer one); we use this for generic methods.
9647
9648         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9649         parent's TypeBuilder.
9650
9651 2004-02-18  Martin Baulig  <martin@ximian.com>
9652
9653         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9654         to check for equality.
9655
9656 2004-02-05  Martin Baulig  <martin@ximian.com>
9657
9658         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9659         `ec.TypeContainer.CurrentType', use it instead of
9660         `ec.ContainerType' to check whether we're in the type's ctor.
9661
9662 2004-01-29  Martin Baulig  <martin@ximian.com>
9663
9664         * expression.cs (Invocation.DoResolve): If we're a
9665         `ConstructedType', then we're actually a generic method, so
9666         rewrite the expr as a GenericMemberAccess.
9667
9668         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9669         here; manually parse it into a string.
9670
9671 2004-01-28  Martin Baulig  <martin@ximian.com>
9672
9673         * typemanager.cs (TypeManager.IsEqual): New static method.
9674         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9675         check for equality instead of using `=='.
9676
9677 2004-01-26  Martin Baulig  <martin@ximian.com>
9678
9679         * decl.cs (DeclSpace.CurrentType): New public field.
9680
9681         * expression.cs (This.ResolveBase): If we have an
9682         `ec.TypeContainer.CurrentType', use it instead of
9683         `ec.ContainerType'.
9684
9685         * class.cs (TypeContainer.DefineType): If we're a generic type,
9686         create the `CurrentType' (unresolved).
9687         (TypeContainer.GenericType): New private field.
9688         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9689         it and store it in `GenericType' before creating the MemberCache.
9690         (TypeContainer.GetMembers): If we have a `GenericType', call
9691         TypeManager.FindMembers() on it.
9692
9693         * interface.cs (Interface.GenericType): New private field.
9694         (Interface.DefineType): If we're a generic type, create the
9695         `CurrentType' (unresolved).
9696         (Interface.DefineMembers): If we have a `CurrentType', resolve it
9697         and store it in `GenericType' before creating the MemberCache.
9698         (Interface.GetMembers): If we have a `GenericType', call
9699         TypeManager.FindMembers() on it.
9700
9701 2004-01-22  Martin Baulig  <martin@ximian.com>
9702
9703         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9704         not a QualifiedIdentifier.  This is what `type_name_expression'
9705         was previously doing.
9706         (type_name_expression): Removed; the code is now in
9707         `namespace_or_type_name'.
9708         (qualified_identifier): Removed, use `namespace_or_type_name'
9709         instead.
9710         (QualifiedIdentifier): Removed this class.      
9711
9712 2004-01-22  Martin Baulig  <martin@ximian.com>
9713
9714         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9715         not a string as alias name.
9716
9717 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9720         #52730 bug, and instead compute correctly the need to use a
9721         temporary variable when requesting an address based on the
9722         static/instace modified of the field and the constructor.
9723  
9724 2004-01-21  Martin Baulig  <martin@ximian.com>
9725
9726         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9727         class and namespace before looking up aliases.  Fixes #52517.
9728
9729 2004-01-21  Martin Baulig  <martin@ximian.com>
9730
9731         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9732         assinged in a 'try'; fixes exception4.cs.
9733
9734 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9735         * class.cs : Implemented parameter-less constructor for TypeContainer
9736
9737         * decl.cs: Attributes are now stored here. New property OptAttributes
9738
9739         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9740
9741         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9742
9743 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9744
9745         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9746           (CSharpSignature): New method for indexer and property signature.
9747
9748 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9749
9750         * pending.cs (IsVirtualFilter): Faster implementation.
9751
9752 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9753
9754         * typemanager.cs: Avoid inclusion of same assembly more than once.
9755
9756 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9757
9758         * cs-parser.jay: Fixed problem where the last assembly attribute
9759           has been applied also to following declaration (class, struct, etc.)
9760           
9761 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9762
9763         * class.cs: Added error CS0538, CS0539 reporting.
9764         Fixed crash on Microsoft runtime when field type is void.
9765
9766         * cs-parser.jay: Added error CS0537 reporting.
9767
9768         * pending.cs: Added error CS0535 reporting.
9769         Improved error report for errors CS0536, CS0534.
9770
9771 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9772
9773         Merge a few bits from the Anonymous Method MCS tree.
9774
9775         * statement.cs (ToplevelBlock): New class for toplevel methods,
9776         will hold anonymous methods, lifted variables.
9777
9778         * cs-parser.jay: Create toplevel blocks for delegates and for
9779         regular blocks of code. 
9780
9781 2004-01-20  Martin Baulig  <martin@ximian.com>
9782
9783         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9784         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9785         and `NeedExplicitReturn'; added `IsLastStatement'.
9786         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9787         have a `ReturnLabel' or we're not unreachable.
9788
9789         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9790         child's reachability; don't just override ours with it.  Fixes
9791         #58058 (lluis's example).
9792         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9793         InFinally(), InLoop(), InSwitch() and
9794         BreakCrossesTryCatchBoundary() methods.
9795
9796         * statement.cs (Return): Do all error checking in Resolve().
9797         Unless we are the last statement in a top-level block, always
9798         create a return label and jump to it.
9799         (Break, Continue): Do all error checking in Resolve(); also make
9800         sure we aren't leaving a `finally'.
9801         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9802         statement in a top-level block.
9803         (Block.Flags): Added `IsDestructor'.
9804         (Block.IsDestructor): New public property.
9805
9806 2004-01-20  Martin Baulig  <martin@ximian.com>
9807
9808         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9809
9810 2004-01-20  Martin Baulig  <martin@ximian.com>
9811
9812         * statement.cs (Statement.ResolveUnreachable): New public method.
9813         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9814         (Block.Resolve): Resolve unreachable statements.
9815
9816 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9817
9818         * expression.cs: We need to fix the case where we do
9819         not have a temp variable here.
9820
9821         * assign.cs: Only expression compound assignments need
9822         temporary variables.
9823
9824 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9825
9826         * flowanalysis.cs: Reduce memory allocation in a few ways:
9827           - A block with no variables should not allocate a bit
9828             vector for itself.
9829           - A method with no out parameters does not need any tracking
9830             for assignment of the parameters, so we need not allocate
9831             any data for it.
9832           - The arrays:
9833                 public readonly Type[] VariableTypes;
9834                 public readonly string[] VariableNames;
9835             Are redundant. The data is already stored in the variable
9836             map, so we need not allocate another array for it.
9837           - We need to add alot of checks for if (params | locals) == null
9838             due to the first two changes.
9839
9840 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9841
9842         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9843         implement IMemoryLocation, we store a copy on a local variable and
9844         take the address of it.  Patch from Benjamin Jemlich
9845
9846         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9847         to use a special "type_name_expression" rule which reduces the
9848         number of "QualifiedIdentifier" classes created, and instead
9849         directly creates MemberAccess expressions.
9850
9851 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9852
9853         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9854         that fixes #52853.  Null literal assignment to ValueType
9855
9856         * class.cs (MethodData.Emit): Instead of checking the name of the
9857         method to determine if its a destructor, create a new derived
9858         class from Method called Destructor, and test for that.  
9859
9860         * cs-parser.jay: Create a Destructor object instead of a Method.  
9861
9862         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9863
9864         Fixes: 52933
9865
9866 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * expression.cs (Binary.ResolveOperator): Perform an implicit
9869         conversion from MethodGroups to their delegate types on the
9870         Addition operation.
9871
9872         * delegate.cs: Introduce a new class DelegateCreation that is the
9873         base class for `NewDelegate' and `ImplicitDelegateCreation',
9874         factor some code in here.
9875
9876         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9877         conversion from MethodGroups to compatible delegate types. 
9878
9879         * ecore.cs (Expression.Resolve): Do not flag error 654
9880         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9881         we allow conversions from MethodGroups to delegate types now.
9882
9883         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9884         assignments in v2 either.
9885
9886 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9887
9888         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9889         static read-only fields in ctors.
9890
9891         Applied patch from Benjamin Jemlich 
9892
9893         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9894
9895 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9896
9897         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9898         here to return true, as they can be used like this:
9899
9900                 (XXX) int.MEMBER ()
9901
9902         Fixed 49836 and all the other dups
9903
9904 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9905
9906         * driver.cs: Implement /win32res and /win32icon.
9907
9908 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9909
9910         * cs-parser.jay: Add a rule to improve error handling for the
9911         common mistake of placing modifiers after the type.
9912
9913 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9914
9915         * cs-parser.jay (interface_event_declaration): Catch
9916         initialization of events on interfaces, and report cs0068
9917
9918         * cs-parser.jay (interface_event_declaration): Catch
9919         initialization of events. 
9920
9921         * ecore.cs: Better report missing constructors.
9922
9923         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9924         the error reporting done in the wrong place.  Fix.
9925
9926         * expression.cs (Binary.ResolveOperator): Catch the 
9927         operator + (E x, E y) error earlier, and later allow for implicit
9928         conversions in operator +/- (E e, U x) from U to the underlying
9929         type of E.
9930
9931         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9932         52596, if the container class is abstract, the default constructor
9933         is protected otherwise its public (before, we were always public).
9934
9935         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9936         fixed statement.
9937
9938         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9939         Jemlich that fixes bug #52597, MCS was generating invalid code for
9940         idisposable structs.   Thanks to Ben for following up with this
9941         bug as well.
9942
9943 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * driver.cs: Allow assemblies without code to be generated, fixes
9946         52230.
9947
9948 2004-01-07  Nick Drochak <ndrochak@gol.com>
9949
9950         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9951
9952 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9953
9954         * cs-parser.jay: Add rules to improve error reporting if fields or
9955         methods are declared at the namespace level (error 116)
9956
9957         * Add rules to catch event add/remove
9958
9959 2004-01-04  David Sheldon <dave-mono@earth.li>
9960
9961   * expression.cs: Added matching ")" to error message for 
9962   CS0077
9963
9964 2004-01-03 Todd Berman <tberman@gentoo.org>
9965
9966         * ecore.cs, attribute.cs:
9967         Applying fix from #52429.
9968
9969 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9970
9971         * ecore.cs, expression.cs, statement.cs:
9972         Total rewrite of how we handle branching. We
9973         now handle complex boolean expressions with fewer
9974         jumps. As well if (x == 0) no longer emits a ceq.
9975
9976         if (x is Foo) is much faster now, because we generate
9977         better code.
9978
9979         Overall, we get a pretty big improvement on our benchmark
9980         tests. The code we generate is smaller and more readable.
9981
9982         I did a full two-stage bootstrap. The patch was reviewed
9983         by Martin and Miguel.
9984
9985 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9986
9987         * cs-parser.jay: Make primary_expression not take a QI.
9988         we dont need this because the member_access rule covers
9989         us here. So we replace the rule with just IDENTIFIER.
9990
9991         This has two good effects. First, we remove a s/r conflict.
9992         Second, we allocate many fewer QualifiedIdentifier objects.
9993
9994 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9995
9996         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9997         set the correct information via SRE. This prevents
9998         hanging on the MS runtime. Fixes #29374.
9999
10000 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10001
10002         * convert.cs: correctly handle conversions to value types
10003         from Enum and ValueType as unboxing conversions.
10004
10005         Fixes bug #52569. Patch by Benjamin Jemlich.
10006
10007 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10008
10009         * expression.cs (BetterConversion): Prefer int -> uint
10010         over int -> ulong (csc's behaviour). This fixed bug #52046.
10011
10012 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10013
10014         * decl.cs (MemberCache.FindMembers): now returns a
10015         MemberInfo [].
10016
10017         * typemanager.cs: In general, go with with ^^.
10018         (CopyNewMethods): take an IList.
10019         (RealMemberLookup): Only allocate an arraylist
10020         if we copy from two sets of methods.
10021
10022         This change basically does two things:
10023         1) Fewer array lists allocated due to CopyNewMethods.
10024         2) the explicit cast in MemberList costed ALOT.
10025
10026 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10027
10028         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10029         a hashtable to avoid needless string allocations when an identifier is
10030         used more than once (the common case).
10031
10032 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10033
10034         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10035         is broken, it will not return anything. So, we
10036         have to use the information we have in mcs to
10037         do the task.
10038
10039         * typemanager.cs: Add a cache for GetInterfaces,
10040         since this will now be used more often (due to ^^)
10041
10042         (GetExplicitInterfaces) New method that gets the
10043         declared, not effective, interfaces on a type
10044         builder (eg, if you have interface IFoo, interface
10045         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10046         { IBar }.
10047
10048         This patch makes MCS able to bootstrap itself on
10049         Windows again.
10050
10051 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10052
10053         * expression.cs: Remove the Nop's that Miguel put
10054         in by mistake.
10055
10056 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10057
10058         * report.cs, codegen.cs: Give the real stack trace to
10059         the error when an exception is thrown.
10060
10061 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10062
10063         * decl.cs: only allocate hashtables for ifaces if 
10064         it is an iface!
10065
10066 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10067
10068         * expression.cs: fix the error from cs0121-2.cs
10069         (a parent interface has two child interfaces that
10070         have a function with the same name and 0 params
10071         and the function is called through the parent).
10072
10073 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10074
10075         * class.cs, rootcontext.cs, typmanager.cs: do not
10076         leak pointers.
10077
10078 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10079
10080         * codegen.cs: remove stack for the ec flow branching.
10081         It is already a linked list, so no need.
10082
10083 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10084
10085         * Makefile: Allow custom profiler here.
10086
10087 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10088
10089         * typemanager.cs (LookupType):
10090           - Use a static char [], because split takes
10091             a param array for args, so it was allocating
10092             every time.
10093           - Do not store true in a hashtable, it boxes.
10094
10095 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10096
10097         * flowanalysis.cs: bytify common enums.
10098
10099 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10100
10101         * modifiers.cs: Add a new set of flags for the
10102         flags allowed on explicit interface impls.
10103         * cs-parser.jay: catch the use of modifiers in
10104         interfaces correctly.
10105         * class.cs: catch private void IFoo.Blah ().
10106
10107         All related to bug #50572.
10108
10109 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10110
10111         * decl.cs: Rewrite the consistant accessability checking.
10112         Accessability is not linear, it must be implemented in
10113         a tableish way. Fixes #49704.
10114
10115 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10116
10117         * expression.cs: Handle negation in a checked context.
10118         We must use subtraction from zero. Fixes #38674.
10119
10120 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10121
10122         * class.cs: Ignore static void main in DLLs.
10123         * rootcontext.cs: Handle the target type here,
10124         since we are have to access it from class.cs
10125         * driver.cs: account for the above.
10126
10127 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10128
10129         * report.cs: Give line numbers and files if available.
10130
10131 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10132
10133         * driver.cs: Implement /addmodule.
10134
10135         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10136         ModuleBuilders.
10137
10138 2003-12-20  Martin Baulig  <martin@ximian.com>
10139
10140         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10141         (FieldBase.IsAssigned): Removed this field.
10142         (FieldBase.SetAssigned): New public method.
10143         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10144
10145 2003-12-20  Martin Baulig  <martin@ximian.com>
10146
10147         * expression.cs (LocalVariableReference.DoResolve): Don't set
10148         `vi.Used' if we're called from DoResolveLValue().
10149
10150         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10151         returns the usage vector it just merged into the current one -
10152         pass this one to UsageWarning().
10153         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10154         of the `EmitContext', don't call this recursively on our children.
10155
10156 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10157
10158         * driver.cs: Implement /target:module.
10159
10160 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10161
10162         * support.cs (CharArrayHashtable): New helper class.
10163
10164         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10165         char arrays, not strings, so we can avoid creating a string in
10166         consume_identifier if the identifier is a keyword.
10167
10168 2003-12-16  Martin Baulig  <martin@ximian.com>
10169
10170         * statement.cs (LocalInfo.Assigned): Removed this property.
10171         (LocalInfo.Flags): Removed `Assigned'.
10172         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10173         and uses flow analysis.
10174         (Block.UsageWarning): Made this method private.
10175         (Block.Resolve): Call UsageWarning() if appropriate.
10176
10177         * expression.cs (LocalVariableReference.DoResolve): Always set
10178         LocalInfo.Used here.
10179
10180 2003-12-13  Martin Baulig  <martin@ximian.com>
10181
10182         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10183         any value here; we're now using flow analysis to figure out
10184         whether a statement/block returns a value.
10185
10186 2003-12-13  Martin Baulig  <martin@ximian.com>
10187
10188         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10189         working again.
10190         (FlowBranching.MergeFinally): Don't call
10191         `branching.CheckOutParameters()' here, this is called in
10192         MergeTopBlock().
10193         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10194         when adding the `finally' vector.       
10195
10196 2003-12-13  Martin Baulig  <martin@ximian.com>
10197
10198         * flowanalysis.cs
10199         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10200         actually work and also fix #48962.
10201
10202 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10203
10204         * decl.cs: Do not check System.Object for nested types,
10205         since we know it does not have any. Big bang for buck:
10206
10207         BEFORE:
10208            Run 1:   8.35 seconds
10209            Run 2:   8.32 seconds
10210            corlib:  17.99 seconds
10211         AFTER:
10212            Run 1:   8.17 seconds
10213            Run 2:   8.17 seconds
10214            corlib:  17.39 seconds
10215
10216 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10217
10218         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10219         time we are returning 0 members, so we save alot here.
10220
10221 2003-12-11  Martin Baulig  <martin@ximian.com>
10222
10223         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10224         `MergeChild()', also just take the `FlowBranching' as argument;
10225         call Merge() on it and return the result.
10226         (FlowBranching.Merge): We don't need to do anything if we just
10227         have one sibling.
10228
10229 2003-12-11  Martin Baulig  <martin@ximian.com>
10230
10231         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10232         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10233         Maurer for this idea.
10234
10235 2003-12-11  Martin Baulig  <martin@ximian.com>
10236
10237         * flowanalysis.cs (MergeResult): This class is now gone; we now
10238         use the `UsageVector' for this.  The reason for this is that if a
10239         branching just has one sibling, we don't need to "merge" them at
10240         all - that's the next step to do.
10241         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10242         `MergeResult'.
10243
10244 2003-12-11  Martin Baulig  <martin@ximian.com>
10245
10246         Reworked flow analyis and made it more precise and bug-free.  The
10247         most important change is that we're now using a special `Reachability'
10248         class instead of having "magic" meanings of `FlowReturns'.  I'll
10249         do some more cleanups and optimizations and also add some more
10250         documentation this week.
10251
10252         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10253         largely reworked this class.
10254         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10255         the new `Reachability' class instead of having "magic" values here.
10256         (FlowBranching): We're now using an instance of `Reachability'
10257         instead of having separate `Returns', `Breaks' etc. fields.
10258
10259         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10260         based on flow analysis; ignore the return value of block.Emit ().
10261
10262 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10263
10264         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10265         if they are private.
10266
10267 2003-12-09  Martin Baulig  <martin@ximian.com>
10268
10269         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10270         call them directly on the UsageVector.
10271
10272 2003-12-09  Martin Baulig  <martin@ximian.com>
10273
10274         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10275         Changed return type from `FlowReturns' to `Reachability'.
10276
10277 2003-12-09  Martin Baulig  <martin@ximian.com>
10278
10279         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10280         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10281         `Reachable' fields with a single `Reachability' one.
10282
10283 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10284
10285         * class.cs (FindMembers): Remove foreach's.
10286
10287         Bootstrap times:
10288
10289         BEFORE
10290                 Run 1:   8.74 seconds
10291                 Run 2:   8.71 seconds
10292
10293         AFTER
10294                 Run 1:   8.64 seconds
10295                 Run 2:   8.58 seconds
10296
10297
10298 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10299
10300         * cs-parser.jay:
10301         * gen-treedump.cs:
10302         * statement.cs:
10303         This patch does a few things:
10304                 1. EmptyStatement is now a singleton, so it is never reallocated.
10305                 2. All blah is EmptyStatement constructs have been changed to
10306                    blah == EmptyStatement.Value, which is much faster and valid
10307                    now that EmptyStatement is a singleton.
10308                 3. When resolving a block, rather than allocating a new array for
10309                    the non-empty statements, empty statements are replaced with
10310                    EmptyStatement.Value
10311                 4. Some recursive functions have been made non-recursive.
10312         Mainly the performance impact is from (3), however (1) and (2) are needed for
10313         this to work. (4) does not make a big difference in normal situations, however
10314         it makes the profile look saner.
10315
10316         Bootstrap times:
10317
10318         BEFORE
10319         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10320         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10321         Total memory allocated: 56397 KB
10322
10323         AFTER
10324         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10325         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10326         Total memory allocated: 55666 KB
10327
10328 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10329
10330         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10331         than the hashtable in a hashtable version
10332
10333         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10334         we always end up concating a string. This results in a huge perf
10335         loss, because many strings have to be tracked by the GC. In this
10336         patch, we first use a hashtable that works with two keys, so that
10337         the strings do not need to be concat'ed.
10338
10339         Bootstrap times:
10340         BEFORE
10341                 Run 1:   8.74 seconds
10342                 Run 2:   8.71 seconds
10343
10344         AFTER
10345                 Run 1:   8.65 seconds
10346                 Run 2:   8.56 seconds
10347
10348 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10349
10350         * Makefile: Add a new target `do-time' that does a quick and simple
10351         profile, leaving easy to parse output.
10352
10353 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10354
10355         * codegen.cs (Init): Create the dynamic assembly with 
10356         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10357
10358 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10359
10360         * support.cs: Make the PtrHashtable use only one
10361         instance of its comparer.
10362
10363 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10364
10365         * typemanager.cs: Fix lookup of GetNamespaces.
10366
10367 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10368
10369         * expression.cs: Removed redundant line.
10370
10371         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10372         ArrayLists, use for loops with bounds.  
10373
10374         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10375         arraylist.
10376
10377         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10378         arraylists, use for loop with bounds.
10379
10380         The above three changes give us a 0.071 second performance
10381         improvement out of 3.294 seconds down to 3.223.  On my machine
10382         the above changes reduced the memory usage by 1,387 KB during
10383         compiler bootstrap.
10384
10385         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10386         QualifiedIdentifiers.  Before we created a new string through
10387         concatenation, and mostly later on, the result would be
10388         manipulated by DecomposeQI through string manipulation.
10389
10390         This reduced the compiler memory usage for bootstrapping from
10391         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10392         compile times in 0.05 seconds.
10393
10394 2003-11-28  Dick Porter  <dick@ximian.com>
10395
10396         * support.cs: Do string compares with the Invariant culture.
10397
10398         * rootcontext.cs: 
10399         * gen-treedump.cs: 
10400         * expression.cs: 
10401         * driver.cs: 
10402         * decl.cs: 
10403         * codegen.cs: 
10404         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10405         the comparison is done with the Invariant culture.
10406
10407 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10408
10409         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10410         GetEnumerator method.
10411
10412         (ProbeCollectionType): Iterate starting at the most specific type
10413         upwards looking for a GetEnumerator
10414
10415         * expression.cs: Shift count can be up to 31 for int/uint and 63
10416         for long/ulong.
10417
10418 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10419
10420         * statement.cs (Block.LookupLabel): Also look for the label on the
10421         children blocks.  Use a hash table to keep track of visited
10422         nodes. 
10423
10424         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10425         we actually did transform the other operand, otherwise fall back
10426         to the common codepath that casts to long.
10427
10428         * cs-tokenizer.cs: Use the same code pattern as the int case.
10429         Maybe I should do the parsing myself, and avoid depending on the
10430         Parse routines to get this done.
10431
10432 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10435         which fixes bug 51347.  This time test it.
10436
10437         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10438         attributes for example can not tell the difference between these.
10439         The difference was only a syntax feature of the language. 
10440
10441         * attribute.cs: Apply attributes to delegates.
10442
10443         * delegate.cs: Call the apply attributes method.
10444
10445 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10446
10447         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10448         comparing 0 vs Byte.MinValue, not the value
10449
10450         (ImplicitConversionRequired): When reporting a conversion error,
10451         use error 31 to print out the constant error instead of the
10452         simpler 29.
10453
10454         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10455         which fixes bug 51347.
10456
10457 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10458
10459         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10460         which fixes the -warnaserror command line option.
10461
10462 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10463
10464         * cfold.cs (DoNumericPromotions): During constant folding of
10465         additions on UIntConstant, special case intconstants with
10466         IntConstants like we do on the expression binary operator. 
10467
10468 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10469
10470         * convert.cs (ImplicitReferenceConversion): We were missing a case
10471         (System.Enum are not value types or class types, so we need to
10472         classify them separatedly).
10473
10474         * driver.cs: We do not support error 2007.
10475
10476 2003-11-12 Jackson Harper <jackson@ximian.com>
10477
10478         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10479         system directory. Also use the full file name so users can
10480         libraries names mscorlib-o-tron.dll in a non system dir.
10481         
10482 2004-01-04  David Sheldon <dave-mono@earth.li>
10483
10484         * expression.cs: Added matching ")" to error message for CS0077.
10485
10486 2003-12-19  Martin Baulig  <martin@ximian.com>
10487
10488         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10489         static method; see documentation in the method.
10490         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10491
10492         * convert.cs (Convert.ImplicitReferenceConversion,
10493         Convert.ImplicitReferenceConversionExists): Add support for
10494         generic type declarations; see gen-36.cs.
10495
10496 2003-12-19  Martin Baulig  <martin@ximian.com>
10497
10498         * pending.cs (Pending.InterfaceMethod): Use
10499         `Type.IsAssignableFrom()' instead of `=='.
10500
10501 2003-12-18  Martin Baulig  <martin@ximian.com>
10502
10503         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10504         byref types first.
10505
10506         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10507         `expr_type.Equals (target_type)' instead of `=='.
10508
10509 2003-12-08  Martin Baulig  <martin@ximian.com>
10510
10511         * generics.cs (Constraints.Types): Removed.
10512         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10513         to Type's.
10514         (Constraints.ResolveTypes): New public method; resolves the
10515         TypeExpr's to Type's.
10516         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10517         longer takes the constraints.
10518         (TypeParameter.DefineMethod): Likewise.
10519         (TypeParameter.DefineType): New public method.  Calls
10520         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10521         the constraints.
10522
10523 2003-12-08  Martin Baulig  <martin@ximian.com>
10524
10525         * convert.cs (Convert.ImplicitConversionStandard): Use
10526         `expr_type.Equals (target_type)' instead of `=='.
10527
10528 2003-12-08  Martin Baulig  <martin@ximian.com>
10529
10530         * typemanager.cs (TypeManager.GetReferenceType): Call
10531         `Type.MakeByRefType ()'.
10532
10533 2003-12-08  Martin Baulig  <martin@ximian.com>
10534
10535         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10536         just has some special meaning in some situations.  For instance,
10537         it is allowed to use `where' as the name of a variable etc.
10538
10539 2003-12-04  Martin Baulig  <martin@ximian.com>
10540
10541         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10542         `Type.MakeArrayType()' for array types.
10543
10544 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10547         debugging message.
10548
10549         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10550         corlib to compile.
10551
10552 2003-11-16  Martin Baulig  <martin@ximian.com>
10553
10554         * codegen.cs (EmitContext.IsGeneric): Removed.
10555
10556         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10557         ResolveGeneric() on the DeclSpace.
10558
10559 2003-11-16  Martin Baulig  <martin@ximian.com>
10560
10561         * generic.cs (TypeArguments.Resolve):
10562         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10563         `ResolveType()' on it to get the Type.
10564
10565 2003-11-15  Martin Baulig  <martin@ximian.com>
10566
10567         * generic.cs (ConstructedType.GetInterfaces): Override this.
10568
10569 2003-11-14  Martin Baulig  <martin@ximian.com>
10570
10571         * interface.cs (Interface.DefineType): Define all type parameters
10572         before adding the interfaces we inherit.
10573
10574 2003-11-11  Martin Baulig  <martin@ximian.com>
10575
10576         * generic.cs (ConstructedType.ResolveType): Always call
10577         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10578
10579 2003-11-10  Martin Baulig  <martin@ximian.com>
10580
10581         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10582         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10583         calling `ResolveType()' on them, directly assign their `Type'.
10584
10585 2003-11-08  Martin Baulig  <martin@ximian.com>
10586
10587         * generic.cs (ConstructedType): Override `IsClass' etc.
10588
10589 2003-11-08  Martin Baulig  <martin@ximian.com>
10590
10591         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10592         return value and the `out parent' parameter.
10593         (TypeContainer.DefineType): Moved the CS0644 check into
10594         GetClassBases().  Don't pass the interface types to the
10595         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10596         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10597
10598         * ecore.cs (TypeExpr.IsAttribute): New property.
10599         (TypeExpr.GetInterfaces): New method.
10600
10601         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10602         TypeExpr instead of a Type.
10603         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10604         (Interface.DefineType): Don't pass the interface types to the
10605         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10606         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10607
10608         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10609         instead of a `Type[]'.
10610         (TypeManager.RegisterBuilder): Likewise.
10611         (TypeManager.AddUserInterface): Likewise.
10612         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10613         `Type[]' and also return a `TypeExpr[]'.
10614         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10615
10616 2003-11-08  Martin Baulig  <martin@ximian.com>
10617
10618         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10619         Expression.     
10620
10621 2003-11-08  Martin Baulig  <martin@ximian.com>
10622
10623         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10624         TypeManager.ResolveExpressionTypes().
10625
10626         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10627         instead of an Expression.
10628         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10629         (TypeExpression): New public class; formerly known as `TypeExpr'.
10630
10631         * expression.cs (ComposedCast): Derive from TypeExpr.
10632
10633         * typemanager.cs (TypeManager.system_*_expr): These are now
10634         TypExpr's instead of Expression's.
10635         (TypeManager.ResolveExpressionTypes): New public static function;
10636         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10637         of them.        
10638
10639 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10640
10641         * expression.cs (New.DoResolve): Do not dereference value that
10642         might be a null return.
10643
10644         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10645         sure that the constant value has the right type.  Fixes an
10646         unreported bug, similar to 50425.
10647
10648         * const.cs (Const.LookupConstantValue): Call
10649         ImplicitStandardConversionExists before doing a conversion to
10650         avoid havng the TypeManager.ChangeType do conversions.
10651
10652         Reduced the number of casts used
10653
10654         (Const.ChangeType): New routine to enable reuse of the constant
10655         type changing code from statement.
10656
10657         * typemanager.cs (ChangeType): Move common initialization to
10658         static global variables.
10659
10660         Fixes #50425.
10661
10662         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10663         every value type to go through, even if it was void.  Fix that. 
10664
10665         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10666         character of the define, and the is_identifier_part_character for
10667         the rest of the string.
10668
10669 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10670
10671         * expression.cs (UnaryMutator.EmitCode): When I updated
10672         LocalVariableReference.DoResolve, I overdid it, and dropped an
10673         optimization done on local variable references.
10674
10675 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10676
10677         * ecore.cs: Convert the return from Ldlen into an int.
10678
10679 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10680
10681         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10682         the accessibility, this is a special case for toplevel non-public
10683         classes (internal for instance).
10684
10685 2003-10-20  Nick Drochak <ndrochak@gol.com>
10686
10687         * ecore.cs: Fix typo and build.  Needed another right paren.
10688
10689 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10690
10691         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10692         `internal' case regular and protected, but not allowing protected
10693         to be evaluated later.  Bug 49840
10694
10695 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10696
10697         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10698         to kb.Nlast, and not the kb.nFirst to isolate the switch
10699         statement.
10700
10701         Extract the underlying type, so enumerations of long/ulong are
10702         treated like long/ulong.
10703
10704 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10705
10706         * expression.cs (New): Overload the meaning of RequestedType to
10707         track the possible creation of the NewDelegate type, since
10708         DoResolve is invoked more than once for new constructors on field
10709         initialization.
10710
10711         See bugs: #48800 and #37014
10712
10713         * cs-parser.jay (declare_local_constants): Take an arraylist
10714         instead of a single constant.
10715
10716         (local_constant_declaration): It should take a
10717         constant_declarators, not a constant_declarator.  Fixes 49487
10718
10719         * convert.cs: Fix error report.
10720
10721 2003-10-13 Jackson Harper <jackson@ximian.com>
10722
10723         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10724         bug #49611
10725         
10726 2003-11-03  Martin Baulig  <martin@ximian.com>
10727
10728         * expression.cs (ArrayAccess.GetStoreOpcode): Added
10729         `out bool has_type_arg'; if set, we need to pass the type to
10730         ig.Emit().
10731         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10732         Stelem_Any/Ldelem_Any for generic parameters.   
10733
10734 2003-11-02  Martin Baulig  <martin@ximian.com>
10735
10736         * expression.cs (Invocation.EmitCall): Use
10737         `TypeManager.IsValueType()' to check whether it's a value type.
10738         Don't set `struct_call' when calling a method on a type parameter.
10739
10740 2003-11-02  Martin Baulig  <martin@ximian.com>
10741
10742         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10743         and removed the TypeBuilder argument.
10744
10745         * typemanager.cs (TypeManager.IsValueType): Return
10746         `t.IsGenericParameter || t.IsValueType'.
10747
10748 2003-10-25  Martin Baulig  <martin@ximian.com>
10749
10750         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10751         call ConstructedType.Resolve() on it.
10752
10753         * generic.cs (ConstructedType.Resolve): Set `type' on success.
10754
10755 2003-10-25  Martin Baulig  <martin@ximian.com>
10756
10757         * class.cs (TypeContainer.GetClassBases): Changed
10758         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
10759         CS8214 reporting here.
10760         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10761         instead of a `Type' for our parent.  In case of a recursive
10762         declaration (see tests/gen-23.cs for an example), our parent is a
10763         ConstructedType and it doesn't have its type set.  So, first
10764         create our own TypeBuilder, then call constructed.Resolve() to get
10765         the parent's type and finally TypeBuilder.SetParent() it.
10766
10767         * ecore.cs (TypeExpr.Name): New public virtual property.
10768
10769         * generic.cs
10770         (ConstructedType): We're now a TypeExpr and not just an Expression.
10771         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10772         arguments here; this is done later.
10773         (ConstructedType.Resolve): New public method to resolve the type
10774         arguments and bind them.
10775
10776 2003-10-21  Martin Baulig  <martin@ximian.com>
10777
10778         * convert.cs: Use `TypeManager.IsValueType' instead of
10779         'type.IsValueType' everywhere.
10780
10781         * typemanager.cs (TypeManager.IsValueType): Return true for type
10782         parameters.  The reason for this is that we need to box a type
10783         parameter when converting it to a reference type.
10784
10785         * cs-parser.jay: Added support for default value expressions.
10786
10787         * generics.cs (DefaultValueExpression): New public class.       
10788
10789 2003-10-17  Martin Baulig  <martin@ximian.com>
10790
10791         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10792         TypeContainer so we can also use this for Interfaces.
10793         (TypeParameter.Resolve): Likewise.
10794
10795         * interface.cs (Interface.DefineType): Added support for generic
10796         interfaces.
10797
10798         * cs-parser.jay: Added support for generic structs and interfaces.
10799
10800 2003-10-17  Martin Baulig  <martin@ximian.com>
10801
10802         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10803         call generic methods :-)
10804
10805 2003-10-16  Martin Baulig  <martin@ximian.com>
10806
10807         * cs-parser.jay (namespace_or_type_name): Only create a
10808         GenericMemberAccess if we actually have type arguments.
10809
10810 2003-10-13  Martin Baulig  <martin@ximian.com>
10811
10812         * class.cs (Method.Define): If we're a generic method, call
10813         TypeBuilder.DefineGenericMethod () before resolving
10814         the parameters.
10815         (MethodData): Added .ctor which takes an additional MethodBuilder
10816         argument; this is used for generic methods.
10817         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10818         we already have a MethodBuilder.
10819
10820 2003-10-10  Martin Baulig  <martin@ximian.com>
10821
10822         * class.cs (Method): Added .ctor which takes a `GenericMethod'
10823         instead of a `DeclSpace'.  This is used for generic methods.
10824
10825         * cs-parser.jay (method_header): Added support for generic
10826         methods; create a `GenericMethod' instance and pass it to the
10827         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10828         parameters and locals.
10829
10830         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10831         since we already have the location.  Check whether we're a generic
10832         type declaration or a generic method and create the correct type
10833         parameter.
10834
10835         * generic.cs (TypeParameter.DefineMethod): New public method.
10836         (GenericMethod): New public class; derives from DeclSpace and is
10837         used for generic methods.       
10838
10839 2003-10-09  Martin Baulig  <martin@ximian.com>
10840
10841         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10842         to the .ctor.
10843         (MethodCore.DoDefineParameters): Removed the TypeContainer
10844         argument; use the DeclSpace which was passed to the .ctor instead.
10845         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10846         TypeContainer; we only need a DeclSpace here.
10847
10848 2003-10-09  Martin Baulig  <martin@ximian.com>
10849
10850         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10851         to the .ctor.
10852         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10853         EmitContext's .ctor.    
10854
10855 2003-10-09  Martin Baulig  <martin@ximian.com>
10856
10857         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10858         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10859         AsAccessible(), moved them as well.
10860
10861         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10862
10863 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10864
10865         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10866         generation for >=, as spotted by Paolo, bug 48679.  
10867         Patch from David Waite.
10868
10869         * cs-tokenizer.cs: Add handling for #pragma.
10870
10871         * cs-parser.jay: Allow for both yield and yield return in the
10872         syntax.  The anti-cobolization of C# fight will go on!
10873
10874         * class.cs (TypeBuilder.DefineType): Catch error condition here
10875         (Parent.DefineType erroring out and returning null).
10876
10877         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10878         coping with enumerations variables, we were mistakenly processing
10879         them as a regular value type instead of built-in types.  Fixes the
10880         bug #48063
10881
10882         * typemanager.cs (IsBuiltinOrEnum): New method.
10883
10884 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10885
10886         * cs-parser.jay: Upgrade: yield now needs the return clause.
10887
10888 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10889
10890         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10891
10892 2003-09-29  Martin Baulig  <martin@ximian.com>
10893
10894         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10895         inflated generic methods.
10896
10897         * generics.cs (ConstructedType): Distinguish between open and
10898         closed constructed types; correctly resolve the arguments.
10899
10900 2003-09-22  Martin Baulig  <martin@ximian.com>
10901
10902         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10903         all type arguments meet their constraints.
10904
10905 2003-09-19  Martin Baulig  <martin@ximian.com>
10906
10907         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10908         `MemberCache parent' argument.  Normally, an interface doesn't
10909         have a parent type except System.Object, but we use this in gmcs
10910         for generic type parameters.
10911
10912 2003-09-18  Martin Baulig  <martin@ximian.com>
10913
10914         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10915         on `type.IsInterface'; don't check whether the type has a parent
10916         to determine whether it's an interface.
10917
10918 2003-09-17  Martin Baulig  <martin@ximian.com>
10919
10920         * generic.cs (ConstructedType.ToString): Always use `name' as the
10921         type name.
10922
10923 2003-09-15  Martin Baulig  <martin@ximian.com>
10924
10925         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10926
10927         * generic.cs (Constraints.Resolve): New public method; this is
10928         called to resolve the constraint types and to check whether all
10929         the constraints are correct.
10930         (Constraints.Types): New public property.
10931         (TypeParameter.Resolve): New public method; resolves all the
10932         type's constraints.
10933
10934         * class.cs (TypeContainer.DefineType): Call
10935         TypeParameter.Resolve() before actually defining the type.
10936
10937 2003-09-15  Martin Baulig  <martin@ximian.com>
10938
10939         * class.cs (TypeContainer.DefineType): Added an error flag to
10940         avoid reporting duplicate CS0146's ("class definition is
10941         circular.").
10942
10943         * driver.cs (Driver.MainDriver): Abort if
10944         RootContext.ResolveTree() reported any errors.
10945
10946 2003-09-07  Martin Baulig  <martin@ximian.com>
10947
10948         * report.cs (Error, Warning): Added overloaded versions which take
10949         a `params object[] args' and call String.Format().
10950
10951 2003-09-07  Martin Baulig  <martin@ximian.com>
10952
10953         * decl.cs (DeclSpace..ctor): Don't call
10954         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10955         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10956         (DeclSpace.RecordDecl): New method.
10957
10958         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10959
10960 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10961
10962         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10963         value attributes to be applied to ParameterBuilders.
10964
10965         * class.cs (MethodCore.LabelParameters): Make static and more
10966         generic so that it can be used from other places - like interface
10967         methods, for instance.
10968
10969         * interface.cs (Interface.Emit): Call LabelParameters before
10970         emitting attributes on the InterfaceMethod.
10971
10972 2003-09-07  Martin Baulig  <martin@ximian.com>
10973
10974         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10975         if the number of type parameters doesn't match.
10976
10977 2003-09-04  Martin Baulig  <martin@ximian.com>
10978
10979         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10980         for arrays of generic type params (ie. `!0[]').
10981
10982 2003-09-04  Martin Baulig  <martin@ximian.com>
10983
10984         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10985         for the moment.
10986
10987 2003-09-04  Martin Baulig  <martin@ximian.com>
10988
10989         * decl.cs (DeclSpace.LookupGeneric): New method.
10990         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10991         moment.
10992
10993         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10994         argument, not just a string.
10995         (TypeParameter.Define): New public method; this is called to
10996         actually define the generic parameter; after this, you can use the
10997         new `Type' property to get the type.
10998
10999 2003-09-04  Martin Baulig  <martin@ximian.com>
11000
11001         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11002         is now an ArrayList; initialize the result of the `TypeParameters'
11003         property here.
11004         (DeclSpace.GetGenericData): Removed.
11005         (DeclSpace.LookupGeneric): Temporarily removed; we need to
11006         implement this in a different way.
11007         (DeclSpace.GetTypeParameters): Removed; there's now a
11008         `TypeParameters' property.
11009         (DeclSpace.TypeParameters): New public property.
11010
11011         * generic.cs (Constraints): Make this class public.
11012         (TypeParameter): New public class.
11013
11014 2003-09-04  Martin Baulig  <martin@ximian.com>
11015
11016         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11017         generic parameters.
11018
11019         * class.cs (TypeContainer.DefineType): Call
11020         TypeBuilder.DefineGenericParameter () on all generic parameters if
11021         this is a generic type.
11022
11023 2003-08-28  Martin Baulig  <martin@ximian.com>
11024
11025         * sample-stack.il: Compile this with ilasm: "ilasm /dll
11026         sample-stack.il".
11027
11028         * sample-hello.cs: Compile this with gmcs: "gmcs
11029         /r:sample-stack.dll sample-hello.cs".
11030
11031 2003-08-28  Martin Baulig  <martin@ximian.com>
11032
11033         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11034         the parameters to the generic type.
11035
11036 2003-08-28  Martin Baulig  <martin@ximian.com>
11037
11038         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11039
11040 2003-08-28  Martin Baulig  <martin@ximian.com>
11041
11042         * cs-parser.jay (opt_type_argument_list): Use
11043         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11044         (primary_expression): Replace `qualified_identifier' with `type_name'.
11045         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11046
11047         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11048         parser to check whether it is syntactically a type parameter list;
11049         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11050         this case.
11051
11052 2003-08-26  Martin Baulig  <martin@ximian.com>
11053
11054         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11055         resolving aliases; fixes #47927.
11056
11057 2003-08-26  Martin Baulig  <martin@ximian.com>
11058
11059         * statement.cs (Using.DoResolve): This is internally emitting a
11060         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11061         do not always return.  Fixes #47681.
11062
11063 2003-08-26  Martin Baulig  <martin@ximian.com>
11064
11065         * decl.cs (MemberCore): Moved WarningNotHiding(),
11066         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11067         into MemberBase.
11068         (AdditionResult): Make this nested in DeclSpace.
11069         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11070         argument; call NamespaceEntry.Define() unless we're nested in a
11071         class or struct.
11072
11073         * namespace.cs (Namespace.DefineName): New public function.  This
11074         is called from DeclSpace's .ctor to add 
11075         (Namespace.Lookup): Include DeclSpaces in the lookup.
11076
11077         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11078
11079         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11080
11081 2003-08-25  Martin Baulig  <martin@ximian.com>
11082
11083         * convert.cs (Convert.ExplicitReferenceConversion): When
11084         converting from an interface type to a class, unbox if the target
11085         type is a struct type.  Fixes #47822.
11086
11087 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11088
11089         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11090         #47854.
11091
11092 2003-08-22  Martin Baulig  <martin@ximian.com>
11093
11094         * class.cs (TypeManager.DefineType): When defining a nested type,
11095         call DefineType() on our parent; fixes #47801.
11096
11097 2003-08-22  Martin Baulig  <martin@ximian.com>
11098
11099         * class.cs (MethodData.Define): While checking if a method is an
11100         interface implementation, improve the test a bit more to fix #47654.
11101
11102 2003-08-22  Martin Baulig  <martin@ximian.com>
11103
11104         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11105         correctly; fixes #47722.
11106
11107 2003-08-22  Martin Baulig  <martin@ximian.com>
11108
11109         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11110         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11111
11112         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11113
11114 2003-08-22  Martin Baulig  <martin@ximian.com>
11115
11116         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11117         can only be assigned in static constructors.  Fixes #47161.
11118
11119 2003-08-22  Martin Baulig  <martin@ximian.com>
11120
11121         Rewrote and improved the flow analysis code.
11122
11123         * flowbranching.cs (FlowBranching): Make this class abstract.
11124         (FlowBranching.CreateBranching): New static function to create a
11125         new flow branching.
11126         (FlowBranchingBlock, FlowBranchingException): New classes.
11127         (FlowBranching.UsageVector.Type): New public readonly field.
11128         (FlowBranching.UsageVector.Breaks): Removed the setter.
11129         (FlowBranching.UsageVector.Returns): Removed the setter.
11130         (FlowBranching.UsageVector): Added Break(), Return(),
11131         NeverReachable() and Throw() methods to modify the reachability.
11132         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11133         done by FlowBranching.Merge().
11134         (FlowBranching.UsageVector.MergeChild): New method; merges the
11135         merge result into the current vector.
11136         (FlowBranching.Merge): New abstract method to merge a branching.
11137
11138 2003-08-12  Martin Baulig  <martin@ximian.com>
11139
11140         * expression.cs (Indirection.CacheTemporaries): Create the
11141         LocalTemporary with the pointer type, not its element type.
11142
11143 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11144
11145         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11146         token was a keyword or not.
11147
11148         Add `error' options where an IDENTIFIER was expected;  Provide
11149         CheckToken and CheckIdentifierToken convenience error reporting
11150         functions. 
11151
11152         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11153
11154         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11155         NameSpaceEntry NameSpaceEntry.
11156
11157         (LookupInterfaceOrClass): Avoid creating a full qualified name
11158         from namespace and name: avoid doing lookups when we know the
11159         namespace is non-existant.   Use new Tree.LookupByNamespace which
11160         looks up DeclSpaces based on their namespace, name pair.
11161
11162         * driver.cs: Provide a new `parser verbose' to display the
11163         exception thrown during parsing.  This is turned off by default
11164         now, so the output of a failure from mcs is more graceful.
11165
11166         * namespace.cs: Track all the namespaces defined in a hashtable
11167         for quick lookup.
11168
11169         (IsNamespace): New method
11170
11171 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11172
11173         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11174         we know that we need to concatenate (full typename can never be
11175         null). 
11176
11177         * class.cs: ditto.
11178
11179         * statement.cs: Use a bitfield;  Do not initialize to null things
11180         which are done by the constructor by default.
11181
11182         * cs-parser.jay: bug fix, parameter was 4, not 3.
11183
11184         * expression.cs: Just use the property;
11185
11186         * statement.cs: No need for GetVariableInfo method.
11187
11188 2003-08-08  Martin Baulig  <martin@ximian.com>
11189
11190         * flowanalysis.cs (FlowReturns): This is now nested in the
11191         `FlowBranching' class.
11192         (MyBitVector): Moved this here from statement.cs.
11193         (FlowBranching.SiblingType): New enum type.
11194         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11195
11196 2003-08-07  Martin Baulig  <martin@ximian.com>
11197
11198         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11199         `FlowBranching' class and called `BranchingType'.
11200
11201 2003-08-07  Martin Baulig  <martin@ximian.com>
11202
11203         * flowanalysis.cs: Moved all the control flow analysis code into
11204         its own file.
11205
11206 2003-08-07  Martin Baulig  <martin@ximian.com>
11207
11208         * assign.cs (Assign.DoResolve): `target' must either be an
11209         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11210         #37319.
11211
11212 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * expression.cs (BinaryMethod): This kind of expression is created by the
11215         Binary class if it determines that the operator has to be handled
11216         by a method.
11217
11218         (BinaryDelegate): This kind of expression is created if we are
11219         dealing with a + or - operator on delegates.
11220
11221         (Binary): remove method, argumetns, and DelegateOperator: when
11222         dealing with methods, 
11223
11224         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11225
11226         * statement.cs (Block): use bitfields for the three extra booleans
11227         we had in use.   Remove unused topblock parameter.
11228
11229         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11230
11231         * assign.cs: Drop extra unneeded tests.
11232
11233 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11234
11235         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11236
11237         * statement.cs (Foreach): Use VariableStorage instead of
11238         LocalBuilders.   
11239
11240         * codegen.cs (VariableStorage): New class used by clients that
11241         require a variable stored: locals or fields for variables that
11242         need to live across yield.
11243
11244         Maybe provide a convenience api for EmitThis+EmitLoad?
11245
11246         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11247         these bad boys.
11248
11249 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11250
11251         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11252         RemapParameterLValue): New methods that are used to turn a
11253         precomputed FieldInfo into an expression like this:
11254
11255                 instance.FieldInfo
11256
11257         The idea is to use this instead of making LocalVariableReference
11258         have more than one meaning.
11259
11260         * cs-parser.jay: Add error production to BASE.
11261
11262         * ecore.cs: Deal with TypeManager.GetField returning null, which
11263         is now a valid return value.
11264
11265         (FieldExprNoAddress): New expression for Fields whose address can
11266         not be taken.
11267
11268         * expression.cs (LocalVariableReference): During the resolve
11269         phases, create new expressions if we are in a remapping context.
11270         Remove code that dealt with remapping here.
11271
11272         (ParameterReference): same.
11273
11274         (ProxyInstance): New expression, like the `This' expression, but
11275         it is born fully resolved.  We know what we are doing, so remove
11276         the errors that are targeted to user-provided uses of `this'.
11277
11278         * statement.cs (Foreach): our variable is now stored as an
11279         Expression;  During resolution, follow the protocol, dont just
11280         assume it will return this.
11281
11282 2003-08-06  Martin Baulig  <martin@ximian.com>
11283
11284         * support.cs (SeekableStreamReader.cs): New public class.
11285
11286         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11287         SeekableStreamReader instead of the normal StreamReader.
11288
11289 2003-08-04  Martin Baulig  <martin@ximian.com>
11290
11291         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11292         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11293         deambiguate casts and delegate invocations.
11294         (parenthesized_expression): Use the new tokens to ensure this is
11295         not a cast of method invocation.
11296
11297         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11298         when reading a `)' and Deambiguate_CloseParens () was previously
11299         called.
11300
11301         * expression.cs (ParenthesizedExpression): New class.  This is
11302         just used for the CS0075 test.
11303         (Binary.DoResolve): Check for CS0075.   
11304
11305 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11306
11307         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11308         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11309         reference comparison.
11310
11311         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11312         examine the ReturnType for equality - this is necessary in the
11313         cases of implicit and explicit operators whose signature also
11314         includes the return type.
11315
11316 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11317
11318         * namespace.cs: Cache the result of the namespace computation,
11319         instead of computing it every time.
11320
11321 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11322
11323         * decl.cs: Use a global arraylist that we reuse over invocations
11324         to avoid excesive memory consumption.  Reduces memory usage on an
11325         mcs compile by one meg (45 average).
11326
11327         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11328         private, work around that.
11329
11330 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * literal.cs (IntLiteral): Define Zero and One static literals. 
11333
11334         * cs-parser.jay (integer_literal): use static literals to reduce
11335         memory usage for the most used literals (0, 1 and -1).  211kb
11336         reduced in memory usage.
11337
11338         Replace all calls to `new ArrayList' with `new
11339         ArrayList(4)' which is a good average number for most allocations,
11340         and also requires only 16 bytes of memory for its buffer by
11341         default. 
11342
11343         This reduced MCS memory usage in seven megabytes for the RSS after
11344         bootstrapping.
11345
11346 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11347
11348         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11349         handle params methods the correct way by forming only one
11350         applicable set with params and normal methods in them. Earlier we
11351         were looking at params methods only if we found no normal methods
11352         which was not the correct thing to do.
11353
11354         (Invocation.BetterFunction): Take separate arguments indicating
11355         when candidate and the best method are params methods in their
11356         expanded form.
11357
11358         This fixes bugs #43367 and #46199.
11359
11360         * attribute.cs: Documentation updates.
11361
11362         (CheckAttribute): Rename to CheckAttributeTarget.
11363         (GetValidPlaces): Rename to GetValidTargets.
11364
11365         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11366         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11367
11368         Fixes bug #44468.
11369
11370 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11371
11372         * codegen.cs: Compute IsGeneric correctly.
11373
11374         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11375         resolution. 
11376
11377         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11378         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11379         regressions, and I was chasing more bugs than I required.
11380
11381         * interface.cs: Use expressions for base type names (like classes
11382         and structs have been doing for a while now), and resolve that.
11383         This patch should probably go into head as well.
11384
11385         This makes it one less user of FindType.
11386
11387 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11388
11389         This compiler can not self host currently.  Need to fix that.
11390         
11391         * Makefile: compile to `gmcs.exe'
11392
11393         * driver.cs: Turn on v2 by default on gmcs.
11394
11395         * generic.cs (ConstructedType): Does no longer take a container
11396         type argument;  That will be taken care of later.
11397
11398         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11399         Use SimpleName to resolve for now, so we can continue the work on
11400         the parser, until we get Type.GetType that understands generics.
11401
11402         (ConstructedType.ToString): Implement
11403
11404         (TypeArguments.Resolve): Resolve the child expressions as types. 
11405         
11406         * cs-parser.jay: Rename interface_constraints to
11407         type_parameter_constraints
11408
11409         (namespace_or_type_name): Only use constructed types for the basic
11410         construction, we will deal with identifier<...> later.
11411
11412         (type/type_name): No longer call DecomposeQI, as
11413         namespace_or_type_name is always decoded now.
11414         
11415 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11416
11417         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11418         closely: we eliminate methods in base types when we have an
11419         applicable method in a top-level type.
11420
11421         Please see section 14.5.5.1 for an exact description of what goes
11422         on. 
11423
11424         This fixes bug #45127 and a host of other related to corlib compilation.
11425
11426         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11427         array is the method corresponding to the top-level type (this is
11428         because of the changes made to icall.c) so we change this
11429         accordingly.
11430
11431         (MethodGroupExpr.Name): This too.
11432
11433         * typemanager.cs (GetElementType): New method which does the right
11434         thing when compiling corlib. 
11435
11436         * everywhere: Make use of the above in the relevant places.
11437
11438 2003-07-22  Martin Baulig  <martin@ximian.com>
11439
11440         * cs-parser.jay (invocation_expression): Moved
11441         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11442         `cast_expression', but create a InvocationOrCast which later
11443         resolves to either an Invocation or a Cast.
11444
11445         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11446         method; call this before EmitStatement() to make sure that this
11447         expression can be used as a statement.
11448
11449         * expression.cs (InvocationOrCast): New class; resolves to either
11450         an Invocation or a Cast.
11451
11452         * statement.cs (StatementExpression): Call ResolveStatement() on
11453         the ExpressionStatement before emitting it.
11454
11455 2003-07-21  Martin Baulig  <martin@ximian.com>
11456
11457         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11458         `ref' and `out' attributes match; fixes #46220.
11459         (MemberAccess.ResolveMemberAccess): You can't reference a type
11460         through an expression; fixes #33180.
11461         (Indexers.GetIndexersForType): Don't return the indexers from
11462         interfaces the class implements; fixes #46502.
11463
11464 2003-07-21  Martin Baulig  <martin@ximian.com>
11465
11466         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11467         CS0661 checks; fixes bug #30442.
11468
11469 2003-07-21  Martin Baulig  <martin@ximian.com>
11470
11471         * decl.cs (AdditionResult): Added `Error'.
11472
11473         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11474
11475         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11476         cs0031.cs actually work.
11477
11478  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11479  
11480         * cs-parser.jay (namespace_name): do not use
11481         namespace_or_type_name, use qualified_identifier, because
11482         namespace_or_type_name will soon return a composed expression
11483         instead of a string.
11484  
11485         (namespace_or_type_name): Instead of returning a string, now this
11486         production returns an expression.
11487  
11488         * codegen.cs (EmitContext): Setup IsGeneric property based on
11489         whether our DeclSpace is generic, our the method is generic.
11490  
11491         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11492         the method is generic.
11493  
11494         * cs-parser.jay (type_arguments, opt_type_argument_list,
11495         type_parameters, type_parameter_list, opt_type_parameter_list,
11496         type_parameter,, opt_type_parameter_constraints_clauses,
11497         type_parameter_constraints_clauses,
11498         type_parameter_constraint_clause, type_parameter_constraint,
11499         interface_constraints): Add new production
11500  
11501         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11502         DeclSpace is generic or not.
11503  
11504         (DeclSpace.SetParameterInfo): New routine, used to set the
11505         parameter info for a type.
11506  
11507         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11508         returns a GenericTypeExpr
11509  
11510         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11511         generic, lookup the generic argument.
11512  
11513         * attribute.cs: Do not allow TypeParameterExpressions in
11514         Attributes.
11515  
11516         * class.cs: Do not allow the Main method to be defined in a
11517         Generic container.
11518  
11519         * expression.cs (SizeOf): Do not allow generic types to be used as
11520         arguments to sizeof.
11521  
11522         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11523         it: whether a type is generic or not.  Only works for types we are
11524         currently building for now.
11525         
11526 2003-07-20  Martin Baulig  <martin@ximian.com>
11527
11528         * namespace.cs: Fixed that bug which caused a crash when compiling
11529         the debugger's GUI.
11530
11531 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11532
11533         * typemanager.cs (LookupTypeReflection): Never expose types which
11534         are NotPublic, NestedPrivate, NestedAssembly, or
11535         NestedFamANDAssem.  We used to return these, and later do a check
11536         that would report a meaningful error, but the problem is that we
11537         would not get the real match, if there was a name override.
11538
11539 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11540
11541         * namespace.cs (Namespace, Name): Do not compute the namespace
11542         name dynamically, compute it in the constructor.  This reduced
11543         memory usage by 1697 KB.
11544
11545         * driver.cs: Use --pause to pause at the end.
11546
11547 2003-07-17  Peter Williams  <peter@newton.cx>
11548
11549         * Makefile: Change the name of the test target so that it doesn't
11550         conflict with the recursive test target.
11551
11552 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11553
11554         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11555         AddressOf): Do not use EmitThis, that was wrong, use the actual
11556         this pointer.
11557
11558 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11559
11560         * class.cs (MethodData.Define): While checking if a method is an
11561         interface implementation, improve the test: If we are not public
11562         (use new test here: use the computed MethodAttributes directly,
11563         instead of the parsed modifier flags) check if the `implementing'
11564         method comes from an interface or not.
11565
11566         * pending.cs (VerifyPendingMethods): Slightly better error
11567         message.
11568
11569         * makefile: add test target that does the mcs bootstrap.
11570
11571 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11572
11573         * interface.cs (Define): Do nothing here since there are no
11574         members to populate etc. Move the attribute emission out of here
11575         since this was just totally the wrong place to put it. Attribute
11576         application happens during the 'Emit' phase, not in the 'Define'
11577         phase.
11578
11579         (Emit): Add this method and move the attribute emission here
11580
11581         * rootcontext.cs (EmitCode): Call the Emit method on interface
11582         types too.
11583
11584 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11585
11586         * expression.cs (OverloadResolve): Report error only if Location
11587         is not 'Null' which means that there was a probe going on.
11588
11589 2003-07-14  Martin Baulig  <martin@ximian.com>
11590
11591         * expression.cs (ConditionalLogicalOperator): New public class to
11592         implement user defined conditional logical operators.
11593         This is section 14.11.2 in the spec and bug #40505.
11594
11595 2003-07-14  Martin Baulig  <martin@ximian.com>
11596
11597         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11598
11599 2003-07-14  Martin Baulig  <martin@ximian.com>
11600
11601         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11602
11603         * ecore.cs (IVariable.VerifyFixed): New interface method.
11604
11605         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11606         operator, check whether the variable is actually fixed.  Fixes bug
11607         #36055.  Set a variable definitely assigned when taking its
11608         address as required by the spec.
11609
11610         * statement.cs (LocalInfo.IsFixed): New field.
11611         (LocalInfo.MakePinned): Set `IsFixed' to true.
11612
11613 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11614
11615         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11616         for .ctors, ensure that we only ask for members declared in the
11617         attribute type (BindingFlags.DeclaredOnly).
11618
11619         Fixes bug #43632.
11620
11621         * expression.cs (Error_WrongNumArguments): Report error 1501
11622         correctly the way CSC does.
11623
11624 2003-07-13  Martin Baulig  <martin@ximian.com>
11625
11626         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11627         lookup on the fully qualified name, to make things like "X.X" work
11628         where "X.X" is a fully qualified type name, but we also have a
11629         namespace "X" in the using list.  Fixes #41975.
11630
11631 2003-07-13  Martin Baulig  <martin@ximian.com>
11632
11633         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11634         function. If we're a CompoundAssign, we need to create an embedded
11635         CompoundAssign, not an embedded Assign.
11636         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11637         Fixes #45854.
11638
11639 2003-07-13  Martin Baulig  <martin@ximian.com>
11640
11641         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11642         work to fix bug #46088.
11643
11644 2003-07-13  Ravi Pratap <ravi@ximian.com>
11645
11646         * class.cs (Operator.Emit): Do not emit attributes here - it is
11647         taken care of by the Method class that we delegate too. This takes
11648         care of bug #45876.
11649
11650 2003-07-10  Martin Baulig  <martin@ximian.com>
11651
11652         * expression.cs (TypeOfVoid): New class.
11653         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11654
11655 2003-07-10  Martin Baulig  <martin@ximian.com>
11656
11657         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11658         bug #35957.
11659
11660 2003-07-10  Martin Baulig  <martin@ximian.com>
11661
11662         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11663         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11664
11665         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11666
11667         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11668
11669 2003-07-10  Martin Baulig  <martin@ximian.com>
11670
11671         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11672         of decimal.  Fixes #42850.
11673
11674         NOTE: I also fixed the created byte blob, but this doesn't work on
11675         the MS runtime and csc never produces any byte blobs for decimal
11676         arrays.
11677
11678 2003-07-10  Martin Baulig  <martin@ximian.com>
11679
11680         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11681         structs; fixes #32068.
11682         (Block.AddChildVariableNames): Fixed #44302.
11683
11684 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11685
11686         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11687
11688 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11689
11690         * attribute.cs: And this test is onger needed.
11691
11692 2003-07-08  Martin Baulig  <martin@ximian.com>
11693
11694         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11695         inaccessible types.  Fixes #36313.
11696
11697         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11698
11699         * namespace.cs (NamespaceEntry): Create implicit entries for all
11700         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11701         implicit entries for N1.N2 and N1.
11702
11703 2003-07-08  Martin Baulig  <martin@ximian.com>
11704
11705         Rewrote the handling of namespaces to fix a lot of the issues
11706         wrt. `using' aliases etc.
11707
11708         * namespace.cs (Namespace): Splitted this class into a
11709         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11710
11711         * typemanager.cs (TypeManager.IsNamespace): Removed.
11712         (TypeManager.ComputeNamespaces): Only compute namespaces from
11713         loaded assemblies here, not the namespaces from the assembly we're
11714         currently compiling.
11715
11716 2003-07-08  Martin Baulig  <martin@ximian.com>
11717
11718         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11719
11720 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11721
11722         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11723         already fixed it.  
11724
11725         I thought about the memory savings here, but LookupTypeReflection
11726         is used under already very constrained scenarios.  Compiling
11727         corlib or mcs only exposes one hit, so it would not really reduce
11728         any memory consumption.
11729
11730 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11731
11732         * typemanager.cs: fixes bug #45889 by only adding public types from
11733         other assemblies to the list of known types.
11734
11735 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11736
11737         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11738         on the type we resolved.
11739
11740 2003-07-05  Martin Baulig  <martin@ximian.com>
11741
11742         * pending.cs (PendingImplementation.ParentImplements): Don't
11743         create the proxy if the parent is abstract.
11744
11745         * class.cs (TypeContainer.DefineIndexers): Process explicit
11746         interface implementations first.  Fixes #37714.
11747
11748 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11751         defined recursively;  but since we modify the input parameters
11752         (left is set to `this' temporarily), we reset this value if the
11753         left_is_explicit is false, which gives the original semantics to
11754         the code.  
11755
11756         * literal.cs (NullPointer): new class used to represent a null
11757         literal in a pointer context.
11758
11759         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11760         type is a pointer, use a NullPointer object instead of a
11761         NullLiteral.   Closes 43687
11762
11763         (ExplicitConversion): Convert pointer values using
11764         the conv opcode to the proper type.
11765
11766         * ecore.cs (New): change ValueTypeVariable property into a method,
11767         that returns whether the valuetype is suitable for being used.
11768
11769         * expression.cs (Binary.DoNumericPromotions): Only return if we
11770         the int constant was a valid uint, and we can return both left and
11771         right as uints.  If not, we continue processing, to trigger the
11772         type conversion.  This fixes 39018.
11773
11774         * statement.cs (Block.EmitMeta): During constant resolution, set
11775         the CurrentBlock property on the emitcontext, so that we resolve
11776         constants propertly.
11777
11778 2003-07-02  Martin Baulig  <martin@ximian.com>
11779
11780         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11781         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11782
11783         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11784         than emitting it here.
11785
11786         * statement.cs: Fixed some more flow analysis bugs.
11787
11788 2003-07-02  Martin Baulig  <martin@ximian.com>
11789
11790         * class.cs (MethodData.Define): When implementing interface
11791         methods, set Final unless we're Virtual.
11792
11793         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11794         check work for interface methods.
11795
11796 2003-07-01  Martin Baulig  <martin@ximian.com>
11797
11798         * ecore.cs (EmitContext.This): Replaced this property with a
11799         GetThis() method which takes a Location argument.  This ensures
11800         that we get the correct error location for a CS0188.
11801
11802 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11803
11804         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11805         ImplicitStandardConversion.
11806
11807         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11808
11809 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11810
11811         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11812         optimization.
11813
11814 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11815
11816         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11817         constructors.
11818
11819         (MethodData.Define): Turn off initlocals for unsafe methods.
11820
11821 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11824         complete;  Fixes #37521.
11825
11826         * delegate.cs: Use Modifiers.TypeAttr to compute the
11827         TypeAttributes, instead of rolling our own.  This makes the flags
11828         correct for the delegates.
11829
11830 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11831
11832         * class.cs (Constructor.Define): Set the private flag for static
11833         constructors as well.
11834
11835         * cs-parser.jay (statement_expression): Set the return value to
11836         null, to avoid a crash when we catch an error.
11837
11838 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11839
11840         * cs-parser.jay: Applied patch from Jackson that adds support for
11841         extern and unsafe modifiers to destructor declarations.
11842
11843         * expression.cs: Report error 21 if the user is trying to index a
11844         System.Array.
11845
11846         * driver.cs: Add an error message, suggested by the bug report.
11847
11848         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11849         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11850
11851 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11852
11853         * namespace.cs: Add some information to reduce FAQs.
11854
11855 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11858         underlying enumeration types.  Fixes #43915.
11859
11860         * expression.cs: Treat ushort/short as legal values to be used in
11861         bitwise operations.
11862
11863 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11864
11865         * delegate.cs: transfer custom attributes for paramenters from
11866         the delegate declaration to Invoke and BeginInvoke.
11867
11868 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11869
11870         * attribute.cs: handle custom marshalers and emit marshal info
11871         for fields, too.
11872
11873 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11874
11875         * makefile.gnu: Added anonymous.cs to the compiler sources.
11876
11877 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * iterators.cs: Change the name of the proxy class to include two
11880         underscores.
11881
11882         * cs-parser.jay: Update grammar to include anonymous methods.
11883
11884         * anonymous.cs: new file.
11885
11886 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11887
11888         * class.cs (Field.Define): Add missing test for pointers and
11889         safety. 
11890
11891 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11892
11893         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11894         we use the stobj opcode.
11895
11896         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11897         since it wasn't the correct fix. 
11898
11899         It still is puzzling that we are required to use stobj for IntPtr
11900         which seems to be a ValueType.
11901
11902 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11903
11904         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11905         during regular simple name resolution.   Now, the trick is that
11906         instead of returning for processing the simplename, we do a
11907         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11908         contextual lookup type).   If a match is found, return that, if
11909         not, return for further composition.
11910
11911         This fixes long-standing 30485.
11912
11913         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11914         using the address to initialize an object, do an Stobj instead of
11915         using the regular Stelem.
11916
11917         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11918         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11919         Because if we are a BaseIndexerAccess that value will be true.
11920         Fixes 43643.
11921
11922         * statement.cs (GotoCase.Resolve): Return after reporting an
11923         error, do not attempt to continue. 
11924
11925         * expression.cs (PointerArithmetic.Emit): If our operand is a
11926         long, convert our constants to match the operand before
11927         multiplying.  Convert to I type before adding.   Fixes 43670.
11928
11929 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11930
11931         * enum.cs (ImplicitConversionExists) : Rename to
11932         ImplicitEnumConversionExists to remove ambiguity. 
11933
11934         * ecore.cs (NullCast): New type of cast expression class which
11935         basically is very similar to EmptyCast with the difference being
11936         it still is a constant since it is used only to cast a null to
11937         something else
11938         (eg. (string) null)
11939
11940         * convert.cs (ImplicitReferenceConversion): When casting a null
11941         literal, we return a NullCast.
11942
11943         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11944         should be around anymore.
11945
11946         The renaming (reported was slightly wrong). Corrections:
11947
11948         ConvertImplicitStandard -> ImplicitConversionStandard
11949         ConvertExplicitStandard -> ExplicitConversionStandard
11950
11951         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11952         before passing them in !
11953
11954         * convert.cs (ImplicitConversionStandard): When comparing for
11955         equal expr and target types, ensure that expr is not a
11956         NullLiteral.
11957
11958         In general, we must not be checking (expr_type ==
11959         target_type) in the top level conversion methods
11960         (ImplicitConversion, ExplicitConversion etc). This checking is
11961         done in the methods that they delegate to.
11962
11963 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11964
11965         * convert.cs: Move Error_CannotConvertType,
11966         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11967         ImplicitNumericConversion, ImplicitConversionExists,
11968         ImplicitUserConversionExists, StandardConversionExists,
11969         FindMostEncompassedType, FindMostSpecificSource,
11970         FindMostSpecificTarget, ImplicitUserConversion,
11971         ExplicitUserConversion, GetConversionOperators,
11972         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11973         TryImplicitIntConversion, Error_CannotConvertImplicit,
11974         ConvertImplicitRequired, ConvertNumericExplicit,
11975         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11976         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11977         its own file.
11978
11979         Perform the following renames:
11980
11981         StandardConversionExists -> ImplicitStandardConversionExists
11982         ConvertImplicit -> ImplicitConversion
11983         ConvertImplicitStandard -> ImplicitStandardConversion
11984         TryImplicitIntConversion -> ImplicitIntConversion
11985         ConvertImplicitRequired -> ImplicitConversionRequired
11986         ConvertNumericExplicit -> ExplicitNumericConversion
11987         ConvertReferenceExplicit -> ExplicitReferenceConversion
11988         ConvertExplicit -> ExplicitConversion
11989         ConvertExplicitStandard -> ExplicitStandardConversion
11990
11991 2003-05-19  Martin Baulig  <martin@ximian.com>
11992
11993         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11994         (TypeInfo): Added support for structs having structs as fields.
11995
11996         * ecore.cs (FieldExpr): Implement IVariable.
11997         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11998         VariableInfo for the field.
11999
12000 2003-05-18  Martin Baulig  <martin@ximian.com>
12001
12002         * expression.cs (This.DoResolve): Report a CS0027 if we're
12003         emitting a field initializer.
12004
12005 2003-05-18  Martin Baulig  <martin@ximian.com>
12006
12007         * expression.cs (This.ResolveBase): New public function.
12008         (This.DoResolve): Check for CS0188.
12009
12010         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12011         This.Resolve().
12012
12013         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12014         `instance_expression' to null if we don't have any non-static
12015         methods.
12016
12017 2003-05-18  Martin Baulig  <martin@ximian.com>
12018
12019         Reworked the way how local variables and parameters are handled by
12020         the flow analysis code.
12021
12022         * statement.cs (TypeInfo, VariableMap): New public classes.
12023         (VariableInfo): New public class.  This is now responsible for
12024         checking whether a variable has been assigned.  It is used for
12025         parameters and local variables.
12026         (Block.EmitMeta): Take the InternalParameters as argument; compute
12027         the layout of the flow vectors here.
12028         (Block.LocalMap, Block.ParameterMap): New public properties.
12029         (FlowBranching): The .ctor doesn't get the InternalParameters
12030         anymore since Block.EmitMeta() now computes the layout of the flow
12031         vector.
12032         (MyStructInfo): This class is now known as `StructInfo' and nested
12033         in `TypeInfo'; we don't access this directly anymore.
12034
12035         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12036         property and removed IsAssigned(), IsFieldAssigned(),
12037         SetAssigned() and SetFieldAssigned(); we now call them on the
12038         VariableInfo so we don't need to duplicate this code everywhere.
12039
12040         * expression.cs (ParameterReference): Added `Block block' argument
12041         to the .ctor.
12042         (LocalVariableReference, ParameterReference, This): The new
12043         VariableInfo class is now responsible for all the definite
12044         assignment stuff.
12045
12046         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12047         IsParameterAssigned, SetParameterAssigned): Removed.
12048
12049 2003-05-18  Martin Baulig  <martin@ximian.com>
12050
12051         * typemanager.cs (InitCoreTypes): Try calling
12052         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12053         the 3-args-version.  Corlib now also needs our `void_type'.
12054         (GetMethod): Added overloaded version which takes an optional
12055         `bool report_errors' to allow lookups of optional methods.
12056
12057 2003-05-12  Martin Baulig  <martin@ximian.com>
12058
12059         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12060         only used for locals and not for parameters.
12061
12062 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12063
12064         * support.cs (InternalParameters.ParameterType): Return the
12065         ExternalType of the parameter.
12066
12067         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12068         they were unused.
12069
12070 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12071
12072         * class.cs (MethodData.Define): Do not set the `newslot' on
12073         interface members, if they are also flagged as "override".
12074
12075         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12076         better code for ++i and i++.  This only works for static fields
12077         and local variables.
12078
12079         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12080         want to pull the DeclSpace out of the builder_to_declspace instead
12081         of the TypeBuilder (like in TypeContainer.FindMembers).
12082
12083         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12084         instead of LookupTypeContainer.  Fixes the crash on .NET for
12085         looking up interface members.
12086
12087         * const.cs: Create our own emit context during the Definition
12088         stage, so that constants are evaluated in the proper context, when
12089         a recursive definition happens.
12090
12091 2003-05-11  Martin Baulig  <martin@ximian.com>
12092
12093         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12094         new block for a switch section.
12095         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12096         the adding/lookup in the switch block.  Fixes #39828.
12097
12098 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12101         functionality: I needed to convert the data after I had performed
12102         the add/sub operation into the operands type size.
12103
12104         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12105         pass the type for the box operation, otherwise the resulting
12106         object would have been of type object.
12107
12108         (BoxedCast): Add constructor to specify the type to box as.
12109
12110 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * iterators.cs: I was reusing the `count' variable inadvertently,
12113         take steps to not allow this to happen.
12114
12115 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12118         by creating an array at the point where the params starts and
12119         putting all those arguments there, then adjusting the size of the
12120         array.
12121
12122 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12123
12124         * expression.cs (New.AddressOf): Implement interface
12125         IMemoryLocation.  This is used when the `new' operator is used in
12126         the context of an invocation to a method on a value type.
12127
12128         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12129         example. 
12130
12131         * namespace.cs: Also check the using aliases here.
12132
12133         * driver.cs: Move the test for using validity after the types have
12134         been entered, so we do a single pass that also includes the using
12135         aliases. 
12136
12137         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12138         in the regular case.   CreateSiblingForFinally is doing extra
12139         error checking.
12140
12141         * attribute.cs (GetAttributeArgumentExpression): Store the result
12142         on an out value, and use the return value to indicate failure
12143         instead of using null (which is a valid return for Constant.GetValue).
12144
12145         * statement.cs: Perform the analysis flow for the increment
12146         portion after the statement, because this will be the real flow of
12147         execution.  Fixes #42385
12148
12149         * codegen.cs (EmitContext.EmitArgument,
12150         EmitContext.EmitStoreArgument): New helper functions when the
12151         RemapToProxy flag is set.
12152
12153         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12154         function.
12155
12156         Add support for remapping parameters. 
12157
12158         * iterators.cs: Propagate parameter values;  Store parameter
12159         values in the proxy classes.
12160
12161 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12164         need a proxy reference;  I do not know what I was thinking
12165
12166         * cs-parser.jay (constructor_initializer): catch another error,
12167         and display nice message.
12168
12169         (field_declaration): catch void field declaration
12170         to flag a better error. 
12171
12172         * class.cs (MemberBase.CheckBase): Report an error instead of a
12173         warning if a new protected member is declared in a struct. 
12174         (Field.Define): catch the error of readonly/volatile.
12175
12176         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12177
12178         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12179         volatile variable is taken
12180
12181 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * statement.cs (Fixed.Resolve): Report an error if we are not in
12184         an unsafe context.
12185
12186 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * typemanager.cs: reuse the code that handles type clashes for
12189         delegates and enumerations.
12190
12191         * class.cs (Report28): Always report.
12192
12193         * expression.cs (EncodeAsAttribute): Allow nulls here.
12194
12195 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12196
12197         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12198         the functionality for testing whether an expression is valid for
12199         an attribute here.  Also handle the case of arrays of elements
12200         being stored. 
12201
12202         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12203         encoding a linear array into an array of objects that are suitable
12204         to be passed to an CustomAttributeBuilder.
12205
12206         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12207
12208         * ecore.cs: (FieldExpr): Handle field remapping here.
12209
12210         * iteratators.cs: Pass the instance variable (if the method is an
12211         instance method) to the constructors, so we can access the field
12212         variables on the class.
12213
12214         TODO: Test this with structs.  I think the THIS variable on
12215         structs might have to be a pointer, and not a refenrece
12216
12217 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12218
12219         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12220         local variables to fields in a proxy class.
12221
12222         * iterators.cs (PopulateProxy): Rename our internal fields to
12223         <XXX>.  
12224         Create a <THIS> field if we are an instance method, so we can
12225         reference our parent container variables.
12226         (MapVariable): Called back from the EmitContext code to enter a
12227         new variable to field mapping into the proxy class (we just create
12228         a FieldBuilder).
12229
12230         * expression.cs
12231         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12232         for using the remapped locals to fields.
12233
12234         I placed the code here, because that gives the same semantics to
12235         local variables, and only changes the Emit code.
12236
12237         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12238         statements inside iterators.
12239         (VariableInfo): Add a FieldBuilder for the cases when we are
12240         remapping local variables to fields in a proxy class
12241
12242         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12243         current_block != null.
12244
12245         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12246         not cope with strings, as it has been moved to the
12247         TableSwitchEmit.  Fixed bug in switch generation.
12248
12249         * expression.cs (New.DoResolve): Provide more context for the user
12250         when reporting an error.
12251
12252         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12253         pointers. 
12254
12255         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12256         check the permissions for it.  Note than in a type-resolution
12257         context the check was already present in DeclSpace.ResolveType,
12258         but was missing from the MemberAccess.
12259
12260         (ArrayCreation.CheckIndices): warn if the user has
12261         more nested levels of expressions, but there are no more
12262         dimensions specified.  Avoids crash on bug 41906.
12263
12264 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12265
12266         * statement.cs (Block): replace Implicit bool, for a generic
12267         flags.   
12268         New flag: `Unchecked'.  This is used during the EmitMeta phase
12269         (which is out-of-line with the regular Resolve/Emit process for a
12270         statement, as this is done ahead of time, but still gets a chance
12271         to call constant resolve).
12272
12273         (Block.Flags): new enum for adding a new flag.
12274
12275         (Block.EmitMeta): track the state of unchecked.
12276
12277         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12278         to enable constant resolution to work there as well.
12279
12280 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * typemanager.cs (ienumerable_type): Also look up
12283         System.Collections.IEnumerable. 
12284
12285 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12286
12287         TODO: Test more than one conditional per method.
12288
12289         * class.cs (Indexer.Define): Report the location where the user is
12290         referencing the unsupported feature.
12291
12292         (MethodData): Overload the use of `conditionals' to
12293         minimize the creation of needless ArrayLists.   This saves roughly
12294         212kb on my machine.
12295
12296         (Method): Implement the new IIteratorContainer interface.
12297         (Method.SetYields): Implement the method by setting the ModFlags
12298         to contain METHOD_YIELDS.
12299
12300         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12301         which just got set to null.
12302
12303         * iterators.cs: New file.
12304
12305         (Yield, YieldBreak): New statements.
12306
12307         * statement.cs (Return.Resolve): Flag an error if we are used in
12308         an iterator method.
12309
12310         * codegen.cs (InIterator): New flag set if the code is being
12311         compiled in an iterator method.
12312
12313         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12314         internal modifier, and we just use it to avoid adding extra
12315         fields, as this is seldom used.  
12316
12317         * cs-parser.jay: Add yield_statement (yield and yield break).
12318
12319         * driver.cs: New flag -v2 to turn on version 2 features. 
12320
12321         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12322         hashtable when v2 is enabled.
12323
12324 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12327         there is already a namespace defined with this name.
12328
12329         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12330         people upgraded their corlibs.
12331
12332         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12333         always use fully qualified types, no need to use the compiler
12334         front end.
12335
12336         (TypeManager.IsNamespace): Use binarysearch.
12337
12338         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12339         AddDelegate): I did not quite use the new IsValid API properly: I
12340         have to pass the short-name and the fullname.  I was passing only
12341         the basename instead of the fullname sometimes. 
12342
12343         (TypeContainer.DefineType): call NamespaceClash.
12344
12345         * interface.cs (Interface.DefineType): use NamespaceClash before
12346         defining the type.
12347
12348         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12349         defining the type.
12350
12351         * enum.cs: (Enum.DefineType): use NamespaceClash before
12352         defining the type.
12353
12354         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12355         speed increase.  First, use the negative_hits cache when we get a
12356         negative.  Second, add the type with its full original name
12357         instead of the new . and + encoded name (reflection uses + to
12358         separate type from a nested type).  Use LookupTypeReflection
12359         directly which bypasses the type->name hashtable (that we already
12360         know does not contain the type.
12361
12362         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12363         location/container type. 
12364
12365         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12366
12367 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12368
12369         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12370
12371         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12372         method is being referenced in the method group from a static
12373         context, and report error 120 if so.
12374
12375         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12376         Error118. 
12377
12378         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12379         is created, we create the A namespace).
12380
12381         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12382         Fixes #41591
12383
12384 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12385
12386         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12387         invocation to ModuleBuilder.GetType with the same values will
12388         return a new type instance, so we need to cache its return
12389         values. 
12390
12391         * expression.cs (Binary.ResolveOperator): Only allow the compare
12392         operators on enums if they are of the same type.
12393
12394         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12395         types of ValueType on their own case.  Before we were giving them
12396         the same treatment as objects.
12397
12398         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12399         fullname.  Short name is used to compare against container name.
12400         Fullname is used to check against defined namespace names.
12401
12402         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12403         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12404
12405         (Method.CheckBase): Call parent.
12406         (MemberBase.CheckBase): Check for protected members on sealed
12407         classes.
12408         (PropertyBase.CheckBase): Call parent.
12409         (Field.Define): Call parent.
12410
12411         * report.cs: Negative error codes are now mapped to 8000 - code,
12412         so that the display is render more nicely.
12413
12414         * typemanager.cs: Do not use try/catch, instead report a regular
12415         error. 
12416
12417         (GetPointerType, GetReferenceType): These methods provide
12418         mechanisms to obtain the T* and T& from a T.  We had the code
12419         previously scattered around the code base, and it also used
12420         TypeManager.LookupType that would go through plenty of caches.
12421         This one goes directly to the type source.
12422
12423         In some places we did the Type.GetType followed by
12424         ModuleBuilder.GetType, but not in others, so this unifies the
12425         processing as well.
12426
12427         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12428         statements now that we have namespace information.
12429
12430         * typemanager.cs (IsNamespace): New method, returns whether the
12431         string presented is a namespace or not.
12432
12433         (ComputeNamespaces): New public entry point, computes the list of
12434         available namespaces, using the GetNamespaces API call in Mono, or
12435         the slower version in MS.NET.   
12436
12437         Now before we start the semantic analysis phase, we have a
12438         complete list of namespaces including everything that the user has
12439         provided.
12440
12441         Deleted old code to cache namespaces in .nsc files.
12442
12443 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12444
12445         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12446         class/struct location definition Location for the implicit
12447         constructor location.
12448
12449         (Operator.Define): Use the location of the operator for the
12450         implicit Method definition.
12451
12452         (Constructor.Emit): use the constructor location for the implicit
12453         base initializer constructor.
12454
12455         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12456         and the Expression class now contains two new methods:
12457
12458         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12459         isolate type lookup from the rest of the resolution process.
12460
12461         Since we use Expressions to hold type definitions due to the way
12462         we parse the input we have historically overloaded Resolve to
12463         perform the Type lookups if a special flag is passed.  Now this is
12464         eliminated and two methods take their place. 
12465
12466         The differences in the two methods between xStep and xTerminal is
12467         that xStep is involved in our current lookup system that uses
12468         SimpleNames to compose a name, while xTerminal is used just to
12469         catch the case where the simplename lookup failed.
12470
12471 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * expression.cs (ResolveMemberAccess): Remove redundant code.
12474         TypeExpr expressions are always born fully resolved.
12475
12476         * interface.cs (PopulateMethod): Do not lookup the types twice.
12477         We were doing it once during SemanticAnalysis and once during
12478         PopulateMethod.
12479
12480         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12481         in local variable type definitions, were being returned as a
12482         SimpleName (we decomposed everything into a string), that is
12483         because primary_expression was being used instead of a type in the
12484         grammar (reduce/reduce conflicts).
12485
12486         The part that was wrong is that we converted the expression into a
12487         string (an oversimplification in one hand, compounded with primary
12488         expressions doing string concatenation).
12489
12490         So things like:
12491
12492         A.B.C [] x;
12493
12494         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12495         using clauses from working on this particular context.  And a type
12496         was being matched directly against "A.B.C[]".
12497
12498         We now use the correct approach, and allow for ComposedCast to be
12499         part of the unary expression.  So the "A.B.C []" become a composed
12500         cast of "A.B.C" (as a nested group of MemberAccess with a
12501         SimpleName at the end) plus the rank composition "[]". 
12502
12503         Also fixes 35567
12504
12505 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12506
12507         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12508         for the access level checking.
12509
12510         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12511         `TypeContainer container', because I kept getting confused when I
12512         was debugging this code.
12513
12514         * expression.cs (Indexers): Instead of tracking getters/setters,
12515         we now track them in parallel.  We create one arraylist less, but
12516         most importantly it is possible now for the LValue code to find a
12517         matching get for a set.
12518
12519         (IndexerAccess.DoResolveLValue): Update the code.
12520         GetIndexersForType has been modified already to extract all the
12521         indexers from a type.  The code assumed it did not.
12522
12523         Also make the code set the correct return type for the indexer.
12524         This was fixed a long time ago for properties, but was missing for
12525         indexers.  It used to be void_type.
12526
12527         (Binary.Emit): Test first for doubles instead of
12528         floats, as they are more common.
12529
12530         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12531         when dealing with floats and the <=, >= operators.  This fixes bug
12532         #39314 
12533
12534         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12535         to load the array value by emitting a load on the foreach variable
12536         type.  This was incorrect.  
12537
12538         We now emit the code to load an element using the the array
12539         variable type, and then we emit the conversion operator.
12540
12541         Fixed #40176
12542
12543 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12544
12545         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12546
12547 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12550         test for protection before we test for signatures. 
12551
12552         (MethodSignature.ToString): implement.
12553
12554         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12555         to the case where we reduced into a LongConstant.
12556
12557         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12558         depend on whether the information is acurrate, because the
12559         Microsoft runtime will always claim that the array type is public,
12560         regardless of the real state.
12561
12562         If the type is a pointer, another problem happens: the type is
12563         reported as non-public in Microsoft.  
12564
12565         In both cases we have to call CheckAccessLevel recursively with
12566         the underlying type as the argument to be tested.
12567
12568 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12569
12570         * assign.cs (Assign.Emit): If we are dealing with a compound
12571         assignment expression, we should use the code path that stores the
12572         intermediate result in a temporary value.  This fixes #40903.
12573
12574         *expression.cs (Indirection.ToString): Provide ToString method for
12575         debugging. 
12576
12577 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12578
12579         * class.cs: Null out fields holding references to Block objects so
12580         they can be garbage collected.
12581
12582         * expression.cs (OverloadResolve): Remove unused local.
12583
12584 2003-04-07  Martin Baulig  <martin@ximian.com>
12585
12586         * codegen.cs (EmitContext.CurrentFile): New public field.
12587         (EmitContext.Mark): Use the CurrentFile to check whether the
12588         location is in the correct file.
12589         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12590
12591 2003-04-07  Martin Baulig  <martin@ximian.com>
12592
12593         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12594
12595         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12596         location.  [FIXME: The location argument which gets passed to this
12597         method is sometimes wrong!]
12598
12599 2003-04-07  Nick Drochak <ndrochak@gol.com>
12600
12601         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12602
12603 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12604
12605         * expression.cs (Indirection.EmitAssign): We were using the
12606         temporary, but returning immediately instead of continuing the
12607         EmitAssing flow.
12608
12609 2003-04-06  Martin Baulig  <martin@ximian.com>
12610
12611         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12612         if it's a nested child, but also deriving from the outer class.
12613         See test 190.cs.
12614
12615         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12616         nested child, but also deriving from the outer class.  See
12617         test-190.cs.
12618         (FilterWithClosure): We may access private members of the outer
12619         class if we're a nested child and deriving from the outer class.
12620         (RealMemberLookup): Only set `closure_private_ok' if the
12621         `original_bf' contained BindingFlags.NonPublic.
12622
12623 2003-04-05  Martin Baulig  <martin@ximian.com>
12624
12625         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12626         probe if its a type parameter, and if so, flag an error.
12627
12628         * decl.cs: Move here the SetParameterInfo code from class.cs.
12629         Handle IsGeneric here.
12630
12631         Handle a variety of errors in the parameter info definition.
12632
12633         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12634         type parameters here.
12635
12636         * cs-parser.jay (class_declaration): report errors for parameters
12637         here as well.
12638
12639 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12640
12641         * generic.cs: New file, contains support code for generics.
12642
12643         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12644         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12645
12646         Update parser for the above removals.
12647
12648         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12649         now taken care of in the parser.
12650
12651 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12652
12653         * class.cs (Event.Define): Do not allow abstract events to have
12654         initializers. 
12655
12656 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12657
12658         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12659         block in event declarations.
12660
12661         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12662         value type, get its address.
12663
12664         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12665         leaving a class on the stack instead of a boolean value (int
12666         0/1).  Change the code so we compare against null, and then the
12667         result against zero.
12668
12669         * class.cs (TypeContainer.GetClassBases): We were checking for the
12670         parent class being sealed too late.
12671
12672         * expression.cs (Binary.Emit): For <= and >= when dealing with
12673         floating point values, use cgt.un and clt.un instead of cgt and
12674         clt alone.
12675
12676 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12677
12678         * statement.cs: Apply the same optimization as MS: skip the 
12679         GetEnumerator returning an IEnumerator, and use the one returning a 
12680         CharEnumerator instead. This allows us to avoid the try-finally block 
12681         and the boxing.
12682
12683 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12684
12685         * cs-parser.jay: Attributes cannot be applied to
12686                          namespaces. Fixes #40473
12687
12688 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12689
12690         * class.cs:
12691         (Add*): check if the name is valid using the full name for constants,
12692         fields, properties and events.
12693
12694 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12695
12696         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12697         char constants to be part of the enumeration.
12698
12699         * expression.cs (Conditional.DoResolve): Add support for operator
12700         true. Implements the missing functionality from 14.12
12701
12702         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12703         operator true/false as required by the spec.
12704
12705         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12706         implicit conversion to boolean.
12707
12708         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12709         also one where the type implements `operator true'. 
12710
12711         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12712         get an expression that will invoke operator true based on an
12713         expression.  
12714
12715         (GetConversionOperators): Removed the hack that called op_True
12716         here.  
12717
12718         (Expression.ResolveBoolean): Move this from Statement.
12719
12720 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * ecore.cs (FieldExpr): do not allow initialization of initonly
12723         fields on derived classes
12724
12725 2003-03-13  Martin Baulig  <martin@ximian.com>
12726
12727         * statement.cs (Block.Emit): Call ig.BeginScope() and
12728         ig.EndScope() when compiling with debugging info; call
12729         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12730
12731 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12732
12733         * expression.cs (Indexers): Do not construct immediately, allow
12734         for new members to be appended as we go.  Fixes 38143
12735
12736 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12737
12738         * expression.cs: save/restore context when resolving an unchecked
12739         expression.
12740
12741 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12742
12743         * cfold.cs: Catch division by zero in modulus operator during
12744         constant folding.
12745
12746 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12747
12748         * interface.cs (Interface.DefineMembers): Avoid defining members
12749         twice. 
12750
12751 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12752
12753         * driver.cs: handle the +/- options for -noconfig
12754
12755         * statement.cs (Unckeched.Resolve): Also track the state of
12756         unchecked in the Resolve phase.
12757
12758 2003-02-27  Martin Baulig  <martin@ximian.com>
12759
12760         * ecore.cs (Expression.MemberLookup): Don't create a
12761         MethodGroupExpr for something which is not a method.  Fixes #38291.
12762
12763 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12764
12765         * class.cs (MemberBase.CheckParameters): Also check that the type
12766         is unmanaged if it is a pointer.
12767
12768         * expression.cs (SizeOf.Resolve): Add location information.
12769
12770         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12771         a managed type is declared.
12772
12773         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12774         parameter modifiers as well.  Fixes bug 38606
12775
12776         * class.cs: Very sad.  Am backing out the speed up changes
12777         introduced by the ArrayList -> Array in the TypeContainer, as they
12778         were not actually that much faster, and introduced a bug (no error
12779         reports on duplicated methods).
12780
12781         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12782         source first, this will guarantee that we have a valid expression
12783         before calling in lower levels functions that will require a
12784         resolved object.  Then use this original_source in the
12785         target.ResolveLValue instead of the original source that was
12786         passed to us.
12787
12788         Another change.  Use target.Resolve instead of LValueResolve.
12789         Although we are resolving for LValues, we will let the Assign code
12790         take care of that (it will be called again from Resolve).  This
12791         basically allows code like this:
12792
12793         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12794         class Y { void A (X x) { x [0] += o; }
12795
12796         The problem was that the indexer was trying to resolve for
12797         set_Item (idx, object o) and never finding one.  The real set_Item
12798         was set_Item (idx, X).  By delaying the process we get the right
12799         semantics. 
12800
12801         Fixes bug 36505
12802
12803 2003-02-23  Martin Baulig  <martin@ximian.com>
12804
12805         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12806         while calling DoEmit ().
12807
12808         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12809         source files; if you use the #line directive inside a method, the
12810         compiler stops emitting line numbers for the debugger until it
12811         reaches the end of the method or another #line directive which
12812         restores the original file.
12813
12814 2003-02-23  Martin Baulig  <martin@ximian.com>
12815
12816         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12817
12818 2003-02-23  Martin Baulig  <martin@ximian.com>
12819
12820         * statement.cs (Block.AddChildVariableNames): We need to call this
12821         recursively, not just for our immediate children.
12822
12823 2003-02-23  Martin Baulig  <martin@ximian.com>
12824
12825         * class.cs (Event.Define): Always make the field private, like csc does.
12826
12827         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12828         actually work, fixes bug #37521.
12829
12830 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12831
12832         * delegate.cs: When creating the various temporary "Parameters"
12833         classes, make sure that we call the ComputeAndDefineParameterTypes
12834         on those new parameters (just like we do with the formal ones), to
12835         allow them to be resolved in the context of the DeclSpace.
12836
12837         This fixes the bug that Dick observed in Bugzilla #38530.
12838
12839 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12840
12841         * expression.cs (ResolveMemberAccess): When resolving a constant,
12842         do not attempt to pull a constant if the value was not able to
12843         generate a valid constant.
12844
12845         * const.cs (LookupConstantValue): Do not report more errors than required.
12846
12847 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12848
12849         * expression.cs: fixes bug #38328.
12850
12851 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * class.cs: Changed all the various members that can be part of a
12854         class from being an ArrayList to be an Array of the right type.
12855         During the DefineType type_list, interface_list, delegate_list and
12856         enum_list are turned into types, interfaces, delegates and enums
12857         arrays.  
12858
12859         And during the member population, indexer_list, event_list,
12860         constant_list, field_list, instance_constructor_list, method_list,
12861         operator_list and property_list are turned into their real arrays.
12862
12863         Although we could probably perform this operation earlier, for
12864         good error reporting we need to keep the lists and remove the
12865         lists for longer than required.
12866
12867         This optimization was triggered by Paolo profiling the compiler
12868         speed on the output of `gen-sample-program.pl' perl script. 
12869
12870         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12871         not crash in methods like MemberLookupFailed that use this field.  
12872
12873         This problem arises when the compiler fails to resolve a type
12874         during interface type definition for example.
12875
12876 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12877
12878         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12879         inherit from System.Object, so we have to stop at null, not only
12880         when reaching System.Object.
12881
12882 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12883
12884         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12885         DeclaredOnly because the parent indexer might have had a different
12886         name, but did not loop until the top of the hierarchy was reached.
12887
12888         The problem this one fixes is 35492: when a class implemented an
12889         indexer from an interface, we were getting the interface method
12890         (which was abstract) and we were flagging an error (can not invoke
12891         abstract method).
12892
12893         This also keeps bug 33089 functioning, and test-148 functioning.
12894
12895         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12896         out if a method is special is to see if it is declared in a
12897         property or event, or whether it is one of the predefined operator
12898         names.   This should fix correctly #36804.
12899
12900 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12901
12902         The goal here is to remove the dependency on EmptyCast.Peel ().
12903         Killing it completely.
12904
12905         The problem is that currently in a number of places where
12906         constants are expected, we have to "probe" for an EmptyCast, and
12907         Peel, which is not the correct thing to do, as this will be
12908         repetitive and will likely lead to errors. 
12909
12910         The idea is to remove any EmptyCasts that are used in casts that
12911         can be reduced to constants, so we only have to cope with
12912         constants. 
12913
12914         This bug hunt was triggered by Bug 37363 and the desire to remove
12915         the duplicate pattern where we were "peeling" emptycasts to check
12916         whether they were constants.  Now constants will always be
12917         constants.
12918
12919         * ecore.cs: Use an enumconstant here instead of wrapping with
12920         EmptyCast.  
12921
12922         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12923         throwing me off.  By handling this we can get rid of a few hacks.
12924
12925         * statement.cs (Switch): Removed Peel() code.
12926
12927 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * class.cs: Location information for error 508
12930
12931         * expression.cs (New.DoResolve): Add a guard against double
12932         resolution of an expression.  
12933
12934         The New DoResolve might be called twice when initializing field
12935         expressions (see EmitFieldInitializers, the call to
12936         GetInitializerExpression will perform a resolve on the expression,
12937         and later the assign will trigger another resolution
12938
12939         This leads to bugs (#37014)
12940
12941         * delegate.cs: The signature for EndInvoke should contain any ref
12942         or out parameters as well.  We were not doing this in the past. 
12943
12944         * class.cs (Field.Define): Do not overwrite the type definition
12945         inside the `volatile' group.  Turns out that volatile enumerations
12946         were changing the type here to perform a validity test, which
12947         broke conversions. 
12948
12949 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12950
12951         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12952         and structs, we do not want to load the instance variable
12953
12954         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12955         enum_type has to be handled like an object reference (implicit
12956         conversions exists from this to object), but the regular IsClass
12957         and IsValueType tests will never return true for this one.
12958
12959         Also we use TypeManager.IsValueType instead of type.IsValueType,
12960         just for consistency with the rest of the code (this is only
12961         needed if we ever use the construct exposed by test-180.cs inside
12962         corlib, which we dont today).
12963
12964 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12965
12966         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12967         just InternalCall.
12968
12969 2003-02-09  Martin Baulig  <martin@ximian.com>
12970
12971         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12972         (Namespace.DefineNamespaces): New static public method; this is
12973         called when we're compiling with debugging to add all namespaces
12974         to the symbol file.
12975
12976         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12977         pass it to the Namespace's .ctor.
12978
12979         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12980         and MethodBase arguments; pass the namespace ID to the symwriter;
12981         pass the MethodBase instead of the token to the symwriter.
12982         (SymbolWriter.DefineNamespace): New method to add a namespace to
12983         the symbol file.
12984
12985 2003-02-09  Martin Baulig  <martin@ximian.com>
12986
12987         * symbolwriter.cs: New file.  This is a wrapper around
12988         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12989         methods here in near future.
12990
12991 2003-02-09  Martin Baulig  <martin@ximian.com>
12992
12993         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12994         ILGenerator.MarkSequencePoint() which are actually used by the
12995         symbol writer.
12996
12997 2003-02-09  Martin Baulig  <martin@ximian.com>
12998
12999         * location.cs (SourceFile): New public sealed class.  This
13000         contains the name and an index which is used in the location's token.
13001         (Location): Reserve an appropriate number of bits in the token for
13002         the source file instead of walking over that list, this gives us a
13003         really huge performance improvement when compiling with debugging.
13004
13005         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13006         `SourceFile' argument instead of a string.
13007         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13008         but don't parse/tokenize here, we need to generate the list of all
13009         source files before we do that.
13010         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13011         the files.
13012
13013         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13014         instead of a string.
13015
13016         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13017         of a string.
13018
13019 2003-02-09  Martin Baulig  <martin@ximian.com>
13020
13021         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13022         filename on `#line default'.
13023
13024 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13025
13026         * statement.cs: don't clear the pinned var when the fixed statement
13027         returns from the method (fixes bug#37752).
13028
13029 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13030
13031         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13032         to IsValueType.
13033
13034 2003-02-07  Martin Baulig  <martin@ximian.com>
13035
13036         * driver.cs: Removed the `--debug-args' command line argument.
13037
13038         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13039         automatically by the AsssemblyBuilder.
13040         (CodeGen.InitializeSymbolWriter): We don't need to call any
13041         initialization function on the symbol writer anymore.  This method
13042         doesn't take any arguments.
13043
13044 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13047         from referenced assemblies as well.
13048
13049 2003-02-02  Martin Baulig  <martin@ximian.com>
13050
13051         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13052
13053 2003-02-02  Martin Baulig  <martin@ximian.com>
13054
13055         * class.cs (Constructor.Emit): Open the symbol writer before
13056         emitting the constructor initializer.
13057         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13058         single-stepping through constructor initializers.
13059
13060 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * class.cs: Handle error 549: do not allow virtual methods in
13063         sealed classes. 
13064
13065 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13066
13067         * decl.cs: Check access levels when resolving types
13068
13069 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13070
13071         * statement.cs: Add parameters and locals set in catch blocks that might 
13072         return to set vector
13073
13074 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13075
13076         * class.cs (Operator): Set the SpecialName flags for operators.
13077
13078         * expression.cs (Invocation.DoResolve): Only block calls to
13079         accessors and operators on SpecialName methods.
13080
13081         (Cast.TryReduce): Handle conversions from char constants.
13082
13083
13084 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13085
13086         * statement.cs: small memory and time optimization in FlowBranching.
13087
13088 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13089
13090         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13091         problem that the last fix but in the other sid (Set).
13092
13093         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13094         access when there is no indexer in the hierarchy.
13095
13096 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13097
13098         * class.cs: Combine some if statements.
13099
13100 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13101
13102         * driver.cs: fixed bug #37187.
13103
13104 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13105
13106         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13107         any indexer, it's needed to build a list with all the indexers in the
13108         hierarchy (AllGetters), else we have problems. Fixes #35653.
13109
13110 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13111
13112         * class.cs (MethodData.Define): It is wrong for an interface
13113         implementation to be static in both cases: explicit and implicit.
13114         We were only handling this in one case.
13115
13116         Improve the if situation there to not have negations.
13117
13118         * class.cs (Field.Define): Turns out that we do not need to check
13119         the unsafe bit on field definition, only on usage.  Remove the test.
13120
13121 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13122
13123         * driver.cs: use assembly.Location instead of Codebase (the latest
13124         patch made mcs fail when using MS assemblies).
13125
13126 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13127
13128         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13129         get the path to *corlib.dll.
13130
13131 2003-01-21  Nick Drochak <ndrochak@gol.com>
13132
13133         * cs-tokenizer.cs:
13134         * pending.cs:
13135         * typemanager.cs: Remove compiler warnings
13136
13137 2003-01-20  Duncan Mak  <duncan@ximian.com>
13138
13139         * AssemblyInfo.cs: Bump the version number to 0.19.
13140
13141 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13142
13143         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13144
13145 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13146
13147         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13148
13149 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13150
13151         * cs-parser.jay: Small fix: we were not comparing the constructor
13152         name correctly.   Thanks to Zoltan for the initial pointer.
13153
13154 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13155
13156         * cs-tokenizer.cs: Set file name when specified with #line
13157
13158 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * cs-parser.jay: Only perform the constructor checks here if we
13161         are named like the class;  This will help provider a better
13162         error.  The constructor path is taken when a type definition is
13163         not found, but most likely the user forgot to add the type, so
13164         report that rather than the constructor error.
13165
13166 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13167
13168         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13169         allocations.
13170
13171 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13172
13173         * cs-parser.jay: Add cleanup call.
13174
13175 2003-01-13  Duncan Mak  <duncan@ximian.com>
13176
13177         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13178         consistent with other methods.
13179
13180 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13181
13182         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13183
13184 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13185
13186         * attribute.cs: only set GuidAttr to true when we have a
13187         GuidAttribute.
13188
13189 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13190
13191         * ecore.cs:
13192         * expression.cs:
13193         * typemanager.cs: fixes to allow mcs compile corlib with the new
13194         Type.IsSubclassOf fix.
13195
13196 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13197
13198         * expression.cs (LocalVariableReference.DoResolve): Classify a
13199         constant as a value, not as a variable.   Also, set the type for
13200         the variable.
13201
13202         * cs-parser.jay (fixed_statement): take a type instead of a
13203         pointer_type, so we can produce a better error message later.
13204
13205         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13206         as an error.  
13207
13208         (For.DoEmit): Make inifinite loops have a
13209         non-conditional branch back.
13210
13211         (Fixed.DoEmit): First populate the pinned variables, then emit the
13212         statement, then clear the variables.  Before I was emitting the
13213         code once for each fixed piece.
13214
13215
13216 2003-01-08  Martin Baulig  <martin@ximian.com>
13217
13218         * statement.cs (FlowBranching.MergeChild): A break in a
13219         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13220
13221 2003-01-08  Martin Baulig  <martin@ximian.com>
13222
13223         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13224         lives in the same number space than `param_map'.  Fixes #36154.
13225
13226 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13227
13228         * cs-parser.jay (constructor_declaration): Set the
13229         Constructor.ModFlags before probing for it.  This makes the
13230         compiler report 514, 515 and 132 (the code was there, but got
13231         broken). 
13232
13233         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13234         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13235         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13236
13237 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13238
13239         * enum.cs: create the enum static fields using the enum type.
13240
13241 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13242
13243         * class.cs: don't try to create the ParamBuilder for the return
13244         type if it's not needed (and handle it breaking for the ms runtime
13245         anyway).
13246
13247 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13248
13249         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13250
13251 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13252
13253         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13254         the command.   This showed up while compiling the JANET source
13255         code, which used \r as its only newline separator.
13256
13257 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13258
13259         * class.cs (Method.Define): If we are an operator (because it
13260         reuses our code), then set the SpecialName and HideBySig.  #36128
13261
13262 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13265         exception, report error 120 `object reference required'.
13266
13267         * driver.cs: Add --pause option, used during to measure the size
13268         of the process as it goes with --timestamp.
13269
13270         * expression.cs (Invocation.DoResolve): Do not allow methods with
13271         SpecialName to be invoked.
13272
13273 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13274
13275         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13276         number before adding it.
13277
13278 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13279
13280         * ecore.cs (StandardImplicitConversion): When in an unsafe
13281         context, we allow conversion between void * to any other pointer
13282         type. This fixes bug #35973.
13283
13284 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13285
13286         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13287         is not thrown when extensionless outputs are used 
13288
13289 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13290
13291         * rootcontext.cs: fixed compilation of corlib.
13292
13293 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13294
13295         * attribute.cs (Attributes.Contains): Add new method.
13296
13297         * class.cs (MethodCore.LabelParameters): if the parameter is an
13298         `out' parameter, check that no attribute `[In]' has been passed.
13299
13300         * enum.cs: Handle the `value__' name in an enumeration.
13301
13302 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13303
13304         * decl.cs: Added special case to allow overrides on "protected
13305         internal" methods
13306
13307 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13308
13309         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13310         since it makes much more sense.
13311
13312         (Attributes.ctor): Don't require a Location parameter.
13313
13314         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13315
13316         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13317         since we already have that information per attribute.
13318
13319         * everywhere : make appropriate changes.
13320
13321         * class.cs (LabelParameters): Write the code which actually
13322         applies attributes to the return type. We can't do this on the MS
13323         .NET runtime so we flag a warning in the case an exception is
13324         thrown.
13325
13326 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * const.cs: Handle implicit null conversions here too.
13329
13330 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13331
13332         * class.cs (MethodCore.LabelParameters): Remove the extra
13333         Type [] parameter since it is completely unnecessary. Instead
13334         pass in the method's attributes so that we can extract
13335         the "return" attribute.
13336
13337 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13340         of ignoring it and letting the compile continue.
13341
13342         * typemanager.cs (ChangeType): use an extra argument to return an
13343         error condition instead of throwing an exception.
13344
13345 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13346
13347         * expression.cs (Unary.TryReduce): mimic the code for the regular
13348         code path.  Perform an implicit cast in the cases where we can
13349         implicitly convert to one of the integral types, and then reduce
13350         based on that constant.   This fixes bug #35483.
13351
13352 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13353
13354         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13355
13356 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13357
13358         * namespace.cs: fixed bug #35489.
13359
13360 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * class.cs: Remove some dead code.
13363
13364         * cs-parser.jay: Estimate the number of methods needed
13365         (RootContext.MethodCount);
13366
13367         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13368         numbers instead of StringBuilders.
13369
13370         * support.cs (PtrHashtable): Add constructor with initial size;
13371         We can now reduce reallocations of the method table.
13372
13373 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13374
13375         * attribute.cs (ApplyAttributes): Keep track of the emitted
13376         attributes on a per-target basis. This fixes bug #35413.
13377
13378 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13379
13380         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13381         default to the Windows 1252 encoding.
13382
13383         (UnixParseOption): Support version, thanks to Alp for the missing
13384         pointer. 
13385
13386         * AssemblyInfo.cs: Add nice assembly information.
13387
13388         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13389         (bug 35169).
13390
13391         * cs-parser.jay: Allow a trailing comma before the close bracked
13392         in the attribute_section production.
13393
13394         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13395         address of the instance was being taken, I will take this out,
13396         because we take the address of the object immediately here.
13397
13398 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13399
13400         * typemanager.cs (AreMultipleAllowed): Take care of the most
13401         obvious case where attribute type is not in the current assembly -
13402         stupid me ;-)
13403
13404 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13405
13406         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13407         definitions, instead of doing that afterwards.  
13408
13409         Also we use a nice little hack, depending on the constructor, we
13410         know if we are a "composed" name or a simple name.  Hence, we
13411         avoid the IndexOf test, and we avoid 
13412
13413         * codegen.cs: Add code to assist in a bug reporter to track down
13414         the source of a compiler crash. 
13415
13416 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13417
13418         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13419         types have been emitted for a given element and flag an error
13420         if something which does not have AllowMultiple set is used more
13421         than once.
13422
13423         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13424         attribute types and their corresponding AllowMultiple properties
13425
13426         (AreMultipleAllowed): Check the property for a given type.
13427
13428         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13429         property in the case we have a TypeContainer.
13430
13431         (Attributes.AddAttribute): Detect duplicates and just skip on
13432         adding them. This trivial fix catches a pretty gross error in our
13433         attribute emission - global attributes were being emitted twice!
13434
13435         Bugzilla bug #33187 is now fixed.
13436
13437 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13438
13439         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13440         instead of pp_and).
13441
13442         * expression.cs (Binary.ResolveOperator): I can only use the
13443         Concat (string, string, string) and Concat (string, string,
13444         string, string) if the child is actually a concatenation of
13445         strings. 
13446
13447 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13448
13449         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13450         context where we need a 2-character lookahead.
13451
13452         * pending.cs (PendingImplementation): Rework so we can keep track
13453         of interface types all the time, and flag those which were
13454         implemented by parents as optional.
13455
13456 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13457
13458         * expression.cs (Binary.ResolveOperator): Use
13459         String.Concat(string,string,string) or
13460         String.Concat(string,string,string,string) when possible. 
13461
13462         * typemanager: More helper methods.
13463
13464
13465 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13466
13467         * pending.cs: remove the bogus return from GetMissingInterfaces()
13468         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13469
13470 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13471
13472         * namespace.cs: avoid duplicated 'using xxx' being added to
13473         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13474         when we get more than one 'using' statement for the same namespace.
13475         Report a CS0105 warning for it.
13476
13477 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13478
13479         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13480         of calling getChar/putback, uses internal knowledge of it.    
13481
13482         (xtoken): Reorder tokenizer so most common patterns are checked
13483         first.  This reduces the compilation time in another 5% (from 8.11s
13484         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13485
13486         The parsing time is 22% of the compilation in mcs, and from that
13487         64% is spent on the tokenization process.  
13488
13489         I tried using a binary search for keywords, but this is slower
13490         than the hashtable.  Another option would be to do a couple of
13491         things:
13492
13493                 * Not use a StringBuilder, instead use an array of chars,
13494                   with a set value.  Notice that this way we could catch
13495                   the 645 error without having to do it *afterwards*.
13496
13497                 * We could write a hand-parser to avoid the hashtable
13498                   compares altogether.
13499
13500         The identifier consumption process takes 37% of the tokenization
13501         time.  Another 15% is spent on is_number.  56% of the time spent
13502         on is_number is spent on Int64.Parse:
13503
13504                 * We could probably choose based on the string length to
13505                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13506                   computations. 
13507
13508         Another 3% is spend on wrapping `xtoken' in the `token' function.
13509
13510         Handle 0xa0 as whitespace (#34752)
13511
13512 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13513
13514         * typemanager.cs (IsCLRType): New routine to tell whether a type
13515         is one of the builtin types.  
13516
13517         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13518         typecode in more places instead of doing pointer comparissions.
13519         We could leverage some knowledge about the way the typecodes are
13520         laid out.
13521
13522         New code to cache namespaces in assemblies, it is currently not
13523         invoked, to be used soon.
13524
13525         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13526
13527         * expression.cs (Binary.ResolveOperator): specially handle
13528         strings, and do not perform user-defined operator overloading for
13529         built-in types.
13530
13531 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13534         internalcall as it is a pretty simple operation;  Avoid whenever
13535         possible to call Char.IsLetter.
13536
13537         (consume_identifier): Cut by half the number of
13538         hashtable calls by merging the is_keyword and GetKeyword behavior.
13539
13540         Do not short-circuit, because if we do, we
13541         report errors (ie, #if false && true would produce an invalid
13542         directive error);
13543
13544
13545 2002-11-24  Martin Baulig  <martin@ximian.com>
13546
13547         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13548         check constant ranges and report a CS0221.  Fixes #33186.
13549
13550 2002-11-24  Martin Baulig  <martin@ximian.com>
13551
13552         * cs-parser.jay: Make this work for uninitialized variable
13553         declarations in the `for' initializer.  Fixes #32416.
13554
13555 2002-11-24  Martin Baulig  <martin@ximian.com>
13556
13557         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13558         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13559
13560 2002-11-24  Martin Baulig  <martin@ximian.com>
13561
13562         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13563         argument; if true, we also check for user-defined conversions.
13564         This is only needed if both arguments are of a user-defined type.
13565         Fixes #30443, added test-175.cs.
13566         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13567
13568         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13569
13570 2002-11-24  Martin Baulig  <martin@ximian.com>
13571
13572         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13573         function to get the store opcode.
13574         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13575         only emit the Ldelema if the store opcode is Stobj.  You must run
13576         both test-34 and test-167 to test this.  Fixes #34529.
13577
13578 2002-11-23  Martin Baulig  <martin@ximian.com>
13579
13580         * ecore.cs (Expression.MemberLookup): Added additional
13581         `qualifier_type' argument which is used when we're being called
13582         from MemberAccess.DoResolve() and null if we're called from a
13583         SimpleName lookup.
13584         (Expression.MemberLookupFailed): New method to report errors; this
13585         does the CS1540 check and reports the correct error message.
13586
13587         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13588         argument for the CS1540 check and redone the way how we're dealing
13589         with private members.  See the comment in the source code for details.
13590         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13591         `closure_start_type' to `closure_qualifier_type' and check whether
13592         it's not null.  It was not this filter being broken, it was just
13593         being called with the wrong arguments.
13594
13595         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13596         and pass it the correct `qualifier_type'; this also does the error
13597         handling for us.
13598
13599 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13600
13601         * expression.cs (Invocation.EmitParams): If the we are dealing
13602         with a non-built-in value type, load its address as well.
13603
13604         (ArrayCreation): Use a a pretty constant instead
13605         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13606         static initializers.  
13607
13608         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13609         because they are not really value types, just glorified integers. 
13610
13611         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13612
13613         * ecore.cs: Remove redundant code for enumerations, make them use
13614         the same code path as everything else, fixes the casting issue
13615         with enumerations in Windows.Forms.
13616
13617         * attribute.cs: Do only cast to string if it is a string, the
13618         validation happens later.
13619
13620         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13621         people upgrade their corlibs.
13622
13623         * ecore.cs: Oops, enumerations were not following the entire code path
13624
13625 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * typemanager.cs (FilterWithClosure): Commented out the test for
13628         1540 in typemanager.cs, as it has problems when accessing
13629         protected methods from a parent class (see test-174.cs). 
13630
13631         * attribute.cs (Attribute.ValidateGuid): new method.
13632         (Attribute.Resolve): Use above.
13633
13634 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13637
13638         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13639         handling for enumerations, as we only needed the TypeContainer
13640         functionality to begin with (this is required for the fix below to
13641         work for enums that reference constants in a container class for
13642         example). 
13643
13644         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13645
13646         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13647         a valid TypeBuilder to perform lookups on.o
13648
13649         * class.cs (InheritableMemberSignatureCompare): Use true in the
13650         call to GetGetMethod and GetSetMethod, because we are comparing
13651         the signature, and we need to get the methods *even* if they are
13652         private. 
13653
13654         (PropertyBase.CheckBase): ditto.
13655
13656         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13657         GotoCase.Resolve): Use Peel on EmpytCasts.
13658
13659         * ecore.cs (EmptyCast): drop child, add Peel method.
13660
13661 2002-11-17  Martin Baulig  <martin@ximian.com>
13662
13663         * ecore.cs (EmptyCast.Child): New public property.
13664
13665         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13666         label resolved to an EmptyCast.  Fixes #34162.
13667         (GotoCase.Resolve): Likewise.
13668         (Block.EmitMeta): Likewise.
13669
13670 2002-11-17  Martin Baulig  <martin@ximian.com>
13671
13672         * expression.cs (Invocation.BetterConversion): Prefer int over
13673         uint; short over ushort; long over ulong for integer literals.
13674         Use ImplicitConversionExists instead of StandardConversionExists
13675         since we also need to check for user-defined implicit conversions.
13676         Fixes #34165.  Added test-173.cs.
13677
13678 2002-11-16  Martin Baulig  <martin@ximian.com>
13679
13680         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13681         with the `true' and `false' literals.  Fixes #33151.
13682
13683 2002-11-16  Martin Baulig  <martin@ximian.com>
13684
13685         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13686         October 22nd; don't do the cs1540 check for static members.
13687
13688         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13689         now using our own filter here and doing the cs1540 check again.
13690
13691 2002-11-16  Martin Baulig  <martin@ximian.com>
13692
13693         * support.cs (InternalParameters): Don't crash if we don't have
13694         any fixed parameters.  Fixes #33532.
13695
13696 2002-11-16  Martin Baulig  <martin@ximian.com>
13697
13698         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13699         when looking up static methods to make this work on Windows.
13700         Fixes #33773.
13701
13702 2002-11-16  Martin Baulig  <martin@ximian.com>
13703
13704         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13705         a setter rather than using PropertyInfo.CanWrite.
13706
13707 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13708
13709         * class.cs: Allow acces to block member by subclasses. Fixes build
13710         breaker.
13711
13712 2002-11-14  Martin Baulig  <martin@ximian.com>
13713
13714         * class.cs (Constructor.Emit): Added the extern/block check.
13715         Fixes bug #33678.
13716
13717 2002-11-14  Martin Baulig  <martin@ximian.com>
13718
13719         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13720         iteration while looking for indexers, this is needed because the
13721         indexer may have a different name in our base classes.  Fixed the
13722         error reporting (no indexers at all, not get accessor, no
13723         overloaded match).  Fixes bug #33089.
13724         (IndexerAccess.DoResolveLValue): Likewise.
13725
13726 2002-11-14  Martin Baulig  <martin@ximian.com>
13727
13728         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13729         indexers.  Fixes the first part of bug #33089.
13730         (MethodSignature.InheritableMemberSignatureCompare): Added support
13731         for properties.
13732
13733 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13734
13735         * attribute.cs (Attribute.Resolve): Catch the
13736         NullReferenceException and report it since it isn't supposed to
13737         happen. 
13738
13739 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13742         LogicalOr and LogicalAnd that can benefit from recursively
13743         handling EmitBranchable.  The code now should be nice for Paolo.
13744
13745 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13746
13747         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13748         the Type lookups, as we perform quite a number of lookups on
13749         non-Types.  This can be removed once we can deterministically tell
13750         whether we have a type or a namespace in advance.
13751
13752         But this might require special hacks from our corlib.
13753
13754         * TODO: updated.
13755
13756         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13757         and double which avoids a conversion from an integer to a double.
13758
13759         * expression.cs: tiny optimization, avoid calling IsConstant,
13760         because it effectively performs the lookup twice.
13761
13762 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13763
13764         But a bogus return here to keep the semantics of the old code
13765         until the Mono runtime is fixed.
13766
13767         * pending.cs (GetMissingInterfaces): New method used to remove all
13768         the interfaces that are already implemented by our parent
13769         classes from the list of pending methods. 
13770
13771         * interface.cs: Add checks for calls after ResolveTypeExpr.
13772
13773 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * class.cs (Class.Emit): Report warning 67: event not used if the
13776         warning level is beyond 3.
13777
13778         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13779         being a NullLiteral.
13780
13781         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13782         specifiers. 
13783
13784         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13785         path that might fail if a type can not be resolved.
13786
13787         * expression.cs (Binary.Emit): Emit unsigned versions of the
13788         operators. 
13789
13790         * driver.cs: use error 5.
13791
13792 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13793
13794         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13795
13796 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * cs-parser.jay (switch_section): A beautiful patch from Martin
13799         Baulig that fixed 33094.
13800
13801 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13802
13803         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13804         Check whether the base is abstract and report an error if so.
13805
13806         * expression.cs (IndexerAccess.DoResolveLValue,
13807         IndexerAccess.DoResolve): ditto. 
13808
13809         (Invocation.DoResolve): ditto.
13810
13811         (Invocation.FullMethodDesc): Improve the report string.
13812
13813         * statement.cs (Block): Eliminate IsVariableDefined as it is
13814         basically just a wrapper for GetVariableInfo.
13815
13816         * ecore.cs (SimpleName): Use new 
13817
13818         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13819         type, as we return the actual parameter ref/unref state on a
13820         different call.
13821
13822 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13823
13824         * support.cs: Return proper flags REF/OUT fixing the previous
13825         commit.  
13826
13827         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13828         not used to mean `ref' but `ref or out' in ParameterReference
13829
13830         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13831         full type signature instead of calling TypeManger.CSharpName
13832         ourselves. 
13833
13834         * support.cs (InternalParameters.ParameterDesc): Do not compare
13835         directly to the modflags, because REF/OUT will actually be bitsets
13836         if set. 
13837
13838         * delegate.cs (VerifyMethod): Check also the modifiers.
13839
13840         * cs-tokenizer.cs: Fix bug where floating point values with an
13841         exponent where a sign was missing was ignored.
13842
13843         * driver.cs: Allow multiple assemblies to be specified in a single
13844         /r: argument
13845
13846 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13849         because identifiers after a parenthesis would end up in this kind
13850         of production, and we needed to desamiguate it for having casts
13851         like:
13852
13853                 (UserDefinedType *) xxx
13854
13855 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13858         we should set on the Bindingflags.NonPublic, but not turn on
13859         private_ok.  private_ok controls whether a Private member is
13860         returned (this is chekced on the filter routine), while the
13861         BindingFlags.NonPublic just controls whether private/protected
13862         will be allowed.   This fixes the problem part of the problem of
13863         private properties being allowed to be used in derived classes.
13864
13865         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13866         so we can call the children DoResolveLValue method (this will
13867         properly signal errors on lvalue assignments to base properties)
13868
13869         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13870         getter are null, and we have a property info, we know that this
13871         happened because the lookup failed, so we report an error 122 for
13872         protection level violation.
13873
13874         We also silently return if setter and getter are null in the
13875         resolve functions, this condition only happens if we have flagged
13876         the error before.  This is the other half of the problem. 
13877
13878         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13879         not have accessibility information, that is why we were returning
13880         true in the filter function in typemanager.cs.
13881
13882         To properly report 122 (property is inaccessible because of its
13883         protection level) correctly, we report this error in ResolveAccess
13884         by failing if both the setter and the getter are lacking (ie, the
13885         lookup failed). 
13886
13887         DoResolve and DoLResolve have been modified to check for both
13888         setter/getter being null and returning silently, the reason being
13889         that I did not want to put the knowledge about this error in upper
13890         layers, like:
13891
13892         int old = Report.Errors;
13893         x = new PropertyExpr (...);
13894         if (old != Report.Errors)
13895                 return null;
13896         else
13897                 return x;
13898
13899         So the property expr is returned, but it is invalid, so the error
13900         will be flagged during the resolve process. 
13901
13902         * class.cs: Remove InheritablePropertySignatureCompare from the
13903         class, as we no longer depend on the property signature to compute
13904         whether it is possible to implement a method or not.
13905
13906         The reason is that calling PropertyInfo.GetGetMethod will return
13907         null (in .NET, in Mono it works, and we should change this), in
13908         cases where the Get Method does not exist in that particular
13909         class.
13910
13911         So this code:
13912
13913         class X { public virtual int A { get { return 1; } } }
13914         class Y : X { }
13915         class Z : Y { public override int A { get { return 2; } } }
13916
13917         Would fail in Z because the parent (Y) would not have the property
13918         defined.  So we avoid this completely now (because the alternative
13919         fix was ugly and slow), and we now depend exclusively on the
13920         method names.
13921
13922         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13923         reference method, instead of using the property.
13924
13925         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13926         routines are gone now.
13927
13928         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13929         names, they were incorrectly named.
13930
13931         * cs-tokenizer.cs: Return are more gentle token on failure. 
13932
13933         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13934         had an out-of-sync index variable, which caused it to remove from
13935         the list of pending methods the wrong method sometimes.
13936
13937 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13938
13939         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13940         CanWrite, because those refer to this particular instance of the
13941         property, and do not take into account the fact that we can
13942         override single members of a property.
13943
13944         Constructor requires an EmitContext.  The resolution process does
13945         not happen here, but we need to compute the accessors before,
13946         because the resolution does not always happen for properties.
13947
13948         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13949         subclass, before we did not update this flag, but we did update
13950         bindingflags. 
13951
13952         (GetAccessors): Drop this routine, as it did not work in the
13953         presence of partially overwritten set/get methods. 
13954
13955         Notice that this broke the cs1540 detection, but that will require
13956         more thinking. 
13957
13958 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13959
13960         * class.cs:
13961         * codegen.cs:
13962         * driver.cs: issue a warning instead of an error if we don't support
13963         debugging for the platform. Also ignore a couple of errors that may
13964         arise when trying to write the symbols. Undo my previous patch.
13965
13966 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13967
13968         * driver.cs: ignore /debug switch except for Unix platforms.
13969
13970 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13971
13972         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13973
13974 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * driver.cs: Do not make mcs-debug conditional, so we do not break
13977         builds that use it.
13978
13979         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13980         review this patch.  But basically after all the children variables
13981         have been merged, the value of "Breaks" was not being set to
13982         new_breaks for Switch blocks.  I think that it should be set after
13983         it has executed.  Currently I set this to the value of new_breaks,
13984         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13985         conservative, but I do not understand this code very well.
13986
13987         I did not break anything in the build, so that is good ;-)
13988
13989         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13990
13991 2002-10-20  Mark Crichton  <crichton@gimp.org>
13992
13993         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13994
13995 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13996
13997         * cfold.cs: Fixed compile blocker.
13998
13999 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * driver.cs: I was chekcing the key, not the file.
14002
14003 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14004
14005         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14006         message that we were generating - we just need to silently return
14007         a null.
14008
14009 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14010
14011         * class.cs (Event.Define): Change my previous commit, as this
14012         breaks the debugger.  This is a temporary hack, as it seems like
14013         the compiler is generating events incorrectly to begin with.
14014
14015         * expression.cs (Binary.ResolveOperator): Added support for 
14016         "U operator - (E x, E y)"
14017
14018         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14019         y)".
14020
14021         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14022         init-only variables, but this path did not take into account that
14023         there might be also instance readonly variables.  Correct this
14024         problem. 
14025
14026         This fixes bug 32253
14027
14028         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14029         delegates as well.
14030
14031         * driver.cs: Change the extension for modules to `netmodule'
14032
14033         * cs-parser.jay: Improved slightly the location tracking for
14034         the debugger symbols.
14035
14036         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14037         modifiers that were specified instead of the hardcoded value
14038         (FamAndAssem).  This was basically ignoring the static modifier,
14039         and others.  Fixes 32429.
14040
14041         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14042         fixed a bug in the process (32476)
14043
14044         * expression.cs (ArrayAccess.EmitAssign): Patch from
14045         hwang_rob@yahoo.ca that fixes bug 31834.3
14046
14047 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * driver.cs: Make the module extension .netmodule.
14050
14051 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14052
14053         * driver.cs: Report an error if the resource file is not found
14054         instead of crashing.
14055
14056         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14057         false, like Emit does.
14058
14059 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14060
14061         * typemanager.cs: Remove unused private member.  Also reported mcs
14062         bug to report this as a warning like csc.
14063
14064 2002-10-15  Martin Baulig  <martin@gnome.org>
14065
14066         * statement.cs (Statement.Emit): Made this a virtual method; emits
14067         the line number info and calls DoEmit().
14068         (Statement.DoEmit): New protected abstract method, formerly knows
14069         as Statement.Emit().
14070
14071         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14072
14073 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14076         have fixed a remaining problem: not every AddXXXX was adding a
14077         fully qualified name.  
14078
14079         Now everyone registers a fully qualified name in the DeclSpace as
14080         being defined instead of the partial name.  
14081
14082         Downsides: we are slower than we need to be due to the excess
14083         copies and the names being registered this way.  
14084
14085         The reason for this is that we currently depend (on the corlib
14086         bootstrap for instance) that types are fully qualified, because
14087         we dump all the types in the namespace, and we should really have
14088         types inserted into the proper namespace, so we can only store the
14089         basenames in the defined_names array.
14090
14091 2002-10-10  Martin Baulig  <martin@gnome.org>
14092
14093         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14094         from bug #31834, see the bug report for a testcase which is
14095         miscompiled.
14096
14097 2002-10-10  Martin Baulig  <martin@gnome.org>
14098
14099         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14100         flow analysis code for this.
14101
14102         * statement.cs (Do, While, For): Tell the flow analysis code about
14103         infinite loops.
14104         (FlowBranching.UsageVector): Added support for infinite loops.
14105         (Block.Resolve): Moved the dead code elimination here and use flow
14106         analysis to do it.
14107
14108 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * class.cs (Field.Define): Catch cycles on struct type
14111         definitions. 
14112
14113         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14114         fields if the fields are static.  We only need to check instance
14115         fields. 
14116
14117         * expression.cs (As.DoResolve): Test for reference type.
14118
14119         * statement.cs (Using.ResolveExpression): Use
14120         ConvertImplicitRequired, not ConvertImplicit which reports an
14121         error on failture
14122         (Using.ResolveLocalVariableDecls): ditto.
14123
14124         * expression.cs (Binary.ResolveOperator): Report errors in a few
14125         places where we had to.
14126
14127         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14128
14129 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14130
14131         * expression.cs: Use StoreFromPtr instead of extracting the type
14132         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14133
14134         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14135         an enumeration value to a System.Enum, but System.Enum is not a
14136         value type, but an class type, so we need to box.
14137
14138         (Expression.ConvertExplicit): One codepath could return
14139         errors but not flag them.  Fix this.  Fixes #31853
14140
14141         * parameter.cs (Resolve): Do not allow void as a parameter type.
14142
14143 2002-10-06  Martin Baulig  <martin@gnome.org>
14144
14145         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14146         if it's a class type and not a struct.  Fixes #31815.
14147
14148 2002-10-06  Martin Baulig  <martin@gnome.org>
14149
14150         * statement.cs: Reworked the flow analysis code a bit to make it
14151         usable for dead code elimination.
14152
14153 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14154
14155         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14156
14157 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14158
14159         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14160         to fix the test 165, will investigate deeper.
14161
14162 2002-10-04  Martin Baulig  <martin@gnome.org>
14163
14164         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14165         finally blocks actually work.
14166         (Try.Resolve): We don't need to create a sibling for `finally' if
14167         there is no finally block.
14168
14169 2002-10-04  Martin Baulig  <martin@gnome.org>
14170
14171         * class.cs (Constructor.Define): The default accessibility for a
14172         non-default constructor is private, not public.
14173
14174 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14175
14176         * class.cs (Constructor): Make AllowedModifiers public, add
14177         EXTERN.
14178
14179         * cs-parser.jay: Perform the modifiers test here, as the
14180         constructor for the Constructor class usually receives a zero
14181         because of the way we create it (first we create, later we
14182         customize, and we were never checking the modifiers).
14183
14184         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14185         is a version of LookupTypeReflection that includes the type-name
14186         cache.  This can be used as a fast path for functions that know
14187         the fully qualified name and are only calling into *.GetType() to
14188         obtain a composed type.
14189
14190         This is also used by TypeManager.LookupType during its type
14191         composition.
14192
14193         (LookupType): We now also track the real type name, as sometimes
14194         we can get a quey for the real type name from things like
14195         ComposedCast.  This fixes bug 31422.
14196
14197         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14198         complete type fullname, it does not have to go through the type
14199         resolution system to obtain the composed version of the type (for
14200         obtaining arrays or pointers).
14201
14202         (Conditional.Emit): Use the EmitBoolExpression to
14203         generate nicer code, as requested by Paolo.
14204
14205         (ArrayCreation.CheckIndices): Use the patch from
14206         hwang_rob@yahoo.ca to validate the array initializers. 
14207
14208 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14209
14210         * class.cs (ConstructorInitializer.Emit): simplify code by using
14211         Invocation.EmitCall, and at the same time, fix the bugs in calling
14212         parent constructors that took variable arguments. 
14213
14214         * ecore.cs (Expression.ConvertNumericExplicit,
14215         Expression.ImplicitNumericConversion): Remove the code that
14216         manually wrapped decimal (InternalTypeConstructor call is now gone
14217         as well).
14218
14219         * expression.cs (Cast.TryReduce): Also handle decimal types when
14220         trying to perform a constant fold on the type.
14221
14222         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14223
14224         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14225         that only turned off an error report, and did nothing else. 
14226
14227 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14228
14229         * driver.cs: Handle and ignore /fullpaths
14230
14231 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14232
14233         * expression.cs (Binary.ResolveOperator): Catch the case where
14234         DoNumericPromotions returns true, 
14235
14236         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14237
14238 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14239
14240         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14241         report error 70.
14242
14243 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14246         conversion exists, but it is also required that the conversion be
14247         performed.  This manifested in "(Type64Enum) 2".  
14248
14249         * class.cs (TypeManager.AddMethod): The fix is not to change
14250         AddEnum, because that one was using a fully qualified name (every
14251         DeclSpace derivative does), but to change the AddMethod routine
14252         that was using an un-namespaced name.  This now correctly reports
14253         the duplicated name.
14254
14255         Revert patch until I can properly fix it.  The issue
14256         is that we have a shared Type space across all namespaces
14257         currently, which is wrong.
14258
14259         Options include making the Namespace a DeclSpace, and merge
14260         current_namespace/current_container in the parser.
14261
14262 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14263
14264         * cs-parser.jay: Improve error reporting when we get a different
14265         kind of expression in local_variable_type and
14266         local_variable_pointer_type. 
14267
14268         Propagate this to avoid missleading errors being reported.
14269
14270         * ecore.cs (ImplicitReferenceConversion): treat
14271         TypeManager.value_type as a target just like object_type.   As
14272         code like this:
14273
14274         ValueType v = 1;
14275
14276         Is valid, and needs to result in the int 1 being boxed before it
14277         is assigned to the value type v.
14278
14279         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14280         to validate the enumeration name.
14281
14282         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14283         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14284         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14285
14286         * ecore.cs (TryImplicitIntConversion): When doing an
14287         implicit-enumeration-conversion, check if the type is 64-bits and
14288         perform a conversion before passing to EnumConstant.
14289
14290 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14291
14292         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14293         report ambiguous type references.  Unlike the MS version, we
14294         report what the ambiguity is.   Innovation at work ;-)
14295
14296         (DeclSpace.FindType): Require a location argument to
14297         display when we display an ambiguous error.
14298
14299         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14300
14301         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14302
14303         * expression.cs (EmitDynamicInitializers): Apply patch from
14304         hwang_rob@yahoo.ca that fixes the order in which we emit our
14305         initializers. 
14306
14307 2002-09-21  Martin Baulig  <martin@gnome.org>
14308
14309         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14310         delegate takes no arguments.
14311
14312 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14313
14314         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14315         from integers.
14316
14317         * expression.cs: Extract the underlying type.
14318
14319         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14320
14321         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14322
14323 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * class.cs (TypeContainer.DefineType): We can not use the nice
14326         PackingSize with the size set to 1 DefineType method, because it
14327         will not allow us to define the interfaces that the struct
14328         implements.
14329
14330         This completes the fixing of bug 27287
14331
14332         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14333         means also structs.  This fixes part of the problem. 
14334         (Expresion.ImplicitReferenceConversionExists): ditto.
14335
14336         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14337         error if there were no errors reported during the type lookup
14338         process, to avoid duplicates or redundant errors.  Without this
14339         you would get an ambiguous errors plus a type not found.  We have
14340         beaten the user enough with the first error.  
14341
14342         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14343         reference. 
14344
14345         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14346         during the resolution process, stop the lookup, this avoids
14347         repeated error reports (same error twice).
14348
14349         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14350
14351         * typemanager.cs (LookupType): Redo the type lookup code to match
14352         the needs of System.Reflection.  
14353
14354         The issue is that System.Reflection requires references to nested
14355         types to begin with a "+" sign instead of a dot.  So toplevel
14356         types look like: "NameSpace.TopLevelClass", and nested ones look
14357         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14358         levels. 
14359
14360 2002-09-19  Martin Baulig  <martin@gnome.org>
14361
14362         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14363         says that a method always returns or always throws an exception,
14364         don't report the CS0161.
14365
14366         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14367         set `Returns = new_returns'.
14368
14369 2002-09-19  Martin Baulig  <martin@gnome.org>
14370
14371         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14372         to an enum constant, check for a CS0176.
14373
14374 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14375
14376         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14377         for operators that must be in pairs and report errors.
14378
14379         * ecore.cs (SimpleName.DoResolveType): During the initial type
14380         resolution process, when we define types recursively, we must
14381         check first for types in our current scope before we perform
14382         lookups in the enclosing scopes.
14383
14384         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14385
14386         (Invocation.VerifyArgumentsCompat): Call
14387         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14388         I thought we were supposed to always call this, but there are a
14389         few places in the code where we dont do it.
14390
14391 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * driver.cs: Add support in -linkres and -resource to specify the
14394         name of the identifier.
14395
14396 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * ecore.cs (StandardConversionExists): Sync with the conversion
14399         code: allow anything-* to void* conversions.
14400
14401         (FindMostSpecificSource): Use an Expression argument
14402         instead of a Type, because we might be handed over a Literal which
14403         gets a few more implicit conversions that plain types do not.  So
14404         this information was being lost.
14405
14406         Also, we drop the temporary type-holder expression when not
14407         required.
14408
14409 2002-09-17  Martin Baulig  <martin@gnome.org>
14410
14411         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14412         this is an explicit interface implementation.
14413
14414 2002-09-17  Martin Baulig  <martin@gnome.org>
14415
14416         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14417         different `IndexerName' attributes.
14418
14419         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14420         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14421         virtual CommonResolve().
14422
14423 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14424
14425         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14426         and convert that to the UnderlyingType.
14427
14428         * statement.cs (Foreach.Resolve): Indexers are just like variables
14429         or PropertyAccesses.
14430
14431         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14432         inside quoted strings, we were not doing this before.
14433
14434 2002-09-16  Martin Baulig  <martin@gnome.org>
14435
14436         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14437         resolve it.  This is needed for the definite assignment check of the
14438         instance expression, fixes bug #29846.
14439         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14440
14441 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14442
14443         * parameter.cs: Fix compile error.  Cannot reference static member
14444         from an instance object.  Is this an mcs bug?
14445
14446 2002-09-14  Martin Baulig  <martin@gnome.org>
14447
14448         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14449         multiple times.  Fixes bug #30295, added test-166.cs.
14450
14451 2002-09-14  Martin Baulig  <martin@gnome.org>
14452
14453         * statement.cs (Block.Emit): Don't emit unreachable code.
14454         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14455         `break' statements.
14456         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14457
14458 2002-09-14  Martin Baulig  <martin@gnome.org>
14459
14460         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14461         is set.
14462
14463 2002-09-14  Martin Baulig  <martin@gnome.org>
14464
14465         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14466         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14467         be false on the ms runtime.
14468
14469 2002-09-13  Martin Baulig  <martin@gnome.org>
14470
14471         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14472         the CS0038 error message.
14473
14474 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14477         constant inside, return it.
14478
14479 2002-09-12  Martin Baulig  <martin@gnome.org>
14480
14481         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14482         implicit conversion can be done between enum types.
14483
14484         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14485         check whether an implicit conversion to the current enum's UnderlyingType
14486         exists and report an error if not.
14487
14488         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14489         without debugging support.
14490
14491         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14492         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14493
14494 2002-09-12  Martin Baulig  <martin@gnome.org>
14495
14496         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14497
14498         * ecore.cs (IMemberExpr.DeclaringType): New property.
14499         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14500         nonstatic member of an outer type (CS0038).
14501
14502 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * driver.cs: Activate the using-error detector at warning level
14505         4 (at least for MS-compatible APIs).
14506
14507         * namespace.cs (VerifyUsing): Small buglett fix.
14508
14509         * pending.cs (PendingImplementation): pass the container pointer. 
14510
14511         * interface.cs (GetMethods): Allow for recursive definition.  Long
14512         term, I would like to move every type to support recursive
14513         definitions, not the current ordering mechanism that we have right
14514         now.
14515
14516         The situation is this: Attributes are handled before interfaces,
14517         so we can apply attributes to interfaces.  But some attributes
14518         implement interfaces, we will now handle the simple cases
14519         (recursive definitions will just get an error).  
14520
14521         * parameter.cs: Only invalidate types at the end if we fail to
14522         lookup all types.  
14523
14524 2002-09-09  Martin Baulig  <martin@gnome.org>
14525
14526         * ecore.cs (PropertyExpr.Emit): Also check for
14527         TypeManager.system_int_array_get_length so this'll also work when
14528         compiling corlib.  Fixes #30003.
14529
14530 2002-09-09  Martin Baulig  <martin@gnome.org>
14531
14532         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14533         and throw an exception if we can't get the type's size.  Fixed #30040,
14534         added test-165.cs.
14535
14536 2002-09-09  Martin Baulig  <martin@gnome.org>
14537
14538         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14539
14540         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14541         context.  Fixes bug #30027.
14542
14543         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14544         virtual functions.  Fixes bug #30043, added test-164.cs.
14545
14546 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14547
14548         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14549
14550 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14551
14552         * driver.cs: Use an object to get the windows codepage since it's not a
14553         static property.
14554
14555 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * statement.cs (For.Emit): for infinite loops (test == null)
14558         return whether there is a break inside, not always "true".
14559
14560         * namespace.cs (UsingEntry): New struct to hold the name of the
14561         using definition, the location where it is defined, and whether it
14562         has been used in a successful type lookup.
14563
14564         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14565         strings.
14566
14567         * decl.cs: ditto.
14568
14569 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14570
14571         * attribute.cs : Fix incorrect code which relied on catching
14572         a NullReferenceException to detect a null being passed in
14573         where an object was expected.
14574
14575 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14576
14577         * statement.cs (Try): flag the catch variable as assigned
14578
14579         * expression.cs (Cast): Simplified by using ResolveType instead of
14580         manually resolving.
14581
14582         * statement.cs (Catch): Fix bug by using ResolveType.
14583
14584 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14585
14586         * expression.cs (BetterConversion): Special case for when we have
14587         a NullLiteral as the argument and we have to choose between string
14588         and object types - we choose string the way csc does.
14589
14590         * attribute.cs (Attribute.Resolve): Catch the
14591         NullReferenceException and report error #182 since the Mono
14592         runtime no more has the bug and having this exception raised means
14593         we tried to select a constructor which takes an object and is
14594         passed a null.
14595
14596 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14597
14598         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14599         message (1502, 1503) when we can't locate a method after overload
14600         resolution. This is much more informative and closes the bug
14601         Miguel reported.
14602
14603         * interface.cs (PopulateMethod): Return if there are no argument
14604         types. Fixes a NullReferenceException bug.
14605
14606         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14607         expressions too. Previously we were checking only in one place for
14608         positional arguments leaving out named arguments.
14609
14610         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14611         type to the enum type is not allowed. Remove code corresponding to
14612         that.
14613
14614         (ConvertNumericExplicit): Allow explicit conversions from
14615         the underlying type to enum type. This precisely follows the spec
14616         and closes a bug filed by Gonzalo.
14617
14618 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14619
14620         * compiler.csproj:
14621         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14622
14623 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14626         it was important that we stored the right value after the
14627         reduction in `converted'.
14628
14629 2002-09-04  Martin Baulig  <martin@gnome.org>
14630
14631         * location.cs (Location.SymbolDocument): Use full pathnames for the
14632         source files.
14633
14634 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14637         of the expression resolve mechanism, because that will catch the
14638         SimpleName error failures.
14639
14640         (Conditional): If we can not resolve the
14641         expression, return, do not crash.
14642
14643 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14644
14645         * cs-tokenizer.cs:
14646         (location): display token name instead of its number.
14647
14648 2002-08-28  Martin Baulig  <martin@gnome.org>
14649
14650         * expression.cs (Binary.ResolveOperator): Don't silently return
14651         but return an error if an operator cannot be applied between two
14652         enum types.
14653
14654 2002-08-28  Martin Baulig  <martin@gnome.org>
14655
14656         * class.cs (Constructor.Define): Set the permission attributes
14657         correctly instead of making all constructors public.
14658
14659 2002-08-28  Martin Baulig  <martin@gnome.org>
14660
14661         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14662         for private members before reporting a CS0103; if we find anything,
14663         it's a CS0122.
14664
14665 2002-08-28  Martin Baulig  <martin@gnome.org>
14666
14667         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14668         to check whether `closure_start_type == closure_invocation_type',
14669         we also need to check whether `m.DeclaringType == closure_invocation_type'
14670         before bypassing the permission checks.  We might be accessing
14671         protected/private members from the base class.
14672         (TypeManager.RealMemberLookup): Only set private_ok if private
14673         members were requested via BindingFlags.NonPublic.
14674
14675         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14676
14677         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14678         MethodGroupExpr.IsExplicitImpl if appropriate.
14679         (Invocation.DoResolve): Don't report the CS0120 for explicit
14680         interface implementations.
14681
14682 2002-08-27  Martin Baulig  <martin@gnome.org>
14683
14684         * expression.cs (Invocation.DoResolve): If this is a static
14685         method and we don't have an InstanceExpression, we must report
14686         a CS0120.
14687
14688 2002-08-25  Martin Baulig  <martin@gnome.org>
14689
14690         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14691         `==' between a valuetype and an object.
14692
14693 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14694
14695         * ecore.cs (TypeExpr): Provide a ToString method.
14696
14697 2002-08-24  Martin Baulig  <martin@gnome.org>
14698
14699         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14700         now called proggie.dbg and it's a binary file.
14701
14702 2002-08-23  Martin Baulig  <martin@gnome.org>
14703
14704         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14705
14706 2002-08-23  Martin Baulig  <martin@gnome.org>
14707
14708         * struct.cs (MyStructInfo.ctor): Make this work with empty
14709         structs; it's not allowed to use foreach() on null.
14710
14711 2002-08-23  Martin Baulig  <martin@gnome.org>
14712
14713         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14714         writer the full pathname of the generated assembly.
14715
14716 2002-08-23  Martin Baulig  <martin@gnome.org>
14717
14718         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14719         A `finally' block never returns or breaks; improved handling of
14720         unreachable code.
14721
14722 2002-08-23  Martin Baulig  <martin@gnome.org>
14723
14724         * statement.cs (Throw.Resolve): Allow `throw null'.
14725
14726 2002-08-23  Martin Baulig  <martin@gnome.org>
14727
14728         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14729         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14730         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14731         MemberLookup would return a wrong event if this is an explicit
14732         interface implementation and the class has an event with the same
14733         name.
14734
14735 2002-08-23  Martin Baulig  <martin@gnome.org>
14736
14737         * statement.cs (Block.AddChildVariableNames): New public method.
14738         (Block.AddChildVariableName): Likewise.
14739         (Block.IsVariableNameUsedInChildBlock): Likewise.
14740         (Block.AddVariable): Check whether a variable name has already
14741         been used in a child block.
14742
14743         * cs-parser.jay (declare_local_variables): Mark all variable names
14744         from the current block as being used in a child block in the
14745         implicit block.
14746
14747 2002-08-23  Martin Baulig  <martin@gnome.org>
14748
14749         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14750         find the symbol writer.
14751
14752         * driver.cs: csc also allows the arguments to /define being
14753         separated by commas, not only by semicolons.
14754
14755 2002-08-23  Martin Baulig  <martin@gnome.org>
14756
14757         * interface.cs (Interface.GetMembers): Added static check for events.
14758
14759 2002-08-15  Martin Baulig  <martin@gnome.org>
14760
14761         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14762         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14763
14764         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14765         why the MethodData.EmitDestructor() change was necessary.
14766
14767 2002-08-20  Martin Baulig  <martin@gnome.org>
14768
14769         * class.cs (TypeContainer.FindMembers): Added static check for events.
14770
14771         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14772
14773         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14774         use Type.GetEvents(), not Type.FindMembers().
14775
14776 2002-08-20  Martin Baulig  <martin@gnome.org>
14777
14778         * decl.cs (MemberCache): Added a special method cache which will
14779         be used for method-only searched.  This ensures that a method
14780         search will return a MethodInfo with the correct ReflectedType for
14781         inherited methods.      
14782
14783 2002-08-20  Martin Baulig  <martin@gnome.org>
14784
14785         * decl.cs (DeclSpace.FindMembers): Made this public.
14786
14787 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14788
14789         * delegate.cs: fixed build on windows.
14790         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14791
14792 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14793
14794         * ecore.cs (StandardConversionExists): Return a false
14795         if we are trying to convert the void type to anything else
14796         since that is not allowed.
14797
14798         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14799         we flag error 70 in the event an event is trying to be accessed
14800         directly from outside the declaring type.
14801
14802 2002-08-20  Martin Baulig  <martin@gnome.org>
14803
14804         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14805         MemberCache from typemanager.cs to decl.cs.
14806
14807 2002-08-19  Martin Baulig  <martin@gnome.org>
14808
14809         * class.cs (TypeContainer): Implement IMemberContainer.
14810         (TypeContainer.DefineMembers): Create the MemberCache.
14811         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14812         return public members if BindingFlags.Public was given, check
14813         whether members are static.
14814
14815 2002-08-16  Martin Baulig  <martin@gnome.org>
14816
14817         * decl.cs (DeclSpace.Define): Splitted this in Define and
14818         DefineMembers.  DefineMembers is called first and initializes the
14819         MemberCache.
14820
14821         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14822         DefineMembers() on all our DeclSpaces.
14823
14824         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14825         but call DefineMembers() on all nested interfaces.  We call their
14826         Define() in our new Define() function.
14827
14828         * interface.cs (Interface): Implement IMemberContainer.
14829         (Interface.Define): Moved all code except the attribute stuf to
14830         DefineMembers().
14831         (Interface.DefineMembers): Initialize the member cache.
14832
14833         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14834         need this anymore since we can use MemberCache.FindMembers directly.
14835
14836 2002-08-19  Martin Baulig  <martin@gnome.org>
14837
14838         * typemanager.cs (MemberCache): When creating the cache for an
14839         interface type, add all inherited members.
14840         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14841         to `out bool used_cache' and documented it.
14842         (TypeManager.MemberLookup): If we already used the cache in the first
14843         iteration, we don't need to do the interfaces check.
14844
14845 2002-08-19  Martin Baulig  <martin@gnome.org>
14846
14847         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14848         here from IMemberFinder and don't implement this interface anymore.
14849         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14850
14851         * typemanager.cs (IMemberFinder): This interface is now only used by
14852         classes which actually support the member cache.
14853         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14854         since we only put DeclSpaces into this Hashtable.
14855         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14856         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14857
14858 2002-08-16  Martin Baulig  <martin@gnome.org>
14859
14860         * typemanager.cs (ICachingMemberFinder): Removed.
14861         (IMemberFinder.MemberCache): New property.
14862         (TypeManager.FindMembers): Merged this with RealFindMembers().
14863         This function will never be called from TypeManager.MemberLookup()
14864         so we can't use the cache here, just the IMemberFinder.
14865         (TypeManager.MemberLookup_FindMembers): Check whether the
14866         IMemberFinder has a MemberCache and call the cache's FindMembers
14867         function.
14868         (MemberCache): Rewrote larger parts of this yet another time and
14869         cleaned it up a bit.
14870
14871 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14872
14873         * driver.cs (LoadArgs): Support quoting.
14874
14875         (Usage): Show the CSC-like command line arguments.
14876
14877         Improved a few error messages.
14878
14879 2002-08-15  Martin Baulig  <martin@gnome.org>
14880
14881         * typemanager.cs (IMemberContainer.Type): New property.
14882         (IMemberContainer.IsInterface): New property.
14883
14884         The following changes are conditional to BROKEN_RUNTIME, which is
14885         defined at the top of the file.
14886
14887         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14888         class'es members, but add all members from TypeHandle.ObjectType
14889         if we're an interface.
14890         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14891         is the current type.
14892         (MemberCache.CacheEntry.Container): Removed this field.
14893         (TypeHandle.GetMembers): Include inherited members.
14894
14895 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14896
14897         * typemanager.cs: fixed compilation and added a comment on a field that
14898         is never used.
14899
14900 2002-08-15  Martin Baulig  <martin@gnome.org>
14901
14902         * class.cs (ConstructorInitializer.Resolve): In the
14903         Expression.MemberLookup call, use the queried_type as
14904         invocation_type.
14905
14906         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14907         declared' attribute, it's always true.
14908         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14909         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14910         temporary wrapper for FindMembers which tells MemberLookup whether
14911         members from the base classes are included in the return value.
14912         This will go away soon.
14913         (TypeManager.MemberLookup): Use this temporary hack here; once the
14914         new MemberCache is completed, we don't need to do the DeclaredOnly
14915         looping here anymore since the MemberCache will take care of this.
14916         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14917         (MemberCache): When creating the MemberCache for a class, get
14918         members from the current class and all its base classes.
14919         (MemberCache.CacheEntry.Container): New field.  This is a
14920         temporary hack until the Mono runtime is fixed to distinguish
14921         between ReflectedType and DeclaringType.  It allows us to use MCS
14922         with both the MS runtime and the unfixed Mono runtime without
14923         problems and without accecting performance.
14924         (MemberCache.SearchMembers): The DeclaredOnly looping from
14925         TypeManager.MemberLookup is now done here.      
14926
14927 2002-08-14  Martin Baulig  <martin@gnome.org>
14928
14929         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14930         Type.GetFields on dynamic types but get the fields from the
14931         corresponding TypeContainer.
14932         (MyStructInfo.GetStructInfo): Added check for enum types.
14933
14934         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14935         (MemberList.SyncRoot): Implemented.
14936         (TypeManager.FilterWithClosure): No need to check permissions if
14937         closure_start_type == closure_invocation_type, don't crash if
14938         closure_invocation_type is null.
14939
14940 2002-08-13  Martin Baulig  <martin@gnome.org>
14941
14942         Rewrote TypeContainer.FindMembers to use a member cache.  This
14943         gives us a speed increase of about 35% for the self-hosting MCS
14944         build and of about 15-20% for the class libs (both on GNU/Linux).
14945
14946         * report.cs (Timer): New class to get enhanced profiling.  This
14947         whole class is "TIMER" conditional since it remarkably slows down
14948         compilation speed.
14949
14950         * class.cs (MemberList): New class.  This is an IList wrapper
14951         which we're now using instead of passing MemberInfo[]'s around to
14952         avoid copying this array unnecessarily.
14953         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14954         (ICachingMemberFinder, IMemberContainer): New interface.
14955         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14956         has already been checked, otherwise use it for the name comparision.
14957         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14958         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14959         if possible.  Returns a MemberList, not a MemberInfo [].
14960         (TypeHandle): New class, implements IMemberContainer.  We create
14961         one instance of this class per type, it contains a MemberCache
14962         which is used to do the member lookups.
14963         (MemberCache): New class.  Each instance of this class contains
14964         all members of a type and a name-based hash table.
14965         (MemberCache.FindMembers): This is our new member lookup
14966         function.  First, it looks up all members of the requested name in
14967         the hash table.  Then, it walks this list and sorts out all
14968         applicable members and returns them.
14969
14970 2002-08-13  Martin Baulig  <martin@gnome.org>
14971
14972         In addition to a nice code cleanup, this gives us a performance
14973         increase of about 1.4% on GNU/Linux - not much, but it's already
14974         half a second for the self-hosting MCS compilation.
14975
14976         * typemanager.cs (IMemberFinder): New interface.  It is used by
14977         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14978         Enum, Delegate or Interface.
14979         (TypeManager.finder_to_member_finder): New PtrHashtable.
14980         (TypeManager.finder_to_container): Removed.
14981         (TypeManager.finder_to_delegate): Removed.
14982         (TypeManager.finder_to_interface): Removed.
14983         (TypeManager.finder_to_enum): Removed.
14984
14985         * interface.cs (Interface): Implement IMemberFinder.
14986
14987         * delegate.cs (Delegate): Implement IMemberFinder.
14988
14989         * enum.cs (Enum): Implement IMemberFinder.
14990
14991         * class.cs (TypeContainer): Implement IMemberFinder.
14992
14993 2002-08-12  Martin Baulig  <martin@gnome.org>
14994
14995         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14996
14997 2002-08-12  Martin Baulig  <martin@gnome.org>
14998
14999         * ecore.cs (ITypeExpression): New interface for expressions which
15000         resolve to a type.
15001         (TypeExpression): Renamed to TypeLookupExpression.
15002         (Expression.DoResolve): If we're doing a types-only lookup, the
15003         expression must implement the ITypeExpression interface and we
15004         call DoResolveType() on it.
15005         (SimpleName): Implement the new ITypeExpression interface.
15006         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15007         hack, the situation that we're only looking up types can't happen
15008         anymore when this method is called.  Moved the type lookup code to
15009         DoResolveType() and call it.
15010         (SimpleName.DoResolveType): This ITypeExpression interface method
15011         is now doing the types-only lookup.
15012         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15013         (ResolveFlags): Added MaskExprClass.
15014
15015         * expression.cs (MemberAccess): Implement the ITypeExpression
15016         interface.
15017         (MemberAccess.DoResolve): Added support for a types-only lookup
15018         when we're called via ITypeExpression.DoResolveType().
15019         (ComposedCast): Implement the ITypeExpression interface.
15020
15021         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15022         Expression.Resolve() with ResolveFlags.Type instead.
15023
15024 2002-08-12  Martin Baulig  <martin@gnome.org>
15025
15026         * interface.cs (Interface.Define): Apply attributes.
15027
15028         * attribute.cs (Attribute.ApplyAttributes): Added support for
15029         interface attributes.
15030
15031 2002-08-11  Martin Baulig  <martin@gnome.org>
15032
15033         * statement.cs (Block.Emit): Only check the "this" variable if we
15034         do not always throw an exception.
15035
15036         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15037         whether the property has a set accessor.
15038
15039 2002-08-11  Martin Baulig  <martin@gnome.org>
15040
15041         Added control flow analysis support for structs.
15042
15043         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15044         with control flow analysis turned off.
15045         (IVariable): New interface.
15046         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15047         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15048         (FieldExpr.DoResolve): Resolve the instance expression with flow
15049         analysis turned off and do the definite assignment check after the
15050         resolving when we know what the expression will resolve to.
15051
15052         * expression.cs (LocalVariableReference, ParameterReference):
15053         Implement the new IVariable interface, only call the flow analysis
15054         code if ec.DoFlowAnalysis is true.
15055         (This): Added constructor which takes a Block argument.  Implement
15056         the new IVariable interface.
15057         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15058         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15059         This does the definite assignment checks for struct members.
15060
15061         * class.cs (Constructor.Emit): If this is a non-static `struct'
15062         constructor which doesn't have any initializer, call
15063         Block.AddThisVariable() to tell the flow analysis code that all
15064         struct elements must be initialized before control returns from
15065         the constructor.
15066
15067         * statement.cs (MyStructInfo): New public class.
15068         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15069         argument to this indexer.  If non-zero, check an individual struct
15070         member, not the whole struct.
15071         (FlowBranching.CheckOutParameters): Check struct members.
15072         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15073         overloaded versions of these methods which take an additional
15074         `int field_idx' argument to check struct members.
15075         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15076         overloaded versions of these methods which take an additional
15077         `string field_name' argument to check struct member.s
15078         (VariableInfo): Implement the IVariable interface.
15079         (VariableInfo.StructInfo): New public property.  Returns the
15080         MyStructInfo instance of the variable if it's a struct or null.
15081         (Block.AddThisVariable): New public method.  This is called from
15082         Constructor.Emit() for non-static `struct' constructor which do
15083         not have any initializer.  It creates a special variable for the
15084         "this" instance variable which will be checked by the flow
15085         analysis code to ensure that all of the struct's fields are
15086         initialized before control returns from the constructor.
15087         (UsageVector): Added support for struct members.  If a
15088         variable/parameter is a struct with N members, we reserve a slot
15089         in the usage vector for each member.  A struct is considered fully
15090         initialized if either the struct itself (slot 0) or all its
15091         members are initialized.
15092
15093 2002-08-08  Martin Baulig  <martin@gnome.org>
15094
15095         * driver.cs (Driver.MainDriver): Only report an error CS5001
15096         if there were no compilation errors.
15097
15098         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15099         `UnsafeContext' property to determine whether the parent is in
15100         unsafe context rather than checking the parent's ModFlags:
15101         classes nested in an unsafe class are unsafe as well.
15102
15103 2002-08-08  Martin Baulig  <martin@gnome.org>
15104
15105         * statement.cs (UsageVector.MergeChildren): Distinguish between
15106         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15107         we return.  Added test17() and test18() to test-154.cs.
15108
15109 2002-08-08  Martin Baulig  <martin@gnome.org>
15110
15111         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15112         Family access, make sure the invoking type isn't a subclass of the
15113         queried type (that'd be a CS1540).
15114
15115         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15116         this method which takes an additional `Type invocation_type'.
15117
15118         * expression.cs (BaseAccess.DoResolve): Use the base type as
15119         invocation and query type.
15120         (MemberAccess.DoResolve): If the lookup failed and we're about to
15121         report a CS0122, try a lookup with the ec.ContainerType - if this
15122         succeeds, we must report a CS1540.
15123
15124 2002-08-08  Martin Baulig  <martin@gnome.org>
15125
15126         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15127         (MethodGroupExpr): Implement the IMemberExpr interface.
15128
15129         * expression (MemberAccess.ResolveMemberAccess): No need to have
15130         any special code for MethodGroupExprs anymore, they're now
15131         IMemberExprs.   
15132
15133 2002-08-08  Martin Baulig  <martin@gnome.org>
15134
15135         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15136         Family, FamANDAssem and FamORAssem permissions.
15137         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15138
15139 2002-08-08  Martin Baulig  <martin@gnome.org>
15140
15141         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15142         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15143         or loop block.
15144
15145 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15146
15147         * driver.cs: implemented /resource option to embed managed resources.
15148
15149 2002-08-07  Martin Baulig  <martin@gnome.org>
15150
15151         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15152         (FieldBase.HasFieldInitializer): New public property.
15153         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15154         returns the field initializer and makes sure it is only resolved once.
15155         (TypeContainer.EmitFieldInitializers): Call
15156         FieldBase.GetInitializerExpression to get the initializer, this ensures
15157         that it isn't resolved multiple times.
15158
15159         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15160         the resolving process (SimpleName/MemberLookup) that we're currently
15161         emitting a field initializer (which must not access any instance members,
15162         this is an error CS0236).
15163
15164         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15165         argument, if the `IsFieldInitializer' flag is set, we must report and
15166         error CS0236 and not an error CS0120.   
15167
15168 2002-08-07  Martin Baulig  <martin@gnome.org>
15169
15170         * ecore.cs (IMemberExpr): New public interface.
15171         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15172         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15173         if the expression is an IMemberExpr.
15174
15175         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15176         to be null, implicitly default to `this' if we're non-static in
15177         this case.  Simplified the code a lot by using the new IMemberExpr
15178         interface.  Also fixed bug #28176 here.
15179
15180 2002-08-06  Martin Baulig  <martin@gnome.org>
15181
15182         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15183         ParameterReferences during semantic analysis so that we can do a
15184         type-only search when resolving Cast, TypeOf and SizeOf.
15185         (block): Pass the `current_local_parameters' to the Block's
15186         constructor.
15187
15188         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15189         argument to the constructor.
15190         (ConstructorInitializer.Resolve): Create a temporary implicit
15191         block with the parameters.
15192
15193         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15194         references here if we aren't doing a type-only search.
15195
15196         * statement.cs (Block): Added constructor which takes a
15197         `Parameters parameters' argument.
15198         (Block.Parameters): New public property.
15199
15200         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15201         to `Parameters' and made it public readonly.
15202
15203 2002-08-06  Martin Baulig  <martin@gnome.org>
15204
15205         * ecore.cs (Expression.Warning): Made this public as well.
15206
15207         * report.cs (Report.Debug): Print the contents of collections.
15208
15209 2002-08-06  Martin Baulig  <martin@gnome.org>
15210
15211         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15212         used to tell Resolve() which kinds of expressions it may return.
15213         (Expression.Resolve): Added overloaded version of this method which
15214         takes a `ResolveFlags flags' argument.  This can be used to tell
15215         Resolve() which kinds of expressions it may return.  Reports a
15216         CS0118 on error.
15217         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15218         ResolveFlags.SimpleName.
15219         (Expression.Error118): Added overloaded version of this method which
15220         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15221         which kinds of expressions are allowed.
15222
15223         * expression.cs (Argument.ResolveMethodGroup): New public method.
15224         Resolves an argument, but allows a MethodGroup to be returned.
15225         This is used when invoking a delegate.
15226
15227         * TODO: Updated a bit.
15228
15229 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15230
15231         Fixed compilation with csc.
15232
15233         * ecore.cs: Expression.Error made public. Is this correct? Should
15234         Warning be made public too?
15235
15236         * expression.cs: use ea.Location instead of ea.loc.
15237         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15238
15239 2002-08-06  Martin Baulig  <martin@gnome.org>
15240
15241         * ecore.cs (Expression.loc): Moved the location here instead of
15242         duplicating it in all derived classes.
15243         (Expression.Location): New public property.
15244         (Expression.Error, Expression.Warning): Made them non-static and
15245         removed the location argument.
15246         (Expression.Warning): Added overloaded version which takes an
15247         `int level' argument.
15248         (Expression.Error118): Make this non-static and removed the
15249         expression and location arguments.
15250         (TypeExpr): Added location argument to the constructor.
15251
15252         * expression.cs (StaticCallExpr): Added location argument to
15253         the constructor.
15254         (Indirection, PointerArithmetic): Likewise.
15255         (CheckedExpr, UnCheckedExpr): Likewise.
15256         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15257         (StringPtr): Likewise.
15258
15259
15260 2002-08-05  Martin Baulig  <martin@gnome.org>
15261
15262         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15263
15264         * assign.cs (Assign.DoResolve): Check whether the source
15265         expression is a value or variable.
15266
15267         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15268         while resolving the corresponding blocks.
15269
15270         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15271         an error, don't silently return null.
15272
15273         * statement.cs (Block.AddVariable): Do the error reporting here
15274         and distinguish between CS0128 and CS0136.
15275         (Block.DoResolve): Report all unused labels (warning CS0164).
15276         (LabeledStatement): Pass the location to the constructor.
15277         (LabeledStatement.HasBeenReferenced): New property.
15278         (LabeledStatement.Resolve): Set it to true here.
15279
15280         * statement.cs (Return.Emit): Return success even after reporting
15281         a type mismatch error (CS0126 or CS0127), this is what csc does and
15282         it avoids confusing the users with any consecutive errors.
15283
15284 2002-08-05  Martin Baulig  <martin@gnome.org>
15285
15286         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15287
15288         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15289
15290         * expression.cs (MemberAccess.DoResolve): Silently return if an
15291         error has already been reported.
15292
15293         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15294         error has already been reported.
15295
15296 2002-08-05  Martin Baulig  <martin@gnome.org>
15297
15298         * statement.cs (UsageVector): Only initialize the `parameters'
15299         vector if we actually have any "out" parameters.
15300
15301 2002-08-05  Martin Baulig  <martin@gnome.org>
15302
15303         * expression.cs (Binary.ResolveOperator): When combining delegates,
15304         they must have the same type.
15305
15306 2002-08-05  Martin Baulig  <martin@gnome.org>
15307
15308         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15309         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15310         work with the ms runtime and we also don't need it: if we're a
15311         PropertyBuilder and not in the `indexer_arguments' hash, then we
15312         are a property and not an indexer.
15313
15314         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15315         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15316         since the latter one doesn't work with the ms runtime.
15317
15318 2002-08-03  Martin Baulig  <martin@gnome.org>
15319
15320         Fixed bugs #27998 and #22735.
15321
15322         * class.cs (Method.IsOperator): New public field.
15323         (Method.CheckBase): Report CS0111 if there's already a method
15324         with the same parameters in the current class.  Report CS0508 when
15325         attempting to change the return type of an inherited method.
15326         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15327         and it's not marked abstract or extern.
15328         (PropertyBase): New abstract base class for Property and Indexer.
15329         (PropertyBase.CheckBase): Moved here from Property and made it work
15330         for indexers.
15331         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15332         the same so we can reuse it there.
15333         (Property, Indexer): Derive from PropertyBase.
15334         (MethodSignature.inheritable_property_signature_filter): New delegate
15335         to find properties and indexers.
15336
15337         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15338         argument and improved error reporting.
15339
15340         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15341         EmptyReadOnlyParameters and made it a property.
15342
15343         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15344         version of this method which takes a `PropertyInfo indexer'.
15345         (TypeManager.RegisterIndexer): New method.
15346
15347         * class.cs: Added myself as author of this file :-)
15348
15349 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15350
15351         * class.cs: fixed compilation on windoze.
15352
15353 2002-08-03  Martin Baulig  <martin@gnome.org>
15354
15355         * interface.cs (Interface.GetInterfaceBases): Check whether all
15356         base interfaces are at least as accessible than the current one.
15357
15358         * class.cs (TypeContainer.GetClassBases): Check whether base types
15359         are at least as accessible than the current type.
15360         (TypeContainer.AsAccessible): Implemented and made non-static.
15361         (MemberBase.CheckParameters): Report errors if the accessibility
15362         checks fail.
15363
15364         * delegate.cs (Delegate.Delegate): The default visibility is
15365         internal for top-level types and private for nested types.
15366         (Delegate.Define): Report errors if the accessibility checks fail.
15367
15368         * enum.cs (Enum.Enum): The default visibility is internal for
15369         top-level types and private for nested types.
15370         (Enum.DefineType): Compute the correct visibility.
15371
15372         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15373         function which takes a `bool is_toplevel' instead of a TypeContainer.
15374
15375         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15376         builtin type.
15377
15378 2002-08-02  Martin Baulig  <martin@gnome.org>
15379
15380         * expression.cs (LocalVariableReferenc): Added constructor which
15381         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15382         (LocalVariableReference.IsReadOnly): New property.
15383         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15384         variable is readonly, use our own readonly flag to do this; you can
15385         use the new constructor to get a writable reference to a read-only
15386         variable.
15387
15388         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15389         reference to the local variable.
15390
15391 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * rootcontext.cs (ResolveCore): Also include System.Exception
15394
15395         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15396         we reach an EmptyStatement.
15397
15398         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15399         is also fine.
15400
15401         * expression.cs (Binary.ResolveOperator): Check error result in
15402         two places.
15403
15404         use brtrue/brfalse directly and avoid compares to null.
15405
15406 2002-08-02  Martin Baulig  <martin@gnome.org>
15407
15408         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15409         Fixes bug #28407, added test-155.cs.
15410
15411 2002-08-01  Martin Baulig  <martin@gnome.org>
15412
15413         * class.cs (Event.EmitDefaultMethod): Make this work with static
15414         events.  Fixes #28311, added verify-3.cs.
15415
15416 2002-08-01  Martin Baulig  <martin@gnome.org>
15417
15418         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15419         `is_disposable' fields.
15420         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15421         `hm.is_disposable' if we're using the collection pattern.
15422         (Foreach.EmitCollectionForeach): Use the correct type for the
15423         enumerator's local variable, only emit the try/finally block if
15424         necessary (fixes #27713).
15425
15426 2002-08-01  Martin Baulig  <martin@gnome.org>
15427
15428         * ecore.cs (Expression.report118): Renamed to Error118 and made
15429         it public static.
15430
15431         * statement.cs (Throw.Resolve): Check whether the expression is of
15432         the correct type (CS0118) and whether the type derives from
15433         System.Exception (CS0155).
15434         (Catch.Resolve): New method.  Do the type lookup here and check
15435         whether it derives from System.Exception (CS0155).
15436         (Catch.CatchType, Catch.IsGeneral): New public properties.
15437
15438         * typemanager.cs (TypeManager.exception_type): Added.
15439
15440 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15441
15442         * driver.cs: Updated About function.
15443
15444 2002-07-31  Martin Baulig  <martin@gnome.org>
15445
15446         Implemented Control Flow Analysis.
15447
15448         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15449         (EmitContext.CurrentBranching): Added.
15450         (EmitContext.StartFlowBranching): Added.
15451         (EmitContext.EndFlowBranching): Added.
15452         (EmitContext.KillFlowBranching): Added.
15453         (EmitContext.IsVariableAssigned): Added.
15454         (EmitContext.SetVariableAssigned): Added.
15455         (EmitContext.IsParameterAssigned): Added.
15456         (EmitContext.SetParameterAssigned): Added.
15457         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15458         Added control flow analysis stuff here.
15459
15460         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15461         resolve the expression as lvalue.
15462         (LocalVariableReference.DoResolve): Check whether the variable has
15463         already been assigned.
15464         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15465         the parameter as assigned here.
15466         (ParameterReference.DoResolve): Check whether the parameter has already
15467         been assigned.
15468         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15469         expression as lvalue.
15470
15471         * statement.cs (FlowBranching): New class for the flow analysis code.
15472         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15473         (LabeledStatement.IsDefined): New public property.
15474         (LabeledStatement.AddUsageVector): New public method to tell flow
15475         analyis that the label may be reached via a forward jump.
15476         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15477         flow analysis.
15478         (VariableInfo.Number): New public field.  This is used by flow analysis
15479         to number all locals of a block.
15480         (Block.CountVariables): New public property.  This is the number of
15481         local variables in this block (including the locals from all parent
15482         blocks).
15483         (Block.EmitMeta): Number all the variables.
15484
15485         * statement.cs: Added flow analysis support to all classes.
15486
15487 2002-07-31  Martin Baulig  <martin@gnome.org>
15488
15489         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15490         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15491         then use this argument.
15492
15493         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15494
15495         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15496         use this to specify /define options.
15497
15498 2002-07-29  Martin Baulig  <martin@gnome.org>
15499
15500         * statement.cs (Fixed): Moved all code that does variable lookups
15501         and resolvings from Emit to Resolve.
15502
15503         * statement.cs (For): Moved all code that does variable lookups
15504         and resolvings from Emit to Resolve.
15505
15506         * statement.cs (Using): Moved all code that does variable lookups
15507         and resolvings from Emit to Resolve.
15508
15509 2002-07-29  Martin Baulig  <martin@gnome.org>
15510
15511         * attribute.cs (Attribute.Resolve): Explicitly catch a
15512         System.NullReferenceException when creating the
15513         CustromAttributeBuilder and report a different warning message.
15514
15515 2002-07-29  Martin Baulig  <martin@gnome.org>
15516
15517         * support.cs (ParameterData.ParameterName): Added method to
15518         get the name of a parameter.
15519
15520         * typemanager.cs (TypeManager.IsValueType): New public method.
15521
15522 2002-07-29  Martin Baulig  <martin@gnome.org>
15523
15524         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15525         is a flag which specifies that it's either ref or out.
15526         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15527         the out parameter to `out Parameter.Modifier mod', also set the
15528         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15529
15530         * support.cs (InternalParameters.ParameterModifier): Distinguish
15531         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15532         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15533
15534         * expression.cs (Argument.GetParameterModifier): Distinguish
15535         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15536         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15537
15538 2002-07-29  Martin Baulig  <martin@gnome.org>
15539
15540         * expression.cs (ParameterReference.ParameterReference): Added
15541         `Location loc' argument to the constructor.
15542
15543         * cs-parser.jay: Pass location to ParameterReference.
15544
15545 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * statement.cs (Try): Initialize the location.
15548
15549         * cs-parser.jay: pass location to Try.
15550
15551         * expression.cs (Unary.Reduce): Change the prototype to return
15552         whether a constant fold could be performed or not.  The result is
15553         returned in an out parameters.  In the case of Indirection and
15554         AddressOf, we want to perform the full tests.
15555
15556 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15557
15558         * statement.cs (Statement.Emit): Flag dead code.
15559
15560 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15561
15562         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15563
15564 2002-07-27  Martin Baulig  <martin@gnome.org>
15565
15566         * class.cs (MethodData.Define): Put back call to
15567         TypeManager.AddMethod(), accidentally commented this out.
15568
15569         * report.cs (Debug): New public method to print debugging information,
15570         this is `[Conditional ("DEBUG")]'.
15571
15572 2002-07-26  Martin Baulig  <martin@gnome.org>
15573
15574         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15575         (switch_statement): Push the current_block to the switch_stack and
15576         pop it again when we're done with the switch.
15577         (switch_section): The new block is a child of the current_block.
15578         Fixes bug #24007, added test-152.cs.
15579
15580 2002-07-27  Martin Baulig  <martin@gnome.org>
15581
15582         * expression.cs (Invocation.EmitArguments): When calling a varargs
15583         function with only its fixed arguments, we need to pass an empty
15584         array.
15585
15586 2002-07-27  Martin Baulig  <martin@gnome.org>
15587
15588         Mono 0.13 has been released.
15589
15590 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * driver.cs: Rename --resource to --linkres, because that is what
15593         we do currently, we dont support --resource yet.
15594
15595         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15596
15597 2002-07-25  Martin Baulig  <martin@gnome.org>
15598
15599         * class.cs (MethodData): New public class.  This is a `method builder'
15600         class for a method or one accessor of a Property/Indexer/Event.
15601         (MethodData.GetMethodFlags): Moved here from MemberBase.
15602         (MethodData.ApplyAttributes): Likewise.
15603         (MethodData.ApplyObsoleteAttribute): Likewise.
15604         (MethodData.ApplyConditionalAttribute): Likewise.
15605         (MethodData.ApplyDllImportAttribute): Likewise.
15606         (MethodData.CheckAbstractAndExternal): Likewise.
15607         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15608         (MethodData.Emit): Formerly known as Method.Emit().
15609         (MemberBase): Moved everything which was specific to a single
15610         accessor/method to MethodData.
15611         (Method): Create a new MethodData and call Define() and Emit() on it.
15612         (Property, Indexer, Event): Create a new MethodData objects for each
15613         accessor and call Define() and Emit() on them.
15614
15615 2002-07-25  Martin Baulig  <martin@gnome.org>
15616
15617         Made MethodCore derive from MemberBase to reuse the code from there.
15618         MemberBase now also checks for attributes.
15619
15620         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15621         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15622         as virtual.
15623         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15624         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15625         (MemberBase.ApplyAttributes): New virtual method; applies the
15626         attributes to a method or accessor.
15627         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15628         (MemberBase.ApplyConditionalAttribute): Likewise.
15629         (MemberBase.ApplyDllImportAttribute): Likewise.
15630         (MemberBase.CheckAbstractAndExternal): Likewise.
15631         (MethodCore.ParameterTypes): This is now a property instead of a
15632         method, it's initialized from DoDefineParameters().
15633         (MethodCore.ParameterInfo): Removed the set accessor.
15634         (MethodCore.DoDefineParameters): New protected virtual method to
15635         initialize ParameterTypes and ParameterInfo.
15636         (Method.GetReturnType): We can now simply return the MemberType.
15637         (Method.GetMethodFlags): Override the MemberBase version and add
15638         the conditional flags.
15639         (Method.CheckBase): Moved some code from Define() here, call
15640         DoDefineParameters() here.
15641         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15642         here to avoid some larger code duplication.
15643         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15644         ensure that abstract and external accessors don't declare a body.
15645
15646         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15647         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15648         lookup in the attribute's parent classes, so we need to abort as soon
15649         as we found the first match.
15650         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15651         the attribute has no arguments.
15652
15653         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15654         of a Method.
15655
15656 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15657
15658         * cs-parser.jay: reverted previous patch.
15659
15660 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15661
15662         * cs-parser.jay: fixed bug #22119.
15663
15664 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15665
15666         * attribute.cs: fixed compilation. The error was:
15667         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15668         be assigned to before control leaves the current method."
15669         [FIXME:  Filed as bug #28186: MCS must report this error.]
15670
15671 2002-07-25  Martin Baulig  <martin@gnome.org>
15672
15673         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15674         method to pull the condition name ouf of a Conditional attribute.
15675         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15676         the obsolete message and error flag out of an Obsolete attribute.
15677
15678         * class.cs (Method.GetMethodFlags): New public method to get the
15679         TypeManager.MethodFlags for this method.
15680         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15681         private methods.
15682         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15683         if we're overriding a virtual function, set the new private variable
15684         `parent_method'; call the new TypeManager.AddMethod().
15685
15686         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15687         the MethodBuilder and the Method in a PtrHashtable.
15688         (TypeManager.builder_to_method): Added for this purpose.
15689         (TypeManager.MethodFlags): Added IsObsoleteError.
15690         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15691         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15692         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15693         the message from the attribute.
15694
15695 2002-07-24  Martin Baulig  <martin@gnome.org>
15696
15697         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15698         preprocessor directives, ensure that the argument to #define/#undef is
15699         exactly one identifier and that it's actually an identifier.
15700
15701         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15702         did not work ....
15703
15704 2002-07-24  Martin Baulig  <martin@gnome.org>
15705
15706         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15707         initialize it to TypeManager.object_type in the constructor.
15708         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15709         of the `hm.get_current' method if we're using the collection pattern.
15710         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15711         for the explicit conversion to make it work when we're using the collection
15712         pattern and the `Current' property has a different return type than `object'.
15713         Fixes #27713.
15714
15715 2002-07-24  Martin Baulig  <martin@gnome.org>
15716
15717         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15718         does not match, but don't report any errors.  This method is called in
15719         order for all methods in a MethodGroupExpr until a matching method is
15720         found, so we don't want to bail out if the first method doesn't match.
15721         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15722         matches, report the 123.  Fixes #28070.
15723
15724 2002-07-24  Martin Baulig  <martin@gnome.org>
15725
15726         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15727         TypeManager.TypeToCoreType() to the top of the method so the
15728         following equality checks will work.  Fixes #28107.
15729
15730 2002-07-24  Martin Baulig  <martin@gnome.org>
15731
15732         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15733         operand is of type uint, and the other operand is of type sbyte,
15734         short or int, the operands are converted to type long." -
15735         Actually do what this comment already told us.  Fixes bug #28106,
15736         added test-150.cs.
15737
15738 2002-07-24  Martin Baulig  <martin@gnome.org>
15739
15740         * class.cs (MethodBase): New abstract class.  This is now a base
15741         class for Property, Indexer and Event to avoid some code duplication
15742         in their Define() and DefineMethods() methods.
15743         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15744         generic methods for Define() and DefineMethods().
15745         (FieldBase): Derive from MemberBase, not MemberCore.
15746         (Property): Derive from MemberBase, not MemberCore.
15747         (Property.DefineMethod): Moved all the code from this method to the
15748         new MethodBase.DefineAccessor(), just call it with appropriate
15749         argumetnts.
15750         (Property.Define): Call the new Property.DoDefine(), this does some
15751         sanity checks and we don't need to duplicate the code everywhere.
15752         (Event): Derive from MemberBase, not MemberCore.
15753         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15754         accessors, this will also make them work with interface events.
15755         (Indexer): Derive from MemberBase, not MemberCore.
15756         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15757         (Indexer.Define): Use the new MethodBase functions.
15758
15759         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15760         argument to the constructor.
15761         (Interface.FindMembers): Added support for interface events.
15762         (Interface.PopluateEvent): Implemented.
15763
15764         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15765
15766 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15769         but this is required to check for a method name being the same as
15770         the containing class.  
15771
15772         Handle this now.
15773
15774 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15775
15776         * interface.cs: initialize variable.
15777
15778 2002-07-23  Martin Baulig  <martin@gnome.org>
15779
15780         Implemented the IndexerName attribute in interfaces.
15781
15782         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15783         name if this is an explicit interface implementation.
15784         (Indexer.InterfaceIndexerName): New public variable.  If we're
15785         implementing an interface indexer, this is the IndexerName in that
15786         interface.  Otherwise, it's the IndexerName.
15787         (Indexer.DefineMethod): If we're implementing interface indexer,
15788         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15789         and Pending.ImplementIndexer methods.
15790         (Indexer.Define): Also define the PropertyBuilder if we're
15791         implementing an interface indexer and this is neither an explicit
15792         interface implementation nor do the IndexerName match the one in
15793         the interface.
15794
15795         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15796         If a method is defined here, then we always need to create a proxy
15797         for it.  This is used when implementing interface indexers.
15798         (Pending.IsInterfaceIndexer): New public method.
15799         (Pending.ImplementIndexer): New public method.
15800         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15801         This is used when implementing interface indexers to define a proxy
15802         if necessary.
15803         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15804         define a proxy if necessary.
15805
15806         * interface.cs (Interface.IndexerName): New public variable.
15807         (Interface.PopulateIndexer): Set the IndexerName.
15808         (Interface.DefineIndexers): New private method.  Populate all the
15809         indexers and make sure their IndexerNames match.
15810
15811         * typemanager.cs (IndexerPropertyName): Added support for interface
15812         indexers.
15813
15814 2002-07-22  Martin Baulig  <martin@gnome.org>
15815
15816         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15817         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15818         ret if HasReturnLabel.
15819         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15820         variables.
15821
15822         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15823         and set the ec.LoopBeginTryCatchLevel.
15824         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15825         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15826         the current ec.TryCatchLevel, the branch goes out of an exception
15827         block.  In this case, we need to use Leave and not Br.
15828
15829 2002-07-22  Martin Baulig  <martin@gnome.org>
15830
15831         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15832         block unless the block does not always return or it is contained in
15833         another try { ... } catch { ... } block.  Fixes bug #26506.
15834         Added verify-1.cs to the test suite.
15835
15836 2002-07-22  Martin Baulig  <martin@gnome.org>
15837
15838         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15839         then we do not always return.  Fixes bug #24985.
15840
15841 2002-07-22  Martin Baulig  <martin@gnome.org>
15842
15843         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15844         lookup on a per-class level; ie. walk up the class hierarchy until we
15845         found at least one applicable method, then choose the best among them.
15846         Fixes bug #24463 and test-29.cs.
15847
15848 2002-07-22  Martin Baulig  <martin@gnome.org>
15849
15850         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15851         return types of the methods.  The return type is not part of the
15852         signature and we must not check it to make the `new' modifier work.
15853         Fixes bug #27999, also added test-147.cs.
15854         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15855
15856         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15857         on the method's return type.
15858
15859 2002-07-21  Martin Baulig  <martin@gnome.org>
15860
15861         * assign.cs: Make this work if the rightmost source is a constant and
15862         we need to do an implicit type conversion.  Also adding a few more tests
15863         to test-38.cs which should have caught this.
15864
15865         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15866         target in the makefile for this.  The makefile.gnu is primarily intended
15867         for end-users who don't want to debug the compiler.
15868
15869 2002-07-21  Martin Baulig  <martin@gnome.org>
15870
15871         * assign.cs: Improved the Assign class so it can now handle embedded
15872         assignments (X = Y = Z = something).  As a side-effect this'll now also
15873         consume less local variables.  test-38.cs now passes with MCS, added
15874         a few new test cases to that test.
15875
15876 2002-07-20  Martin Baulig  <martin@gnome.org>
15877
15878         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15879         instructions.  Fixes bug #27977, also added test-146.cs.
15880
15881 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15882
15883         * cs-tokenizer.cs: fixed getHex ().
15884
15885 2002-07-19  Martin Baulig  <martin@gnome.org>
15886
15887         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15888         not Type.GetType() to lookup the array type.  This is needed when
15889         we're constructing an array of a user-defined type.
15890         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15891         single-dimensional arrays, but also for single-dimensial arrays of
15892         type decimal.
15893
15894 2002-07-19  Martin Baulig  <martin@gnome.org>
15895
15896         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15897         this function is called, it's not allowed to share LocalBuilders
15898         among ILGenerators.
15899
15900 2002-07-19  Martin Baulig  <martin@gnome.org>
15901
15902         * expression.cs (Argument.Resolve): Report an error 118 when trying
15903         to pass a type as argument.
15904
15905 2002-07-18  Martin Baulig  <martin@gnome.org>
15906
15907         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15908         Conv_R_Un for the signed `long' type.
15909
15910 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15913         `expr' for the temporary result, as that will fail if we do
15914         multiple resolves on the same expression.
15915
15916 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15917
15918         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15919         ec.TypeContainer for looking up aliases. 
15920
15921         * class.cs (TypeContainer): Remove LookupAlias from here.
15922
15923         * decl.cs (DeclSpace); Move here.
15924
15925 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15926
15927         * class.cs (FindMembers): Only call filter if the constructor
15928         bulider is not null.
15929
15930         Also handle delegates in `NestedTypes' now.  Now we will perform
15931         type lookups using the standard resolution process.  This also
15932         fixes a bug.
15933
15934         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15935         This uses Expressions (the limited kind that can be parsed by the
15936         tree) instead of strings.
15937
15938         * expression.cs (ComposedCast.ToString): Implement, used to flag
15939         errors since now we have to render expressions.
15940
15941         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15942         FormArrayType. 
15943
15944         * ecore.cs (SimpleName.ToString): ditto.
15945
15946         * cs-parser.jay: Instead of using strings to assemble types, use
15947         Expressions to assemble the type (using SimpleName, ComposedCast,
15948         MemberAccess).  This should fix the type lookups in declarations,
15949         because we were using a different code path for this.
15950
15951         * statement.cs (Block.Resolve): Continue processing statements
15952         even when there is an error.
15953
15954 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15955
15956         * class.cs (Event.Define): Also remove the `remove' method from
15957         the list of pending items.
15958
15959         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15960         generate more compact code. 
15961
15962 2002-07-17  Martin Baulig  <martin@gnome.org>
15963
15964         * const.cs (Const.LookupConstantValue): Add support for constant
15965         `unchecked' and `checked' expressions.
15966         Also adding test case test-140.cs for this.
15967
15968 2002-07-17  Martin Baulig  <martin@gnome.org>
15969
15970         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15971         check whether mi.ReturnType implements the IEnumerator interface; the
15972         `==' and the IsAssignableFrom() will fail in this situation.
15973
15974 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15975
15976         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15977         here too.
15978
15979 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15980
15981         * expression.cs: fixed bug #27811.
15982
15983 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15984
15985         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15986         Molaro: when we are a ref, the value already contains a pointer
15987         value, do not take the address of it.
15988
15989 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15990         * removed mb-parser.jay and mb-tokenizer.cs
15991
15992 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15993
15994         * expression.cs: check against the building corlib void type.
15995
15996 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15997
15998         * ecore.cs: fix for valuetype static readonly fields: when 
15999         initializing them, we need their address, not the address of a copy.
16000
16001 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16002
16003         * typemanager.cs: register also enum_type in corlib.
16004
16005 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16006
16007         * class.cs: allow calling this (but not base) initializers in structs.
16008
16009 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16010
16011         * ecore.cs: make sure we compare against the building base types
16012         in GetTypeSize ().
16013
16014 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16015
16016         * typemanager.cs: fix TypeToCoreType() to handle void and object
16017         (corlib gets no more typerefs after this change).
16018
16019 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * expression.cs (ArrayCreation.EmitArrayArguments): use
16022         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16023
16024         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16025         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16026         array indexes, the runtime actually forbids them.
16027
16028         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16029         for array arguments here.
16030
16031         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16032         instead of the default for ValueTypes.
16033
16034         (New.DoEmit): Use IsValueType instead of
16035         IsSubclassOf (value_type)
16036         (New.DoResolve): ditto.
16037         (Invocation.EmitCall): ditto.
16038
16039         * assign.cs (Assign): ditto.
16040
16041         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16042         Statements *are* currently doing part of their resolution during
16043         Emit.  
16044
16045         Expressions do always resolve during resolve, but statements are
16046         only required to propagate resolution to their children.
16047
16048 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16051
16052         (LoadAssembly): Do not add the dll if it is already specified
16053
16054         (MainDriver): Add the System directory to the link path at the end,
16055         after all the other -L arguments. 
16056
16057         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16058         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16059         ldelem.u1) and using the opposite for sbytes.
16060
16061         This fixes Digger, and we can finally run it.
16062
16063         * driver.cs (UnixParseOption): Move the option parsing here.  
16064         (CSCParseOption): Implement CSC-like parsing of options.
16065
16066         We now support both modes of operation, the old Unix way, and the
16067         new CSC-like way.  This should help those who wanted to make cross
16068         platform makefiles.
16069
16070         The only thing broken is that /r:, /reference: and /lib: are not
16071         implemented, because I want to make those have the same semantics
16072         as the CSC compiler has, and kill once and for all the confussion
16073         around this.   Will be doing this tomorrow.
16074
16075         * statement.cs (Unsafe.Resolve): The state is checked during
16076         resolve, not emit, so we have to set the flags for IsUnsfe here.
16077
16078 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16079
16080         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16081         not catch the Error_ObjectRefRequired in SimpleName (as it is
16082         possible to have a class/instance variable name that later gets
16083         deambiguated), we have to check this here.      
16084
16085 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16086
16087         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16088         make static and put into Expression.
16089
16090         (Event.Define): Register the private field of the event with the 
16091         TypeManager so that GetFieldFromEvent can get at it.
16092
16093         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16094         keep track of the private field associated with an event which
16095         has no accessors.
16096
16097         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16098         private field.
16099
16100         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16101
16102 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16103
16104         * expression.cs (Binary.EmitBranchable): this routine emits the
16105         Binary expression in a branchable context.  This basically means:
16106         we need to branch somewhere, not just get the value on the stack.
16107
16108         This works together with Statement.EmitBoolExpression.
16109
16110         * statement.cs (Statement.EmitBoolExpression): Use
16111         EmitBranchable. 
16112
16113 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * statement.cs (For): Reduce the number of jumps in loops.
16116
16117         (For): Implement loop inversion for the For statement.
16118
16119         (Break): We can be breaking out of a Try/Catch controlled section
16120         (foreach might have an implicit try/catch clause), so we need to
16121         use Leave instead of Br.
16122
16123         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16124         now).  If the instace expression supports IMemoryLocation, we use
16125         the AddressOf method from the IMemoryLocation to extract the
16126         address instead of emitting the instance.
16127
16128         This showed up with `This', as we were emitting the instance
16129         always (Emit) instead of the Address of This.  Particularly
16130         interesting when This is a value type, as we dont want the Emit
16131         effect (which was to load the object).
16132
16133 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16134
16135         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16136
16137         * statement.cs (Checked): Set the CheckedState during the resolve
16138         process too, as the ConvCast operations track the checked state on
16139         the resolve process, and not emit.
16140
16141         * cs-parser.jay (namespace_member_declaration): Flag that we have
16142         found a declaration when we do.  This is used to flag error 1529
16143
16144         * driver.cs: Report ok when we display the help only.
16145
16146 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16147
16148         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16149
16150 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16151
16152         * cs-tokenizer.cs (define): We also have to track locally the
16153         defines.  AllDefines is just used for the Conditional Attribute,
16154         but we also need the local defines for the current source code. 
16155
16156 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16157
16158         * statement.cs (While, For, Do): These loops can exit through a
16159         Break statement, use this information to tell whether the
16160         statement is the last piece of code.
16161
16162         (Break): Flag that we break.
16163
16164         * codegen.cs (EmitContexts): New `Breaks' state variable.
16165
16166 2002-07-03  Martin Baulig  <martin@gnome.org>
16167
16168         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16169         modifiers in method declarations in structs.  Otherwise, you won't
16170         be able to override things like Object.Equals().
16171
16172 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16173
16174         * class.cs (Method, Property, Indexer): Do not allow the public
16175         modifier to be used in explicit interface implementations.
16176
16177         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16178         override modifiers in method declarations in structs
16179
16180 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16181
16182         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16183         integer or real overflow, report an error
16184
16185 2002-07-02  Martin Baulig  <martin@gnome.org>
16186
16187         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16188         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16189         to tell the runtime about our newly created System.Object and
16190         System.ValueType types.
16191
16192 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16193
16194         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16195         struct instead of Ldarg/Starg.
16196
16197 2002-07-02  Martin Baulig  <martin@gnome.org>
16198
16199         * expression.cs (Indirection.Indirection): Call
16200         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16201
16202 2002-07-02  Martin Baulig  <martin@gnome.org>
16203
16204         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16205         ValueType, call TypeManager.TypeToCoreType() on it.
16206         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16207         the OpCodes.Newarr argument.
16208
16209 2002-07-02  Martin Baulig  <martin@gnome.org>
16210
16211         * expression.cs (Invocation.EmitCall): When compiling corlib,
16212         replace all calls to the system's System.Array type to calls to
16213         the newly created one.
16214
16215         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16216         System.Array methods.
16217         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16218         from the system's System.Array type which must be replaced.
16219
16220 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16221
16222         * typemanager.cs: load unverifiable_code_ctor so we can build
16223         corlib using the correct type. Avoid using GetTypeCode() with
16224         TypeBuilders.
16225         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16226         TypeManager.object_type to allow building corlib.
16227
16228 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16229
16230         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16231
16232 2002-07-01  Martin Baulig  <martin@gnome.org>
16233
16234         * class.cs: Make the last change actually work, we need to check
16235         whether `ifaces != null' to avoid a crash.
16236
16237 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16238
16239         * class.cs: when we build structs without fields that implement
16240         interfaces, we need to add the interfaces separately, since there is
16241         no API to both set the size and add the interfaces at type creation
16242         time.
16243
16244 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16245
16246         * expression.cs: the dimension arguments to the array constructors
16247         need to be converted if they are a long.
16248
16249 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16250
16251         * class.cs: don't emit ldarg.0 if there is no parent constructor
16252         (fixes showstopper for corlib).
16253
16254 2002-06-29  Martin Baulig  <martin@gnome.org>
16255
16256         MCS now compiles corlib on GNU/Linux :-)
16257
16258         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16259         ie. check for MethodImplOptions.InternalCall.
16260
16261         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16262         and TypeManager.attribute_type are null, so we must explicitly check
16263         whether parent is not null to find out whether it's an attribute type.
16264         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16265         and SetBuilder, not only if the property is neither abstract nor external.
16266         This is necessary to set the MethodImplOptions on the accessor methods.
16267         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16268         SetBuilder, see Property.Emit().
16269
16270         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16271         populate "System.Object", "System.ValueType" and "System.Attribute" since
16272         they've already been populated from BootCorlib_PopulateCoreTypes().
16273
16274 2002-06-29  Martin Baulig  <martin@gnome.org>
16275
16276         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16277         is the NullLiteral, we also need to make sure that target_type is not
16278         an enum type.   
16279
16280 2002-06-29  Martin Baulig  <martin@gnome.org>
16281
16282         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16283         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16284         before calling BootstrapCorlib_ResolveDelegate ().
16285
16286 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16287
16288         * statement.cs: fixed build-breaker. All tests passed ok.
16289
16290 2002-06-27  Martin Baulig  <martin@gnome.org>
16291
16292         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16293         for System.Decimal when compiling corlib.
16294
16295 2002-06-27  Martin Baulig  <martin@gnome.org>
16296
16297         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16298         switch blocks which contain nothing but a default clause.
16299
16300 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16301
16302        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16303
16304 2002-06-27  Martin Baulig  <martin@gnome.org>
16305
16306         * ecore.cs (PropertyExpr.PropertyExpr): Call
16307         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16308
16309         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16310         is already a TypeBuilder.
16311
16312 2002-06-27  Martin Baulig  <martin@gnome.org>
16313
16314         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16315         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16316         the "from an array-type to System.Array" case.  This makes it work
16317         when compiling corlib.
16318
16319 2002-06-27  Martin Baulig  <martin@gnome.org>
16320
16321         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16322         non-static PropertyExpr, set its InstanceExpression.  This makes
16323         the `ICollection.Count' property work in System/Array.cs.
16324
16325 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16326
16327         * driver.cs: Made error handling more consistent.  Errors now
16328         tracked by Report class, so many methods which used to return int
16329         now return void.  Main() now prints success/failure and 
16330         errors/warnings message.
16331
16332         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16333         the magic number return values (123 and 124).  Now, if the
16334         expected error occurs, the compiler exits with success (exit value
16335         0).  If the compilation completes without seeing that particular
16336         error, the compiler exits with failure (exit value 1).  The
16337         makefile in mcs/errors has been changed to handle the new behaviour.
16338
16339         * report.cs: Made 'expected error' number a property and renamed
16340         it from 'Probe' to 'ExpectedError'.
16341
16342         * genericparser.cs: Removed error handling support, since it is
16343         now all done by Report class.
16344
16345         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16346         class, so parse() no longer returns an int.
16347
16348         * namespace.cs: Use Report.Error instead of GenericParser.error
16349
16350 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16353         TypeContainer.AddOperator): At the front of the list put the
16354         explicit implementations, so they get resolved/defined first. 
16355
16356 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16357
16358         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16359         interface type is implemented by this TypeContainer.  Used during
16360         explicit interface implementation.
16361
16362         (Property.Define, Indexer.Define, Method.Define): Validate that
16363         the given interface in the explicit implementation is one of the
16364         base classes for the containing type.
16365
16366         Also if we are explicitly implementing an interface, but there is
16367         no match in the pending implementation table, report an error.
16368
16369         (Property.Define): Only define the property if we are
16370         not explicitly implementing a property from an interface.  Use the
16371         correct name also for those properties (the same CSC uses,
16372         although that is really not needed).
16373
16374         (Property.Emit): Do not emit attributes for explicitly implemented
16375         properties, as there is no TypeBuilder.
16376
16377         (Indexer.Emit): ditto.
16378
16379         Hiding then means that we do not really *implement* a pending
16380         implementation, which makes code fail.
16381
16382 2002-06-22  Martin Baulig  <martin@gnome.org>
16383
16384         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16385         the return value of Object.GetType().  [FIXME: we need to do this whenever
16386         we get a type back from the reflection library].
16387
16388 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16389
16390         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16391
16392 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * attribute.cs: Return null if we can not look up the type.
16395
16396         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16397         the interface types found.
16398
16399         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16400         interface types found.
16401
16402         * typemanager.cs (GetInterfaces): Make this routine returns alll
16403         the interfaces and work around the lame differences between
16404         System.Type and System.Reflection.Emit.TypeBuilder in the results
16405         result for GetInterfaces.
16406
16407         (ExpandInterfaces): Given an array of interface types, expand and
16408         eliminate repeated ocurrences of an interface.  This expands in
16409         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16410         be IA, IB, IC.
16411
16412 2002-06-21  Martin Baulig  <martin@gnome.org>
16413
16414         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16415         on System.Enum.
16416
16417 2002-06-21  Martin Baulig  <martin@gnome.org>
16418
16419         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16420         and called with one of the core types, return the corresponding typebuilder for
16421         that type.
16422
16423         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16424         element type.
16425
16426 2002-06-21  Martin Baulig  <martin@gnome.org>
16427
16428         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16429         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16430         (Expression.ConvertReferenceExplicit): Likewise.
16431
16432         * expression.cs (ElementAccess.DoResolve): Likewise.
16433         (ElementAccess.DoResolveLValue): Likewise.
16434
16435 2002-06-10  Martin Baulig  <martin@gnome.org>
16436
16437         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16438         add the "value" parameter to the parameter list.
16439
16440         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16441         to our caller.
16442
16443 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16446         the argument to an int, uint, long or ulong, per the spec.  Also
16447         catch negative constants in array creation.
16448
16449 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16450
16451         * class.cs: do not allow the same interface to appear twice in
16452         the definition list.
16453
16454 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16455
16456         * ecore.cs: don't use ldlen with System.Array.
16457
16458 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16459
16460         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16461
16462 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16463
16464         * modifiers.cs: produce correct field attributes for protected
16465         internal. Easy fix so miguel can work on ther harder stuff:-)
16466
16467 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * pending.cs: New file.  Move the code from class.cs here.
16470         Support clearning the pending flag for all methods (when not doing
16471         explicit interface implementation).
16472
16473 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16474
16475         * rootcontext.cs: added a couple more types needed to bootstrap.
16476
16477 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16478
16479         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16480         constructor in the type, instead of any constructor in the type
16481         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16482         a bug in the Mono runtime when applying the params attribute). 
16483
16484 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16485         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16486
16487 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16488
16489         * expression.cs (Unary.ResolveOperator): Use TypeManager
16490         to resolve the type.
16491
16492 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16493
16494         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16495         attached.
16496
16497         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16498         with each member too.
16499
16500         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16501         field builders too - this takes care of the enum member case.
16502
16503 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16504
16505         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16506         address-of operator on both value types and pointers.
16507
16508 2002-06-10  Martin Baulig  <martin@gnome.org>
16509
16510         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16511         PropertyBuilder to the `property_builders' list.
16512
16513         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16514         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16515         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16516         find any indexers which are inherited from an interface.
16517
16518 2002-06-09  Martin Baulig  <martin@gnome.org>
16519
16520         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16521         the same type as the constant if necessary.  There's also a test-130.cs
16522         for this.
16523
16524         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16525
16526         * typemanager.cs (TypeManager.ChangeType): Previously known as
16527         Enum.ChangeEnumType().
16528
16529 2002-06-09  Martin Baulig  <martin@gnome.org>
16530
16531         * expression.cs (Cast.TryReduce): Added support for consts.
16532
16533 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16534
16535         * class.cs (Accessor): Hold attributes information so we can pass
16536         it along.
16537
16538         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16539         Modify to pass in attributes attached to the methods.
16540
16541         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16542
16543         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16544         to handle the Accessor kind :-)
16545
16546         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16547
16548 2002-06-08  Martin Baulig  <martin@gnome.org>
16549
16550         * expression.cs (Unary.TryReduceNegative): Added support for
16551         ULongConstants.
16552
16553 2002-06-08  Martin Baulig  <martin@gnome.org>
16554
16555         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16556         name can't be found in the `defined_names' - the caller will do a
16557         MemberLookup in this case and thus find methods in System.Enum
16558         such as Enum.IsDefined().
16559
16560 2002-06-08  Martin Baulig  <martin@gnome.org>
16561
16562         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16563         Convert.ChangeType() which works with TypeBuilder created types.
16564         (Enum.LookupEnumValue, Enum.Define): Use it here.
16565
16566         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16567         `TypeBuilder.BaseType != null' check.
16568         (TypeContainer.FindMembers): Only lookup parent members if we
16569         actually have a parent.
16570         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16571         (ConstructorInitializer.Resolve): Likewise.
16572
16573         * interface.cs (Interface.FindMembers): Added
16574         `TypeBuilder.BaseType != null' check.
16575
16576         * rootcontext.cs (RootContext.ResolveCore): Added
16577         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16578         classes_second_stage.
16579
16580         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16581         debug_type and trace_type when compiling with --nostdlib.       
16582
16583 2002-06-07  Martin Baulig  <martin@gnome.org>
16584
16585         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16586         (AddField): Set it to true when adding a non-static field.
16587         (DefineType): Use `have_nonstatic_fields' to find out whether we
16588         have non-static fields, not `Fields != null'.
16589
16590 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16591
16592         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16593         dereferencing a null on the static-field code path)
16594
16595 2002-05-30  Martin Baulig  <martin@gnome.org>
16596
16597         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16598         to take command line arguments.  Use reflection to call the new
16599         custom `Initialize' function on the symbol writer and pass it the
16600         command line arguments.
16601
16602         * driver.cs (--debug-args): New command line argument to pass command
16603         line arguments to the symbol writer.
16604
16605 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16608         the target type for indexers and properties.  Thanks to Joe for
16609         catching this.
16610
16611 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16612
16613         * typemanager.cs (MethodFlags): returns the method flags
16614         (Obsolete/ShouldIgnore) that control warning emission and whether
16615         the invocation should be made, or ignored. 
16616
16617         * expression.cs (Invocation.Emit): Remove previous hack, we should
16618         not do this on matching a base type, we should do this based on an attribute
16619
16620         Only emit calls to System.Diagnostics.Debug and
16621         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16622         on the command line.
16623
16624         * rootcontext.cs: Global settings for tracing and debugging.
16625
16626         * cs-tokenizer.cs (define): New utility function to track
16627         defines.   Set the global settings for TRACE and DEBUG if found.
16628
16629 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16630
16631         * interface.cs (Populate*): Pass in the TypeContainer as well as
16632         the DeclSpace as parameters so that we can create EmitContexts and
16633         then use that to apply attributes etc.
16634
16635         (PopulateMethod, PopulateEvent, PopulateProperty)
16636         (PopulateIndexer): Apply attributes everywhere.
16637
16638         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16639         etc.
16640
16641         (ApplyAttributes): Update accordingly.
16642
16643         We now apply interface attributes for all members too.
16644
16645 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16646
16647         * class.cs (Indexer.Define); Correctly check if we are explicit
16648         implementation (instead of checking the Name for a ".", we
16649         directly look up if the InterfaceType was specified).
16650
16651         Delay the creation of the PropertyBuilder.
16652
16653         Only create the PropertyBuilder if we are not an explicit
16654         interface implementation.   This means that explicit interface
16655         implementation members do not participate in regular function
16656         lookups, and hence fixes another major ambiguity problem in
16657         overload resolution (that was the visible effect).
16658
16659         (DefineMethod): Return whether we are doing an interface
16660         implementation. 
16661
16662         * typemanager.cs: Temporary hack until we get attributes in
16663         interfaces (Ravi is working on that) and we get IndexerName
16664         support in interfaces.
16665
16666         * interface.cs: Register the indexers as properties.
16667
16668         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16669         warning, I have verified that this is a bug in the .NET runtime
16670         (JavaScript suffers of the same problem).
16671
16672         * typemanager.cs (MemberLookup): When looking up members for
16673         interfaces, the parent of an interface is the implicit
16674         System.Object (so we succeed in searches of Object methods in an
16675         interface method invocation.  Example:  IEnumerable x;  x.ToString
16676         ()) 
16677
16678 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * class.cs (Event): Events should also register if they do
16681         implement the methods that an interface requires.
16682
16683         * typemanager.cs (MemberLookup); use the new GetInterfaces
16684         method. 
16685
16686         (GetInterfaces): The code used to lookup interfaces for a type is
16687         used in more than one place, factor it here. 
16688
16689         * driver.cs: Track the errors at the bottom of the file, we kept
16690         on going.
16691
16692         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16693         instance if the method we are calling is static!
16694
16695 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * attribute.cs (ApplyAttributes): Make this function filter out
16698         the IndexerName attribute (as that attribute in reality is never
16699         applied) and return the string constant for the IndexerName
16700         attribute. 
16701
16702         * class.cs (TypeContainer.Emit): Validate that all the indexers
16703         have the same IndexerName attribute, and if so, set the
16704         DefaultName attribute on the class. 
16705
16706         * typemanager.cs: The return value might contain other stuff (not
16707         only methods).  For instance, consider a method with an "Item"
16708         property and an Item method.
16709
16710         * class.cs: If there is a problem with the parameter types,
16711         return. 
16712
16713 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16714
16715         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16716         looks at user defined conversion after making a call to 
16717         StandardConversionExists - we need this for overload resolution.
16718
16719         * expression.cs : Update accordingly the various method calls.
16720
16721         This fixes 2 bugs filed against implicit user defined conversions 
16722
16723 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * statement.cs: Track the result of the assignment.
16726
16727 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16728
16729         * expression.cs (MemberAccess): Improved error reporting for
16730         inaccessible members.
16731
16732 2002-05-22  Martin Baulig  <martin@gnome.org>
16733
16734         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16735         itself with debugging support.
16736
16737 2002-05-22  Martin Baulig  <martin@gnome.org>
16738
16739         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16740         Removed, this isn't needed anymore.
16741
16742 2002-05-20  Martin Baulig  <martin@gnome.org>
16743
16744         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16745         be underlying type for an enum.
16746
16747 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16748
16749         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16750         that splits out the loading of just the core types.
16751
16752         * rootcontext.cs (ResolveCore): Split the struct resolution in
16753         two, so we can load the enumeration underlying types before any
16754         enums are used.
16755
16756         * expression.cs (Is): Bandaid until we fix properly Switch (see
16757         bug #24985 for details).
16758
16759         * typemanager.cs (ImplementsInterface): The hashtable will contain
16760         a null if there are no interfaces implemented.
16761
16762 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16763
16764         * cs-parser.jay (indexer_declarator): It is fine to have array
16765         parameters
16766
16767 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * typemanager.cs: (RegisterBuilder): New function used to register
16770         TypeBuilders that implement interfaces.  Since
16771         TypeBuilder.GetInterfaces (as usual) does not work with lame
16772         Reflection.Emit. 
16773         (AddUserType): register interfaces.
16774
16775         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16776         dealing with TypeBuilder.  Also, arrays are showing up as
16777         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16778         methods can not be invoked on them!
16779
16780         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16781         (ImplicitReferenceConversionExists): Split out from
16782         StandardConversionExists. 
16783
16784         * expression.cs (As): We were only implementing one of the three
16785         cases for the as operator.  We now implement them all.
16786         (Is): Implement the various other cases for Is as well.
16787
16788         * typemanager.cs (CACHE): New define used to control if we want or
16789         not the FindMembers cache.  Seems to have a negative impact on
16790         performance currently
16791
16792         (MemberLookup): Nested types have full acess to
16793         enclosing type members
16794
16795         Remove code that coped with instance/static returns for events, we
16796         now catch this in RealFindMembers.
16797
16798         (RealFindMembers): only perform static lookup if the instance
16799         lookup did not return a type or an event.  
16800
16801 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16802
16803         * assign.cs (CompoundAssign): We pass more semantic information
16804         now to Compound Assignments than we did before: now we have all
16805         the information at hand, and now we resolve the target *before* we
16806         do the expression expansion, which allows the "CacheValue" method
16807         to have the effect we intended (before, a [x] += 1 would generate
16808         two differen ArrayAccess expressions from the ElementAccess,
16809         during the resolution process).
16810
16811         (CompoundAssign.DoResolve): Resolve target and original_source here.
16812
16813 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16814
16815         * expression.cs (ArrayAccess): dropped debugging information. 
16816
16817         * typemanager.cs: Small bug fix: I was always returning i_members,
16818         instead of one of i_members or s_members (depending on which had
16819         the content).
16820
16821         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16822         method is invoked before any code generation takes place, and it
16823         is a mechanism to inform that the expression will be invoked more
16824         than once, and that the method should use temporary values to
16825         avoid having side effects
16826
16827         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16828
16829         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16830         implementation.
16831
16832         * expression.cs (Indirection, ArrayAccess): Add support for
16833         CacheTemporaries in these two bad boys. 
16834
16835         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16836         ldobj or ldind_ref.  
16837         (StoreFromPtr): Handle stobj as well.
16838
16839         * expression.cs (UnaryMutator): Share more code.
16840
16841         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16842         down: I was not tracking the Filter function as well, which
16843         was affecting the results of the cache.
16844
16845 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16846
16847         * attribute.cs: Remove the hack to handle the CharSet property on
16848         StructLayouts. 
16849
16850 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16851
16852         * attribute.cs (DoResolve): More uglyness, we now only try to
16853         resolve the attribute partially, to extract the CharSet
16854         information (only if we are a StructLayout attribute).  Otherwise 
16855
16856         (GetExtraTypeInfo): Add some code to conditionally kill in the
16857         future this.   I am more and more convinced that the .NET
16858         framework has special code to handle the attribute setting on
16859         certain elements.
16860
16861         * expression.cs (IsParamsMethodApplicable): Revert my previous
16862         foreach change here, it was wrong.
16863
16864 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16865
16866         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16867         (pp_expr): do not abort on unknown input, just return.
16868         (eval): abort if there are pending chars.
16869
16870         * attribute.cs (Attribute.Resolve): Positional parameters are
16871         optional.  Deal with that case.
16872
16873         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16874         the Ansi/Unicode/Auto information for the type.
16875
16876         (TypeContainer.DefineType): instantiate the EmitContext here, as
16877         we will be using it during the type definition (to resolve
16878         attributes) and during the emit phase.
16879
16880         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16881         to pull type information out of the attributes
16882
16883         (Attribute.Resolve): track the constructor builder, and allow for
16884         multiple invocations (structs and classes will use this).
16885
16886         * ecore.cs (MemberLookupFinal): new version with all the
16887         parameters customizable.
16888
16889         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16890         constructors.  Return if the result value is null (as the error
16891         would have been flagged already by MemberLookupFinal)
16892
16893         Do not allow instances of abstract classes or interfaces to be
16894         created.
16895
16896         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16897         We have to compare the assembly property here when dealing with
16898         FamANDAssem and Assembly access modifiers, because we might be
16899         creating an assembly from *modules* (that means that we are not
16900         getting TypeBuilders for types defined in other modules that are
16901         part of this assembly).
16902
16903         (Method.Emit): If the method is marked abstract and has a body,
16904         emit an error. 
16905
16906         (TypeContainer.DefineMembers): If both the defined member and the
16907         parent name match are methods, then do not emit any warnings: let
16908         the Method.Define routine take care of flagging warnings.  But if
16909         there is a mismatch (method overrides something else, or method is
16910         overriwritten by something, then emit warning).
16911
16912         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16913         set to null, this means `do not check for the return type on the
16914         signature'. 
16915
16916         (Method.Define): set the return type for the method signature to
16917         null, so that we get methods with the same name and parameters and
16918         different return types.  This is used to flag warning 114 (you are
16919         hiding a method, and you probably want to use the new/override
16920         keywords instead).
16921
16922         * typemanager.cs (MemberLookup): Implemented proper access
16923         control, closing a long standing set of bug reports.  The problem
16924         was that the Framework only has two bits: Public and NonPublic,
16925         and NonPublic includes private and protected methods, but we need
16926         to enforce the FamANDAssem, FamOrAssem and Family. 
16927
16928 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16929
16930         * statement.cs (GotoCase): Return true: Ammounts to giving up
16931         knowledge on whether we return or not, and letting the other case
16932         be responsible for it.
16933
16934 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16935
16936         * driver.cs: Do not load directories for each file processed, only
16937         do it if there is a pattern.
16938
16939         * ecore.cs: Report readonly assigns here as well, as we might have
16940         been resolved only by MemberAccess.
16941
16942         (SimpleName.SimpleNameResolve): Also be useful for LValue
16943         resolution.   We need this to propagate assign to local readonly variables
16944
16945         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16946         do not want to reuse potential criteria memory.
16947
16948         * class.cs (MyEventBuilder): Set reflected_type;
16949
16950         * ecore.cs (Constantify): Added support for constifying bools.
16951
16952         (RootContext.LookupType): Added a cache for values looked up in
16953         the declaration space.
16954
16955         * typemanager.cs (FindMembers): Now is a front-end to
16956         RealFindMembers, and provides a two-level hashtable-based cache to
16957         the request.  
16958
16959         15% performance improvement: from 22.5 to 19.2 seconds.
16960
16961         * expression.cs (IsParamsMethodApplicable): use foreach.
16962         (Invocation.DoResolve): ditto.
16963         (New.DoResolve): ditto.
16964         (ArrayCreation.DoResolve): ditto.
16965
16966         * ecore.cs (FindMostEncompassingType): use foreach.
16967
16968         * delegate.cs (NewDelegate.DoResolve): Use foreach
16969
16970         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16971         (RemoveMethods): use foreach.
16972
16973         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16974         nested foreach statements instead of for, and also break out of
16975         the inner loop once a match is found.
16976
16977         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16978
16979 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16980
16981         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16982         we actually unwrap the expression to allow for extra information
16983         to be extracted. 
16984
16985         * expression.cs: Use Shr_Un on unsigned operations. 
16986
16987 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16988
16989         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16990         applicable operators was not being considered correctly. This closes
16991         the bug Miguel reported.
16992
16993 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16994
16995         * attribute.cs: check that the type derives from System.Attribute
16996         and report the correct error in that case (moved the duplicate code to
16997         its own method, too).
16998
16999 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17000
17001         * attribute.cs: lookup attribute type name as the spec says: first the
17002         bare attribute name and then name + "Attribute" (nant compiles with
17003         mcs after this fix).
17004
17005 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17006
17007         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17008         Because of the way we parse things, we should try to see if a
17009         UIntConstant can fit in an integer.
17010
17011 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17012
17013         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17014         when we are in an explicit context.
17015
17016         (ConvertReferenceExplicit): When converting from Iface type S to Class
17017         T make sure the rules are implemented as an OR.
17018
17019         * parameter.cs (ParameterType): Make it a property for now although the
17020         purpose really isn't anything immediate.
17021
17022         * expression.cs (Is*Applicable): Do better checking on the parameter type
17023         of a ref/out parameter. The ones from the system assemblies are already 
17024         marked with the correct type so we don't need to do any correction.
17025
17026         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17027         the object type is standard too so include that.
17028
17029 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * ecore.cs (StandardConversionExists): Augment with missing code:
17032         deal with IntConstant, LongConstants and Enumerations.
17033
17034         * assign.cs: Report the error, instead of failing silently
17035
17036         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17037         typecontainer that they are declared, because the
17038         typecontainer/namespace will have the list of using clauses that
17039         need to be applied.
17040
17041         Assembly Attributes were escaping the normal registration
17042         mechanism. 
17043
17044         (EmitCode): Apply attributes within an EmitContext that represents
17045         the container they were declared on.
17046
17047         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17048
17049 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17050
17051         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17052         Revamp completely - make much cleaner as we now operate only
17053         on a set of Types.
17054
17055         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17056         to implement the logic detailed in the spec more correctly.
17057
17058         (UserDefinedConversion): Update accordingly.
17059
17060 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17061
17062         * statement.cs: Return flow analysis information up.
17063
17064         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17065         and the default.
17066
17067         (token): Do not consume an extra character before calling
17068         decimal_digits.
17069
17070 2002-05-06  Piers Haken <piersh@friskit.com>
17071
17072         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17073
17074 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17075
17076         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17077         EmitContext during the instance constructor initializer
17078         resolution, to stop access to instance variables.
17079
17080         This is mandated by the spec, last paragraph of the `constructor
17081         initializers' section. 
17082
17083 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * cs-parser.jay, class.cs (Accessor): new class used to represent
17086         an accessor (get or set).  In the past we used `null' to represent
17087         a missing accessor.  But this is ambiguous because there was no
17088         way to tell in abstract indexers/properties if one of them was
17089         specified.
17090
17091         Now there is a way of addressing that.
17092
17093         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17094         instead of FindMembers.
17095
17096         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17097         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17098
17099         * attribute.cs: Treat indexers and properties as the same in terms
17100         of applying attributes
17101
17102         * ecore.cs (FindMostEncompassedType): Use statically initialized
17103         EmptyExpressions()s like we do elsewhere to avoid creating useless
17104         objects (and we take this out of the tight loop).
17105
17106         (GetConversionOperators): Move the code to extract the actual
17107         operators to a separate routine to clean things up.
17108
17109 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17112         events are always registered FieldBuilders.
17113
17114         * class.cs (FieldBase): New class shared by Fields 
17115
17116         * delegate.cs: If we are a toplevel delegate, use our full name.
17117         If we are a nested delegate, then only use our tail name.
17118
17119 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17120
17121         * expression.cs (IsApplicable): Ensure that we add the "&" to
17122         ref/out types before comparing it with the type of the argument.
17123
17124         (IsParamsMethodApplicable): Ditto.
17125
17126         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17127         silly me ;-)
17128
17129         * delegate.cs : Handle the case when we have more than one applicable
17130         method. Flag an error only when we finish checking all.
17131
17132 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * expression.cs: Add support for boolean static initializers.
17135
17136 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17137
17138         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17139
17140         * parameter.cs (ComputeParameterTypes,
17141         ComputeAndDefineParameterTypes): Better error handling: now we
17142         clear the `types' cache if we fail during any of the type lookups.
17143         We also return the status code correctly to our caller
17144
17145         * delegate.cs: If we fail to define a delegate, abort the extra
17146         steps. 
17147
17148         * expression.cs (Binary.ResolveOperator): for
17149         operator==(object,object) and operator !=(object, object) we also
17150         have to verify that there is an implicit conversion from one to
17151         the other.
17152
17153         (ArrayAccess.DoResolve): Array Access can operate on
17154         non-variables. 
17155
17156 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17157
17158         * assign.cs (CompoundAssign): A new class used as a "flag" that
17159         the assignment actually is happening as part of a compound
17160         assignment operator.
17161
17162         During compound assignment, a few new rules exist to enable things
17163         like:
17164
17165         byte b |= 1 + 2
17166
17167         From the spec:
17168
17169         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17170         to the type of x) if y is implicitly convertible to the type of x,
17171         and the operator is a builtin operator and the return type of the
17172         operator is explicitly convertible to the type of x. 
17173
17174         * rootcontext.cs: Reset warning level to 2.  4 catches various
17175         "interesting" features in mcs, we must clean this up at some
17176         point, but currently am trying to kill other bugs ;-)
17177
17178         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17179         in container classes as well.  
17180
17181         * expression.cs (Binary.ResolveOperator): Handle string case
17182         before anything else (as operator overloading does emit an error
17183         before doing anything else).
17184
17185         This code could go away when we move to a table driven model, but
17186         i could not come up with a good plan last night.
17187
17188 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17189
17190         * typemanager.cs (CSharpName): reimplementation using regex.
17191         * class.cs: added null check for fields in Emit
17192         * rootcontext.cs: set warninglevel to 4
17193
17194 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * typemanager.cs (CSharpName): reimplemented with Lupus
17197         suggestion.
17198
17199 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17200
17201         * statement.cs (If): correclty implement Resolve, because we were
17202         not catching sem errors in there.  The same process is needed
17203         everywhere else. 
17204         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17205
17206
17207         (Statement.Warning_DeadCodeFound): Factorize code.
17208         (While): Report dead code here too.
17209
17210         (Statement): Added Resolve virtual method to allow
17211         for resolution split from the emit code.
17212
17213 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17214
17215         * statement.cs (EmitBoolExpression): No longer try to resolve the
17216         expression here.    
17217         (MakeBoolean): New utility function that resolve, implicitly
17218         converts to boolean and tags the expression. 
17219
17220
17221         (If, Do): Implement dead code elimination.
17222         (While): Implement loop inversion
17223
17224         (Do, While, For, If): Resolve the expression prior to calling our
17225         code generation.
17226
17227 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17228
17229         * class.cs:
17230           - added method Report28 (warning: program has more than one entry point)
17231           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17232           - modified method Method.Define, the part at the end of the method
17233
17234         * rootcontext.cs: added static public Location EntryPointLocation;
17235           
17236         * ../errors/cs0028.cs : Add test case for the above warning.              
17237
17238         * typemanager.cs:
17239           - modified method CSharpName to allow arrays of primitive type to
17240             be printed nicely (e.g. instead of System.Int32[][] it now prints
17241             int[][])
17242           - added method CSharpSignature: returns the signature of a method
17243             in string format to be used in reporting errors, warnings, etc.
17244
17245         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17246         with String.Empty.
17247
17248 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17249
17250         * delegate.cs (Define): Fix extremely silly bug where I was
17251         setting the type of the 'object' parameter of the BeginInvoke
17252         method to System.IAsyncResult instead of System.Object ;-)
17253
17254 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17255
17256         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17257         here. 
17258
17259         (Constructor.Emit): return if we fail to initialize the
17260         constructor.  Another door closed!  
17261
17262         * expression.cs (New.DoResolve): Improve error message (from -6 to
17263         1501).  Use DeclaredOnly lookup to find the exact constructor.
17264
17265         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17266         loop.  This is useful.
17267
17268         * cs-parser.jay: Adjust the default parameters so that destructors
17269         have the proper signature.
17270
17271 2002-04-26  Martin Baulig  <martin@gnome.org>
17272
17273         * driver.cs (LoadAssembly): If `assembly' contains any characters
17274         which are only valid in path names and not in assembly names
17275         (currently slash, backslash and point), use Assembly.LoadFrom ()
17276         instead of Assembly.Load () on the `assembly' (before iteration
17277         over the link_paths).
17278
17279 2002-04-26  Martin Baulig  <martin@gnome.org>
17280
17281         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17282
17283 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17284
17285         * class.cs (Property): use the new typemanager.MemberLookup
17286
17287         (TypeContainer.MemberLookup): Implement using the
17288         TypeManager.MemberLookup now. 
17289
17290         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17291         and return MemberInfos, so that these can be used without an
17292         EmitContext (what we had before).
17293
17294 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17295
17296         * expression.cs: Fix the case where the argument to params if the
17297         type of the params.  I omitted handling this before.   Fixed
17298
17299 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17300
17301         * driver.cs: Call BootCorlib_PopulateCoreType
17302
17303         * class.cs (Property.CheckBase): Check for properties only, not
17304         for all members. 
17305
17306         * interface.cs: Temporary hack: try/catch around the
17307         CustomAttributeBuilder, because I am getting an exception that I
17308         do not understand.
17309
17310         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17311         types whose definitions are required to be there (attributes are
17312         defined before standard types).
17313
17314         Compute definitions as we boot the various types, as they are used
17315         immediately (value_type class will need object_type, but if we do
17316         not initialize object_type, we will pass a null, which will let
17317         the runtime pick the System.Object from the existing corlib, which
17318         is not what we want).
17319
17320 2002-04-22  Patrik Torstensson <totte@labs2.com>
17321
17322         * cs-tokenizer.cs: fixed a number of trim() issues.
17323
17324 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17325
17326         * expression.cs (Argument.Type): Ensure that we return the correct
17327         type when we have out or ref parameters [in which case we 
17328         append a "&"].
17329
17330 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17331
17332         * class.cs (Property, Indexer): Allow extern modifier in there. 
17333
17334         * typemanager.cs (InitBaseTypes): Initializes object_type and
17335         value_type, since those will be used early on during the bootstrap
17336         process to compile corlib.
17337
17338         (InitCoreTypes): Move code from here to InitBaseTypes.
17339
17340 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17343         single-dimension arrays as using the ldlen opcode.  
17344
17345         Daniel Lewis discovered this optimization.  
17346
17347         * typemanager.cs: Add signature for System.Array::get_Length
17348
17349 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17350
17351         * statement.cs: report the error when the foreach does not apply to an
17352         array nor a collection.
17353
17354 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17355
17356         * expression.cs: Add implicit conversions to the operator ~.
17357
17358         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17359
17360         * typemanager.cs: Locate the decimal constructor.
17361
17362 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17363
17364         * attribute.cs: use the new property of TypeOf.
17365         * expression.cs: added 'get' property around typearg.
17366
17367         These changes fix a build breaker reported by NickD. Is this the
17368         correct way to fix?  If not, please, revert my changes and make it
17369         work :-).
17370
17371 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17372
17373         * attribute.cs: Add support for typeof in attribute invocations.
17374         I am not sure that this is right though.
17375
17376 2002-04-14  Duncan Mak  <duncan@ximian.com>
17377
17378         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17379         Binary.Operator.Division case.
17380
17381 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17382
17383         * class.cs (DefineType): Ensure that we do a proper check on
17384         attribute types and also register it with the TypeManager.
17385
17386         (TypeContainer.Targets): The default for attribute types is
17387         AttributeTargets.All.
17388
17389         * attribute.cs (ApplyAttributes): Registering the attribute type
17390         is done elsewhere, not when we discover we have a Usage attribute.
17391
17392 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17393
17394         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17395         and get rid of is_delegate parameter.
17396
17397         * everywhere : update.
17398
17399 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17400
17401         * cs-parser.jay (compilation_unit): Revamp completely to use
17402         some new ideas that I got from Rhys' grammar to solve the problems
17403         with assembly level attributes.
17404
17405         (outer_declaration): New grammar production.
17406
17407         (attribute_sections): Add.
17408
17409         (opt_attributes): Base on attribute_sections
17410
17411         (namespace_declaration): Allow opt_attributes to tackle the case
17412         when we have assembly level attributes - we are clever in this
17413         regard now ;-)
17414
17415         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17416         attributes in the non-global context.
17417
17418         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17419         instead of SetGlobalAttributes.
17420
17421         * class.cs, rootcontext.cs : Ensure we define and generate 
17422         attribute types before anything else.
17423
17424         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17425         and flag the new error -20 for the case when the attribute type
17426         does not have valid targets specified. csc does not catch this.
17427
17428         * ../errors/errors.txt : update for error # -20
17429
17430 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17431
17432         * support.cs (InternalParameters.ParameterModifier): Do some null
17433         checking and return sane values.
17434
17435         * class.cs (Method.Define): If we are a PInvoke method, ensure
17436         that we are static and extern. Report error # 601
17437
17438         * ../errors/cs0601.cs : Add test case for the above error.
17439
17440 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17441
17442         * rootcontext.cs (attribute_types): We need to keep type of
17443         all attribute types separately and emit code for them first.
17444
17445         (RegisterAttribute) : Implement.
17446
17447         * class.cs (DefineType): Check if the current Type is a custom
17448         attribute type and register it accordingly.
17449
17450         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17451         adding the first attribute twice and rename to
17452
17453         (SetGlobalAttributes): this.
17454
17455         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17456         lookups.
17457
17458         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17459         if we are processing global arguments. Hmm, I am unsure of this.
17460
17461 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17462
17463         * expression.cs: added static array of strings to avoid calling
17464         Enum.ToString () for Operator in Binary. Significant recover of
17465         performance.
17466
17467 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17468
17469         * class.cs (FindMembers): Allow the Builders of the various
17470         members to be null.  If they are skip them.  This only happens
17471         during the PInvoke declaration.
17472
17473 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17476         failure, so we do not keep going afterwards.
17477
17478         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17479         wanted to pass `false' as the `is_delegate' argument.  If this is
17480         the case, why not use delegate_type == null to mean `is_delegate =
17481         false' and anything else as is_delegate = true.
17482
17483 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17484
17485         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17486         code for the section, not the beginning of the tests.
17487
17488 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17489
17490         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17491
17492         * expression.cs (Binary): same.  Warn about errors where we have
17493         Enum/Enum in operator + as well.
17494
17495 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17496
17497         * statement.cs:
17498                 - added support for switch(bool)
17499                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17500                 - add TableSwitchEmit() to handle table-based switch statements
17501
17502 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17503
17504         * expression.cs (Invocation.OverloadResolve): Factor out code which
17505         does parameter compatibility checking with arguments so that we can 
17506         re-use the code even from Delegate.VerifyApplicability
17507
17508         (VerifyArgumentsCompat): Move above code here.
17509
17510         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17511         and instead make a call to the above method.
17512
17513 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17514
17515         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17516         We use it to keep track of classes which are attribute types.
17517
17518 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * delegate.cs (Delegate.Define): Correctly define the types in the
17521         presence of fixed and array parameters.
17522
17523         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17524         doing FindMembers.
17525
17526         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17527         include NonPublic after the first iteration.
17528
17529         * class.cs (Indexer.CheckBase): Only check if both parents are
17530         non-null. 
17531
17532         * cs-parser.jay (accessor_body): If empty, set to null.
17533
17534         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17535         same code path here to resolve constants names that we did have in
17536         MemberAccess.DoResolve.  There is too much code duplicated here.
17537
17538 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17539
17540         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17541
17542         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17543         to MakeUnionSet.
17544
17545         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17546         tokens, numbers and strings.
17547
17548         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17549         parenthesis.
17550
17551         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17552         asyncronous parameters and the regular parameters.  
17553
17554         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17555         specify the target directory.
17556
17557         * expression.cs: (This.DoResolve): Simplify
17558         (As.Emit): Optimize, do not generate IsInst if the expression is
17559         always of the given type.
17560
17561         (Is.DoResolve): Bug fix, we were reporting both always/never for
17562         the is expression.
17563
17564         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17565         creating too many unnecessary arrays.
17566
17567 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17568
17569         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17570         fields instead of rolling our own initializer.   Takes care of all
17571         implicit conversions, and drops unnecessary static checks/argument.
17572
17573 2002-03-31  Dick Porter  <dick@ximian.com>
17574
17575         * driver.cs: use the GetDirectories() return values properly, and
17576         use "/" as path separator.
17577
17578 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17579
17580         * expression.cs (Unary): Optimize - - expr into expr.
17581         (Binary): Optimize a + (-b) into a -b.
17582
17583         * codegen.cs (CodeGen): Made all methods static.
17584
17585 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * rootcontext.cs: 
17588
17589         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17590         TypeBuilder property.
17591
17592         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17593         instead. 
17594
17595         * tree.cs: Removed the various RecordXXXX, and replaced with a
17596         single RecordDecl.  Removed all the accessor methods, and just
17597         left a single access point Type 
17598
17599         * enum.cs: Rename DefineEnum to DefineType.
17600
17601         * decl.cs: New abstract method `DefineType' used to unify the
17602         Defines for Enumerations, Interfaces, TypeContainers and
17603         Delegates.
17604
17605         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17606         LookupBaseClasses method that used to live in class.cs and
17607         interface.cs here, and renamed to FindType.
17608
17609         * delegate.cs: Implement DefineType.  Take advantage of the
17610         refactored pattern for locating the parent builder without taking
17611         the parent_builder argument (which we know does not work if we are
17612         nested, and triggering a toplevel definition).
17613
17614 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17615
17616         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17617         accessibility of a member has changed during override and report
17618         an error if so.
17619
17620         * class.cs (Method.Define, Property.Define): Only complain on
17621         overrides if the method is private, any other accessibility is
17622         fine (and since we just checked the permission is the same, we are
17623         good to go).
17624
17625         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17626         and elif are processed always.  The other pre-processing
17627         directives are only processed if we are "taking" the path
17628
17629 2002-03-29  Martin Baulig  <martin@gnome.org>
17630
17631         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17632         current location is not Null.
17633
17634         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17635         a separate method so we can profile it.
17636
17637         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17638         `span.Seconds' are just seconds, but no minutes or hours.
17639         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17640
17641 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17644         Remove the gratuitous set of Final:
17645
17646                                 // If an interface implementation, then we can set Final.
17647                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17648                                     implementing.DeclaringType.IsInterface)
17649                                         flags |= MethodAttributes.Final;
17650
17651         I do not know what I was smoking when I used that.
17652
17653
17654         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17655         step into fixing the name resolution issues for delegates and
17656         unifying the toplevel name resolution.
17657
17658 2002-03-28  Martin Baulig  <martin@gnome.org>
17659
17660         * class.cs (Method.Emit): If we have a symbol writer, call its
17661         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17662         tell it about the current method.
17663
17664         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17665         writer that we're going to emit the first byte of IL code for a new
17666         statement (a new source line).
17667         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17668         EmitContext.Mark() before emitting any code.
17669
17670         * location.cs (SymbolDocument): Return null when we're Null.
17671
17672         * statement.cs (Statement): Moved the `Location loc' variable here.
17673         (Statement.EmitBoolExpression): If we have a symbol writer, call
17674         ec.Mark() before emitting any code to tell it that we're at the
17675         beginning of a new statement.
17676         (StatementExpression): Added `Location' argument to the constructor.
17677         (Block): Added public readonly variable `StartLocation' and public
17678         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17679         (Block): Added constructor which takes a start and end location.
17680         (Block.SetEndLocation): New method. This sets the end location.
17681         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17682         local variables we create.
17683         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17684         each statement and do also mark the begin and end of the block.
17685
17686         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17687         tell it the current lexer.Location, use Location.Null for the end of the
17688         block.
17689         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17690         current block, set its end location using SetEndLocation().
17691         (statement_expression): StatementExpression constructor now takes the
17692         lexer.Location as additional argument.
17693         (for_statement, declare_local_variables): Likewise.
17694         (declare_local_variables): When creating a new implicit block, use the
17695         new Block constructor and pass it the lexer.Location.
17696
17697 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17700         members also on the parent interfaces recursively.
17701
17702 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * report.cs: Use new formats, since Gonzalo finished the missing
17705         bits. 
17706
17707         * expression.cs (Binary.ResolveOperator): added missing operator|
17708         operator& and operator^ for bool/bool.
17709
17710         * cs-parser.jay: CheckDef now takes a Location argument that is
17711         used to report errors more precisly (instead of reporting the end
17712         of a definition, we try to track something which is a lot closer
17713         to the source of the problem).
17714
17715         * cs-tokenizer.cs: Track global token use, so we can properly flag
17716         the use of #define/#undef after the first token has been seen.
17717
17718         Also, rename the reportXXXX to Error_DescriptiveName
17719
17720         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17721         TypeContainer, so that Enum and Interface can use this too.
17722
17723         * class.cs (TypeContainer.LookupInterfaceOrClass,
17724         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17725         `builder' argument.  Typically this was used to pass the parent
17726         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17727         the definition).  
17728
17729         The problem is that a nested class could trigger the definition of
17730         a toplevel class, and the builder would be obviously wrong in that
17731         case. 
17732
17733         So we drop this argument, and we compute dynamically the
17734         TypeBuilder/ModuleBuilder (the correct information was available
17735         to us anyways from DeclSpace.Parent)
17736
17737         * interface.cs (Interface.DefineInterface): Drop builder
17738         parameter cleanup like class.cs
17739
17740         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17741         like class.cs
17742
17743         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17744         values. 
17745
17746         (Try.Emit): Propagate the returns value from the statement.
17747
17748         (Return.Emit): Even if we are leavning 
17749
17750         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17751
17752         * modifiers.cs: Fix the computation of MethodAttributes flags.
17753
17754 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17755
17756         * driver.cs: allow compilation of files that start with '/'.
17757         Add a default case when checking the argument of --target.
17758
17759 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17760
17761         * interface.cs: Implement the same search algorithm for types in
17762         the interface code.
17763
17764         * delegate.cs: Do not allow multiple definition.
17765
17766         * Recovered ChangeLog that got accidentally amputated
17767
17768         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17769
17770         * rootcontext.cs: Load manually enum to allow core classes to
17771         contain enumerations.
17772
17773         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17774         Update to new static methods in TypeManager.
17775
17776         * typemanager.cs (GetMethod, GetConstructor): Use our
17777         implementation of FindMembers to find the members, since during
17778         corlib compilation, the types are TypeBuilders and GetMethod and
17779         GetConstructor do not work.
17780
17781         Make all methods in TypeManager static.
17782
17783         (InitCodeHelpers): Split the functionality from
17784         the InitCodeTypes function.
17785
17786         * driver.cs: Call InitCodeHelpers after we have populated the
17787         types. 
17788
17789         * cs-parser.jay (delegate_declaration): we did not used to compute
17790         the delegate name correctly for void delegates.
17791
17792 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17793
17794         * rootcontext.cs (RootContext): Init the interface_resolve_order
17795         and type_container_resolve_order always.
17796
17797         (ResolveCore, BootstrapCorlib_ResolveClass,
17798         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17799         compiler when compiling with --nostdlib
17800
17801         * class.cs (TypeContainer.DefineType): Check that our parent is
17802         not null.  This test is most important when we are bootstraping
17803         the core types.
17804
17805         * codegen.cs: Split out the symbol writing code.
17806
17807 2002-03-25  Martin Baulig  <martin@gnome.org>
17808
17809         * driver.cs (-g): Made -g an alias for --debug.
17810
17811 2002-03-24  Martin Baulig  <martin@gnome.org>
17812
17813         * codegen.cs (SymbolWriter): New public variable. Returns the
17814         current symbol writer.
17815         (CodeGen): Added `bool want_debugging_support' argument to the
17816          constructor. If true, tell the ModuleBuild that we want debugging
17817         support and ask it for the ISymbolWriter.
17818         (Save): If we have a symbol writer, call it's Close() method after
17819         saving the assembly.
17820
17821         * driver.c (--debug): New command line argument to create a
17822         debugger information file.
17823
17824         * location.cs (SymbolDocument): New public property. Returns an
17825         ISymbolDocumentWriter object for the current source file or null
17826         if we don't have a symbol writer.
17827
17828 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17829
17830         * driver.cs (LoadAssembly): Correctly return when all the paths
17831         have been tried and not before.
17832
17833         * statement.cs (Switch.Emit): return the actual coverage for this
17834         statement (returns/not-returns)
17835
17836         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17837         switch of the statement if we are the last switch section.  That
17838         kills two problems: try/catch problems (we used to emit an empty
17839         nop at the end) and switch statements where all branches would
17840         return. 
17841
17842 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17843
17844         * driver.cs: Add default assemblies (the equivalent to the
17845         Microsoft CSC.RSP file)
17846
17847         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17848         also update tokens_seen and set it to false.
17849
17850         * driver.cs: Implement --recurse for Mike.
17851
17852         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17853         correctly splitting out the paths.
17854
17855 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * interface.cs (Interface.PopulateProperty): Instead of using
17858         `parent' as the declaration space for the set parameters, use
17859         `this' 
17860
17861         * support.cs (InternalParameters): InternalParameters constructor
17862         takes a DeclSpace instead of a TypeContainer.
17863
17864         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17865         types are being initialized, load the address of it before calling
17866         the function.  
17867
17868         (New): Provide a mechanism to disable the generation of local
17869         value type temporaries when the caller will be providing us with
17870         an address to store it.
17871
17872         (ArrayCreation.EmitDynamicInitializers): Use it.
17873
17874 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * expression.cs (Invocation.EmitArguments): Only probe for array
17877         property if there is more than one argument.  Sorry about that.
17878
17879         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17880         empty param arrays.
17881
17882         * class.cs (Method.LabelParameters): Fix incorrect code path that
17883         prevented the `ParamArrayAttribute' from being applied to the
17884         params attribute.
17885
17886 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * support.cs (ReflectionParameters): Correctly compute whether the
17889         last argument is a params array.  Fixes the problem with
17890         string.Split ('a')
17891
17892         * typemanager.cs: Make the assemblies array always be non-null
17893         (empty, but non-null)
17894
17895         * tree.cs (RecordDecl): New function that abstracts the recording
17896         of names.  This reports error 101, and provides a pointer to the
17897         previous declaration.  Fixes a crash in the compiler.
17898
17899         * cs-parser.jay (constructor_declaration): Update to new grammar,
17900         and provide a constructor_body that can be empty.
17901
17902 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17903
17904         * driver.cs: Add support for --resources.
17905
17906         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17907         Make all types for the various array helper methods be integer.
17908
17909         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17910         CheckState to ConvCast.
17911
17912         (ConvCast): Now it takes a `checked' state argument, to avoid
17913         depending on the emit context for the conversion, and just using
17914         the resolve time setting.
17915
17916         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17917         instead of Invocation.EmitArguments.  We do not emit the original
17918         arguments, instead we emit those which have been converted to
17919         unsigned int expressions.
17920
17921         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17922
17923         * codegen.cs: ditto.
17924
17925         * expression.cs (LocalVariableReference): Drop the use of the
17926         Store function that depended on the variable index.
17927
17928         * statement.cs (VariableInfo): Drop the `Idx' property from this
17929         class, as this is not taking into account the indexes for
17930         temporaries tat we generate during the execution, getting the
17931         indexes wrong.
17932
17933         * class.cs: First emit class initializers, then call the parent
17934         constructor. 
17935
17936         * expression.cs (Binary): Fix opcode emision.
17937         (UnaryMutator.EmitCode): Support checked code generation
17938
17939         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17940         matches for events for both the Static and Instance scans,
17941         pointing to the same element.   Fix that.
17942
17943 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17944
17945         * rootcontext.cs (ResolveTree): Always set the
17946         interface_resolve_order, because nested interfaces will be calling
17947         into us.
17948
17949         * class.cs (GetInterfaceOrClass): Track the same resolution
17950         process used by TypeManager.LookupType.  This fixes the nested
17951         type lookups in class declarations (separate path from
17952         LookupType). 
17953
17954         (TypeContainer.DefineType): Also define nested interfaces.
17955         (TypeContainer.RegisterOrder): New public function used to
17956         register the order in which child interfaces need to be closed.
17957
17958         Nested interfaces need to be closed after their parents have been
17959         created. 
17960
17961         * interface.cs (InterfaceAttr): Put all the logic for computing
17962         the interface attribute here. 
17963
17964         (DefineInterface): Register our interface order with the
17965         RootContext or with the TypeContainer depending on the case.
17966
17967 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * cs-parser.jay: rework foreach statement to work with the new
17970         changes to the policy on SimpleNames.
17971
17972         * report.cs: support Stacktrace on warnings as well.
17973
17974         * makefile: drop --unsafe and /unsafe from the compile.
17975
17976 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17977
17978         * ecore.cs (StandardConversionExists): Modify to take an Expression
17979         as the first parameter. Ensure we do null -> reference type conversion
17980         checking.
17981
17982         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17983         temporary Expression objects.
17984
17985 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17986
17987         * interface.cs: workaround bug in method overloading resolution
17988         (there is already a bugzilla bug for it).
17989
17990 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17991
17992         We could also solve this problem by having a separate path for
17993         performing type lookups, instead of DoResolve, we could have a
17994         ResolveType entry point, and only participating pieces of the
17995         production (simplename, deref, array) would implement this. 
17996
17997         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17998         signal SimpleName to only resolve type names and not attempt to
17999         resolve anything else.
18000
18001         * expression.cs (Cast): Set the flag.
18002
18003         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18004
18005         * class.cs: Only report 108 if there is no `new' modifier.
18006
18007         * cs-parser.jay: rework foreach statement to work with the new
18008         changes to the policy on SimpleNames.
18009         
18010         * report.cs: support Stacktrace on warnings as well.
18011
18012         * makefile: drop --unsafe and /unsafe from the compile.
18013
18014 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18017         lookups here, instead of doing that at parse time.  This means
18018         that our grammar will not introduce `LocalVariableReferences' as
18019         expressions at this point.  That solves the problem of code like
18020         this:
18021
18022         class X {
18023            static void Main ()
18024            { int X = 1;
18025             { X x = null }}}
18026
18027         This is only half the fix.  The full fix requires parameters to
18028         also be handled in this way.
18029
18030         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18031         makes the use more obvious of the DeclSpace.  The
18032         ec.TypeContainer.TypeBuilder is now only used to pull the
18033         TypeBuilder for it.
18034
18035         My theory is that I can get rid of the TypeBuilder completely from
18036         the EmitContext, and have typecasts where it is used (from
18037         DeclSpace to where it matters).  
18038
18039         The only pending problem is that the code that implements Aliases
18040         is on TypeContainer, and probably should go in DeclSpace.
18041
18042         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18043         lookups here, instead of doing that at parse time.  This means
18044         that our grammar will not introduce `LocalVariableReferences' as
18045         expressions at this point.  That solves the problem of code like
18046         this:
18047
18048         class X {
18049            static void Main ()
18050            { int X = 1;
18051             { X x = null }}}
18052
18053         This is only half the fix.  The full fix requires parameters to
18054         also be handled in this way.
18055
18056         * class.cs (Property.DefineMethod): When implementing an interface
18057         method, set newslot, when implementing an abstract method, do not
18058         set the flag (before we tried never setting it, or always setting
18059         it, which is the difference).
18060         (Indexer.DefineMethod): same.
18061         (Method.DefineMethod): same.
18062
18063         * ecore.cs: Only set the status used flag if we get back a Field.
18064
18065         * attribute.cs: Temporary hack, so Paolo can keep working.
18066
18067 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18068
18069         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18070         the unmanaged type in the case we have a MarshalAs attribute.
18071
18072         (Resolve): Handle the case when we are parsing the special MarshalAs
18073         attribute [we need to store the unmanaged type to use later]
18074
18075         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18076         MarshalAs Attribute.
18077
18078         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18079         on parameters and accordingly set the marshalling info.
18080
18081 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18082
18083         * class.cs: Optimizing slightly by removing redundant code after
18084         we switched to the `NoTypes' return value.
18085         (Property.DefineMethod): use NoTypes here too.
18086
18087         This fixes the bug I introduced in my last batch of changes.
18088
18089 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18090
18091         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18092
18093         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18094         Enums since those are types too. 
18095
18096         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18097
18098         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18099         thanks to a call during the lookup process.
18100
18101 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * statement.cs (Foreach): Lots of work to accomodate a particular
18104         kind of foreach statement that I had not kept in mind.  It is
18105         possible to have foreachs on classes that provide a GetEnumerator
18106         method that return objects that implement the "pattern" for using
18107         a foreach, there is no need to support GetEnumerator
18108         specifically. 
18109
18110         This is needed to compile nant.
18111
18112         * decl.cs: Only report 114 if the member is not `Finalize' and if
18113         the warning level is at least 2.
18114
18115         * class.cs: Moved the compare function from Method to
18116         MethodSignature. 
18117
18118         (MethodSignature.InheritableMemberSignatureCompare): Add new
18119         filter function that is used to extract inheritable methods from a
18120         class. 
18121
18122         (Method.Define): Use the new `inheritable_method_signature_filter'
18123         delegate
18124
18125         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18126         command. 
18127
18128 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18129
18130         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18131
18132         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18133
18134         * expression.cs: Pass location information to
18135         ConvertImplicitStandard. 
18136
18137         * class.cs: Added debugging code to track return values from
18138         interfaces. 
18139
18140 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18141
18142         * expression.cs (Is.DoResolve): If either side of the `is' is an
18143         interface, do not flag the warning.
18144
18145         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18146         for interfaces
18147
18148         * report.cs: Allow for --fatal to be used with --probe.
18149
18150         * typemanager.cs (NoTypes): Move the definition for the empty Type
18151         array here. 
18152
18153         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18154         properties. 
18155         (TypeContainer.DefineProxy): New function used to proxy to parent
18156         implementations when implementing interfaces.
18157         (TypeContainer.ParentImplements): used to lookup if our parent
18158         implements a public function that is required by an interface.
18159         (TypeContainer.VerifyPendingMethods): Hook this up.
18160
18161         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18162         `modules' and `assemblies' arraylists into arrays.  We only grow
18163         these are the very early start up of the program, so this improves
18164         the speedof LookupType (nicely measured).
18165
18166         * expression.cs (MakeByteBlob): Replaced unsafe code with
18167         BitConverter, as suggested by Paolo.
18168
18169         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18170         folding of string concatenation, but if either side is a string,
18171         and the other is not, then return null, and let the runtime use
18172         the concatenation on the string plus the object (using
18173         `Object.ToString'). 
18174
18175 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18176
18177         Constant Folding has been implemented now.
18178
18179         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18180         the error instead on types that are not supported in one's
18181         complement. 
18182
18183         * constant.cs (Constant and all children): New set of functions to
18184         perform implict and explicit conversions.
18185
18186         * ecore.cs (EnumConstant): Implement the new functions to perform
18187         conversion by proxying to the child expression.
18188
18189         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18190         own separate setting that can not be turned off from the command
18191         line using --unchecked or --checked and is only controlled using
18192         the checked/unchecked statements and expressions.  This setting is
18193         used by the constant folder to flag errors.
18194
18195         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18196         ConstantCheckState as well.   
18197
18198         During Resolve, they also have to flag the state, because the
18199         constant folder runs completely in the Resolve phase.
18200
18201         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18202         well.
18203
18204 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18205
18206         * cfold.cs: New file, this file contains the constant folder.
18207
18208         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18209         argument to track whether we are using the resulting address to
18210         load or store a value and provide better error messages. 
18211
18212         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18213         new AddressOf arguments.
18214
18215         * statement.cs (Foreach.EmitCollectionForeach): Update
18216
18217         * expression.cs (Argument.Emit): Call AddressOf with proper
18218         arguments to track usage.
18219
18220         (New.DoEmit): Call AddressOf with new arguments.
18221
18222         (Unary.Emit): Adjust AddressOf call.
18223
18224 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18225
18226         * cs-parser.jay (member_access): Change the case for pre-defined types
18227         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18228         this suggestion.
18229
18230         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18231         a method body.
18232
18233         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18234         essentially like methods and apply attributes like MethodImplOptions to them too.
18235
18236         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18237         not being null.
18238
18239         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18240         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18241         is the DeclSpace.
18242
18243         * Update code everywhere accordingly.
18244
18245         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18246
18247         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18248
18249 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18250
18251         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18252         try performing lookups against those instead of jumping straight into using
18253         the 'using' clauses.
18254
18255         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18256
18257         (LookupType): Perform lookups in implicit parents too.
18258
18259         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18260         sequence as RootContext.LookupType. 
18261
18262         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18263         the various cases of namespace lookups into this method.
18264
18265 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18268         in positional arguments)
18269
18270         * class.cs (Operator): Update the AllowedModifiers to contain
18271         extern. 
18272
18273         * cs-parser.jay: Update operator declaration to allow for the
18274         operator body to be empty.
18275
18276         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18277         values. 
18278
18279 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18280
18281         * class.cs (Method.Emit): Label parameters.
18282
18283         * driver.cs: Return 1 or 0 as the program exit code.
18284
18285 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * expression.cs: Special case the `null' object when trying to
18288         auto-compute the type, as anything can be explicitly converted to
18289         that. 
18290
18291         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18292         spotting this Paolo.
18293
18294         (Expression.ImplicitNumericConversion): Perform comparissions of
18295         the type using the underlying type in the case of an enumeration
18296         rather than using the enumeration type for the compare.
18297
18298         Cope with the underlying == type case, which is not possible to
18299         catch before. 
18300
18301         (Expression.ConvertNumericExplicit): Perform comparissions of
18302         the type using the underlying type in the case of an enumeration
18303         rather than using the enumeration type for the compare.
18304
18305         * driver.cs: If the user does not supply an extension, assume .exe
18306
18307         * cs-parser.jay (if_statement): Rewrote so that we can track the
18308         location for the if statement.
18309
18310         * expression.cs (Binary.ConstantFold): Only concat strings when
18311         the operation is "+", not everything ;-)
18312
18313         * statement.cs (Statement.EmitBoolExpression): Take a location
18314         argument. 
18315         (If, While, Do): Track location.
18316
18317         * expression.cs (Binary.ResolveOperator): In the object + string
18318         case, I was missing a call to ConvertImplicit
18319
18320 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18321
18322         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18323         Location arguments. Ensure we use RootContext.LookupType to do our work
18324         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18325
18326         * interface.cs (PopulateMethod): Handle the type of the parameter being
18327         null gracefully.
18328
18329         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18330         have a params method with no fixed arguments and a call is made with no
18331         arguments.
18332
18333 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18334
18335         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18336         the verbatim-string-literal
18337
18338         * support.cs (InternalParameters.ParameterModifier): handle null
18339         fixed parameters.
18340         (InternalParameters.ParameterType): ditto.
18341
18342         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18343         duplicating the name of the variable parameter.
18344         (GetParameterByName): Fix bug where we were not looking up array
18345         paramters if they were the only present (thanks Paolo!).
18346         (GetParameterInfo): We only have an empty set of types if both
18347         fixed and array are set to null.
18348         (GetParameterInfo-idx): Handle FixedParameter == null
18349
18350         * cs-parser.jay: Handle the case where there is no catch
18351         statements (missing null test).
18352
18353 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18354
18355         * driver.cs (MainDriver): Be conservative on our command line
18356         handling.
18357
18358         Catch DirectoryNotFoundException when calling GetFiles.
18359
18360         (SplitPathAndPattern): Used to split the input specification into
18361         a path and a pattern that we can feed to Directory.GetFiles.
18362
18363 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18364
18365         * statement.cs (Fixed): Implement the last case of the Fixed
18366         statement (string handling).
18367
18368         * expression.cs (StringPtr): New class used to return a char * to
18369         a string;  Used by the Fixed statement.
18370
18371         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18372
18373         * expression.cs (Binary.ResolveOperator): Remove redundant
18374         MemberLookup pn parent type.
18375         Optimize union call, we do not need a union if the types are the same.
18376         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18377         type.
18378
18379         Specialize the use of MemberLookup everywhere, instead of using
18380         the default settings. 
18381
18382         (StackAlloc): Implement stackalloc keyword.
18383
18384         * cs-parser.jay: Add rule to parse stackalloc.
18385
18386         * driver.cs: Handle /h, /help, /?
18387
18388         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18389         before we supported unsafe code.
18390
18391         * makefile: add --unsafe to the self compilation of mcs.
18392
18393 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18394
18395         * expression.cs (PointerArithmetic): New class that is used to
18396         perform pointer arithmetic.
18397         (Binary.Resolve): Handle pointer arithmetic
18398         Handle pointer comparission.
18399         (ArrayPtr): Utility expression class that is used to take the
18400         address of an array.
18401
18402         (ElementAccess): Implement array access for pointers
18403
18404         * statement.cs (Fixed): Implement fixed statement for arrays, we
18405         are missing one more case before we are done.
18406
18407         * expression.cs (Indirection): Implement EmitAssign and set the
18408         ExprClass to Variable.  This allows pointer dereferences to be
18409         treated as variables, and to have values assigned to them.
18410
18411         * ecore.cs (Expression.StoreFromPtr): New utility function to
18412         store values dereferencing.
18413
18414 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18415
18416         * expression.cs (Binary.ResolveOperator): Ensure that we are
18417         not trying to operate on a void type - this fixes the reported
18418         bug.
18419
18420         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18421         the parent implementation is sealed.
18422
18423         * ../errors/cs0239.cs : Add.
18424
18425         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18426
18427         * typemanager.cs (unverifiable_code_type): Corresponds to 
18428         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18429         which have unsafe code in them.
18430
18431         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18432         unsafe context.
18433
18434 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * cs-tokenizer.cs: Add support for @"litreal strings"
18437
18438         Make tokenizer accept pre-processor directives
18439         on any column (remove the old C-like limitation). 
18440
18441         * rootcontext.cs (EmitCode): Emit any global attributes.
18442         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18443
18444         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18445
18446         * cs-parser.jay: Add support for global attributes.  
18447
18448 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18449
18450         * expression.cs (Indirection): New helper class.  Unary will
18451         create Indirection classes to be able to implement the
18452         IMemoryLocation interface on it.
18453
18454 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18455
18456         * cs-parser.jay (fixed_statement): reference the right statement.
18457
18458         * statement.cs (Fixed.Emit): Finish implementing the fixed
18459         statement for the &x case.
18460
18461 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18462
18463         * class.cs (Property.Define, Method.Define): Remove newslot when
18464         `implementing'.  
18465
18466         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18467         wrong.  NewSlot should only be used if the `new' keyword is present.
18468
18469         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18470         locating our system dir.  Sorry about this.
18471
18472 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * driver.cs (GetSystemDir): Compute correctly the location of our
18475         system assemblies.  I was using the compiler directory instead of
18476         the library directory.
18477
18478 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18479
18480         * expression.cs (BetterFunction): Put back in what Miguel commented out
18481         since it is the correct fix. The problem is elsewhere ;-)
18482
18483         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18484         parameters of the parms method are themselves compatible or not !
18485
18486         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18487         to check that a class implements an interface before saying that an implicit
18488         conversion was allowed. Use ImplementsInterface to do the checking.
18489
18490 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18491
18492         * class.cs (Method.Define): Track whether we are an explicit
18493         implementation or not.  And only call DefineMethodOverride if we
18494         are an explicit implementation.
18495
18496         (Property.DefineMethod): Ditto.
18497
18498 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18499
18500         * expression.cs (BetterFunction): Catch hideous bug which was
18501          preventing us from detecting ambiguous calls due to implicit casts i.e
18502         cs0121.
18503
18504 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18505
18506         * support.cs (Pair): Remove un-needed method.  I figured why I was
18507         getting the error in cs-parser.jay, the variable in a foreach loop
18508         is readonly, and the compiler does not really treat this as a variable.
18509
18510         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18511         instead of EQUALS in grammar.  
18512
18513         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18514
18515         * expression.cs (Unary.DoResolve): Check whether the argument is
18516         managed or not.
18517
18518 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18519
18520         * support.cs: Api for Pair to set a value.  Despite the fact that
18521         the variables are public the MS C# compiler refuses to compile
18522         code that accesses the field if the variable is part of a foreach
18523         statement. 
18524
18525         * statement.cs (Fixed): Begin implementation of the fixed
18526         statement.
18527
18528         (Block.AddVariable): Return the VariableInfo on success and null
18529         on failure instead of true/false. 
18530
18531         * cs-parser.jay (foreach): Catch errors on variables already
18532         defined (we were ignoring this value before) and properly unwind
18533         the block hierarchy
18534
18535         (fixed_statement): grammar for the fixed statement.
18536
18537 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18538
18539         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18540         pointer types to be incretemented.
18541
18542         (SizeOf): Implement.
18543
18544         * cs-parser.jay (pointer_member_access): Implement
18545         expr->IDENTIFIER production.
18546
18547         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18548         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18549         on safe contexts.
18550
18551         (Unary): Implement indirection.
18552
18553         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18554         use in non-unsafe context).
18555
18556         (SimpleName.DoResolve): Check for pointers in field access on safe
18557         contexts. 
18558
18559         (Expression.LoadFromPtr): Factor the load-indirect code in this
18560         function.  This was duplicated in UnboxCast and ParameterReference
18561
18562 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18563
18564         * expression.cs (ComposedCast): report an error if a pointer cast
18565         is used in a safe region.
18566
18567         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18568         pointer type casts in unsafe context.
18569
18570         * codegen.cs (EmitContext): Set up IsUnsafe.
18571
18572         * cs-parser.jay (non_expression_type): Add productions for pointer
18573         casts. 
18574
18575         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18576         code.  We should not use force into static mode if the method is
18577         not virtual.  Fixes bug in MIS
18578
18579         * statement.cs (Do.Emit, While.Emit, For.Emit,
18580         Statement.EmitBoolExpression): Add support to Do and While to
18581         propagate infinite loop as `I do return' semantics.
18582
18583         Improve the For case to also test for boolean constants.
18584
18585         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18586         to the list of attributes we can add.
18587
18588         Remove `EmitContext' argument.
18589
18590         * class.cs (Method.Define): Apply parameter attributes.
18591         (Constructor.Define): Apply parameter attributes.
18592         (MethodCore.LabelParameters): Move here the core of labeling
18593         parameters. 
18594
18595         * support.cs (ReflectionParameters.ParameterModifier,
18596         InternalParameters.ParameterModifier): Use IsByRef on the type and
18597         only return the OUT bit for these parameters instead of in/out/ref
18598         flags.
18599
18600         This is because I miss-understood things.  The ParameterInfo.IsIn
18601         and IsOut represent whether the parameter has the [In] and [Out]
18602         attributes set.  
18603
18604 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18605
18606         * ecore.cs (FieldExpr.Emit): Release temporaries.
18607
18608         * assign.cs (LocalTemporary.Release): new function.
18609
18610         * codegen.cs (EmitContext.GetTemporaryStorage,
18611         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18612         temporary storage.  Now we can "put back" localbuilders when we
18613         are done with them
18614
18615 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18616
18617         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18618         need to make a copy of the variable to generate verifiable code.
18619
18620 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18621
18622         * driver.cs: Compute dynamically the system directory.
18623
18624         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18625         Slower, but more generally useful.  Used by the abstract
18626         registering implementation. 
18627
18628         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18629         the rules for the special rule on Type/instances.  First check if
18630         we have the same name, and if so, try that special static path
18631         rather than the instance path.
18632
18633 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18636         for, while and if.
18637
18638         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18639         Enum, ValueType, Delegate or Array for non-corlib compiles.
18640
18641         * cs-tokenizer.cs: Catch long identifiers (645)
18642
18643         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18644         piece of code.
18645
18646         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18647         fix, we were returning too early, so we were not registering
18648         pending methods from abstract classes.
18649
18650         Do not register pending methods if the class is abstract.
18651
18652         * expression.cs (Conditional.DoResolve): Report circular implicit
18653         conversions when we neecd to compute it for conditional
18654         expressions. 
18655
18656         (Is.DoResolve): If the expression is always of the provided type,
18657         flag warning 183.  If the expression can not ever be of the
18658         provided type flag warning 184.
18659
18660         * class.cs: Catch 169 as well.
18661
18662         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18663         read. 
18664
18665 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18666
18667         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18668
18669 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18670
18671         * interface.cs: (PopulateMethod): Check for pointers being defined
18672         only if the unsafe context is active.
18673         (PopulateProperty): ditto.
18674         (PopulateIndexer): ditto.
18675
18676         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18677         specified.  If pointers are present, make sure that they are
18678         present in an unsafe context.
18679         (Constructor, Constructor.Define): ditto.
18680         (Field, Field.Define): ditto.
18681         (Property, Property.Define): ditto.
18682         (Event, Event.Define): ditto.
18683
18684         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18685         hashtable if there are classes or structs defined.
18686
18687         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18688         code, as the constant resolution moved.
18689
18690         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18691         the metadata, so we can flag error 133. 
18692
18693         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18694         pointer is being declared in an unsafe context.
18695
18696 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18697
18698         * modifiers.cs (Modifiers.Check): Require a Location argument.
18699         Report error 227 for Unsafe use.
18700
18701         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18702
18703         * statement.cs (For.Emit): If the test is null, then report that
18704         we do `return', as we wont reach anything afterwards.
18705
18706         (Switch.SwitchGoverningType): Track the expression that matched
18707         the conversion.
18708
18709         * driver.cs: Allow negative numbers as an error code to flag.
18710
18711         * cs-parser.jay: Handle 1551.
18712
18713         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18714
18715 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18716
18717         * cs-parser.jay: Report 1518 (type declaration can only contain
18718         class, struct, interface, enum or delegate)
18719
18720         (switch_label): Report 1523 (keywords `case' or `default' must
18721         preced code)
18722
18723         (opt_switch_sections): Report 1522 (empty switch)
18724
18725         * driver.cs: Report 1515 (response file specified multiple times)
18726         Report 1516 (Source file specified multiple times).
18727
18728         * expression.cs (Argument.Resolve): Signal 1510
18729
18730         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18731         access not allowed in static code)
18732
18733 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18734
18735         * typemanager.cs (IsPointerType): Utility method which we are going
18736         to need a lot.
18737
18738         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18739         the object type, so we take care of that.
18740
18741         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18742
18743         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18744         added to non-params parameters :-)
18745
18746         * typemanager.cs (CSharpName): Include 'void' type too. 
18747
18748         (void_ptr_type): Include in the set of core types.
18749
18750         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18751         duplicating code.
18752
18753         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18754         an unsafe context.
18755
18756         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18757         completely forgotten about it.
18758
18759 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18760
18761         * cs-parser.jay (pointer_type): Add. This begins our implementation
18762         of parsing rules for unsafe code.
18763
18764         (unsafe_statement): Implement.
18765
18766         (embedded_statement): Modify to include the above.
18767
18768         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18769
18770         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18771         if the current context is an unsafe one.
18772
18773         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18774         are handled differently, we need separate rules for them.
18775
18776         (local_variable_declaration): Update to use local_variable_pointer_type
18777         to allow variable declarations of unmanaged pointer types.
18778
18779         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18780         in unsafe contexts.
18781
18782         * ../errors/cs0214.cs : Add.
18783
18784 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18785
18786         * makefile: remove 'response' file when cleaning.
18787
18788 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18789
18790         * cs-parser.jay: Report 1524.
18791
18792 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * typemanager.cs (RegisterMethod): drop checking if we have
18795         registered this from here
18796
18797 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18798
18799         * class.cs (Method.EmitDestructor): Implement calling our base
18800         destructor. 
18801
18802         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18803         value of InFinally.
18804
18805         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18806         this routine and will wrap the call in a try/catch block.  Deal
18807         with the case.
18808
18809 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * ecore.cs (Expression.MemberLookup): instead of taking a
18812         parameter `same_type' that was used to tell whether we could
18813         access private members we compute our containing type from the
18814         EmitContext.
18815
18816         (FieldExpr): Added partial support for volatile fields.  This does
18817         not work for volatile fields exposed from assemblies, as I can not
18818         figure out how to extract the modreq from it.
18819
18820         Updated all the source files to use this.
18821
18822         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18823         because it is referenced by MemberLookup very often. 
18824
18825 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18826
18827         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18828         TypeBuilder.GetCustomAttributes to retrieve what we need.
18829
18830         Get rid of redundant default_member_attr_type as this is the same as
18831         default_member_type which already exists.
18832
18833         * interface.cs, attribute.cs : Update accordingly.
18834
18835 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18838         work for TYpeBuilders though.  Ravi, can you please fix this?
18839
18840         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18841
18842         * expression.cs (Argument.Emit): Handle the case of ref objects
18843         being passed to ref functions;  
18844
18845         (ParameterReference.EmitLoad): Loads the content of the pointer
18846         without dereferencing.
18847
18848 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18849
18850         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18851
18852 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18853
18854         * class.cs (Indexer.DefineMethod): Incorporate the interface
18855         type in the name of the method if we are doing explicit interface
18856         implementation.
18857
18858         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18859
18860         (BetterConversion): Fix extremely trivial bug where we were referring to
18861         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18862         again !
18863
18864         * ../errors/bug16.cs : Add although we have fixed it.
18865
18866 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * expression.cs (BaseIndexer): Begin implementation.
18869
18870         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18871
18872         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18873         production directly to remove a shift/reduce, and implement
18874         explicit interface implementation.
18875
18876         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18877         after a floating point suffix.
18878
18879         * expression.cs (DoNumericPromotions): Improved the conversion for
18880         uint/uint.  If we have a constant, we avoid doing a typecast to a
18881         larger type.
18882
18883         * class.cs (Indexer): Implement explicit interface implementation
18884         for indexers.
18885
18886 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18887
18888         * class.cs: make the default instance constructor public and hidebysig.
18889
18890 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18891
18892         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18893         so we can call it from elsewhere.
18894
18895         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18896         we emit it internally if the class has a defined indexer; otherwise the user
18897         emits it by decorating the class definition with the DefaultMemberAttribute.
18898
18899         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18900         attribute is not used on a type which defines an indexer.
18901
18902         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18903         character when we skip whitespace.
18904
18905         * ../errors/cs0646.cs : Add.
18906
18907 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18910         again. 
18911
18912         * makefile: Add practical target `mcs3.exe' which builds the third
18913         generation compiler. 
18914
18915         * expression.cs (New): Fix structures constructor calling.
18916
18917         * class.cs (Property, Method, Indexer): Emit Final flag on the
18918         method if we are an interface implementation and we are not
18919         abstract. 
18920
18921         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18922         whether this property is referencing a `base' method.
18923
18924         * expression.cs (Invocation.EmitCall): take an extra argument:
18925         is_base, this is used to determine whether the `call' or
18926         `callvirt' opcode should be used.
18927
18928
18929         * delegate.cs: update EmitCall.
18930
18931         * class.cs (Method.Define): Set NewSlot for the cases where we are
18932         not implementing an interface method.
18933
18934         (Property.Define): ditto.
18935
18936 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18939         'r'.  Allows mcs to parse itself fully.
18940
18941 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18942
18943         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18944         of the number of initializers that require the InitializeArray method.
18945
18946         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18947         update the above field where necessary.
18948
18949         (MakeByteBlob): Update accordingly.
18950
18951         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18952         greater than 2.
18953
18954         (EmitDynamicInitializers): Update in accordance with the new optimization.
18955
18956         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18957         same OpCode applies.
18958
18959         * cs-parser.jay : Fix some glaring errors I introduced.
18960
18961 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18962
18963         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18964         so that we can check for name clashes there too.
18965
18966         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18967         for interface indexers.
18968
18969         * interfaces.cs (Define): Emit the default member attribute.
18970
18971         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18972         variable was being referred to while setting the value ;-)
18973
18974 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18975
18976         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18977         byte-by-byte information when we know the data is zero.
18978
18979         Make the block always a multiple of 4, because
18980         DefineInitializedData has a bug.
18981
18982         * assign.cs: Fix, we should assign from the temporary, not from
18983         the source. 
18984
18985         * expression.cs (MakeByteBlob): Fix my incorrect code.
18986
18987 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * typemanager.cs (EnumToUnderlying): This function is used to get
18990         the underlying type from an enumeration, because it does not
18991         always work. 
18992
18993         * constant.cs: Use the I4_S form for values between -128 and 127.
18994
18995         * statement.cs (Block.LookupLabel): Looks up a label.
18996         (Block): Drop support for labeled blocks.
18997
18998         (LabeledStatement): New kind of statement that represents a label
18999         only.
19000
19001         (Goto): Finally implement this bad boy.
19002
19003         * cs-parser.jay: Update to reflect new mechanism to implement
19004         labels.
19005
19006 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19007
19008         * codegen.cs (EmitContext.This): a codegen property that keeps the
19009         a single instance of this instead of creating many different this
19010         instances. 
19011
19012         * delegate.cs (Delegate.DoResolve): Update to use the property;
19013
19014         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19015
19016         * expression.cs (BaseAccess.DoResolve): Ditto.
19017
19018 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19019
19020         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19021         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19022
19023         (InitCoreTypes): Update accordingly.
19024
19025         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19026         so we can quickly store the state.
19027
19028         (ApplyAttributes): Set the correct implementation flags
19029         for InternalCall methods.
19030
19031 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * expression.cs (EmitCall): if a method is not virtual, then do
19034         not use callvirt on it.
19035
19036         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19037         user defined stuff) requires the use of stobj, which takes an
19038         address on the stack instead of an array and an index.  So emit
19039         the Ldelema operation for it.
19040
19041         (EmitStoreOpcode): Use stobj for valuetypes.
19042
19043         (UnaryMutator.EmitCode): Use the right 1 value depending on
19044         whether we are dealing with int64/uint64, float or doubles.
19045
19046         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19047         constructors that I implemented last night.
19048
19049         (Constructor.IsDefault): Fix to work properly for static
19050         constructors.
19051
19052         * cs-parser.jay (CheckDef): report method signature errors.
19053         Update error number 103 to be 132.
19054
19055         * decl.cs: New AdditionResult enumeration value: MethodExists.
19056         Although we do this check for methods later on in the semantic
19057         analysis, catching repeated default constructors is so easy that
19058         we catch these here. 
19059
19060         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19061         promotions code.
19062
19063         (ParameterReference.EmitAssign, Emit): handle
19064         bools as bytes.
19065
19066         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19067         (ArrayAccess.EmitStoreOpcode): ditto.
19068
19069         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19070
19071         * expression.cs (MakeByteBlob): Complete all the missing types
19072         (uint, short, ushort, byte, sbyte)
19073
19074         * class.cs: Only init instance field initializers on instance
19075         constructors. 
19076
19077         Rename `constructors' to instance_constructors. 
19078
19079         (TypeContainer.AddConstructor): Only add constructors to the list
19080         if it is not static.
19081
19082         Make sure that we handle default_static_constructor independently
19083         everywhere where we handle instance_constructors
19084
19085 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19086
19087         * class.cs: Do not lookup or create a base initializer for a
19088         static constructor.
19089
19090         (ConstructorInitializer.Resolve): use the proper type to lookup
19091         for constructors.
19092
19093         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19094
19095         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19096         in DeclSpace. 
19097
19098         * decl.cs: CloseType is now an virtual method, the default
19099         implementation just closes this type.
19100
19101 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19102
19103         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19104         to PreserveSig by default. Also emit HideBySig on such methods.
19105
19106         Basically, set the defaults to standard values.
19107
19108         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19109         argument, if candidate is better, it can't be worse than the best !
19110
19111         (Invocation): Re-write bits to differentiate between methods being
19112         applicable in their expanded form and their normal form - for params
19113         methods of course.
19114
19115         Get rid of use_standard everywhere as only standard conversions are allowed
19116         in overload resolution. 
19117
19118         More spec conformance.
19119
19120 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * driver.cs: Add --timestamp, to see where the compiler spends
19123         most of its time.
19124
19125         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19126         `this' in static code.
19127
19128         (SimpleName.DoResolve): Implement in terms of a helper function
19129         that allows static-references to be passed upstream to
19130         MemberAccess.
19131
19132         (Expression.ResolveWithSimpleName): Resolve specially simple
19133         names when called by MemberAccess to implement the special
19134         semantics. 
19135
19136         (Expression.ImplicitReferenceConversion): Handle conversions from
19137         Null to reference types before others, as Null's type is
19138         System.Object. 
19139
19140         * expression.cs (Invocation.EmitCall): Handle the special case of
19141         calling methods declared on a reference type from a ValueType
19142         (Base classes System.Object and System.Enum)
19143
19144         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19145         the left hand side is a TypeExpr, not on every enumeration. 
19146
19147         (Binary.Resolve): If types are reference types, then do a cast to
19148         object on operators != and == of both arguments.
19149
19150         * typemanager.cs (FindMembers): Extract instance and static
19151         members if requested.
19152
19153         * interface.cs (PopulateProperty): Use void_type instead of null
19154         as the return type for the setter method.
19155
19156         (PopulateIndexer): ditto.
19157
19158 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19159
19160         * support.cs (ReflectionParameters): Fix minor bug where we
19161         were examining the wrong parameter for the ParamArray attribute.
19162
19163         Cope with requests for the type of the parameter at position
19164         greater than the params parameter's. We now return the element
19165         type of the params array as that makes more sense.
19166
19167         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19168         accordingly as we no longer have to extract the element type
19169         ourselves.
19170
19171         (Invocation.OverloadResolve): Update.
19172
19173 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19174
19175         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19176         against IEnumerator, test whether the return value is a descendant
19177         of the IEnumerator interface.
19178
19179         * class.cs (Indexer.Define): Use an auxiliary method to implement
19180         the other bits of the method definition.  Begin support for
19181         explicit interface implementation.
19182
19183         (Property.DefineMethod): Use TypeManager.void_type instead of null
19184         for an empty return value.
19185
19186 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19187
19188         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19189         dealing with a FieldExpr which is composed of a FieldBuilder, in
19190         the code path we did extract the constant, but we should have
19191         obtained the underlying value to be able to cast it (otherwise we
19192         end up in an infinite loop, this is what Ravi was running into).
19193
19194         (ArrayCreation.UpdateIndices): Arrays might be empty.
19195
19196         (MemberAccess.ResolveMemberAccess): Add support for section
19197         14.5.4.1 that deals with the special case of E.I when E is a type
19198         and something else, that I can be a reference to a static member.
19199
19200         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19201         handle a particular array type to create byte blobs, it is just
19202         something we dont generate byteblobs for.
19203
19204         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19205         arguments. 
19206
19207         * location.cs (Push): remove the key from the hashtable that we
19208         are about to add.   This happens for empty files.
19209
19210         * driver.cs: Dispose files after we have parsed them.
19211
19212         (tokenize): new function that only runs the tokenizer on its
19213         input, for speed testing.
19214
19215 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19216
19217         * class.cs (Event.Define): Define the private field only if there
19218         are no accessors defined.
19219
19220         * expression.cs (ResolveMemberAccess): If there is no associated
19221         field with the event, that means we have an event defined with its
19222         own accessors and we should flag error cs0070 since transforming
19223         ourselves into a field is not valid in that case.
19224
19225         * ecore.cs (SimpleName.DoResolve): Same as above.
19226
19227         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19228         and charset to sane values.
19229
19230 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19231
19232         * assign.cs (DoResolve): Perform check on events only if they 
19233         are being accessed outside the declaring type.
19234
19235         * cs-parser.jay (event_declarations): Update rules to correctly
19236         set the type of the implicit parameter etc.
19237
19238         (add_accessor, remove_accessor): Set current local parameters.
19239
19240         * expression.cs (Binary): For delegate addition and subtraction,
19241         cast the return value from the method into the appropriate delegate
19242         type.
19243
19244 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19245
19246         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19247         of these as the workaround is unnecessary.
19248
19249         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19250         delegate data - none of that is needed at all.
19251
19252         Re-write bits to extract the instance expression and the delegate method
19253         correctly.
19254
19255         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19256         on delegates too.
19257
19258         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19259         of attaching attributes instead of duplicating code everywhere.
19260
19261         * everywhere : Update code to do attribute emission using the above method.
19262
19263 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * expression.cs (IsParamsMethodApplicable): if there are not
19266         parameters, return immediately.
19267
19268         * ecore.cs: The 0 literal can be implicity converted to an enum
19269         type. 
19270
19271         (SimpleName.DoResolve): First lookup the type, then lookup the
19272         members. 
19273
19274         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19275         want to get its address.  If the InstanceExpression is not
19276         addressable, store the result in a temporary variable, then get
19277         the address of it.
19278
19279         * codegen.cs: Only display 219 errors on warning level or above. 
19280
19281         * expression.cs (ArrayAccess): Make it implement the
19282         IMemoryLocation interface.
19283
19284         (Binary.DoResolve): handle the operator == (object a, object b)
19285         and operator != (object a, object b) without incurring into a
19286         BoxedCast (because 5 != o should never be performed).
19287
19288         Handle binary enumerator operators.
19289
19290         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19291         value type, otherwise use Ldelem_ref.
19292
19293         Use precomputed names;
19294
19295         (AddressOf): Implement address of
19296
19297         * cs-parser.jay (labeled_statement): Fix recursive block
19298         addition by reworking the production.
19299
19300         * expression.cs (New.DoEmit): New has a special case:
19301                 
19302                  If we are dealing with a ValueType, we have a few
19303                  situations to deal with:
19304                 
19305                     * The target of New is a ValueType variable, that is
19306                       easy, we just pass this as the variable reference
19307                 
19308                     * The target of New is being passed as an argument,
19309                       to a boxing operation or a function that takes a
19310                       ValueType.
19311                 
19312                       In this case, we need to create a temporary variable
19313                       that is the argument of New.
19314
19315
19316 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19317
19318         * rootcontext.cs (LookupType): Check that current_type is not null before
19319         going about looking at nested types.
19320
19321         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19322         not implement the IAssignMethod interface any more.
19323
19324         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19325         where we tranform them into FieldExprs if they are being resolved from within
19326         the declaring type.
19327
19328         * ecore.cs (SimpleName.DoResolve): Do the same here.
19329
19330         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19331
19332         * ../errors/bug10.cs : Add.
19333
19334         * ../errors/cs0070.cs : Add.
19335
19336         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19337
19338         * assign.cs : Get rid of EventIsLocal everywhere.
19339
19340 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19341
19342         * ecore.cs (ConvertIntLiteral): finished the implementation.
19343
19344         * statement.cs (SwitchLabel): Convert the value we are using as a
19345         key before looking up the table.
19346
19347 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19348
19349         * codegen.cs (EmitTopBlock): Require a Location argument now.
19350
19351         * cs-parser.jay (constructor_declarator): We need to setup
19352         current_local_parameters before we parse the
19353         opt_constructor_initializer, to allow the variables to be bound
19354         to the constructor arguments.
19355
19356         * rootcontext.cs (LookupType): First lookup nested classes in our
19357         class and our parents before we go looking outside our class.
19358
19359         * expression.cs (ConstantFold): Extract/debox the values at the
19360         beginnning. 
19361
19362         * rootcontext.cs (EmitCode): Resolve the constants first before we
19363         resolve the types.  This is not really needed, but it helps debugging.
19364
19365         * statement.cs: report location.
19366
19367         * cs-parser.jay: pass location to throw statement.
19368
19369         * driver.cs: Small bug fix.
19370
19371         * report.cs: Updated format to be 4-zero filled digits.
19372
19373 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19374
19375         * expression.cs (CheckIndices): Fix minor bug where the wrong
19376         variable was being referred to ;-)
19377
19378         (DoEmit): Do not call EmitStaticInitializers when the 
19379         underlying type is System.Object.
19380
19381 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19382
19383         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19384         and do the usual workaround for SRE.
19385
19386         * class.cs (MyEventBuilder.EventType): New member to get at the type
19387         of the event, quickly.
19388
19389         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19390
19391         * assign.cs (Assign.DoResolve): Handle the case when the target
19392         is an EventExpr and perform the necessary checks.
19393
19394         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19395         interface.
19396
19397         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19398
19399         (EventExpr): Set the type in the constructor itself since we 
19400         are meant to be born fully resolved.
19401
19402         (EventExpr.Define): Revert code I wrote earlier.
19403                 
19404         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19405         instance expression is null. The instance expression is a This in that case
19406         or a null, depending on whether it is a static method or not.
19407
19408         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19409         refers to more than one method.
19410
19411         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19412         and accordingly flag errors.
19413
19414 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19415
19416         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19417
19418 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19419
19420         * location.cs (ToString): Provide useful rutine.
19421
19422 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19423
19424         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19425         objects, return the actual integral boxed.
19426
19427         * statement.cs (SwitchLabel): define an ILLabel for each
19428         SwitchLabel. 
19429
19430         (Switch.CheckSwitch): If the value is a Literal, extract
19431         the underlying literal.
19432
19433         Also in the unused hashtable we had, add the SwitchLabel so we can
19434         quickly look this value up.
19435
19436         * constant.cs: Implement a bunch of new constants.  Rewrite
19437         Literal based on this.  Made changes everywhere to adapt to this.
19438
19439         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19440         dereferencing array only once, and also copes with enumrations.
19441
19442         bytes are two bytes wide, not one.
19443
19444         (Cast): Perform constant conversions.
19445
19446         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19447         wrappers to the literals here.
19448
19449         * expression.cs (DoNumericPromotions): long literals can converted
19450         to ulong implicity (this is taken care of elsewhere, but I was
19451         missing this spot).
19452
19453         * ecore.cs (Expression.Literalize): Make the return type Literal,
19454         to improve type checking.
19455
19456         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19457
19458 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19459
19460         * literal.cs: Revert code from ravi that checked the bounds.  The
19461         bounds are sane by the definition of the type itself. 
19462
19463         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19464         need to actually look up in our parent hierarchy for interfaces
19465         implemented. 
19466
19467         * const.cs: Use the underlying type for enumerations
19468
19469         * delegate.cs: Compute the basename for the delegate creation,
19470         that should fix the delegate test case, and restore the correct
19471         Type Lookup semantics in rootcontext
19472
19473         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19474         referencing a nested type with the Reflection API is using the "+"
19475         sign. 
19476
19477         * cs-parser.jay: Do not require EOF token at the end.
19478
19479 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19480
19481         * rootcontext.cs (LookupType): Concatenate type names with
19482         a '.' instead of a '+' The test suite passes again.
19483
19484         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19485         field of the enumeration.
19486
19487         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19488         the case when the member is an EventExpr.
19489
19490         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19491         static has an associated instance expression.
19492
19493         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19494
19495         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19496
19497         * class.cs (Event.Define): Register event and perform appropriate checks
19498         for error #111.
19499
19500         We define the Add and Remove methods even if the use provides none because
19501         in that case, we provide default implementations ourselves.
19502
19503         Define a private field of the type of the event. This is done by the CSC compiler
19504         and we should be doing it too ;-)
19505
19506         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19507         More methods we use in code we generate.
19508
19509         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19510         is important.
19511
19512         (InitCoreTypes): Update accordingly for the above.
19513
19514         * class.cs (Event.Emit): Generate code for default accessors that we provide
19515
19516         (EmitDefaultMethod): Do the job in the above.
19517
19518         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19519         appropriate place.
19520
19521 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19524         builders even if we were missing one.
19525
19526         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19527         pass the Basename as our class name instead of the Name.  The
19528         basename will be correctly composed for us.
19529
19530         * parameter.cs (Paramters): Now takes a Location argument.
19531
19532         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19533         make all the code call directly LookupType in RootContext and take
19534         this chance to pass the Location information everywhere.
19535
19536         * Everywhere: pass Location information.
19537
19538 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19539
19540         * class.cs (Constructor.Define): Updated way of detecting the
19541         length of the parameters.
19542
19543         (TypeContainer.DefineType): Use basename as the type name for
19544         nested types.
19545
19546         (TypeContainer.Define): Do not recursively define types here, as
19547         definition is taken care in order by the RootContext.
19548
19549         * tree.cs: Keep track of namespaces in a per-file basis.
19550
19551         * parameter.cs (Parameter.ComputeSignature): Update to use
19552         DeclSpace. 
19553
19554         (Parameters.GetSignature): ditto.
19555
19556         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19557         instead of a TypeContainer.
19558
19559         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19560         resolve names.  Because we need to be resolve in our context, not
19561         our parents.
19562
19563         * driver.cs: Implement response files.
19564
19565         * class.cs (TypeContainer.DefineType): If we are defined, do not
19566         redefine ourselves.
19567
19568         (Event.Emit): Emit the code for add/remove handlers.
19569         (Event.Define): Save the MethodBuilders for add/remove.
19570
19571         * typemanager.cs: Use pair here too.
19572
19573         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19574         DictionaryEntry requires the first argument to be non-null.  
19575
19576         (enum_declaration): Compute full name for registering the
19577         enumeration.
19578
19579         (delegate_declaration): Instead of using
19580         formal_parameter_list, use opt_formal_parameter_list as the list
19581         can be empty.
19582
19583         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19584         (EventParsing): New property that controls whether `add' and
19585         `remove' are returned as tokens or identifiers (for events);
19586
19587 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19588
19589         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19590         use MyEventBuilder only and let it wrap the real builder for us.
19591
19592         (MyEventBuilder): Revamp constructor etc.
19593
19594         Implement all operations that we perform on EventBuilder in precisely the same
19595         way here too.
19596
19597         (FindMembers): Update to use the EventBuilder member.
19598
19599         (Event.Emit): Update accordingly.
19600
19601 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19602
19603         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19604         by calling the appropriate methods.
19605
19606         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19607         useful.
19608
19609         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19610
19611 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19612
19613         * delegate.cs (Delegate.Populate): Check that the return type
19614         and various parameters types are indeed accessible.
19615
19616         * class.cs (Constructor.Define): Same here.
19617
19618         (Field.Define): Ditto.
19619
19620         (Event.Define): Ditto.
19621
19622         (Operator.Define): Check that the underlying Method defined itself
19623         correctly - so it's MethodBuilder should not be null.
19624
19625         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19626         expression happens to be null.
19627
19628         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19629         members but as of now we don't seem to be able to do anything really useful with it.
19630
19631         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19632         not the EventBuilder.
19633
19634 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * cs-tokenizer.cs: Add support for defines.
19637         Add support for #if, #elif, #else, #endif
19638
19639         (eval_var): evaluates a variable.
19640         (eval): stubbed for evaluating functions.
19641
19642         * cs-parser.jay: Pass the defines information
19643
19644         * driver.cs: Add --define command line option.
19645
19646         * decl.cs: Move MemberCore here.
19647
19648         Make it the base class for DeclSpace.  This allows us to catch and
19649         report 108 and 109 for everything now.
19650
19651         * class.cs (TypeContainer.Define): Extract all the members
19652         before populating and emit the warning 108 (new keyword required
19653         to override) instead of having each member implement this.
19654
19655         (MemberCore.Define): New abstract method, we will be using this in
19656         the warning reporting engine in Populate.
19657
19658         (Operator.Define): Adjust to new MemberCore protocol. 
19659
19660         * const.cs (Const): This does not derive from Expression, it is a
19661         temporary object we use to create fields, it is a MemberCore. 
19662
19663         * class.cs (Method.Define): Allow the entry point to be in a
19664         specific class.
19665
19666         * driver.cs: Rewrite the argument handler to clean it up a bit.
19667
19668         * rootcontext.cs: Made it just an auxiliary namespace feature by
19669         making everything static.
19670
19671         * driver.cs: Adapt code to use RootContext type name instead of
19672         instance variable.
19673
19674         * delegate.cs: Remove RootContext argument.
19675
19676         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19677         argument. 
19678
19679         * class.cs (Event.Define): The lookup can fail.
19680
19681         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19682
19683         * expression.cs: Resolve the this instance before invoking the code.
19684
19685 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * cs-parser.jay: Add a production in element_access that allows
19688         the thing to become a "type" reference.  This way we can parse
19689         things like "(string [])" as a type.
19690
19691         Note that this still does not handle the more complex rules of
19692         casts. 
19693
19694
19695         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19696
19697         * ecore.cs: (CopyNewMethods): new utility function used to
19698         assemble the list of methods from running FindMembers.
19699
19700         (MemberLookup): Rework FindMembers so that 
19701
19702 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * class.cs (TypeContainer): Remove Delegates who fail to be
19705         defined.
19706
19707         * delegate.cs (Populate): Verify that we dont get null return
19708         values.   TODO: Check for AsAccessible.
19709
19710         * cs-parser.jay: Use basename to emit error 574 (destructor should
19711         have the same name as container class), not the full name.
19712
19713         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19714         possible representation.  
19715
19716         Also implements integer type suffixes U and L.
19717
19718 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19719
19720         * expression.cs (ArrayCreation.DoResolve): We need to do the
19721         argument resolution *always*.
19722
19723         * decl.cs: Make this hold the namespace.  Hold the root context as
19724         well.
19725         (LookupType): Move here.
19726
19727         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19728
19729         * location.cs (Row, Name): Fixed the code, it was always returning
19730         references to the first file.
19731
19732         * interface.cs: Register properties defined through interfaces.
19733
19734         * driver.cs: Add support for globbing on the command line
19735
19736         * class.cs (Field): Make it derive from MemberCore as well.
19737         (Event): ditto.
19738
19739 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19740
19741         * class.cs (Event::Define): Check that the type of the event is a delegate
19742         type else flag error #66.
19743
19744         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19745         same.
19746
19747         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19748         values of EntryPoint, CharSet etc etc.
19749
19750         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19751
19752         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19753         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19754         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19755         which needs this to do its work.
19756
19757         * ../errors/cs0066.cs : Add.
19758
19759 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19760
19761         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19762         helper functions.
19763
19764         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19765         clears out the parameters field.
19766         (MemberSignatureCompare): Cleanup
19767
19768         (MemberCore): New base class used to share code between MethodCore
19769         and Property.
19770
19771         (RegisterRequiredImplementations) BindingFlags.Public requires
19772         either BindingFlags.Instace or Static.  Use instance here.
19773
19774         (Property): Refactored code to cope better with the full spec.
19775
19776         * parameter.cs (GetParameterInfo): Return an empty array instead
19777         of null on error.
19778
19779         * class.cs (Property): Abstract or extern properties have no bodies.
19780
19781         * parameter.cs (GetParameterInfo): return a zero-sized array.
19782
19783         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19784         method modifier validation to the typecontainer so we can reuse
19785         this on properties.
19786
19787         (MethodCore.ParameterTypes): return an empty sized array of types.
19788
19789         (Property.Define): Test property modifier validity.
19790
19791         Add tests for sealed/override too.
19792
19793         (Method.Emit): abstract or extern methods have no bodies.
19794
19795 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19796
19797         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19798         thing.
19799
19800         (Method::Define, ::Emit): Modify accordingly.
19801
19802         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19803
19804         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19805
19806         * makefile: Pass in /unsafe.
19807
19808 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * class.cs (MakeKey): Kill routine.
19811
19812         * class.cs (TypeContainer.Define): Correctly define explicit
19813         method implementations (they require the full interface name plus
19814         the method name).
19815
19816         * typemanager.cs: Deply the PtrHashtable here and stop using the
19817         lame keys.  Things work so much better.
19818
19819         This of course broke everyone who depended on `RegisterMethod' to
19820         do the `test for existance' test.  This has to be done elsewhere.
19821
19822         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19823         the object stupid Equals method (because, that like fails all over
19824         the place).  We still do not use it.
19825
19826         * class.cs (TypeContainer.SetRequiredInterface,
19827         TypeContainer.RequireMethods): Killed these two routines and moved
19828         all the functionality to RegisterRequiredImplementations.
19829
19830         (TypeContainer.RegisterRequiredImplementations): This routine now
19831         registers all the implementations required in an array for the
19832         interfaces and abstract methods.  We use an array of structures
19833         which can be computed ahead of time to reduce memory usage and we
19834         also assume that lookups are cheap as most classes will not
19835         implement too many interfaces.
19836
19837         We also avoid creating too many MethodSignatures.
19838
19839         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19840         clear the "pending" bit if we find that there are problems with
19841         the declaration.
19842
19843         (TypeContainer.VerifyPendingMethods): Update to report errors of
19844         methods that look like implementations but are not.
19845
19846         (TypeContainer.Define): Add support for explicit interface method
19847         implementation. 
19848
19849 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * typemanager.cs: Keep track of the parameters here instead of
19852         being a feature of the TypeContainer.
19853
19854         * class.cs: Drop the registration of parameters here, as
19855         InterfaceMethods are also interface declarations.
19856
19857         * delegate.cs: Register methods with the TypeManager not only with
19858         the TypeContainer.  This code was buggy.
19859
19860         * interface.cs: Full registation here.
19861
19862 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * expression.cs: Remove reducer for binary expressions, it can not
19865         be done this way.
19866
19867         * const.cs: Put here the code that used to go into constant.cs
19868
19869         * constant.cs: Put here the code for constants, this is a new base
19870         class for Literals.
19871
19872         * literal.cs: Make Literal derive from Constant.
19873
19874 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * statement.cs (Return.Emit): Report error 157 if the user
19877         attempts to return from a finally block.
19878
19879         (Return.Emit): Instead of emitting a return, jump to the end of
19880         the function.
19881
19882         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19883         LocalBuilder to store the result of the function.  ReturnLabel is
19884         the target where we jump.
19885
19886
19887 2001-12-09  Radek Doulik  <rodo@ximian.com>
19888
19889         * cs-parser.jay: remember alias in current namespace
19890
19891         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19892         namespaces
19893
19894         * class.cs (LookupAlias): lookup alias in my_namespace
19895
19896         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19897         aliases hashtable
19898         (LookupAlias): lookup alias in this and if needed in parent
19899         namespaces
19900
19901 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19902
19903         * support.cs: 
19904
19905         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19906         making things static.  I need this to avoid passing the
19907         TypeContainer when calling ParameterType.
19908
19909         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19910         that did string manipulation to compute the type and then call
19911         GetType.  Use Parameter.ParameterType instead.
19912
19913         * cs-tokenizer.cs: Consume the suffix for floating values.
19914
19915         * expression.cs (ParameterReference): figure out whether this is a
19916         reference parameter or not.  Kill an extra variable by computing
19917         the arg_idx during emission.
19918
19919         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19920         function that returns whether a parameter is an out/ref value or not.
19921
19922         (Parameter.ParameterType): The type of the parameter (base,
19923         without ref/out applied).
19924
19925         (Parameter.Resolve): Perform resolution here.
19926         (Parameter.ExternalType): The full type (with ref/out applied).
19927
19928         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19929         support for expressions on the using statement.
19930
19931 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * statement.cs (Using.EmitLocalVariableDecls): Split the
19934         localvariable handling of the using statement.
19935
19936         (Block.EmitMeta): Keep track of variable count across blocks.  We
19937         were reusing slots on separate branches of blocks.
19938
19939         (Try.Emit): Emit the general code block, we were not emitting it. 
19940
19941         Check the type of the declaration to be an IDisposable or
19942         something that can be implicity converted to it. 
19943
19944         Emit conversions if required.
19945
19946         * ecore.cs (EmptyExpression): New utility class.
19947         (Expression.ImplicitConversionExists): New utility function.
19948
19949 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19950
19951         * statement.cs (Using): Implement.
19952
19953         * expression.cs (LocalVariableReference): Support read only variables.
19954
19955         * statement.cs: Remove the explicit emit for the Leave opcode.
19956         (VariableInfo): Add a readonly field.
19957
19958 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19959
19960         * ecore.cs (ConvCast): new class used to encapsulate the various
19961         explicit integer conversions that works in both checked and
19962         unchecked contexts.
19963
19964         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19965         properly generate the overflow opcodes.
19966
19967 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19968
19969         * statement.cs: The correct type for the EmptyExpression is the
19970         element_type, not the variable type.  Ravi pointed this out.
19971
19972 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19973
19974         * class.cs (Method::Define): Handle PInvoke methods specially
19975         by using DefinePInvokeMethod instead of the usual one.
19976
19977         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19978         above to do the task of extracting information and defining the method.
19979
19980 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19981
19982         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19983         of the condition for string type.
19984
19985         (Emit): Move that here. 
19986
19987         (ArrayCreation::CheckIndices): Keep string literals in their expression
19988         form.
19989
19990         (EmitDynamicInitializers): Handle strings appropriately.
19991
19992 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * codegen.cs (EmitContext): Replace multiple variables with a
19995         single pointer to the current Switch statement.
19996
19997         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19998         EmitContext.
19999
20000 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20001
20002         * statement.cs 
20003
20004         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20005         default'.
20006
20007         (Foreach.Emit): Foreach on arrays was not setting
20008         up the loop variables (for break/continue).
20009
20010         (GotoCase): Semi-implented.
20011
20012 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20013
20014         * attribute.cs (CheckAttribute): Handle system attributes by using
20015         Attribute.GetAttributes to examine information we need.
20016
20017         (GetValidPlaces): Same here.
20018
20019         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20020
20021         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20022
20023         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20024
20025         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20026
20027         (Method::Emit): Handle the case when we are a PInvoke method.
20028
20029 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * expression.cs: Use ResolveWithSimpleName on compound names.
20032
20033 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20034
20035         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20036         before trying to reduce it.
20037
20038         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20039
20040         * constant.cs (LookupConstantValue): Implement.
20041
20042         (EmitConstant): Use the above in emitting the constant.
20043
20044         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20045         that are user-defined by doing a LookupConstantValue on them.
20046
20047         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20048         too, like above.
20049
20050 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20053
20054         (BaseAccess.DoResolve): Implement.
20055
20056         (MemberAccess.DoResolve): Split this routine into a
20057         ResolveMemberAccess routine that can be used independently
20058
20059 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20062         As that share bits of the implementation.  Is returns a boolean,
20063         while As returns the Type that is being probed.
20064
20065 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20066
20067         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20068         instead of a Literal - much easier.
20069
20070         (EnumInTransit): Remove - utterly useless :-)
20071
20072         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20073
20074         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20075
20076         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20077         chain when we have no associated expression.
20078
20079 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20080
20081         * constant.cs (Define): Use Location while reporting the errror.
20082
20083         Also emit a warning when 'new' is used and there is no inherited
20084         member to hide.
20085
20086         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20087         populated.
20088
20089         (LookupEnumValue): Implement to lookup an enum member's value and define it
20090         if necessary.
20091
20092         (Populate): Re-write accordingly to use the above routine.
20093
20094 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20095
20096         * expression.cs (This): Fix prototype for DoResolveLValue to
20097         override the base class DoResolveLValue.
20098
20099         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20100         declarations) 
20101
20102         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20103         (we need to load the address of the field here).  This fixes
20104         test-22. 
20105
20106         (FieldExpr.DoResolveLValue): Call the DoResolve
20107         function to initialize the Instance expression.
20108
20109         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20110         correctly the GetEnumerator operation on a value type.
20111
20112         * cs-parser.jay: Add more simple parsing error catches.
20113
20114         * statement.cs (Switch): Add support for string switches.
20115         Handle null specially.
20116
20117         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20118
20119 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20120
20121         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20122
20123         (declare_local_constant): New helper function.
20124
20125         * statement.cs (AddConstant): Keep a separate record of constants
20126
20127         (IsConstant): Implement to determine if a variable is a constant.
20128
20129         (GetConstantExpression): Implement.
20130
20131         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20132
20133         * statement.cs (IsVariableDefined): Re-write.
20134
20135 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20136
20137         * class.cs (TypeContainer::FindMembers): Look for constants
20138         in the case when we are looking for MemberTypes.Field
20139
20140         * expression.cs (MemberAccess::DoResolve): Check that in the
20141         case we are a FieldExpr and a Literal, we are not being accessed
20142         by an instance reference.
20143
20144         * cs-parser.jay (local_constant_declaration): Implement.
20145
20146         (declaration_statement): Implement for constant declarations.
20147
20148 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20149
20150         * statement.cs (Switch): Catch double defaults.
20151
20152         (Switch): More work on the switch() statement
20153         implementation.  It works for integral values now, need to finish
20154         string support.
20155
20156
20157 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20160         integer literals into other integer literals.  To be used by
20161         switch. 
20162
20163 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20164
20165         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20166         some memory.
20167
20168         (EmitDynamicInitializers): Cope with the above since we extract data
20169         directly from ArrayData now.
20170
20171         (ExpectInitializers): Keep track of whether initializers are mandatory
20172         or not.
20173
20174         (Bounds): Make it a hashtable to prevent the same dimension being 
20175         recorded for every element in that dimension.
20176
20177         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20178         from being found.
20179
20180         Also fix bug which was causing the indices to be emitted in the reverse
20181         order.
20182
20183 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20184
20185         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20186         unfinished.  They do not work, because the underlying code is
20187         sloppy.
20188
20189 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * cs-parser.jay: Remove bogus fixme.
20192
20193         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20194         on Switch statement.
20195
20196 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20197
20198         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20199         the same. 
20200
20201         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20202         parameter. Apparently, any expression is allowed. 
20203
20204         (ValidateInitializers): Update accordingly.
20205
20206         (CheckIndices): Fix some tricky bugs thanks to recursion.
20207
20208         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20209         I was being completely brain-dead.
20210
20211         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20212         and re-write acordingly.
20213
20214         (DelegateInvocation): Re-write accordingly.
20215
20216         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20217
20218         (MakeByteBlob): Handle types more correctly.
20219
20220         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20221         initialization from expressions but it is incomplete because I am a complete
20222         Dodo :-|
20223
20224 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20227         on If.  Basically, we have to return `true' (ie, we do return to
20228         our caller) only if both branches of the if return.
20229
20230         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20231         short-circuit operators, handle them as short circuit operators. 
20232
20233         (Cast.DoResolve): Resolve type.
20234         (Cast.Cast): Take an expression as the target type.
20235
20236         * cs-parser.jay (cast_expression): Remove old hack that only
20237         allowed a limited set of types to be handled.  Now we take a
20238         unary_expression and we resolve to a type during semantic
20239         analysis.
20240
20241         Use the grammar productions from Rhys to handle casts (this is
20242         not complete like Rhys syntax yet, we fail to handle that corner
20243         case that C# has regarding (-x), but we will get there.
20244
20245 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20246
20247         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20248         field which is an array type.
20249
20250         * cs-parser.jay (declare_local_variables): Support array initialization too.
20251
20252         * typemanager.cs (MakeKey): Implement.
20253
20254         (everywhere): Use the above appropriately.
20255
20256         * cs-parser.jay (for_statement): Update for array initialization while
20257         declaring variables.
20258
20259         * ecore.cs : The error message was correct, it's the variable's names that
20260         were misleading ;-) Make the code more readable.
20261
20262         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20263         the correct type etc.
20264
20265         (ConvertExplicit): Handle Enum types by examining the underlying type.
20266
20267 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20268
20269         * parameter.cs (GetCallingConvention): Always return
20270         CallingConventions.Standard for now.
20271
20272 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20275         and `r' after calling DoNumericPromotions.
20276
20277         * ecore.cs: Fix error message (the types were in the wrong order).
20278
20279         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20280         BindingFlags.Instance as well 
20281
20282         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20283         implicit int literal conversion in an empty cast so that we
20284         propagate the right type upstream.
20285
20286         (UnboxCast): new class used to unbox value types.
20287         (Expression.ConvertExplicit): Add explicit type conversions done
20288         by unboxing.
20289
20290         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20291         the target type before applying the implicit LongLiterals to ULong
20292         literal cast.
20293
20294 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20295
20296         * cs-parser.jay (for_statement): Reworked the way For works: now
20297         we declare manually any variables that are introduced in
20298         for_initializer to solve the problem of having out-of-band code
20299         emition (that is what got for broken).
20300
20301         (declaration_statement): Perform the actual variable declaration
20302         that used to be done in local_variable_declaration here.
20303
20304         (local_variable_declaration): Do not declare anything, just pass
20305         the information on a DictionaryEntry
20306
20307 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20308
20309         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20310         re-write of the logic to now make it recursive.
20311
20312         (UpdateIndices): Re-write accordingly.
20313
20314         Store element data in a separate ArrayData list in the above methods.
20315
20316         (MakeByteBlob): Implement to dump the array data into a byte array.
20317
20318 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20319
20320         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20321         into CheckIndices.
20322
20323         * constant.cs (Define): Implement.
20324
20325         (EmitConstant): Re-write fully.
20326
20327         Pass in location info.
20328
20329         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20330         respectively.
20331
20332         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20333         DictionaryEntry since we need location info too.
20334
20335         (constant_declaration): Update accordingly.
20336
20337         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20338         code into another method : UpdateIndices.
20339
20340 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20341
20342         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20343         some type checking etc.
20344
20345 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20346
20347         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20348         bits to provide dimension info if the user skips doing that.
20349
20350         Update second constructor to store the rank correctly.
20351
20352 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20353
20354         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20355         and try to implement.
20356
20357         * ../errors/cs0150.cs : Add.
20358
20359         * ../errors/cs0178.cs : Add.
20360
20361 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20362
20363         * statement.cs: Implement foreach on multi-dimensional arrays. 
20364
20365         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20366         name of the params argument.
20367
20368         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20369         initializing the array.
20370
20371         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20372         we can use this elsewhere.
20373
20374         * statement.cs: Finish implementation of foreach for single
20375         dimension arrays.
20376
20377         * cs-parser.jay: Use an out-of-band stack to pass information
20378         around, I wonder why I need this.
20379
20380         foreach_block: Make the new foreach_block the current_block.
20381
20382         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20383         function used to return a static Parameters structure.  Used for
20384         empty parameters, as those are created very frequently.
20385
20386         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20387
20388 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20389
20390         * interface.cs : Default modifier is private, not public. The
20391         make verify test passes again.
20392
20393 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20394
20395         * support.cs (ReflectionParameters): Fix logic to determine
20396         whether the last parameter is a params one. Test 9 passes again.
20397
20398         * delegate.cs (Populate): Register the builders we define with
20399         RegisterParameterForBuilder. Test 19 passes again.
20400
20401         * cs-parser.jay (property_declaration): Reference $6 instead
20402         of $$ to get at the location.
20403
20404         (indexer_declaration): Similar stuff.
20405
20406         (attribute): Ditto.
20407
20408         * class.cs (Property): Register parameters for the Get and Set methods
20409         if they exist. Test 23 passes again.
20410
20411         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20412         call to EmitArguments as we are sure there aren't any params arguments. 
20413         Test 32 passes again.
20414
20415         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20416         IndexOutOfRangeException. 
20417
20418         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20419         Test 33 now passes again.
20420
20421 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20422
20423         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20424         broke a bunch of things.  Will have to come up with a better way
20425         of tracking locations.
20426
20427         * statement.cs: Implemented foreach for single dimension arrays.
20428
20429 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20432         an error.  This removes the lookup from the critical path.
20433
20434         * cs-parser.jay: Removed use of temporary_loc, which is completely
20435         broken. 
20436
20437 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20438
20439         * support.cs (ReflectionParameters.ParameterModifier): Report
20440         whether the argument is a PARAMS argument or not.
20441
20442         * class.cs: Set the attribute `ParamArrayAttribute' on the
20443         parameter argument.
20444
20445         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20446         and cons_param_array_attribute (ConstructorInfo for
20447         ParamArrayAttribute)., 
20448
20449         * codegen.cs: Emit the return using the `Return' statement, that
20450         way we can report the error correctly for missing return values. 
20451
20452         * class.cs (Method.Emit): Clean up.
20453
20454         * expression.cs (Argument.Resolve): Take another argument: the
20455         location where this argument is used.  Notice that this is not
20456         part of the "Argument" class as to reduce the size of the
20457         structure (we know the approximate location anyways).
20458
20459         Test if the argument is a variable-reference, if not, then
20460         complain with a 206.
20461
20462         (Argument.Emit): Emit addresses of variables.
20463
20464         (Argument.FullDesc): Simplify.
20465
20466         (Invocation.DoResolve): Update for Argument.Resolve.
20467
20468         (ElementAccess.DoResolve): ditto.
20469
20470         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20471         method should be virtual, as this method is always virtual.
20472
20473         (NewDelegate.DoResolve): Update for Argument.Resolve.
20474
20475         * class.cs (ConstructorInitializer.DoResolve): ditto.
20476
20477         * attribute.cs (Attribute.Resolve): ditto.
20478
20479 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20480
20481         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20482
20483         * expression.cs (ParameterReference): Drop IStackStorage and implement
20484         IAssignMethod instead. 
20485
20486         (LocalVariableReference): ditto.
20487
20488         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20489         IAssignMethod instead. 
20490
20491 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20492
20493         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20494         enumerations that are used in heavily used structures derive from
20495         byte in a laughable and pathetic attempt to reduce memory usage.
20496         This is the kind of pre-optimzations that you should not do at
20497         home without adult supervision.
20498
20499         * expression.cs (UnaryMutator): New class, used to handle ++ and
20500         -- separatedly from the other unary operators.  Cleans up the
20501         code, and kills the ExpressionStatement dependency in Unary.
20502
20503         (Unary): Removed `method' and `Arguments' from this class, making
20504         it smaller, and moving it all to SimpleCall, so I can reuse this
20505         code in other locations and avoid creating a lot of transient data
20506         strucutres when not required.
20507
20508         * cs-parser.jay: Adjust for new changes.
20509
20510 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * enum.cs (Enum.Populate): If there is a failure during
20513         definition, return
20514
20515         * cs-parser.jay (opt_enum_base): we used to catch type errors
20516         here, but this is really incorrect.  The type error should be
20517         catched during semantic analysis.
20518
20519 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20520
20521         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20522         current_local_parameters as expected since I, in my stupidity, had forgotten
20523         to do this :-)
20524
20525         * attribute.cs (GetValidPlaces): Fix stupid bug.
20526
20527         * class.cs (Method::Emit): Perform check on applicability of attributes.
20528
20529         (Constructor::Emit): Ditto.
20530
20531         (Field::Emit): Ditto.
20532
20533         (Field.Location): Store location information.
20534
20535         (Property, Event, Indexer, Operator): Ditto.
20536
20537         * cs-parser.jay (field_declaration): Pass in location for each field.
20538
20539         * ../errors/cs0592.cs : Add.
20540
20541 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20542
20543         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20544
20545         (InitCoreTypes): Update accordingly.
20546
20547         (RegisterAttrType, LookupAttr): Implement.
20548
20549         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20550         info about the same.
20551
20552         (Resolve): Update to populate the above as necessary.
20553
20554         (Error592): Helper.
20555
20556         (GetValidPlaces): Helper to the above.
20557
20558         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20559
20560         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20561
20562 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20563
20564         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20565
20566         * ../errors/cs0617.cs : Add.
20567
20568 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20569
20570         * enum.cs (Emit): Rename to Populate to be more consistent with what
20571         we expect it to do and when exactly it is called.
20572
20573         * class.cs, rootcontext.cs : Update accordingly.
20574
20575         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20576         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20577
20578         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20579
20580         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20581         of a fieldinfo using the above, when dealing with a FieldBuilder.
20582
20583 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20584
20585         * ../errors/cs0031.cs : Add.
20586
20587         * ../errors/cs1008.cs : Add.
20588
20589         * ../errrors/cs0543.cs : Add.
20590
20591         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20592         enum type.
20593
20594         (FindMembers): Implement.
20595
20596         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20597         enums and delegates too.
20598
20599         (enum_types): Rename to builder_to_enum.
20600
20601         (delegate_types): Rename to builder_to_delegate.
20602
20603         * delegate.cs (FindMembers): Implement.
20604
20605 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20606
20607         * typemanager.cs (IsEnumType): Implement.
20608
20609         * enum.cs (Emit): Re-write parts to account for the underlying type
20610         better and perform checking etc.
20611
20612         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20613         of the underlying type.
20614
20615         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20616         value
20617
20618         * enum.cs (error31): Helper to report error #31.
20619
20620         * cs-parser.jay (enum_declaration): Store location of each member too.
20621
20622         * enum.cs (member_to_location): New hashtable. 
20623
20624         (AddEnumMember): Update location hashtable.
20625
20626         (Emit): Use the location of each member while reporting errors.
20627
20628 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20629
20630         * cs-parser.jay: A for_initializer if is a
20631         local_variable_declaration really ammount to have an implicit
20632         block with the variable declaration and no initializer for for.
20633
20634         * statement.cs (For.Emit): Cope with null initializers.
20635
20636         This fixes the infinite loop on for initializers.
20637
20638 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20639
20640         * enum.cs: More cleanup.
20641
20642         * ecore.cs: Remove dead code.
20643
20644         * class.cs (Property.Emit): More simplification.
20645         (Event.Emit): ditto.
20646
20647         Reworked to have less levels of indentation.
20648
20649 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20650
20651         * class.cs (Property): Emit attributes.
20652
20653         (Field): Ditto.
20654
20655         (Event): Ditto.
20656
20657         (Indexer): Ditto.
20658
20659         (Operator): Ditto.
20660
20661         * enum.cs (Emit): Ditto.
20662
20663         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20664         Enums too.
20665
20666         * class.cs (Field, Event, etc.): Move attribute generation into the
20667         Emit method everywhere.
20668
20669         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20670         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20671         as we had no way of defining nested enums !
20672
20673         * rootcontext.cs : Adjust code accordingly.
20674
20675         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20676
20677 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20678
20679         * expression.cs (EvalConstantExpression): Move into ecore.cs
20680
20681         * enum.cs (Enum): Rename some members and make them public and readonly
20682         according to our convention.
20683
20684         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20685         nothing else.
20686
20687         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20688
20689         (Enum::Emit): Write a simple version for now which doesn't try to compute
20690         expressions. I shall modify this to be more robust in just a while.
20691
20692         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20693
20694         (TypeContainer::CloseType): Create the Enum types too.
20695
20696         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20697
20698         * expression.cs (EvalConstantExpression): Get rid of completely.
20699
20700         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20701         user-defined values and other cases.
20702
20703         (IsValidEnumLiteral): Helper function.
20704
20705         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20706         out there in the case we had a literal FieldExpr.
20707
20708         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20709
20710         (Literalize): Revamp a bit to take two arguments.
20711
20712         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20713
20714 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20715
20716         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20717
20718         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20719
20720         (Resolve): Use the above to ensure we have proper initializers.
20721
20722 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20723
20724         * expression.cs (Expression::EvalConstantExpression): New method to 
20725         evaluate constant expressions.
20726
20727         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20728
20729 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20730
20731         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20732         in an array.
20733
20734         (Binary.ResolveOperator): Handle operator != (object a, object b)
20735         and operator == (object a, object b);
20736
20737         (Binary.DoNumericPromotions): Indicate whether the numeric
20738         promotion was possible.
20739
20740         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20741         Implement.  
20742
20743         Made the ArrayAccess implement interface IAssignMethod instead of
20744         IStackStore as the order in which arguments are passed reflects
20745         this.
20746
20747         * assign.cs: Instead of using expr.ExprClass to select the way of
20748         assinging, probe for the IStackStore/IAssignMethod interfaces.
20749
20750         * typemanager.cs: Load InitializeArray definition.
20751
20752         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20753         static data that can be used to initialize arrays. 
20754
20755 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20756
20757         * expression.cs: Handle operator== and operator!= for booleans.
20758
20759         (Conditioal.Reduce): Implement reducer for the ?: operator.
20760
20761         (Conditional.Resolve): Implement dead code elimination.
20762
20763         (Binary.Resolve): Catch string literals and return a new
20764         concatenated string.
20765
20766         (Unary.Reduce): Implement reduction of unary expressions.
20767
20768         * ecore.cs: Split out the expression core handling here.
20769
20770         (Expression.Reduce): New method used to perform constant folding
20771         and CSE.  This is needed to support constant-expressions. 
20772
20773         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20774         targets, and optimize for !x.
20775
20776 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20777
20778         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20779         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20780         set custom atttributes.
20781
20782         * literal.cs (Literal::GetValue): New abstract method to return the actual
20783         value of the literal, cast as an object.
20784
20785         (*Literal): Implement GetValue method.
20786
20787         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20788         expressions to the arraylist but objects of type Argument.
20789
20790         * class.cs (TypeContainer::Emit): Emit our attributes too.
20791
20792         (Method::Emit, Constructor::Emit): Ditto.
20793
20794         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20795         to be ignoring earlier.
20796
20797 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20798
20799         * attribute.cs (AttributeSection::Define): Implement to do the business
20800         of constructing a CustomAttributeBuilder.
20801
20802         (Attribute): New trivial class. Increases readability of code.  
20803
20804         * cs-parser.jay : Update accordingly.
20805
20806         (positional_argument_list, named_argument_list, named_argument): New rules
20807
20808         (attribute_arguments): Use the above so that we are more correct.
20809
20810 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20811
20812         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20813         to perform all checks for a method with a params parameter.
20814
20815         (Invocation::OverloadResolve): Update to use the above method and therefore
20816         cope correctly with params method invocations.
20817
20818         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20819         params too.
20820
20821         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20822         constructors in our parent too because we can't afford to miss out on 
20823         protected ones ;-)
20824
20825         * attribute.cs (AttributeSection): New name for the class Attribute
20826
20827         Other trivial changes to improve readability.
20828
20829         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20830         use the new class names.
20831
20832 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20833
20834         * class.cs (Method::Define): Complete definition for params types too
20835
20836         (Indexer::Define): Ditto.
20837
20838         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20839         Cope everywhere with a request for info about the array parameter.
20840
20841 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20842
20843         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20844
20845         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20846         local_variable_type to extract the string corresponding to the type.
20847
20848         (local_variable_type): Fixup the action to use the new helper method.
20849
20850         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20851         go.
20852
20853         * expression.cs : Clean out code which uses the above.
20854
20855 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20856
20857         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20858         and bale out if necessary by returning a false.
20859
20860         (RegisterProperty): Ditto.
20861
20862         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20863         and print out appropriate error messages.
20864
20865         * interface.cs (everywhere): Ditto.
20866
20867         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20868         location to constructor.
20869
20870         * class.cs (Property, Event, Indexer): Update accordingly.
20871
20872         * ../errors/cs111.cs : Added.
20873
20874         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20875         of a method, as laid down by the spec.
20876
20877         (Invocation::OverloadResolve): Use the above method.
20878
20879 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20880
20881         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20882         now take a TypeContainer and a Parameters object.
20883
20884         (ParameterData): Modify return type of ParameterModifier method to be 
20885         Parameter.Modifier and not a string.
20886
20887         (ReflectionParameters, InternalParameters): Update accordingly.
20888
20889         * expression.cs (Argument::GetParameterModifier): Same here.
20890
20891         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20892         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20893         symbol in it at all so maybe this is only for now.
20894
20895 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20896
20897         * support.cs (InternalParameters): Constructor now takes an extra argument 
20898         which is the actual Parameters class.
20899
20900         (ParameterDesc): Update to provide info on ref/out modifiers.
20901
20902         * class.cs (everywhere): Update call to InternalParameters to pass in
20903         the second argument too.
20904
20905         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20906         to return the modifier info [ref/out etc]
20907
20908         (InternalParameters, ReflectionParameters): Implement the above.
20909
20910         * expression.cs (Argument::ParameterModifier): Similar function to return
20911         info about the argument's modifiers.
20912
20913         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20914         too.
20915
20916         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20917         a new SetFormalParameters object which we pass to InternalParameters.
20918
20919 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20920
20921         * expression.cs (NewArray): Merge into the ArrayCreation class.
20922
20923 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20924
20925         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20926         NewUserdefinedArray into one as there wasn't much of a use in having
20927         two separate ones.
20928
20929         * expression.cs (Argument): Change field's name to ArgType from Type.
20930
20931         (Type): New readonly property which returns the proper type, taking into 
20932         account ref/out modifiers.
20933
20934         (everywhere): Adjust code accordingly for the above.
20935
20936         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20937         whether we are emitting for a ref or out parameter.
20938
20939         * expression.cs (Argument::Emit): Use the above field to set the state.
20940
20941         (LocalVariableReference::Emit): Update to honour the flag and emit the
20942         right stuff.
20943
20944         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20945
20946         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20947
20948         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20949
20950         (ReflectionParameters, InternalParameters): Implement the above method.
20951
20952         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20953         reporting errors.
20954
20955         (Invocation::FullMethodDesc): Ditto. 
20956
20957 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20958
20959         * cs-parser.jay: Add extra production for the second form of array
20960         creation. 
20961
20962         * expression.cs (ArrayCreation): Update to reflect the above
20963         change. 
20964
20965         * Small changes to prepare for Array initialization.
20966
20967 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * typemanager.cs (ImplementsInterface): interface might be null;
20970         Deal with this problem;
20971
20972         Also, we do store negative hits on the cache (null values), so use
20973         this instead of calling t.GetInterfaces on the type everytime.
20974
20975 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20976
20977         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20978
20979         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20980         split functionality out into different classes.
20981
20982         (New::FormArrayType): Move into NewBuiltinArray.
20983
20984         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20985         quite useless.
20986
20987         (NewBuiltinArray): New class to handle creation of built-in arrays.
20988
20989         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20990         account creation of one-dimensional arrays.
20991
20992         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20993
20994         (NewUserdefinedArray::DoResolve): Implement.
20995
20996         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20997
20998         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20999         we maintain inside the TypeManager. This is necessary to perform lookups on the
21000         module builder.
21001
21002         (LookupType): Update to perform GetType on the module builders too.     
21003
21004         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21005
21006         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21007
21008 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21009
21010         * expression.cs (New::DoResolve): Implement guts of array creation.
21011
21012         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21013
21014 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * expression.cs: Fix bug I introduced lsat night that broke
21017         Delegates. 
21018
21019         (Expression.Resolve): Report a 246 error (can not resolve name)
21020         if we find a SimpleName in the stream.
21021
21022         (Expression.ResolveLValue): Ditto.
21023
21024         (Expression.ResolveWithSimpleName): This function is a variant of
21025         ResolveName, this one allows SimpleNames to be returned without a
21026         warning.  The only consumer of SimpleNames is MemberAccess
21027
21028 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21031         might arrive here.  I have my doubts that this is correct.
21032
21033         * statement.cs (Lock): Implement lock statement.
21034
21035         * cs-parser.jay: Small fixes to support `lock' and `using'
21036
21037         * cs-tokenizer.cs: Remove extra space
21038
21039         * driver.cs: New flag --checked, allows to turn on integer math
21040         checking. 
21041
21042         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21043         Threading.Monitor.Exit 
21044
21045 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21046
21047         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21048         Expression Class to be IndexerAccess.
21049
21050         Notice that Indexer::DoResolve sets the eclass to Value.
21051
21052 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21053
21054         * class.cs (TypeContainer::Emit): Emit code for indexers.
21055
21056         * assign.cs (IAssignMethod): New interface implemented by Indexers
21057         and Properties for handling assignment.
21058
21059         (Assign::Emit): Simplify and reuse code. 
21060
21061         * expression.cs (IndexerAccess, PropertyExpr): Implement
21062         IAssignMethod, clean up old code. 
21063
21064 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21065
21066         * typemanager.cs (ImplementsInterface): New method to determine if a type
21067         implements a given interface. Provides a nice cache too.
21068
21069         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21070         method.
21071
21072         (ConvertReferenceExplicit): Ditto.
21073
21074         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21075         various methods, with correct names etc.
21076
21077         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21078         Operator.UnaryNegation.
21079
21080         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21081         we have a unary plus or minus operator.
21082
21083         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21084         UnaryMinus.
21085
21086         * everywhere : update accordingly.
21087
21088         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21089         respectively.
21090
21091         * class.cs (Method::Define): For the case where we are implementing a method
21092         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21093         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21094
21095 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21096
21097         * interface.cs (FindMembers): Implement to work around S.R.E
21098         lameness.
21099
21100         * typemanager.cs (IsInterfaceType): Implement.
21101
21102         (FindMembers): Update to handle interface types too.
21103
21104         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21105         use IsAssignableFrom as that is not correct - it doesn't work.
21106
21107         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21108         and accordingly override EmitStatement.
21109
21110         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21111         using the correct logic :-)
21112
21113 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21114
21115         * ../errors/cs-11.cs : Add to demonstrate error -11 
21116
21117 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21118
21119         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21120         then pass this as a hint to ResolveLValue.
21121
21122         * expression.cs (FieldExpr): Add Location information
21123
21124         (FieldExpr::LValueResolve): Report assignment to readonly
21125         variable. 
21126
21127         (Expression::ExprClassFromMemberInfo): Pass location information.
21128
21129         (Expression::ResolveLValue): Add new method that resolves an
21130         LValue. 
21131
21132         (Expression::DoResolveLValue): Default invocation calls
21133         DoResolve. 
21134
21135         (Indexers): New class used to keep track of indexers in a given
21136         Type. 
21137
21138         (IStackStore): Renamed from LValue, as it did not really describe
21139         what this did.  Also ResolveLValue is gone from this interface and
21140         now is part of Expression.
21141
21142         (ElementAccess): Depending on the element access type
21143
21144         * typemanager.cs: Add `indexer_name_type' as a Core type
21145         (System.Runtime.CompilerServices.IndexerNameAttribute)
21146
21147         * statement.cs (Goto): Take a location.
21148
21149 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21150
21151         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21152         if two delegates are compatible.
21153
21154         (NewDelegate::DoResolve): Update to take care of the case when
21155         we instantiate a delegate from another delegate.
21156
21157         * typemanager.cs (FindMembers): Don't even try to look up members
21158         of Delegate types for now.
21159
21160 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21161
21162         * delegate.cs (NewDelegate): New class to take care of delegate
21163         instantiation.
21164
21165         * expression.cs (New): Split the delegate related code out into 
21166         the NewDelegate class.
21167
21168         * delegate.cs (DelegateInvocation): New class to handle delegate 
21169         invocation.
21170
21171         * expression.cs (Invocation): Split out delegate related code into
21172         the DelegateInvocation class.
21173
21174 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21175
21176         * expression.cs (New::DoResolve): Implement delegate creation fully
21177         and according to the spec.
21178
21179         (New::DoEmit): Update to handle delegates differently.
21180
21181         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21182         because of which we were printing out arguments in reverse order !
21183
21184         * delegate.cs (VerifyMethod): Implement to check if the given method
21185         matches the delegate.
21186
21187         (FullDelegateDesc): Implement.
21188
21189         (VerifyApplicability): Implement.
21190
21191         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21192         delegate invocations too.
21193
21194         (Invocation::Emit): Ditto.
21195
21196         * ../errors/cs1593.cs : Added.
21197
21198         * ../errors/cs1594.cs : Added.
21199
21200         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21201
21202 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21203
21204         * typemanager.cs (intptr_type): Core type for System.IntPtr
21205
21206         (InitCoreTypes): Update for the same.
21207
21208         (iasyncresult_type, asynccallback_type): Ditto.
21209
21210         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21211         correct.
21212
21213         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21214         too.
21215
21216         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21217         the builders for the 4 members of a delegate type :-)
21218
21219         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21220         type.
21221
21222         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21223
21224         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21225
21226 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21227
21228         * statement.cs (Break::Emit): Implement.   
21229         (Continue::Emit): Implement.
21230
21231         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21232         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21233         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21234         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21235         end loop
21236
21237         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21238         properties that track the label for the current loop (begin of the
21239         loop and end of the loop).
21240
21241 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21242
21243         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21244         use of emitting anything at all.
21245
21246         * class.cs, rootcontext.cs : Get rid of calls to the same.
21247
21248         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21249
21250         (Populate): Define the constructor correctly and set the implementation
21251         attributes.
21252
21253         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21254         have been defined.
21255
21256         (AddDelegateType): Implement.
21257
21258         (IsDelegateType): Implement helper method.
21259
21260         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21261
21262         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21263         and accordingly handle it.
21264
21265         * delegate.cs (Populate): Take TypeContainer argument.
21266         Implement bits to define the Invoke method. However, I still haven't figured out
21267         how to take care of the native int bit :-(
21268
21269         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21270         Qualify the name of the delegate, not its return type !
21271
21272         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21273         conversion.
21274
21275         (StandardConversionExists): Checking for array types turns out to be recursive.
21276
21277         (ConvertReferenceExplicit): Implement array conversion.
21278
21279         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21280
21281 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21282
21283         * cs-parser.jay (delegate_declaration): Store the fully qualified
21284         name as it is a type declaration.
21285
21286         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21287         readonly.
21288
21289         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21290         as TypeContainer::DefineType.
21291
21292         (Populate): Method in which all the definition of the various methods (Invoke)
21293         etc is done.
21294
21295         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21296         see.
21297
21298         (CloseDelegate): Finally creates the delegate.
21299
21300         * class.cs (TypeContainer::DefineType): Update to define delegates.
21301         (Populate, Emit and CloseType): Do the same thing here too.
21302
21303         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21304         delegates in all these operations.
21305
21306 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21307
21308         * expression.cs: LocalTemporary: a new expression used to
21309         reference a temporary that has been created.
21310
21311         * assign.cs: Handle PropertyAccess back here, so that we can
21312         provide the proper semantic access to properties.
21313
21314         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21315         a few more explicit conversions. 
21316
21317         * modifiers.cs: `NEW' modifier maps to HideBySig.
21318
21319         * expression.cs (PropertyExpr): Make this into an
21320         ExpressionStatement, and support the EmitStatement code path. 
21321
21322         Perform get/set error checking, clean up the interface.
21323
21324         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21325         them into toplevel access objects.
21326
21327 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21328
21329         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21330         SRE.
21331
21332         * typemanager.cs: Keep track here of our PropertyBuilders again to
21333         work around lameness in SRE.
21334
21335 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21336
21337         * expression.cs (LValue::LValueResolve): New method in the
21338         interface, used to perform a second resolution pass for LValues. 
21339
21340         (This::DoResolve): Catch the use of this in static methods.
21341
21342         (This::LValueResolve): Implement.
21343
21344         (This::Store): Remove warning, assigning to `this' in structures
21345         is 
21346
21347         (Invocation::Emit): Deal with invocation of
21348         methods on value types.  We need to pass the address to structure
21349         methods rather than the object itself.  (The equivalent code to
21350         emit "this" for structures leaves the entire structure on the
21351         stack instead of a pointer to it). 
21352
21353         (ParameterReference::DoResolve): Compute the real index for the
21354         argument based on whether the method takes or not a `this' pointer
21355         (ie, the method is static).
21356
21357         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21358         value types returned from functions when we need to invoke a
21359         method on the sturcture.
21360
21361
21362 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21363
21364         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21365         defining the type in the Modulebuilder or Typebuilder. This is to take
21366         care of nested types which need to be defined on the TypeBuilder using
21367         DefineNestedMethod.
21368
21369         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21370         methods in RootContext, only ported to be part of TypeContainer.
21371
21372         (TypeContainer::GetInterfaceOrClass): Ditto.
21373
21374         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21375
21376         * interface.cs (Interface::DefineInterface): New method. Does exactly
21377         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21378         too.
21379
21380         (Interface::GetInterfaces): Move from RootContext here and port.
21381
21382         (Interface::GetInterfaceByName): Same here.
21383
21384         * rootcontext.cs (ResolveTree): Re-write.
21385
21386         (PopulateTypes): Re-write.
21387
21388         * class.cs (TypeContainer::Populate): Populate nested types too.
21389         (TypeContainer::Emit): Emit nested members too.
21390
21391         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21392         instead just use the name argument passed in as it is already fully
21393         qualified.
21394
21395         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21396         to TypeContainer mapping to see if a type is user-defined.
21397
21398         * class.cs (TypeContainer::CloseType): Implement. 
21399
21400         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21401         the default constructor.
21402
21403         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21404         twice.
21405
21406         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21407
21408         * interface.cs (CloseType): Create the type here.
21409
21410         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21411         the hierarchy.
21412
21413         Remove all the methods which are now in TypeContainer.
21414
21415 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21416
21417         * delegate.cs (Define): Re-write bits to define the delegate
21418         correctly.
21419
21420 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21421
21422         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21423
21424         * expression.cs (ImplicitReferenceConversion): handle null as well
21425         as a source to convert to any reference type.
21426
21427         * statement.cs (Return): Perform any implicit conversions to
21428         expected return type.  
21429
21430         Validate use of return statement.  
21431
21432         * codegen.cs (EmitContext): Pass the expected return type here.
21433
21434         * class.cs (Method, Constructor, Property): Pass expected return
21435         type to EmitContext.
21436
21437 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * expression.cs: Make DoResolve take an EmitContext instead of a
21440         TypeContainer.
21441
21442         Replaced `l' and `location' for `loc', for consistency.
21443
21444         (Error, Warning): Remove unneeded Tc argument.
21445
21446         * assign.cs, literal.cs, constant.cs: Update to new calling
21447         convention. 
21448
21449         * codegen.cs: EmitContext now contains a flag indicating whether
21450         code is being generated in a static method or not.
21451
21452         * cs-parser.jay: DecomposeQI, new function that replaces the old
21453         QualifiedIdentifier.  Now we always decompose the assembled
21454         strings from qualified_identifier productions into a group of
21455         memberaccesses.
21456
21457 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21458
21459         * rootcontext.cs: Deal with field-less struct types correctly now
21460         by passing the size option to Define Type.
21461
21462         * class.cs: Removed hack that created one static field. 
21463
21464 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21465
21466         * statement.cs: Moved most of the code generation here. 
21467
21468 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21469
21470         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21471         seem very right.
21472
21473         (ElementAccess): Remove useless bits for now - keep checks as the spec
21474         says.
21475
21476 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21477
21478         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21479         and start performing checks according to the spec.
21480
21481 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21482
21483         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21484         rank_specifiers instead.
21485
21486         (rank_specifiers): Change the order in which the rank specifiers are stored
21487
21488         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21489
21490         * expression.cs (ElementAccess): Implement the LValue interface too.
21491
21492 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21493
21494         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21495         except that user defined conversions are not included.
21496
21497         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21498         perform the conversion of the return type, if necessary.
21499
21500         (New::DoResolve): Check whether we are creating an array or an object
21501         and accordingly do the needful.
21502
21503         (New::Emit): Same here.
21504
21505         (New::DoResolve): Implement guts of array creation.
21506
21507         (New::FormLookupType): Helper function.
21508
21509 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21510
21511         * codegen.cs: Removed most of the code generation here, and move the
21512         corresponding code generation bits to the statement classes. 
21513
21514         Added support for try/catch/finalize and throw.
21515
21516         * cs-parser.jay: Added support for try/catch/finalize.
21517
21518         * class.cs: Catch static methods having the flags override,
21519         virtual or abstract.
21520
21521         * expression.cs (UserCast): This user cast was not really doing
21522         what it was supposed to do.  Which is to be born in fully resolved
21523         state.  Parts of the resolution were being performed at Emit time! 
21524
21525         Fixed this code.
21526
21527 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21528
21529         * expression.cs: Implicity convert the result from UserCast.
21530
21531 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21532
21533         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21534         prevented it from working correctly. 
21535
21536         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21537         merely ConvertImplicit.
21538
21539 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21540
21541         * typemanager.cs: Make the LookupTypeContainer function static,
21542         and not per-instance.  
21543
21544         * class.cs: Make static FindMembers (the one that takes a Type
21545         argument). 
21546
21547         * codegen.cs: Add EmitForeach here.
21548
21549         * cs-parser.jay: Make foreach a toplevel object instead of the
21550         inline expansion, as we need to perform semantic analysis on it. 
21551
21552 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21553
21554         * expression.cs (Expression::ImplicitUserConversion): Rename to
21555         UserDefinedConversion.
21556
21557         (Expression::UserDefinedConversion): Take an extra argument specifying 
21558         whether we look for explicit user conversions too.
21559
21560         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21561
21562         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21563
21564         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21565         with the appropriate arguments.
21566
21567         * cs-parser.jay (cast_expression): Record location too.
21568
21569         * expression.cs (Cast): Record location info.
21570
21571         (Expression::ConvertExplicit): Take location argument.
21572
21573         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21574         to determine if we are doing explicit conversions.
21575
21576         (UserCast::Emit): Update accordingly.
21577
21578         (Expression::ConvertExplicit): Report an error if everything fails.
21579
21580         * ../errors/cs0030.cs : Add.
21581
21582 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21583
21584         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21585         virtual and newslot bits. 
21586
21587         * class.cs (TypeContainer::RegisterRequiredImplementations):
21588         Record methods we need.
21589
21590         (TypeContainer::MakeKey): Helper function to make keys for
21591         MethodBases, since the Methodbase key is useless.
21592
21593         (TypeContainer::Populate): Call RegisterRequiredImplementations
21594         before defining the methods.   
21595
21596         Create a mapping for method_builders_to_methods ahead of time
21597         instead of inside a tight loop.
21598
21599         (::RequireMethods):  Accept an object as the data to set into the
21600         hashtable so we can report interface vs abstract method mismatch.
21601
21602 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * report.cs: Make all of it static.
21605
21606         * rootcontext.cs: Drop object_type and value_type computations, as
21607         we have those in the TypeManager anyways.
21608
21609         Drop report instance variable too, now it is a global.
21610
21611         * driver.cs: Use try/catch on command line handling.
21612
21613         Add --probe option to debug the error reporting system with a test
21614         suite. 
21615
21616         * report.cs: Add support for exiting program when a probe
21617         condition is reached.
21618
21619 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21620
21621         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21622         we do a forcible conversion regardless of type, to check if 
21623         ForceConversion returns a null.
21624
21625         (Binary::error19): Use location to report error.
21626
21627         (Unary::error23): Use location here too.
21628
21629         * ../errors/cs0019.cs : Check in.
21630
21631         * ../errors/cs0023.cs : Check in.
21632
21633         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21634         case of a non-null MethodInfo object with a length of 0 !
21635
21636         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21637         an applicable member - according to the spec :-)
21638         Also fix logic to find members in base types.
21639
21640         (Unary::ResolveOperator): Same here.
21641
21642         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21643         as I was getting thoroughly confused between this and error19 :-)
21644
21645         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21646         (::FindMostEncompassedType): Implement.
21647         (::FindMostEncompassingType): Implement.
21648         (::StandardConversionExists): Implement.
21649
21650         (UserImplicitCast): Re-vamp. We now need info about most specific
21651         source and target types so that we can do the necessary conversions.
21652
21653         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21654         mathematical union with no duplicates.
21655
21656 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21657
21658         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21659         in order from base classes to child classes, so that we can in
21660         child classes look up in our parent for method names and
21661         attributes (required for handling abstract, virtual, new, override
21662         constructs: we need to instrospect our base class, and if we dont
21663         populate the classes in order, the introspection might be
21664         incorrect.  For example, a method could query its parent before
21665         the parent has any methods and would determine that the parent has
21666         no abstract methods (while it could have had them)).
21667
21668         (RootContext::CreateType): Record the order in which we define the
21669         classes.
21670
21671 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * class.cs (TypeContainer::Populate): Also method definitions can
21674         fail now, keep track of this.
21675
21676         (TypeContainer::FindMembers): Implement support for
21677         DeclaredOnly/noDeclaredOnly flag.
21678
21679         (Constructor::Emit) Return the ConstructorBuilder.
21680
21681         (Method::Emit) Return the MethodBuilder. 
21682         Check for abstract or virtual methods to be public.
21683
21684         * rootcontext.cs (RootContext::CreateType): Register all the
21685         abstract methods required for the class to be complete and the
21686         interface methods that must be implemented. 
21687
21688         * cs-parser.jay: Report error 501 (method requires body if it is
21689         not marked abstract or extern).
21690
21691         * expression.cs (TypeOf::Emit): Implement.
21692
21693         * typemanager.cs: runtime_handle_type, new global type.
21694
21695         * class.cs (Property::Emit): Generate code for properties.
21696
21697 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21698
21699         * expression.cs (Unary::ResolveOperator): Find operators on base type
21700         too - we now conform exactly to the spec.
21701
21702         (Binary::ResolveOperator): Same here.
21703
21704         * class.cs (Operator::Define): Fix minor quirk in the tests.
21705
21706         * ../errors/cs0215.cs : Added.
21707
21708         * ../errors/cs0556.cs : Added.
21709
21710         * ../errors/cs0555.cs : Added.
21711
21712 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21713
21714         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21715         single integer which is really efficient
21716
21717 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21718
21719         *  expression.cs (Expression::ImplicitUserConversion): Use location
21720         even in the case when we are examining True operators.
21721  
21722         * class.cs (Operator::Define): Perform extensive checks to conform
21723         with the rules for operator overloading in the spec.
21724
21725         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21726         some of the other conversions mentioned in the spec.
21727
21728         * typemanager.cs (array_type): New static member for the System.Array built-in
21729         type.
21730
21731         (cloneable_interface): For System.ICloneable interface.
21732
21733         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21734         we start resolving the tree and populating types.
21735
21736         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21737  
21738 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * expression.cs (Expression::ExprClassFromMemberInfo,
21741         Expression::Literalize): Create literal expressions from
21742         FieldInfos which are literals.
21743
21744         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21745         type casts, because they were wrong.  The test suite in tests
21746         caught these ones.
21747
21748         (ImplicitNumericConversion): ushort to ulong requires a widening
21749         cast. 
21750
21751         Int32 constant to long requires widening cast as well.
21752
21753         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21754         for integers because the type on the stack is not i4.
21755
21756 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21757
21758         * expression.cs (report118): require location argument. 
21759
21760         * parameter.cs: Do not dereference potential null value.
21761
21762         * class.cs: Catch methods that lack the `new' keyword when
21763         overriding a name.  Report warnings when `new' is used without
21764         anything being there to override.
21765
21766         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21767
21768         * class.cs: Only add constructor to hashtable if it is non-null
21769         (as now constructors can fail on define).
21770
21771         (TypeManager, Class, Struct): Take location arguments.
21772
21773         Catch field instance initialization in structs as errors.
21774
21775         accepting_filter: a new filter for FindMembers that is static so
21776         that we dont create an instance per invocation.
21777
21778         (Constructor::Define): Catch errors where a struct constructor is
21779         parameterless 
21780
21781         * cs-parser.jay: Pass location information for various new
21782         constructs. 
21783
21784         * delegate.cs (Delegate): take a location argument.
21785
21786         * driver.cs: Do not call EmitCode if there were problesm in the
21787         Definition of the types, as many Builders wont be there. 
21788
21789         * decl.cs (Decl::Decl): Require a location argument.
21790
21791         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21792         into integers, and find the most appropiate integer for it.
21793
21794         * literal.cs: Implement ULongLiteral.
21795
21796         * rootcontext.cs: Provide better information about the location of
21797         failure when CreateType fails.
21798
21799 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21800
21801         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21802         as well.
21803
21804         * expression.cs (Binary::CheckShiftArguments): Add missing type
21805         computation.
21806         (Binary::ResolveOperator): Add type to the logical and and logical
21807         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21808         before.
21809
21810         (Binary::DoNumericPromotions): In the case where either argument
21811         is ulong (and most signed types combined with ulong cause an
21812         error) perform implicit integer constant conversions as well.
21813
21814 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21815
21816         * expression.cs (UserImplicitCast): Method should always be
21817         non-null. 
21818         (Invocation::BetterConversion): Simplified test for IntLiteral.
21819
21820         (Expression::ImplicitNumericConversion): Split this routine out.
21821         Put the code that performs implicit constant integer conversions
21822         here. 
21823
21824         (Expression::Resolve): Become a wrapper around DoResolve so we can
21825         check eclass and type being set after resolve.
21826
21827         (Invocation::Badness): Remove this dead function
21828
21829         (Binary::ResolveOperator): Do not compute the expensive argumnets
21830         unless we have a union for it.
21831
21832         (Probe::Emit): Is needs to do an isinst and then
21833         compare against null.
21834
21835         (::CanConvert): Added Location argument.  If the Location argument
21836         is null (Location.Null), then we do not report errors.  This is
21837         used by the `probe' mechanism of the Explicit conversion.  We do
21838         not want to generate an error for something that the user
21839         explicitly requested to be casted.  But the pipeline for an
21840         explicit cast first tests for potential implicit casts.
21841
21842         So for now, if the Location is null, it means `Probe only' to
21843         avoid adding another argument.   Might have to revise this
21844         strategy later.
21845
21846         (ClassCast): New class used to type cast objects into arbitrary
21847         classes (used in Explicit Reference Conversions).
21848
21849         Implement `as' as well.
21850
21851         Reverted all the patches from Ravi below: they were broken:
21852
21853                 * The use of `level' as a mechanism to stop recursive
21854                   invocations is wrong.  That was there just to catch the
21855                   bug with a strack trace but not as a way of addressing
21856                   the problem.
21857
21858                   To fix the problem we have to *understand* what is going
21859                   on and the interactions and come up with a plan, not
21860                   just get things going.
21861
21862                 * The use of the type conversion cache that I proposed
21863                   last night had an open topic: How does this work across
21864                   protection domains.  A user defined conversion might not
21865                   be public in the location where we are applying the
21866                   conversion, a different conversion might be selected
21867                   (ie, private A->B (better) but public B->A (worse),
21868                   inside A, A->B applies, but outside it, B->A will
21869                   apply).
21870
21871                 * On top of that (ie, even if the above is solved),
21872                   conversions in a cache need to be abstract.  Ie, `To
21873                   convert from an Int to a Short use an OpcodeCast', not
21874                   `To convert from an Int to a Short use the OpcodeCast on
21875                   the variable 5' (which is what this patch was doing).
21876
21877 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21878
21879         * expression.cs (Invocation::ConversionExists): Re-write to use
21880         the conversion cache
21881
21882         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21883         cache all conversions done, not just user-defined ones.
21884
21885         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21886         to determine if a conversion exists instead of acutually trying to 
21887         perform the conversion. It's faster too.
21888
21889         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21890         and only then attempt the implicit conversion.
21891
21892 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21893
21894         * expression.cs (ConvertImplicit): Use a cache for conversions
21895         already found. Check level of recursion and bail out if necessary.
21896
21897 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21898
21899         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21900         Export standard methods that we expect for string operations.
21901
21902         * statement.cs (Block::UsageWarning): Track usage of variables and
21903         report the errors for not used variables.
21904
21905         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21906         operator. 
21907
21908 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21909
21910         * codegen.cs: remove unnneded code 
21911
21912         * expression.cs: Removed BuiltinTypeAccess class
21913
21914         Fix the order in which implicit conversions are
21915         done.  
21916
21917         The previous fixed dropped support for boxed conversions (adding a
21918         test to the test suite now)
21919
21920         (UserImplicitCast::CanConvert): Remove test for source being null,
21921         that code is broken.  We should not feed a null to begin with, if
21922         we do, then we should track the bug where the problem originates
21923         and not try to cover it up here.
21924
21925         Return a resolved expression of type UserImplicitCast on success
21926         rather than true/false.  Ravi: this is what I was talking about,
21927         the pattern is to use a static method as a "constructor" for
21928         objects. 
21929
21930         Also, do not create arguments until the very last minute,
21931         otherwise we always create the arguments even for lookups that
21932         will never be performed. 
21933
21934         (UserImplicitCast::Resolve): Eliminate, objects of type
21935         UserImplicitCast are born in a fully resolved state. 
21936
21937         * typemanager.cs (InitCoreTypes): Init also value_type
21938         (System.ValueType). 
21939
21940         * expression.cs (Cast::Resolve): First resolve the child expression.
21941
21942         (LValue): Add new method AddressOf to be used by
21943         the `&' operator.  
21944
21945         Change the argument of Store to take an EmitContext instead of an
21946         ILGenerator, because things like FieldExpr need to be able to call
21947         their children expression to generate the instance code. 
21948
21949         (Expression::Error, Expression::Warning): Sugar functions for
21950         reporting errors.
21951
21952         (Expression::MemberLookup): Accept a TypeContainer instead of a
21953         Report as the first argument.
21954
21955         (Expression::ResolvePrimary): Killed.  I still want to improve
21956         this as currently the code is just not right.
21957
21958         (Expression::ResolveMemberAccess): Simplify, but it is still
21959         wrong. 
21960
21961         (Unary::Resolve): Catch errors in AddressOf operators.
21962
21963         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21964         index to a byte for the short-version, or the compiler will choose
21965         the wrong Emit call, which generates the wrong data.
21966
21967         (ParameterReference::Emit, ::Store): same.
21968
21969         (FieldExpr::AddressOf): Implement.
21970
21971         * typemanager.cs: TypeManager: made public variable instead of
21972         property.
21973
21974         * driver.cs: document --fatal.
21975
21976         * report.cs (ErrorMessage, WarningMessage): new names for the old
21977         Error and Warning classes.
21978
21979         * cs-parser.jay (member_access): Turn built-in access to types
21980         into a normal simplename
21981
21982 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21983
21984         * expression.cs (Invocation::BetterConversion): Fix to cope
21985         with q being null, since this was introducing a bug.
21986
21987         * expression.cs (ConvertImplicit): Do built-in conversions first.
21988
21989 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21990
21991         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21992
21993 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21994
21995         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21996         I had introduced long ago (what's new ?).
21997
21998         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21999         the work of all the checking. 
22000         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22001         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22002
22003         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22004         that is the right way. 
22005
22006         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22007         overloading resolution. Use everywhere instead of cutting and pasting code.
22008
22009         (Binary::ResolveOperator): Use MakeUnionSet.
22010
22011         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22012         we have to convert to bool types. Not complete yet.
22013
22014 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * typemanager.cs (TypeManager::CSharpName): support ushort.
22017
22018         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22019         to provide an expression that performsn an implicit constant int
22020         conversion (section 6.1.6).
22021         (Expression::ConvertImplicitRequired): Reworked to include
22022         implicit constant expression conversions.
22023
22024         (Expression::ConvertNumericExplicit): Finished.
22025
22026         (Invocation::Emit): If InstanceExpression is null, then it means
22027         that we perform a call on this.
22028
22029 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22030
22031         * expression.cs (Unary::Emit): Remove some dead code.
22032         (Probe): Implement Resolve and Emit for `is'.
22033         (Expression::ConvertImplicitRequired): Attempt to do constant
22034         expression conversions here.  Maybe should be moved to
22035         ConvertImplicit, but I am not sure.
22036         (Expression::ImplicitLongConstantConversionPossible,
22037         Expression::ImplicitIntConstantConversionPossible): New functions
22038         that tell whether is it possible to apply an implicit constant
22039         expression conversion.
22040
22041         (ConvertNumericExplicit): Started work on explicit numeric
22042         conversions.
22043
22044         * cs-parser.jay: Update operator constants.
22045
22046         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22047         (Parameters::GetSignature): Hook up VerifyArgs here.
22048         (Parameters::VerifyArgs): Verifies that no two arguments have the
22049         same name. 
22050
22051         * class.cs (Operator): Update the operator names to reflect the
22052         ones that the spec expects (as we are just stringizing the
22053         operator names).
22054
22055         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22056         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22057         previous usage did only work for our methods.
22058         (Expression::ConvertImplicit): Handle decimal implicit numeric
22059         conversions as well.
22060         (Expression::InternalTypeConstructor): Used to invoke constructors
22061         on internal types for default promotions.
22062
22063         (Unary::Emit): Implement special handling for the pre/post
22064         increment/decrement for overloaded operators, as they need to have
22065         the same semantics as the other operators.
22066
22067         (Binary::ResolveOperator): ditto.
22068         (Invocation::ConversionExists): ditto.
22069         (UserImplicitCast::Resolve): ditto.
22070
22071 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22072
22073         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22074         operator, return after emitting body. Regression tests pass again !
22075
22076         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22077         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22078         (Invocation::OverloadResolve): Ditto.
22079         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22080
22081         * everywhere : update calls to the above methods accordingly.
22082
22083 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22084
22085         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22086
22087         * expression.cs (ExpressionStatement): New base class used for
22088         expressions that can appear in statements, so that we can provide
22089         an alternate path to generate expression that do not leave a value
22090         on the stack.
22091
22092         (Expression::Emit, and all the derivatives): We no longer return
22093         whether a value is left on the stack or not.  Every expression
22094         after being emitted leaves a single value on the stack.
22095
22096         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22097         facilties of ExpressionStatement if possible.
22098
22099         * cs-parser.jay: Update statement_expression.
22100
22101 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * driver.cs: Change the wording of message
22104
22105 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22106
22107         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22108         the type of the expression to the return type of the method if
22109         we have an overloaded operator match ! The regression tests pass again !
22110         (Unary::ResolveOperator): Ditto.
22111
22112         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22113         to find "op_Implicit", not "implicit" ;-)
22114         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22115         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22116
22117         * everywhere : Correct calls to the above accordingly.
22118
22119         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22120         (ConvertImplicit): Do user-defined conversion if it exists.
22121
22122 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22123
22124         * assign.cs: track location.
22125         (Resolve): Use implicit conversions on assignment.
22126
22127         * literal.cs: Oops.  Not good, Emit of short access values should
22128         pass (Bytes) or the wrong argument will be selected.
22129
22130         * expression.cs (Unary::Emit): Emit code for -expr.
22131
22132         (Unary::ResolveOperator): Handle `Substract' for non-constants
22133         (substract from zero from the non-constants).
22134         Deal with Doubles as well. 
22135
22136         (Expression::ConvertImplicitRequired): New routine that reports an
22137         error if no implicit conversion exists. 
22138
22139         (Invocation::OverloadResolve): Store the converted implicit
22140         expressions if we make them
22141
22142 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22143
22144         * class.cs (ConstructorInitializer): Take a Location argument.
22145         (ConstructorBaseInitializer): Same here.
22146         (ConstructorThisInitializer): Same here.
22147
22148         * cs-parser.jay : Update all calls accordingly.
22149
22150         * expression.cs (Unary, Binary, New): Take location argument.
22151         Update accordingly everywhere.
22152
22153         * cs-parser.jay : Update all calls to the above to take a location
22154         argument.
22155
22156         * class.cs : Ditto.
22157
22158 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22159
22160         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22161         (Invocation::BetterConversion): Same here
22162         (Invocation::ConversionExists): Ditto.
22163
22164         (Invocation::ConversionExists): Implement.
22165
22166 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22167
22168         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22169         Also take an additional TypeContainer argument.
22170
22171         * All over : Pass in TypeContainer as argument to OverloadResolve.
22172
22173         * typemanager.cs (CSharpName): Update to check for the string type and return
22174         that too.
22175
22176         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22177         a given method.
22178
22179 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22180
22181         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22182         (Invocation::BetterFunction): Implement.
22183         (Invocation::BetterConversion): Implement.
22184         (Invocation::ConversionExists): Skeleton, no implementation yet.
22185
22186         Okay, things work fine !
22187
22188 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22189
22190         * typemanager.cs: declare and load enum_type, delegate_type and
22191         void_type. 
22192
22193         * expression.cs (Expression::Emit): Now emit returns a value that
22194         tells whether a value is left on the stack or not.  This strategy
22195         might be reveted tomorrow with a mechanism that would address
22196         multiple assignments.
22197         (Expression::report118): Utility routine to report mismatches on
22198         the ExprClass.
22199
22200         (Unary::Report23): Report impossible type/operator combination
22201         utility function.
22202
22203         (Unary::IsIncrementableNumber): Whether the type can be
22204         incremented or decremented with add.
22205         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22206         complemented. 
22207         (Unary::ResolveOperator): Implement ++, !, ~,
22208
22209         (Invocation::Emit): Deal with new Emit convetion.
22210
22211         * All Expression derivatives: Updated their Emit method to return
22212         whether they leave values on the stack or not.
22213
22214         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22215         stack for expressions that are statements. 
22216
22217 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22218
22219         * expression.cs (LValue): New interface.  Must be implemented by
22220         LValue objects.
22221         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22222         LValue interface.
22223
22224         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22225         interface for generating code, simplifies the code.
22226
22227 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22228
22229         * expression.cs (everywhere): Comment out return statements in ::Resolve
22230         methods to avoid the warnings.
22231
22232 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * driver.cs (parse): Report error 2001 if we can not open the
22235         source file.
22236
22237         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22238         not resolve it.
22239
22240         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22241         object. 
22242
22243         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22244         otherwise nested blocks end up with the same index.
22245
22246         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22247
22248         * expression.cs:  Instead of having FIXMEs in the Resolve
22249         functions, throw exceptions so it is obvious that we are facing a
22250         bug. 
22251
22252         * cs-parser.jay (invocation_expression): Pass Location information.
22253
22254         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22255         Use a basename for those routines because .NET does not like paths
22256         on them. 
22257
22258         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22259         already defined.
22260
22261 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22264         are loading the correct data types (throws an exception if not).
22265         (TypeManager::InitCoreTypes): Use CoreLookupType
22266
22267         * expression.cs (Unary::ResolveOperator): return the child
22268         expression for expressions which are just +expr.
22269         (Unary::ResolveOperator): Return negative literals for -LITERAL
22270         expressions (otherwise they are Unary {Literal}).
22271         (Invocation::Badness): Take into account `Implicit constant
22272         expression conversions'.
22273
22274         * literal.cs (LongLiteral): Implement long literal class.
22275         (IntLiteral): export the `Value' of the intliteral. 
22276
22277 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22278
22279         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22280
22281         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22282         instead of 'Operator'
22283
22284         * expression.cs (Binary::ResolveOperator): Update accordingly.
22285         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22286         and 'Minus'
22287
22288         * cs-parser.jay (unary_expression): Update to use the new names.
22289
22290         * gen-treedump.cs (GetUnary): Same here.
22291
22292         * expression.cs (Unary::Resolve): Implement.
22293         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22294         operators are found instead of making noise ;-)
22295         (Unary::ResolveOperator): New method to do precisely the same thing which
22296         Binary::ResolveOperator does for Binary expressions.
22297         (Unary.method, .Arguments): Add.
22298         (Unary::OperName): Implement.   
22299         (Unary::ForceConversion): Copy and Paste !
22300
22301         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22302         a unary operator.
22303
22304         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22305         for the inbuilt operators. Only overloading works for now ;-)
22306
22307 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22310         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22311
22312         * expression.cs (This::Emit): Implement. 
22313         (This::Resolve): Implement.
22314         (TypeOf:Resolve): Implement.
22315         (Expression::ResolveSimpleName): Add an implicit this to instance
22316         field references. 
22317         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22318         Bind instance variable to Field expressions.
22319         (FieldExpr::Instance): New field used to track the expression that
22320         represents the object instance.
22321         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22322         binding 
22323         (FieldExpr::Emit): Implement.
22324
22325         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22326         the last instruction contains a return opcode to avoid generating
22327         the last `ret' instruction (this generates correct code, and it is
22328         nice to pass the peverify output).
22329
22330         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22331         initializer for static and instance variables.
22332         (Constructor::Emit): Allow initializer to be null in the case of
22333         static constructors.  Only emit initializer for instance
22334         constructors. 
22335
22336         (TypeContainer::FindMembers): Return a null array if there are no
22337         matches.
22338
22339         Also fix the code for the MemberTypes.Method branch, as it was not
22340         scanning that for operators (or tried to access null variables before).
22341
22342         * assign.cs (Assign::Emit): Handle instance and static fields. 
22343
22344         * TODO: Updated.
22345
22346         * driver.cs: Stop compilation if there are parse errors.
22347
22348         * cs-parser.jay (constructor_declaration): Provide default base
22349         initializer for non-static constructors.
22350         (constructor_declarator): Do not provide a default base
22351         initializers if none was specified.
22352         Catch the fact that constructors should not have parameters.
22353
22354         * class.cs: Do not emit parent class initializers for static
22355         constructors, that should be flagged as an error.
22356
22357 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22358
22359         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22360         Move back code into TypeContainer::Populate.
22361
22362 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22363
22364         * class.cs (TypeContainer::AddConstructor): Fix the check to
22365         compare against Name, not Basename. 
22366         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22367
22368         * cs-parser.jay : Update accordingly.
22369
22370         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22371         for methods, don't forget to look into the operators too.
22372         (RegisterMethodBuilder): Helper method to take care of this for
22373         methods, constructors and operators.
22374         (Operator::Define): Completely revamp.
22375         (Operator.OperatorMethod, MethodName): New fields.
22376         (TypeContainer::Populate): Move the registering of builders into
22377         RegisterMethodBuilder.
22378         (Operator::Emit): Re-write.
22379
22380         * expression.cs (Binary::Emit): Comment out code path to emit method
22381         invocation stuff for the case when we have a user defined operator. I am
22382         just not able to get it right !
22383
22384 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22385
22386         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22387         argument. 
22388
22389         (Expression::MemberLookup): Provide a version that allows to
22390         specify the MemberTypes and BindingFlags. 
22391
22392         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22393         so it was not fetching variable information from outer blocks.
22394
22395         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22396         Beforefieldinit as it was buggy.
22397
22398         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22399         that Ravi put here.  
22400
22401         * class.cs (Constructor::Emit): Only emit if block is not null.
22402         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22403         deal with this by semantically definining it as if the user had
22404         done it.
22405
22406         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22407         constructors as we now "emit" them at a higher level.
22408
22409         (TypeContainer::DefineDefaultConstructor): Used to define the
22410         default constructors if none was provided.
22411
22412         (ConstructorInitializer): Add methods Resolve and Emit. 
22413
22414         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22415
22416 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22417
22418         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22419         the default constructor builder with our hashtable for methodbuilders
22420         to methodcores.
22421
22422         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22423         and argument_count is 0 in which case we have a match.
22424         (Binary::ResolveOperator): More null checking and miscellaneous coding
22425         style cleanup.
22426
22427 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22428
22429         * rootcontext.cs (IsNameSpace): Compare against null.
22430
22431         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22432
22433         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22434         and Unary::Operator.
22435
22436         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22437         accordingly.
22438
22439         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22440         we have overloaded operators.
22441         (Binary::ResolveOperator): Implement the part which does the operator overload
22442         resolution.
22443
22444         * class.cs (Operator::Emit): Implement.
22445         (TypeContainer::Emit): Emit the operators we have too.
22446
22447         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22448         the case when we have a user-defined operator.
22449
22450 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22451
22452         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22453
22454 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22455
22456         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22457         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22458         (Constructor::Emit): Implement.
22459         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22460         if we have no work to do. 
22461         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22462         Emit method.
22463
22464         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22465         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22466
22467         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22468         of parent.parent.
22469
22470 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22471
22472         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22473         in the source.
22474         (Tree::RecordNamespace): Method to do what the name says ;-)
22475         (Tree::Namespaces): Property to get at the namespaces hashtable.
22476
22477         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22478         keep track.
22479
22480         * rootcontext.cs (IsNamespace): Fixed it :-)
22481
22482 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * class.cs (TypeContainer::FindMembers): Add support for
22485         constructors. 
22486         (MethodCore): New class that encapsulates both the shared aspects
22487         of a Constructor and a Method.  
22488         (Method, Constructor): Factored pieces into MethodCore.
22489
22490         * driver.cs: Added --fatal which makes errors throw exceptions.
22491         Load System assembly as well as part of the standard library.
22492
22493         * report.cs: Allow throwing exceptions on errors for debugging.
22494
22495         * modifiers.cs: Do not use `parent', instead use the real type
22496         container to evaluate permission settings.
22497
22498         * class.cs: Put Ravi's patch back in.  He is right, and we will
22499         have to cope with the
22500
22501 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22502
22503         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22504         FamORAssem, not FamANDAssem.
22505
22506 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22507
22508         * driver.cs: Added --parse option that only parses its input files
22509         and terminates.
22510
22511         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22512         incorrect.  IsTopLevel is not used to tell whether an object is
22513         root_types or not (that can be achieved by testing this ==
22514         root_types).  But to see if this is a top-level *class* (not
22515         necessarly our "toplevel" container). 
22516
22517 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22518
22519         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22520         parent instead of a direct call to GetType.
22521
22522 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22523
22524         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22525         Modifiers.TypeAttr. This should just be a call to that method.
22526
22527         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22528         object so that we can determine if we are top-level or not.
22529
22530         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22531         TypeContainer too.
22532
22533         * enum.cs (Enum::Define): Ditto.
22534
22535         * modifiers.cs (FieldAttr): Re-write.
22536
22537         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22538         (TypeContainer::HaveStaticConstructor): New property to provide access
22539         to precisely that info.
22540
22541         * modifiers.cs (MethodAttr): Re-write.
22542         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22543
22544         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22545         of top-level types as claimed.
22546
22547 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22548
22549         * expression.cs (MemberLookup): Fruitless attempt to lookup
22550         constructors.  Maybe I need to emit default constructors?  That
22551         might be it (currently .NET emits this for me automatically).
22552         (Invocation::OverloadResolve): Cope with Arguments == null.
22553         (Invocation::EmitArguments): new function, shared by the new
22554         constructor and us.
22555         (Invocation::Emit): Handle static and instance methods.  Emit
22556         proper call instruction for virtual or non-virtual invocations.
22557         (New::Emit): Implement.
22558         (New::Resolve): Implement.
22559         (MemberAccess:Resolve): Implement.
22560         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22561         to track instances.
22562         (FieldExpr::Resolve): Set type.
22563
22564         * support.cs: Handle empty arguments.
22565                 
22566         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22567         SimpleLookup): Auxiliary routines to help parse a qualifier
22568         identifier.  
22569
22570         Update qualifier_identifier rule.
22571
22572         * codegen.cs: Removed debugging messages.
22573
22574         * class.cs: Make this a global thing, this acts just as a "key" to
22575         objects that we might have around.
22576
22577         (Populate): Only initialize method_builders_to_methods once.
22578
22579         * expression.cs (PropertyExpr): Initialize type from the
22580         PropertyType. 
22581
22582         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22583         Resolve pattern.  Attempt to implicitly convert value to boolean.
22584         Emit code.
22585
22586         * expression.cs: Set the type for the int32/int32 argument case.
22587         (Binary::ResolveOperator): Set the return type to boolean for
22588         comparission operators
22589
22590         * typemanager.cs: Remove debugging print code.
22591
22592         (Invocation::Resolve): resolve type.
22593
22594         * class.cs: Allocate a MemberInfo of the correct size, as the code
22595         elsewhere depends on the test to reflect the correct contents.
22596
22597         (Method::) Keep track of parameters, due to System.Reflection holes
22598
22599         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22600         mapping here.
22601
22602         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22603         of the exact size and return that.
22604
22605         (Class::LookupMethodByBuilder): New function that maps
22606         MethodBuilders to its methods.  Required to locate the information
22607         on methods because System.Reflection bit us again.
22608
22609         * support.cs: New file, contains an interface ParameterData and
22610         two implementations: ReflectionParameters and InternalParameters
22611         used to access Parameter information.  We will need to grow this
22612         as required.
22613
22614         * expression.cs (Invocation::GetParameterData): implement a cache
22615         and a wrapper around the ParameterData creation for methods. 
22616         (Invocation::OverloadResolve): Use new code.
22617
22618 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22619
22620         * class.cs (TypeContainer::EmitField): Remove and move into 
22621         (Field::Define): here and modify accordingly.
22622         (Field.FieldBuilder): New member.
22623         (TypeContainer::Populate): Update accordingly.
22624         (TypeContainer::FindMembers): Implement.
22625
22626 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22627
22628         * statement.cs: (VariableInfo::VariableType): New field to be
22629         initialized with the full type once it is resolved. 
22630
22631 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22632
22633         * parameter.cs (GetParameterInfo): Use a type cache to compute
22634         things only once, and to reuse this information
22635
22636         * expression.cs (LocalVariableReference::Emit): Implement.
22637         (OpcodeCast::Emit): fix.
22638
22639         (ParameterReference::Resolve): Implement.
22640         (ParameterReference::Emit): Implement.
22641
22642         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22643         that are expressions need to stay as Expressions.
22644
22645         * typemanager.cs (CSharpName): Returns the C# name of a type if
22646         possible. 
22647
22648         * expression.cs (Expression::ConvertImplicit): New function that
22649         implements implicit type conversions.
22650
22651         (Expression::ImplicitReferenceConversion): Implements implicit
22652         reference conversions.
22653
22654         (EmptyCast): New type for transparent casts.
22655
22656         (OpcodeCast): New type for casts of types that are performed with
22657         a sequence of bytecodes.
22658
22659         (BoxedCast): New type used for casting value types into reference
22660         types.  Emits a box opcode.
22661
22662         (Binary::DoNumericPromotions): Implements numeric promotions of
22663         and computation of the Binary::Type.
22664
22665         (Binary::EmitBranchable): Optimization.
22666
22667         (Binary::Emit): Implement code emission for expressions.
22668
22669         * typemanager.cs (TypeManager): Added two new core types: sbyte
22670         and byte.
22671
22672 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22673
22674         * class.cs (TypeContainer::FindMembers): Method which does exactly
22675         what Type.FindMembers does, only we don't have to use reflection. No
22676         implementation yet.
22677
22678         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22679         typecontainer objects as we need to get at them.
22680         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22681
22682         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22683         typecontainer object.
22684
22685         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22686         of just a Report object.
22687
22688 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22689
22690         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22691         "remove_"
22692         (TypeContainer::Populate): Now define the delegates of the type too.
22693         (TypeContainer.Delegates): Property to access the list of delegates defined
22694         in the type.
22695
22696         * delegates.cs (Delegate::Define): Implement partially.
22697
22698         * modifiers.cs (TypeAttr): Handle more flags.
22699
22700 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22701
22702         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22703         and not <=
22704         (Operator::Define): Re-write logic to get types by using the LookupType method
22705         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22706         (Indexer::Define): Ditto.
22707         (Event::Define): Ditto.
22708         (Property::Define): Ditto.
22709
22710 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22711
22712         * class.cs (TypeContainer::Populate): Now define operators too. 
22713         (TypeContainer.Operators): New property to access the list of operators
22714         in a type.
22715         (Operator.OperatorMethodBuilder): New member to hold the method builder
22716         for the operator we are defining.
22717         (Operator::Define): Implement.
22718
22719 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22720
22721         * class.cs (Event::Define): Make the prefixes of the accessor methods
22722         addOn_ and removeOn_ 
22723
22724         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22725         of the location being passed in too. Ideally, this should go later since all
22726         error reporting should be done through the Report object.
22727
22728         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22729         (Populate): Iterate thru the indexers we have and define them too.
22730         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22731         for the get and set accessors.
22732         (Indexer::Define): Implement.
22733
22734 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22735
22736         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22737         my previous implementation, did not work.
22738
22739         * typemanager.cs: Add a couple of missing types (the longs).
22740
22741         * literal.cs: Use TypeManager.bool_type instead of getting it.
22742
22743         * expression.cs (EventExpr): New kind of expressions.
22744         (Expressio::ExprClassFromMemberInfo): finish
22745
22746 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22747
22748         * assign.cs: Emit stores to static fields differently.
22749
22750 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22751
22752         * Merge in changes and adjust code to tackle conflicts. Backed out my
22753         code in Assign::Resolve ;-) 
22754
22755 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22756
22757         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22758         instead Report.Error and also pass in the location.
22759         (CSharpParser::Lexer): New readonly property to return the reference
22760         to the Tokenizer object.
22761         (declare_local_variables): Use Report.Error with location instead of plain 
22762         old error.
22763         (CheckDef): Ditto.
22764
22765         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22766         (Operator.CheckBinaryOperator): Ditto.
22767
22768         * cs-parser.jay (operator_declarator): Update accordingly.
22769
22770         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22771         (CheckBinaryOperator): Same here.
22772
22773         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22774         on the name without any prefixes of namespace names etc. This is because we
22775         already might have something already fully qualified like 
22776         'System.Console.WriteLine'
22777
22778         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22779
22780 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22781
22782         * cs-tokenizer.cs (location): Return a string which also contains
22783         the file name.
22784
22785         * expression.cs (ElementAccess): New class for expressions of the
22786         type 'element access.'
22787         (BaseAccess): New class for expressions of the type 'base access.'
22788         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22789         respectively.
22790
22791         * cs-parser.jay (element_access): Implement action.
22792         (base_access): Implement actions.
22793         (checked_expression, unchecked_expression): Implement.
22794
22795         * cs-parser.jay (local_variable_type): Correct and implement.
22796         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22797
22798         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22799
22800         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22801         name and the specifiers.
22802
22803         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22804
22805         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22806         making them all public ;-)
22807
22808         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22809         class anyways.
22810
22811 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22812
22813         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22814         PropertyExprs.
22815         (FieldExpr, PropertyExprs): New resolved expressions.
22816         (SimpleName::MemberStaticCheck): Perform static checks for access
22817         to non-static fields on static methods. Maybe this should be
22818         generalized for MemberAccesses. 
22819         (SimpleName::ResolveSimpleName): More work on simple name
22820         resolution. 
22821
22822         * cs-parser.jay (primary_expression/qualified_identifier): track
22823         the parameter index.
22824
22825         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22826         (EmitContext::EmitBoolExpression): Chain to expression generation
22827         instead of temporary hack.
22828         (::EmitStatementExpression): Put generic expression code generation.
22829
22830         * assign.cs (Assign::Emit): Implement variable assignments to
22831         local variables, parameters and fields.
22832
22833 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22834
22835         * statement.cs (Block::GetVariableInfo): New method, returns the
22836         VariableInfo for a variable name in a block.
22837         (Block::GetVariableType): Implement in terms of GetVariableInfo
22838
22839         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22840         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22841
22842 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22843
22844         * cs-parser.jay (operator_declaration): Continue on my quest : update
22845         to take attributes argument.
22846         (event_declaration): Ditto.
22847         (enum_declaration): Ditto.
22848         (indexer_declaration): Ditto.
22849
22850         * class.cs (Operator::Operator): Update constructor accordingly.
22851         (Event::Event): Ditto.
22852
22853         * delegate.cs (Delegate::Delegate): Same here.
22854
22855         * enum.cs (Enum::Enum): Same here.
22856
22857 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22858
22859         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22860
22861         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22862
22863         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22864         being passed around as an arraylist.
22865         (Attributes::AddAttribute): Method to add attribute sections.
22866
22867         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22868         (struct_declaration): Update accordingly.
22869         (constant_declaration): Update.
22870         (field_declaration): Update.
22871         (method_header): Update.
22872         (fixed_parameter): Update.
22873         (parameter_array): Ditto.
22874         (property_declaration): Ditto.
22875         (destructor_declaration): Ditto.
22876
22877         * class.cs (Struct::Struct): Update constructors accordingly.
22878         (Class::Class): Ditto.
22879         (Field::Field): Ditto.
22880         (Method::Method): Ditto.
22881         (Property::Property): Ditto.
22882         (TypeContainer::OptAttribute): update property's return type.
22883
22884         * interface.cs (Interface.opt_attributes): New member.
22885         (Interface::Interface): Update to take the extra Attributes argument.
22886
22887         * parameter.cs (Parameter::Parameter): Ditto.
22888
22889         * constant.cs (Constant::Constant): Ditto.
22890
22891         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22892         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22893         the attributes as a parameter.
22894         (InterfaceProperty): Update constructor call.
22895         (InterfaceEvent): Ditto.
22896         (InterfaceMethod): Ditto.
22897         (InterfaceIndexer): Ditto.
22898
22899         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22900         pass the attributes too.
22901         (interface_event_declaration): Ditto.
22902         (interface_property_declaration): Ditto.
22903         (interface_method_declaration): Ditto.
22904         (interface_declaration): Ditto.
22905
22906 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22907
22908         * class.cs (Method::Define): Track the "static Main" definition to
22909         create an entry point. 
22910
22911         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22912         EntryPoint if we find it. 
22913
22914         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22915         (EmitContext::ig): Make this variable public.
22916
22917         * driver.cs: Make the default output file be the first file name
22918         with the .exe extension.  
22919
22920         Detect empty compilations
22921
22922         Handle various kinds of output targets.  Handle --target and
22923         rename -t to --dumper.
22924
22925         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22926         methods inherited from Expression return now an Expression.  This
22927         will is used during the tree rewriting as we resolve them during
22928         semantic analysis.
22929
22930         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22931         the spec.  Missing entirely is the information about
22932         accessability of elements of it.
22933
22934         (Expression::ExprClassFromMemberInfo): New constructor for
22935         Expressions that creates a fully initialized Expression based on
22936         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22937         a Type.
22938
22939         (Invocation::Resolve): Begin implementing resolution of invocations.
22940
22941         * literal.cs (StringLiteral):  Implement Emit.
22942
22943 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22944
22945         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22946         member.
22947
22948 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22949
22950         * cs-parser.jay (attribute_arguments): Implement actions.
22951         (attribute): Fix bug in production. Implement action.
22952         (attribute_list): Implement.
22953         (attribute_target): Implement.
22954         (attribute_target_specifier, opt_target_specifier): Implement
22955         (CheckAttributeTarget): New method to check if the attribute target
22956         is valid.
22957         (attribute_section): Implement.
22958         (opt_attributes): Implement.
22959
22960         * attribute.cs : New file to handle attributes.
22961         (Attribute): Class to hold attribute info.
22962
22963         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22964         (attribute_section): Modify production to use 2 different rules to 
22965         achieve the same thing. 1 s/r conflict down !
22966         Clean out commented, useless, non-reducing dimension_separator rules.
22967
22968         * class.cs (TypeContainer.attributes): New member to hold list
22969         of attributes for a type.
22970         (Struct::Struct): Modify to take one more argument, the attribute list.
22971         (Class::Class): Ditto.
22972         (Field::Field): Ditto.
22973         (Method::Method): Ditto.
22974         (Property::Property): Ditto.
22975
22976         * cs-parser.jay (struct_declaration): Update constructor call to
22977         pass in the attributes too.
22978         (class_declaration): Ditto.
22979         (constant_declaration): Ditto.
22980         (field_declaration): Ditto.
22981         (method_header): Ditto.
22982         (fixed_parameter): Ditto.
22983         (parameter_array): Ditto.
22984         (property_declaration): Ditto.
22985
22986         * constant.cs (Constant::Constant): Update constructor similarly.
22987         Use System.Collections.
22988
22989         * parameter.cs (Parameter::Parameter): Update as above.
22990
22991 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22992
22993         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22994         (TypeContainer.delegates): New member to hold list of delegates.
22995
22996         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22997         this time as I seem to be on crack ;-)
22998
22999 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23000
23001         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23002         tell whether an identifier represents a namespace.
23003
23004         * expression.cs (NamespaceExpr): A namespace expression, used only
23005         temporarly during expression resolution.
23006         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23007         utility functions to resolve names on expressions.
23008
23009 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * codegen.cs: Add hook for StatementExpressions. 
23012
23013         * class.cs: Fix inverted test for static flag in methods.
23014
23015 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23016
23017         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23018         to make it coincide with MS' number.
23019         (Operator::CheckBinaryOperator): Ditto.
23020
23021         * ../errors/errors.txt : Remove error numbers added earlier.
23022
23023         * ../errors/cs1019.cs : Test case for error # 1019
23024
23025         * ../errros/cs1020.cs : Test case for error # 1020
23026
23027         * cs-parser.jay : Clean out commented cruft.
23028         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23029         used anywhere - non-reducing rule.
23030         (namespace_declarations): Non-reducing rule - comment out.
23031
23032         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23033         with TypeContainer::AddEnum.
23034
23035         * delegate.cs : New file for delegate handling classes.
23036         (Delegate): Class for declaring delegates.
23037
23038         * makefile : Update.
23039
23040         * cs-parser.jay (delegate_declaration): Implement.
23041
23042 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23043
23044         * class.cs (Event::Define): Implement.
23045         (Event.EventBuilder): New member.
23046
23047         * class.cs (TypeContainer::Populate): Update to define all enums and events
23048         we have.
23049         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23050         readonly fields for all these cases ?
23051
23052 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23053
23054         * class.cs (Property): Revamp to use the convention of making fields readonly.
23055         Accordingly modify code elsewhere.
23056
23057         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23058         the Define method of the Property class.
23059
23060         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23061         trivial bug.
23062         (TypeContainer::Populate): Update to define all the properties we have. Also
23063         define all enumerations.
23064
23065         * enum.cs (Define): Implement.
23066
23067 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23068
23069         * cs-parser.jay (overloadable_operator): The semantic value is an
23070         enum of the Operator class.
23071         (operator_declarator): Implement actions.
23072         (operator_declaration): Implement.
23073
23074         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23075         validity of definitions.
23076         (Operator::CheckBinaryOperator): Static method to check for binary operators
23077         (TypeContainer::AddOperator): New method to add an operator to a type.
23078
23079         * cs-parser.jay (indexer_declaration): Added line to actually call the
23080         AddIndexer method so it gets added ;-)
23081
23082         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23083         already taken care of by the MS compiler ?  
23084
23085 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23086
23087         * class.cs (Operator): New class for operator declarations.
23088         (Operator::OpType): Enum for the various operators.
23089
23090 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23091
23092         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23093         ostensibly handle this in semantic analysis.
23094
23095         * cs-parser.jay (general_catch_clause): Comment out
23096         (specific_catch_clauses, specific_catch_clause): Ditto.
23097         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23098         (catch_args, opt_catch_args): New productions.
23099         (catch_clause): Rewrite to use the new productions above
23100         (catch_clauses): Modify accordingly.
23101         (opt_catch_clauses): New production to use in try_statement
23102         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23103         and re-write the code in the actions to extract the specific and
23104         general catch clauses by being a little smart ;-)
23105
23106         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23107         Hooray, try and catch statements parse fine !
23108
23109 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23110
23111         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23112         string from the hashtable of variables.
23113
23114         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23115         I end up making that mistake ;-)
23116         (catch_clauses): Fixed gross error which made Key and Value of the 
23117         DictionaryEntry the same : $1 !!
23118
23119 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23120
23121         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23122
23123         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23124         when the add and remove accessors are specified. 
23125
23126 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23127
23128         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23129         information about indexer_declarator.
23130         (indexer_declarator): Implement actions.
23131         (parsing_indexer): New local boolean used to keep track of whether
23132         we are parsing indexers or properties. This is necessary because 
23133         implicit_parameters come into picture even for the get accessor in the 
23134         case of an indexer.
23135         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23136
23137         * class.cs (Indexer): New class for indexer declarations.
23138         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23139         (TypeContainer::indexers): New member to hold list of indexers for the
23140         type.
23141
23142 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23143
23144         * cs-parser.jay (add_accessor_declaration): Implement action.
23145         (remove_accessor_declaration): Implement action.
23146         (event_accessors_declaration): Implement
23147         (variable_declarators): swap statements for first rule - trivial.
23148
23149         * class.cs (Event): New class to hold information about event
23150         declarations.
23151         (TypeContainer::AddEvent): New method to add an event to a type
23152         (TypeContainer::events): New member to hold list of events.
23153
23154         * cs-parser.jay (event_declaration): Implement actions.
23155
23156 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23157
23158         * cs-parser.jay (dim_separators): Implement. Make it a string
23159         concatenating all the commas together, just as they appear.
23160         (opt_dim_separators): Modify accordingly
23161         (rank_specifiers): Update accordingly. Basically do the same
23162         thing - instead, collect the brackets here.
23163         (opt_rank_sepcifiers): Modify accordingly.
23164         (array_type): Modify to actually return the complete type string
23165         instead of ignoring the rank_specifiers.
23166         (expression_list): Implement to collect the expressions
23167         (variable_initializer): Implement. We make it a list of expressions
23168         essentially so that we can handle the array_initializer case neatly too.
23169         (variable_initializer_list): Implement.
23170         (array_initializer): Make it a list of variable_initializers
23171         (opt_array_initializer): Modify accordingly.
23172
23173         * expression.cs (New::NType): Add enumeration to help us
23174         keep track of whether we have an object/delegate creation
23175         or an array creation.
23176         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23177         members to hold data about array creation.
23178         (New:New): Modify to update NewType
23179         (New:New): New Overloaded contructor for the array creation
23180         case.
23181
23182         * cs-parser.jay (array_creation_expression): Implement to call
23183         the overloaded New constructor.
23184
23185 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23186
23187         * class.cs (TypeContainer::Constructors): Return member
23188         constructors instead of returning null.
23189
23190 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23191
23192         * typemanager.cs (InitCoreTypes): Initialize the various core
23193         types after we have populated the type manager with the user
23194         defined types (this distinction will be important later while
23195         compiling corlib.dll)
23196
23197         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23198         on Expression Classification.  Now all expressions have a method
23199         `Resolve' and a method `Emit'.
23200
23201         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23202         generation from working.     Also add some temporary debugging
23203         code. 
23204
23205 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23206
23207         * codegen.cs: Lots of code generation pieces.  This is only the
23208         beginning, will continue tomorrow with more touches of polish.  We
23209         handle the fundamentals of if, while, do, for, return.  Others are
23210         trickier and I need to start working on invocations soon.
23211
23212         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23213         s.InitStatement. 
23214
23215         * codegen.cs (EmitContext): New struct, used during code
23216         emission to keep a context.   Most of the code generation will be
23217         here. 
23218
23219         * cs-parser.jay: Add embedded blocks to the list of statements of
23220         this block.  So code generation proceeds in a top down fashion.
23221
23222 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * statement.cs: Add support for multiple child blocks.
23225
23226 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23227
23228         * codegen.cs (EmitCode): New function, will emit the code for a
23229         Block of code given a TypeContainer and its ILGenerator. 
23230
23231         * statement.cs (Block): Standard public readonly optimization.
23232         (Block::Block constructors): Link children. 
23233         (Block::Child): Child Linker.
23234         (Block::EmitVariables): Emits IL variable declarations.
23235
23236         * class.cs: Drop support for MethodGroups here, delay until
23237         Semantic Analysis.
23238         (Method::): Applied the same simplification that I did before, and
23239         move from Properties to public readonly fields.
23240         (Method::ParameterTypes): Returns the parameter types for the
23241         function, and implements a cache that will be useful later when I
23242         do error checking and the semantic analysis on the methods is
23243         performed.
23244         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23245         and made a method, optional argument tells whether this is a class
23246         or a structure to apply the `has-this' bit.
23247         (Method::GetCallingConvention): Implement, returns the calling
23248         convention. 
23249         (Method::Define): Defines the type, a second pass is performed
23250         later to populate the methods.
23251
23252         (Constructor::ParameterTypes): implement a cache similar to the
23253         one on Method::ParameterTypes, useful later when we do semantic
23254         analysis. 
23255
23256         (TypeContainer::EmitMethod):  New method.  Emits methods.
23257
23258         * expression.cs: Removed MethodGroup class from here.
23259
23260         * parameter.cs (Parameters::GetCallingConvention): new method.
23261
23262 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23263
23264         * class.cs (TypeContainer::Populate): Drop RootContext from the
23265         argument. 
23266
23267         (Constructor::CallingConvention): Returns the calling convention.
23268         (Constructor::ParameterTypes): Returns the constructor parameter
23269         types. 
23270
23271         (TypeContainer::AddConstructor): Keep track of default constructor
23272         and the default static constructor.
23273
23274         (Constructor::) Another class that starts using `public readonly'
23275         instead of properties. 
23276
23277         (Constructor::IsDefault): Whether this is a default constructor. 
23278
23279         (Field::) use readonly public fields instead of properties also.
23280
23281         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23282         track of static constructors;  If none is used, turn on
23283         BeforeFieldInit in the TypeAttributes. 
23284
23285         * cs-parser.jay (opt_argument_list): now the return can be null
23286         for the cases where there are no arguments. 
23287
23288         (constructor_declarator): If there is no implicit `base' or
23289         `this', then invoke the default parent constructor. 
23290
23291         * modifiers.cs (MethodAttr): New static function maps a set of
23292         modifiers flags into a MethodAttributes enum
23293         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23294         MethodAttr, TypeAttr to represent the various mappings where the
23295         modifiers are used.
23296         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23297
23298 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23299
23300         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23301         method arguments.
23302
23303         * interface.cs (PopulateIndexer): Implemented the code generator
23304         for interface indexers.
23305
23306 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23307
23308         * interface.cs (InterfaceMemberBase): Now we track the new status
23309         here.  
23310
23311         (PopulateProperty): Implement property population.  Woohoo!  Got
23312         Methods and Properties going today. 
23313
23314         Removed all the properties for interfaces, and replaced them with
23315         `public readonly' fields. 
23316
23317 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23320         initialize their hashtables/arraylists only when they are needed
23321         instead of doing this always.
23322
23323         * parameter.cs: Handle refs and out parameters.
23324
23325         * cs-parser.jay: Use an ArrayList to construct the arguments
23326         instead of the ParameterCollection, and then cast that to a
23327         Parameter[] array.
23328
23329         * parameter.cs: Drop the use of ParameterCollection and use
23330         instead arrays of Parameters.
23331
23332         (GetParameterInfo): Use the Type, not the Name when resolving
23333         types. 
23334
23335 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23336
23337         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23338         and instead use public readonly fields.
23339
23340         * class.cs: Put back walking code for type containers.
23341
23342 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23343
23344         * class.cs (MakeConstant): Code to define constants.
23345
23346         * rootcontext.cs (LookupType): New function.  Used to locate types 
23347
23348
23349 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23350
23351         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23352         this System.Reflection code is.  Kudos to Microsoft
23353
23354         * typemanager.cs: Implement a type cache and avoid loading all
23355         types at boot time.  Wrap in LookupType the internals.  This made
23356         the compiler so much faster.  Wow.  I rule!
23357
23358         * driver.cs: Make sure we always load mscorlib first (for
23359         debugging purposes, nothing really important).
23360
23361         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23362         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23363
23364         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23365         on namespaces that have been imported using the `using' keyword.
23366
23367         * class.cs (TypeContainer::TypeAttr): Virtualize.
23368         (Class::TypeAttr): Return attributes suitable for this bad boy.
23369         (Struct::TypeAttr): ditto.
23370         Handle nested classes.
23371         (TypeContainer::) Remove all the type visiting code, it is now
23372         replaced with the rootcontext.cs code
23373
23374         * rootcontext.cs (GetClassBases): Added support for structs. 
23375
23376 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * interface.cs, statement.cs, class.cs, parameter.cs,
23379         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23380         Drop use of TypeRefs, and use strings instead.
23381
23382 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23383
23384         * rootcontext.cs: 
23385
23386         * class.cs (Struct::Struct): set the SEALED flags after
23387         checking the modifiers.
23388         (TypeContainer::TypeAttr): new property, returns the
23389         TypeAttributes for a class.  
23390
23391         * cs-parser.jay (type_list): Oops, list production was creating a
23392         new list of base types.
23393
23394         * rootcontext.cs (StdLib): New property.
23395         (GetInterfaceTypeByName): returns an interface by type name, and
23396         encapsulates error handling here.
23397         (GetInterfaces): simplified.
23398         (ResolveTree): Encapsulated all the tree resolution here.
23399         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23400         types. 
23401
23402         * driver.cs: Add support for --nostdlib, to avoid loading the
23403         default assemblies.
23404         (Main): Do not put tree resolution here. 
23405
23406         * rootcontext.cs: Beginning of the class resolution.
23407
23408 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23409
23410         * rootcontext.cs: Provide better error reporting. 
23411
23412         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23413
23414         * rootcontext.cs (CreateInterface): Handle the case where there
23415         are no parent interfaces.
23416
23417         (CloseTypes): Routine to flush types at the end.
23418         (CreateInterface): Track types.
23419         (GetInterfaces): Returns an array of Types from the list of
23420         defined interfaces.
23421
23422         * typemanager.c (AddUserType): Mechanism to track user types (puts
23423         the type on the global type hash, and allows us to close it at the
23424         end). 
23425
23426 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23427
23428         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23429         RecordInterface instead.
23430
23431         * cs-parser.jay: Updated to reflect changes above.
23432
23433         * decl.cs (Definition): Keep track of the TypeBuilder type that
23434         represents this type here.  Not sure we will use it in the long
23435         run, but wont hurt for now.
23436
23437         * driver.cs: Smaller changes to accomodate the new code.
23438
23439         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23440         when done. 
23441
23442         * rootcontext.cs (CreateInterface):  New method, used to create
23443         the System.TypeBuilder type for interfaces.
23444         (ResolveInterfaces): new entry point to resolve the interface
23445         hierarchy. 
23446         (CodeGen): Property, used to keep track of the code generator.
23447
23448 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23449
23450         * cs-parser.jay: Add a second production for delegate_declaration
23451         with `VOID'.
23452
23453         (enum_body): Put an opt_comma here instead of putting it on
23454         enum_body or enum_member_declarations so we can handle trailing
23455         commas on enumeration members.  Gets rid of a shift/reduce.
23456
23457         (type_list): Need a COMMA in the middle.
23458
23459         (indexer_declaration): Tell tokenizer to recognize get/set
23460
23461         * Remove old targets.
23462
23463         * Re-add the parser target.
23464
23465 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23466
23467         * cs-parser.jay: Add precendence rules for a number of operators
23468         ot reduce the number of shift/reduce conflicts in the grammar.
23469
23470 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23471
23472         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23473         and put it here.
23474
23475         Get rid of old crufty code.
23476
23477         * rootcontext.cs: Use this to keep track of the parsed
23478         representation and the defined types available to the program. 
23479
23480         * gen-treedump.cs: adjust for new convention.
23481
23482         * type.cs: Split out the type manager, and the assembly builder
23483         from here. 
23484
23485         * typemanager.cs: the type manager will live here now.
23486
23487         * cil-codegen.cs: And the code generator here. 
23488
23489 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23490
23491         * makefile: Fixed up for easy making.
23492
23493 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23494
23495         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23496         the 
23497
23498         (unary_expression): Expand pre_increment_expression and
23499         post_decrement_expression to reduce a shift/reduce.
23500
23501 2001-07-11  Simon Cozens
23502
23503         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23504
23505         Improve allow_keyword_as_indent name.
23506
23507 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23508
23509         * Adjustments for Beta2. 
23510
23511 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23512
23513         * decl.cs: Added `Define' abstract method.
23514         (InTransit): new property, used to catch recursive definitions. 
23515
23516         * interface.cs: Implement `Define'. 
23517
23518         * modifiers.cs: Map Modifiers.constants to
23519         System.Reflection.TypeAttribute flags.
23520
23521         * class.cs: Keep track of types and user-defined types.
23522         (BuilderInit): New method for creating an assembly
23523         (ResolveType): New function to launch the resolution process, only
23524         used by interfaces for now.
23525
23526         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23527         that are inserted into the name space. 
23528
23529 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23530
23531         * ARGH.  I have screwed up my tree so many times due to the use of
23532         rsync rather than using CVS.  Going to fix this at once. 
23533
23534         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23535         load types.
23536
23537 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23538
23539         * Experiment successful: Use System.Type rather that our own
23540         version of Type.  
23541
23542 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23543
23544         * cs-parser.jay: Removed nsAliases from here.
23545
23546         Use new namespaces, handle `using XXX;' 
23547
23548         * namespace.cs: Reimplemented namespace handling, use a recursive
23549         definition of the class.  Now we can keep track of using clauses
23550         and catch invalid using clauses.
23551
23552 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23553
23554         * gen-treedump.cs: Adapted for all the renaming.
23555
23556         * expression.cs (Expression): this class now has a Type property
23557         which returns an expression Type.
23558
23559         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23560         `Type', as this has a different meaning now in the base
23561
23562 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23563
23564         * interface.cs, class.cs: Removed from all the sources the
23565         references to signature computation, as we can not do method
23566         signature computation during the parsing time, as we are not
23567         trying to solve at that point distinguishing:
23568
23569         class X {
23570                 void a (Blah x) {}
23571                 void a (NS.Blah x) {}
23572         }
23573
23574         Which depending on the context might be valid or not, as we do not
23575         know if Blah is the same thing as NS.Blah at that point.
23576
23577         * Redid everything so the code uses TypeRefs now instead of
23578         Types.  TypeRefs are just temporary type placeholders, that need
23579         to be resolved.  They initially have a pointer to a string and the
23580         current scope in which they are used.  This is used later by the
23581         compiler to resolve the reference to an actual Type. 
23582
23583         * DeclSpace is no longer a CIR.Type, and neither are
23584         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23585         are all DeclSpaces, but no Types. 
23586
23587         * type.cs (TypeRefManager): This implements the TypeRef manager,
23588         which keeps track of all the types that need to be resolved after
23589         the parsing has finished. 
23590
23591 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23592
23593         * ARGH.  We are going to have to store `foreach' as a class rather
23594         than resolving it, as we need to verify error 1579 after name
23595         resolution.   *OR* we could keep a flag that says `This request to
23596         IEnumerator comes from a foreach statement' which we can then use
23597         to generate the error.
23598
23599 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23600
23601         * class.cs (TypeContainer.AddMethod): we now add methods to the
23602         MethodGroup instead of the method hashtable.  
23603
23604         * expression.cs: Add MethodGroup abstraction, which gets us one
23605         step closer to the specification in the way we handle method
23606         declarations.  
23607
23608         * cs-parser.jay (primary_expression): qualified_identifier now
23609         tried to match up an identifier to a local variable reference or
23610         to a parameter reference.
23611
23612         current_local_parameters is now a parser global variable that
23613         points to the current parameters for the block, used during name
23614         lookup.
23615
23616         (property_declaration): Now creates an implicit `value' argument to
23617         the set accessor.
23618
23619 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23620
23621         * parameter.cs: Do not use `param' arguments as part of the
23622         signature, per the spec.
23623
23624 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23625
23626         * decl.cs: Base class for classes, structs and interfaces.  This
23627         is the "Declaration Space" 
23628
23629         * cs-parser.jay: Use CheckDef for checking declaration errors
23630         instead of having one on each function.
23631
23632         * class.cs: Factor out some code for handling error handling in
23633         accordance to the "Declarations" section in the "Basic Concepts"
23634         chapter in the ECMA C# spec.
23635
23636         * interface.cs: Make all interface member classes derive from
23637         InterfaceMemberBase.
23638
23639 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23640
23641         * Many things: all interfaces are parsed and generated in
23642         gen-treedump.  Support for member variables, constructors,
23643         destructors, properties, constants is there.
23644
23645         Beginning of the IL backend, but very little done, just there for
23646         testing purposes. 
23647
23648 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23649
23650         * cs-parser.jay: Fix labeled statement.
23651
23652         * cs-tokenizer.cs (escape): Escape " and ' always.
23653         ref_line, ref_name: keep track of the line/filename as instructed
23654         by #line by the compiler.
23655         Parse #line.
23656
23657 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23658
23659         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23660         to match the values in System.CodeDOM.
23661
23662         Divid renamed to Divide.
23663
23664         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23665         statements. 
23666         (Statements.set): remove.
23667
23668         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23669         statements. 
23670
23671         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23672         falseStatements always have valid values. 
23673
23674         * cs-parser.jay: Use System.CodeDOM now.
23675