2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2
3         * typemanager.cs (TypeManager): Added 
4         TypeManager.internals_visible_attr_type to cache
5         S.R.CompilerServices.InternalsVisibleToAttribute.
6
7         * codegen.cs (AssemblyClass): Added checks for 
8         InternalsVisibleToAttribute in new method 
9         CheckInternalsVisibleAttribute () and also cache the
10         AssemblyName in AssemblyClass.Name.
11         
12 2005-10-24  Martin Baulig  <martin@ximian.com>
13
14         * typemanager.cs
15         (TypeManager.ExpandInterfaces): Added overloaded version which
16         just takes a `Type[]' array.
17
18         * generic.cs
19         (Constraints.Resolve): Don't expand the interfaces here; ie. we
20         just use the interfaces which were explicitly specified and not
21         the interfaces they inherit.  Fixes #76482.
22         (TypeParameter.FindMembers): Expand the interfaces here.
23
24 2005-10-21  Martin Baulig  <martin@ximian.com>
25
26         * generic.cs
27         (Constraints.Resolve): Also resolve the actual types here.
28         (Constraints.ResolveTypes): Just check the constraints here.
29         Fixes #76363; see gtest-218.cs.
30
31 2005-10-21  Martin Baulig  <martin@ximian.com>
32
33         * convert.cs
34         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
35         instead of a `BoxedCast'; fixes gtest-217.cs.
36
37 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
38
39         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
40           1) "new()" is specified as generic parameter constraint and 2) the
41           type is TypeBuilder and 3) the type is abstract even if it has a
42           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
43
44 2005-10-20  Martin Baulig  <martin@ximian.com>
45
46         * generic.cs
47         (GenericConstraints.TypeParameter): New public property.
48         (TypeParameter.ctor): Also take a `DeclSpace' argument.
49         (TypeParameter.DeclSpace): New public property.
50         (TypeParameter.DefineType): Inflate the constraints if our
51         `DeclSpace' is an `Iterator'.   
52
53 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
54
55         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
56           GenericMethod argument to compare methods' generic type arguments.
57           Fixed bug #76382.
58
59 2005-10-19  Martin Baulig  <martin@ximian.com>
60
61         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
62         not ResolveType() when resolving the base type, so we're not
63         checking the constraints here.
64         (TypeContainer.ResolveType): Call ResolveType() on our base_type
65         if we have any.
66
67 2005-10-19  Martin Baulig  <martin@ximian.com>
68
69         * generic.cs (ConstructedType.CheckConstraints): Committing
70         untested fix for #76441.
71
72 2005-10-18  Raja R Harinath  <rharinath@novell.com>
73
74         Fix #76371.
75         * class.cs (TypeContainer.DefineType): Move updating of
76         topological sort earlier in the code.
77         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
78
79 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
80
81         Fix #76273.
82         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
83         
84         * constant.cs (Constant.TryReduce): Moved from Cast class.
85         (Reduce): Made little bit more OO and fixed missing conversions.
86         
87         * ecore.cs (Reduce): Implemented.
88         (Binary.EnumLiftUp): New method to upgrade values to enum values.
89         
90         * literal.cs (Reduce): Implemented.
91         
92         * class.cs: Reverted Miguel's wrong commit.
93
94 2005-10-14  Miguel de Icaza  <miguel@novell.com>
95
96         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
97
98 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
99
100         * cs-parser.jay, expression.cs : CS0214 was missing error location
101           for constants. Fixed bug #76404.
102
103 2005-10-10  Raja R Harinath  <rharinath@novell.com>
104
105         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
106         InstanceExpression.
107         (PropertyExpr.EmitCall): Likewise.
108         * expression.cs (Invocation.EmitArguments): Handle case where
109         arguments == null.
110         (Invocation.EmitCall): Avoid allocating temporary variable if
111         there are no arguments.
112
113 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
114
115         Fix #76370.
116         * convert.cs (ExplicitConversionCore): Fixed object->enum
117         conversion.
118
119 2005-10-07  Raja R Harinath  <rharinath@novell.com>
120
121         Fix #76323.
122         * convert.cs (ImplicitConversionStandard): Move conversion of
123         void* to arbitrary pointer types ...
124         (ExplicitConversionStandard): .. here.
125         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
126         error to always print typenames.
127
128 2005-10-07  Raja R Harinath  <rharinath@novell.com>
129
130         * convert.cs (GetConversionOperator): Rename from
131         GetConversionOperators.  Move operator selection code from ...
132         (UserDefinedConversion): ... here.
133
134 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
135
136         * convert.cs (ExplicitConversionCore): Removed duplicate enum
137         conversion.
138
139 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
140
141         * assign.cs (Assign.DoResolve): Error method changed.
142
143         * cfold.cs (DoConstantNumericPromotions): Error method changed.
144         
145         * const.cs (ResolveValue): Reset in_transit immediately.
146         
147         * constant.cs: Error method changed.
148         
149         * convert.cs: Removed useless location parameter.
150         (ExplicitNumericConversion): Don't do double enum check.
151         (ExplicitConversionCore): Renamed from ExplicitConversion.
152         (ExplicitUnsafe): Extracted from ExplicitConversion.
153         (ExplicitConversion): Uses for error reporting.
154         
155         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
156         error messages.
157         (ResolveBoolean): Uses common error method.
158         (CastToDecimal): Get rid of ec.
159         (CastFromDecimal): Optimized.
160         (ConvCast): Get rid of ec.
161         
162         * enum.cs (ResolveValue): Reset in_transit immediately.
163         (Emit): Return after first error.
164         
165         * expression.cs: Convert changes.
166         
167         * literal.cs: Error method changed.
168         
169         * statement.cs: Error method changed.
170
171 2005-10-06  Raja R Harinath  <rharinath@novell.com>
172
173         Fix gtest-131.cs and gtest-211.cs.
174         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
175         Only emit code for a label if it is used.  Unreachable code can
176         violate ECMA evaluation stack invariants.
177
178 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
179
180         * anonymous.cs: Implemented ExprClassName.
181         
182         * assign.cs (Assign.DoResolve): Don't chrash when type is not
183         delegate.
184         
185         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
186         check.
187         
188         * class.cs (StaticClass.DefineContainerMembers): Report protected
189         members as error.
190         
191         * codegen.cs: if(ed) PRODUCTION.
192         
193         * convert.cs (Error_CannotImplicitConversion): Better error
194         distinction.
195         
196         * cs-parser.jay: More error checks.
197         
198         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
199         
200         * driver.cs (CSCParseOption): Enabled wrong option check.
201         
202         * ecore.cs (Expression.ExprClassName): Turned to property.
203         (MemberExpr.CheckIntermediateModification): For checking boxed
204         value types     modification.
205         
206         * statement.cs (Fixed.Resolve): Expression type must be
207         convertible to fixed type.
208         (CollectionForeach.GetEnumeratorFilter,TryType):
209         Small refactoring for easier error checking.
210
211 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
212
213         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
214         attributes.
215         
216         * class.cs (GeneratedBaseInitializer): New class for customization
217         compiler generated initializers.
218         (MemberBase.DoDefine): Check Obsolete attribute here.
219         (FieldMember.DoDefine): Ditto.
220         
221         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
222         constants.
223         
224         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
225         (MemberCore.GetObsoleteAttribute): Removed argument.
226         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
227         (MemberCore.CheckObsoleteType): New helper.
228         
229         * delegate.cs,
230         * enum.cs,
231         * statement.cs: Updates after MemberCore changes.
232         
233         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
234         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
235         
236         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
237         obsolete attribute for compiler construct.
238         (As.DoResolve): Cache result.
239         
240         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
241
242 2005-10-01  Miguel de Icaza  <miguel@novell.com>
243
244         * expression.cs (Probe): instead of having a "Type probe_type"
245         keep the extra information as a TypeExpr probe_type_expr since the
246         "As" operator needs to perform some type checks.
247
248         * (As.DoResolve): If the type is a type parameter, ensure that it
249         is constrained by a class.
250
251 2005-09-22  Miguel de Icaza  <miguel@novell.com>
252
253         * statement.cs (Lock): Use the TemporaryVariable class instead of
254         manually using local variables as those do not work when variables
255         are captured.
256
257         * ecore.cs: Moved the TemporaryVariable class from being a nested
258         class inside Foreach to be a public class that can be employed in
259         other places. 
260
261 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
262
263         * cs-parser.jay: interface_accessors replaced by
264         accessor_declarations.
265
266         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
267         location.
268         
269         * statement.cs (GotoCase.Resolve): Convert null constant to
270         null case.
271         (SwitchLabel.ResolveAndReduce): Ditto.
272         (SwitchLabel.NullStringCase): Custom null stamp.
273         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
274         
275         typemanager.cs (CSharpSignature): Don't skip first argument
276         for full names.
277
278 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
279
280         * cfold.cs, constant.cs, convert.cs, ecore.cs,
281         expression.cs, iterators.cs, literal.cs: Store constants and
282         literals location.
283         
284         * class.cs (MemberBase.ShortName): Pass location.
285         
286         * cs-parser.jay: Some location fixes.
287         
288         * ecore.cs (Expression.Location): Made virtual.
289
290 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
291
292         Fix #72930.
293         * const.cs (Const.ResolveValue): Check for assigning non-null
294         value to reference type.
295
296 2005-09-26  Raja R Harinath  <rharinath@novell.com>
297
298         Fix #76133.
299         * expression.cs (This.VerifyFixed): In a value type T, the type of
300         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
301         value type R, 'this' is treated as a value parameter.
302
303 2005-09-05  Miguel de Icaza  <miguel@novell.com>
304
305         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
306         if the underlying types are the same, otherwise we need to produce
307         code that will do the proper cast.
308
309         This was exposed by Marek's constant rewrite which produced
310         invalid code for the call site:
311
312         enum X : long { a }
313         void Method (X v) {}
314
315         Method ((X) 5)
316
317         This fixes test-49.cs
318
319 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
320
321         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
322           Type/Object should be allowed as well. Fixed bug #75968.
323
324 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
325
326         * expression.cs : (Binary.DoResolve): when one is enum constant and
327           another is constant 0, then return enum one *as enum type*.
328           Fixed bug 74846.
329
330 2005-10-04  Martin Baulig  <martin@ximian.com>
331
332         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
333         `SetMemberIsUsed()' work for generics, too.
334
335 2005-10-04  Martin Baulig  <martin@ximian.com>
336
337         * expression.cs (DelegateInvocation.EmitStatement): Make this work
338         for corlib.  Fixes #75691.
339
340 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
341
342         Fix #76255.
343         * driver.cs: Fix compilation files with full root path.
344
345 2005-09-25  Miguel de Icaza  <miguel@novell.com>
346
347         * report.cs (SymbolRelatedToPreviousError): Format the output so
348         it does not use an open parenthesis that is never closed. 
349
350         * driver.cs: Follow coding guidelines
351
352 2005-09-18  Miguel de Icaza  <miguel@novell.com>
353
354         * driver.cs: Set InEmacs based on the environment variable EMACS. 
355
356         * location.cs (InEmacs): in this mode, do not report column
357         location as it confuses Emacs.
358
359 2005-10-03  Raja R Harinath  <rharinath@novell.com>
360
361         * support.cs (SeekableStreamReader.Position): Don't error out when
362         the requested position is just beyond the end of the current
363         buffered data.
364
365 2005-09-28  Raja R Harinath  <rharinath@novell.com>
366
367         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
368         try to keep in sync with the byte count of the underlying Stream.
369         However, this limits us to a window size of 2048 characters: i.e.,
370         the maximum lookahead of our lexer/parser can be 2048 characters.
371
372 2005-09-22  Martin Baulig  <martin@ximian.com>
373
374         * driver.cs: Removed a debugging FIXME.
375
376 2005-09-21  Raja R Harinath  <rharinath@novell.com>
377
378         * cs-parser.jay (type_arguments): Add CS1644 check.
379         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
380
381 2005-09-15  Raja R Harinath  <rharinath@novell.com>
382
383         * Makefile (PROGRAM): Make profile specific.
384         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
385         the current directory.
386
387         Fix test-455.cs.
388         * expression.cs (Invocation.EmitCall): Remove optimization on
389         this_call since it doesn't handle 'this' being a value type.
390
391 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
392
393         * driver.cs: Ensure file handles are closed after parsing
394
395 2005-09-05  Miguel de Icaza  <miguel@novell.com>
396
397         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
398         if the underlying types are the same, otherwise we need to produce
399         code that will do the proper cast.
400
401         This was exposed by Marek's constant rewrite which produced
402         invalid code for the call site:
403
404         enum X : long { a }
405         void Method (X v) {}
406
407         Method ((X) 5)
408
409         This fixes test-49.cs
410
411 2005-09-05  Martin Baulig  <martin@ximian.com>
412
413         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
414         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
415
416         * cs-parser.jay (delegate_declaration): Small fix for #75852.
417
418 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
419
420         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
421           to be a pointer type due to the spec 25.2, so check if declaring
422           type is generic type definition. Fixed bug #75772.
423
424 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
425
426         Fixed bug #75957.
427         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
428           both types are not defined by methods.
429         * expression.cs : (Invocation.IsApplicable): it should work when
430           the argument type is equal to the parameter type, not only when
431           ImplicitConversionExists() returns true.
432
433 2005-09-02  Raja R Harinath  <rharinath@novell.com>
434
435         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
436         internal.
437
438         Fix #75941.
439         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
440         flow-branching for LocalVariableReferences in case we were invoked
441         from a MemberAccess.
442         * expression.cs (LocalVariableReference.VerifyAssigned): New.
443         Carved out of ...
444         (LocalVariableReference.DoResolveBase): ... this.
445         (MemberAccess.Resolve): Do the check that was disabled during
446         SimpleNameResolve.
447
448 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
449
450         * class.cs :
451           (PartialContainer.Create): check abstract/sealed/static strictly
452           but abstract/sealed can exist only at one side. Fixed bug #75883.
453
454 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
455
456         Fix #75945.
457         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
458         specified, don't default to UnmanagedType.I4.
459
460 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
461
462         * expression.cs : conditional operator should check possibly
463           incorrect assign expression. Fixed bug #75946.
464
465 2005-08-30  Raja R Harinath  <rharinath@novell.com>
466
467         Fix #75934.
468         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
469         (ScopeInfo.EmitScopeType): Use it to construct field names from
470         names of captured locals.
471
472         Fix #75929.
473         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
474         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
475         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
476         (ExplicitConversion): Remove enum cases already handled by
477         implicit conversion.  Move implicit conversion check to the beginning.
478         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
479         * expression.cs (ArrayCreation.EmitDynamicInitializers):
480         Don't treat System.Enum as a struct.
481
482 2005-08-30  Jb Evain  <jbevain@gmail.com>
483
484         * attribute.cs: handles as expression in parameters.
485
486 2005-08-30  Raja R Harinath  <rharinath@novell.com>
487
488         Fix #75802.
489         * class.cs (TypeContainer.VerifyClsName): Don't use a
490         PartialContainer when verifying CLS compliance.
491         (AbstractPropertyEventMethod): Set Parent here, ...
492         (PropertyMethod): ... not here.
493
494 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
495
496         * attribute.cs : escaped attribute name should not be allowed to be
497           resolved (e.g. @class as classAttribute). Fixed bug #75930.
498
499 2005-08-29  Raja R Harinath  <rharinath@novell.com>
500
501         Fix #75927.
502         * convert.cs (ImplicitStandardConversionExists): Allow zero also
503         when converting a long constant to unsigned long.
504         * expression.cs (Invocation.OverloadResolve): Add sanity check to
505         detect where IsApplicable and VerifyArgumentsCompat disagree.
506
507 2005-08-29  Raja R Harinath  <rharinath@novell.com>
508         and Carlos Alberto Cortez  <carlos@unixmexico.org>
509
510         Fix #75848.
511         * class.cs (TypeContainer.CanElideInitializer): New helper.
512         (TypeContainer.EmitFieldInitializers): Use it to determine if we
513         can safely emitting the initializer of a field.
514
515 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
516
517         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
518           allowed inside a switch (without loop). Fixed bug #75433.
519
520 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
521
522         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
523         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
524
525 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
526
527         * driver.cs : kinda reverting the default encoding changes (not exact 
528           revert since I noticed that "codepage:reset" might not work fine).
529
530 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
531
532         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
533           Location. Now getter and setter store location correctly.
534           (errors/cs0111-12.cs now reports the expected location.)
535
536 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
537
538         * driver.cs : Use default encoding on the environment.
539           Removed (now that) extra parameter for SeekableStreamReader.
540         * support.cs : (SeekableStreamReader) third .ctor() argument for
541           StreamReader is not required (always true). preamble size could
542           be acquired in simpler and safe way.
543
544 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
545
546         * cs-parser.jay: report CS0642 at warning level 3
547           and report CS0642 for an if else statement also
548           fixes bug #74745. Patch by John Luke (and a bit
549           modified by me).
550           Removed extra CS0642 warning check for "while",
551           "for" and "fixed".
552         * statement.cs: In Block.Resolve(), CS0642 check
553           is reimplemented to check a sequence of an empty
554           statement and a block.
555
556           Both fix bug #66777.
557
558 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
559
560         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
561         detection until I fix it.
562         
563         * cs-tokenizer.cs: Changed error message.
564         
565         * cs-parser.jay: Fixed 2 error locations.
566         
567         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
568         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
569         properties.
570         
571         * enum.cs (GetSignatureForError): Fixed.
572         
573         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
574         method detection.
575         
576         * class.cs,
577         * typemanager.cs (RegisterProperty): Removed.
578         
579         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
580
581 2005-08-24  Raja R Harinath  <rharinath@novell.com>
582
583         Fix #75874.
584         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
585         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
586
587 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
588
589         * expression.cs : tiny fix is required for not warning positive ulong.
590           See test-441.cs.
591
592 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
593
594         * expression.cs : add CS0652 check for constant and integral
595           expression. Fixed bug #53974.
596
597 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
598
599         * expression.cs : in DoNumericPromotions(), check if there is implicit
600           conversion overload for string (to check CS0034). Fixed bug #52492.
601
602 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
603
604         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
605
606 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
607
608         * ecore.cs : report location when it is *not* Null.
609
610 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
611
612         * codegen.cs,
613           ecore.cs,
614           flowanalysis.cs,
615           expression.cs:
616           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
617           correctly. Fixed bug #75721.
618
619 2005-08-23  Raja R Harinath  <rharinath@novell.com>
620
621         * support.cs (SeekableStreamReader.Position): Avoid an expensive
622         loop that performs 'min (pos, char_count)'.
623
624         Fix #75862.
625         * expression.cs (Unary.ResolveOperator): Don't discard implicit
626         converted value in Operator.OnesComplement.
627
628 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
629
630         * anonymous.cs: If the anon method is pulled into a helper class,
631         it needs to be `internal' not `private'. Fixes runtime behavior on
632         msft. bug #75704
633
634 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
635
636         Fix #75803
637         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
638         is a partial class.
639
640 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
641
642         The big constants rewrite
643         Fix #75746, #75685 and more
644         As a side effect saved 1MB for MWF ;-)
645         
646         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
647         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
648         enum based for corlib compilation.
649         
650         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
651         subtractions.
652         
653         * class.cs (FixedField.Define): Use ResolveAsConstant.
654         
655         * const.cs (IConstant): Interface constants and enums.
656         (Const.ResolveValue): New method for constant resolvning.
657         (ExternalConstant): Constants from imported assemblies.
658         
659         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
660         conversion; like enums.
661         (Constant.ToType): Converts this constant to different type.
662         (Constant.Increment): Adds 1.
663         
664         * convert.cs (ImplicitConversionRequired): Simplified.
665         
666         * cs-parser.jay: Create EnumMember directly.
667         
668         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
669         
670         * doc.cs (GenerateEnumDocComment): Removed.
671         
672         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
673         (ConvertIntLiteral): Removed.
674         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
675         
676         * enum.cs (EnumMember): Implement IConstant.
677         (Enum.IsValidEnumConstant): Removed.
678         (Enum.GetNextDefaultValue): Removed.
679         (Enum.FindMembers): Updated.
680         (Enum.GenerateDocComment): Iterate enum members.
681         
682         * expression.cs (Cast.TryReduce): Handle enums correctly.
683         (New.Constantify): Made public.
684         (MemberAccess.DoResolve): Removed contant specific if(s).
685         
686         * literal.cs (NullLiteral): Implement new abstract methods.
687         
688         * statement.cs (GotoCase.Resolve): Use new constant methods.
689         (SwitchLabel.ResolveAndReduce): Use new constant methods.
690         
691         * typemanager.cs (LookupEnum): Removed.
692         (IsEnumType): Fixed to work with corlib.
693         (RegisterConstant): Removed.
694         (LookupConstant): Removed.
695         (GetConstant): Changed to work with IConstant.
696
697 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
698
699         * location.cs : Fixed overflown (>255) column number.
700
701 2005-08-03  Raja R Harinath  <rharinath@novell.com>
702
703         First cut of the qualified-alias-member feature.
704         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
705         token.
706         * cs-parser.jay (DOUBLE_COLON): New token.
707         (namespace_or_type_name): Add rule for recognizing
708         qualified-alias-members.
709         (primary_expression): Likewise.
710         (element_access): Allow QualifiedAliasMember as a possible
711         type-bearing expression.
712         (local_variable_type, local_variable_pointer_type): Likewise.
713         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
714         aliases in the current and enclosing namespace declarations.
715         (NamespaceEntry.UsingAlias): Add CS0440 warning.
716         * decl.cs (MemberName.is_double_colon): New.
717         (MemberName.MemberName): Add new constructor for alias-member.
718         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
719         * expression.cs (QualifiedAliasMember): New expression type.
720
721 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
722
723         * location.cs : it borked when no argument was specified.
724
725 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
726
727         * location.cs : tiny ToString() format fix.
728
729 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
730
731         * statement.cs : oops, it was missing.
732
733 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
734
735         A set of fixes for precise line/column location.
736
737         * location.cs :
738           "token" field now holds a file/line "delta", a line number offset 
739           from the segment, and a column number. See also:
740           http://lists.ximian.com/pipermail/mono-devel-list/2004-
741           December/009508.html
742           Removed static IsNull. Use instance IsNull property instead.
743         * cs-tokenizer.cs :
744           For some tokens it stores Location. For Identifier it stores
745           LocatedToken which is a pair of string name and location.
746           Column numbers are adjusted only at getChar().
747         * report.cs :
748           Use Location.ToString() for reporting (it now contains column).
749         * cs-parser.jay :
750           Largely modified to use LocatedToken instead of
751           string (IDENTIFIER), and to acquire Location from some tokens.
752         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
753           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
754           codegen.cs :
755           Now MemberName holds Location. DeclSpace.ctor() receives Location
756           as a parameter. Removed extra parameters to all derived classes.
757           Replaced Location.IsNull() with instance property.
758         * assign.cs, expression.cs :
759           Added .ctor() overload that omits Location.
760         * attribute.cs :
761           Added "nameEscaped" flag that indicates the identifier was escaped
762           in the source file. This fixes bug #57047.
763
764 2005-09-02  Martin Baulig  <martin@ximian.com>
765
766         * class.cs: Make CS3005 a warning, not an error.
767
768 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
769
770         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
771         New method, looking for lo-case imported cls type.
772
773         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
774         here.
775
776         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
777
778         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
779
780         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
781         all_imported_types.
782         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
783
784         Optimized to save 3.5 MB for SWF compilation.
785
786 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
787
788         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
789         (PartialContainer.Create): Moved logic AddToContainer.
790         (PartialContainer.MarkForDuplicationCheck): Shares name.
791         
792         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
793         place.
794         
795         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
796         initialization.
797         (Namespace.GetSignatureForError): New method.
798         
799         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
800         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
801
802 2005-08-01  Raja R Harinath  <rharinath@novell.com>
803
804         Fix #75669.
805         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
806         member lookup rather than qualifier_type, since qualifier_type can
807         be null.
808
809 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
810
811         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
812         enum member.
813
814 2005-07-31  Miguel de Icaza  <miguel@novell.com>
815
816         * statement.cs: Copy the local exception into the exception
817         captured local.  Fixes 75674
818
819 2005-07-31  Raja R Harinath  <harinath@gmail.com>
820
821         Fix #75658.
822         * expression.cs (Invocation.OverloadResolve): Don't report error
823         CS1501 if error CS1502 has been reported.
824         (New.DoResolve): Delegate CS1501 reporting to
825         Invocation.OverloadResolve.
826
827         Fix #75656.
828         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
829         invariant-meaning-in-block property in an enclosing block if
830         necessary.
831
832 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
833
834         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
835         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
836         (Switch.CheckSwitch): Just save 50kb for SWF.
837
838 2005-07-27  Martin Baulig  <martin@ximian.com>
839
840         * anonymous.cs (CaptureContext.AddField): Added
841         `AnonymousContainer am' argument; compute its toplevel scope if
842         it's not already computed.  Fixes #75649.
843
844 2005-07-26  Raja R Harinath  <rharinath@novell.com>
845
846         Fix #75628.
847         * class.cs (Constructor.Emit): Reset block to null if the block
848         resolve fails.
849
850 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
851
852         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
853
854 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
855
856         * class.cs (MethodData.Define): Check whether accessor implementing
857         interface is public.
858
859         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
860
861 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
862
863         Fix #57245
864         * namespace.cs (LookupType): Moved same type check to...
865         
866         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
867         with the same name.
868
869 2005-07-21  Raja R Harinath  <rharinath@novell.com>
870
871         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
872         already found a typebuilder.
873         * class.cs (MethodCore.IsDuplicateImplementation): Compare
874         MemberNames, not strings.
875
876         * const.cs (Error_ExpressionMustBeConst): 
877         Rename from Error_EpressionMustBeConst.
878         * const.cs, class.cs, statement.cd: Update.
879
880 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
881
882         Fix #65573
883
884         * const.cs (Const.LookupConstantValue): Report missing contant expression
885         everytime.
886         (Error_EpressionMustBeConstant): Only one error method.
887
888         * class.cs, statement.c: Updated.
889
890 2005-07-20  Raja R Harinath  <rharinath@novell.com>
891
892         * statement.cs (Block.Flags): Add back HasVarargs.
893         (Block.flags): Make protected.
894         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
895
896         * typemanager.cs (types, typecontainers, user_types): Remove.
897         (UserTypes, TypeContainers): Likewise.
898         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
899         (CleanUp, Reset): Update.
900         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
901         (GetNestedType): Use Type.GetNestedType.
902         (CoreLookupType): Take two arguments, the namespace and the
903         basename of the type.  Update to use the Namespace.Lookup
904         mechanism.
905         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
906         (RealMemberLookup): Use IsNestedChildOf instead of playing with
907         string concatenation and substring matches.
908         * class.cs, enum.cs, delegate.cs: Update to changes.
909
910 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
911
912         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
913         Expression and made virtual.
914
915         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
916         (ImplicitStandardConversionExists): Fixed `byte' typo ?
917
918         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
919
920         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
921         error message.
922
923         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
924         change.
925
926 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
927
928         Fix #57707
929         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
930         AssemblyCultureAttribute is not used on executable.
931
932         * rootcontext.cs,
933         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
934
935 2005-07-16  Raja R Harinath  <rharinath@novell.com>
936
937         Fix #60638.
938         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
939         New.  Reports CS0252/CS0253.
940         Mostly taken from preliminary patch by Duncak Mak.
941         (Binary.DoResolveOperator): Store results of operator lookup.
942         Use them to detect if we need to warn about unintended reference
943         comparisons.
944
945 2005-07-15  Raja R Harinath  <rharinath@novell.com>
946
947         Fix #72969.
948         * namespace.cs (Namespace.Lookup): Add back location parameter.
949         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
950         * delegate.cs, ecore.cs, expression.cs: Update to changes.
951
952         * codegen.cs (EmitContext.DeclSpace): Make readonly.
953         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
954         (Namespace.LookupType): ... this.
955         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
956         of namespaces.
957         * typemanager.cs (LookupTypeReflection): Remove buggy code that
958         purported to handle pointers.
959         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
960         CoreLookupType.
961
962 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
963
964         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
965         type as namespace.
966
967 2005-07-15  Raja R Harinath  <rharinath@novell.com>
968
969         * namespace.cs (Namespace.Lookup): Drop location parameter.
970         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
971         (NamespaceEntry.Lookup): ... this.
972         (NamespaceEntry.Error_AmbiguousTypeReference):
973         Move here from DeclSpace.
974         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
975         names ...
976         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
977         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
978         Move to NamespaceEntry.
979         * delegate.cs, expression.cs: Update to changes.
980
981 2005-08-31  Martin Baulig  <martin@ximian.com>
982
983         Committing a patch from Atsushi Enomoto for #75850.
984
985         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
986         Prefer a generic enumerator over a non-generic one.
987
988 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
989
990         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
991         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
992
993 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
994
995         * driver.cs : reverting default encoding change as well as mcs.
996
997 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
998
999         * driver.cs, support.cs : merged r48826.
1000           Marek Safer wrote:
1001           > could you integrate your mcs changes to gmcs otherwise
1002           > gmcs cannot compile some files.
1003
1004 2005-08-20  Martin Baulig  <martin@ximian.com>
1005
1006         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1007         scope if we don't already have it.
1008
1009         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1010         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1011         fixes #75867.
1012
1013 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1014
1015         * statement.cs: Copy the local exception into the exception
1016         captured local.  Fixes 75674
1017
1018 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1019
1020         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1021         type as namespace.
1022
1023 2005-08-12  Martin Baulig  <martin@ximian.com>
1024
1025         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1026         for nested types here to avoid hitting the cache too early.
1027
1028 2005-08-09  Miguel de Icaza  <miguel@novell.com>
1029
1030         * enum.cs: On the new compiler CLS error 3005 is now a warning not
1031         an error. 
1032
1033 2005-08-03  Martin Baulig  <martin@ximian.com>
1034
1035         Make iterators in generic methods work; see gtest-191.cs.
1036
1037         * generic.cs
1038         (Constraints.Resolve): Protect against being called twice.
1039
1040         * class.cs
1041         (TypeContainer.GetClassBases): Make this `protected virtual'.
1042
1043         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1044         (Iterator.GetClassBases): Override this and compute the base
1045         classes here.
1046         (Iterator.DefineNestedTypes): If we're a generic method, all our
1047         method type parameters become class type parameters on the proxy
1048         class.
1049
1050         * statement.cs
1051         (ToplevelBlock.Parameters): Make this a property, not a field.
1052         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1053
1054 2005-08-03  Martin Baulig  <martin@ximian.com>
1055
1056         * typemanager.cs (TypeManager.IsSubclassOf): Use
1057         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1058         (TypeManager.GetFullName_recursed): Improved.
1059
1060 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1061
1062         Fix #75417
1063         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1064         Private accessor case, using TypeManager.IsPrivateAccessible instead of
1065         invocation_type == mi.DeclaringType, since the first one also checks
1066         other condition used by generic instances.
1067         
1068 2005-07-27  Martin Baulig  <martin@ximian.com>
1069
1070         * anonymous.cs (CaptureContext.AddField): Added
1071         `AnonymousContainer am' argument; compute its toplevel scope if
1072         it's not already computed.  Fixes #75649.
1073
1074 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1077         CheckAttributeType and refactored.
1078         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1079         ResolveAsTypeTerminal error handling.
1080         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1081         handling.
1082         (GetSignatureForError): Print errors in same way.
1083
1084         * class.cs,
1085         * codegen.cs: Reflect attribute GetSignatureForError change.
1086
1087         * ecore.cs,
1088         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1089
1090         * namespace.cs (UsingEntry): Refactored to make fields private.
1091
1092         * assign.cs,
1093         statement.cs: Error_UnexpectedKind has extra parameter.
1094
1095 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1096
1097         * ecore.cs (IAlias): Remove.
1098         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1099         that implement the interface.
1100         * namespace.cs (Namespace): Likewise.
1101         (Namespace.declspaces): Renamed from 'defined_names'.
1102         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1103         DeclSpace instead of an IAlias.
1104         * tree.cs (Tree.AddDecl): Update.
1105
1106 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1107
1108         * statement.cs (Block.Flags); Remove HasVarargs.
1109         (Block.HasVarargs): Move to ToplevelBlock.
1110         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1111         (Block.Variables): Make protected.  Initialize variable hashtable
1112         if necessary.
1113         (Block.AddVariable): Update.
1114         (Block.Resolve): Update to changes.
1115         (ToplevelBlock.HasVarargs): New boolean.
1116         (ToplevelBlock.ThisVariable): Move here from Block.
1117         (ToplevelBlock.AddThisVariable): Likewise.
1118         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1119         * expression.cs (This.ResolveBase): Update to changes.
1120         (ArglistAccess.DoResolve): Likewise.
1121
1122 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1123
1124         Fix #75321
1125         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1126
1127         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1128         not used and not used & assigned.
1129         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1130
1131 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1132
1133         Fix #75053
1134         * expression.cs (Is.DoResolve): null is never provided type.
1135
1136 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1137
1138         Fix #52496
1139         * cs-parser.jay: Less strict event error rule to catch more errors.
1140
1141 2005-07-11  Martin Baulig  <martin@ximian.com>
1142
1143         * generic.cs (ConstructedType.CheckConstraints): Improve the check
1144         for the constructor constraint: we do not only have to check
1145         whether the class has a public constructor, but also ensure that
1146         it's parameterless.  Fixes #75492.
1147
1148 2005-07-11  Martin Baulig  <martin@ximian.com>
1149
1150         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1151         between type parameters if they either have the reference type
1152         constraint or the class constraint.
1153
1154 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
1155
1156         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1157
1158 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1159
1160         Fix #74975
1161         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1162         (ExtractSecurityPermissionSet): Cope with self referencing security
1163         attributes properly.
1164
1165         * driver.cs (SetOutputFile): Made public property OutputFile.
1166
1167 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1168
1169         Fix #75486.
1170         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1171         has_nonstatic_fields.  Make into a FieldBase pointer.
1172         (TypeContainer.AddField): Add CS0282 check.
1173         (TypeContainer.EmitType): Update.
1174
1175 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1176
1177         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1178         compare if they start with __.
1179
1180 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1181
1182         * statement.cs (Switch.SwitchGoverningType): Only look at
1183         UserCasts that don't need implicit standard conversions to one of
1184         the allowed switch types (Fixes test-322.cs).
1185         (LocalInfo.Resolve): Re-enable sanity-test.
1186
1187 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1188
1189         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1190         
1191         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1192         
1193         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1194
1195 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1196
1197         Fix #75472.
1198         * ecore.cs (SimpleName.GetSignatureForError): Add.
1199         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1200         (MemberAccess.GetSignatureForError): Add.
1201
1202 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1203  
1204         The big error and warning messages review.
1205         
1206         * anonymous.cs,
1207         * assign.cs,
1208         * attribute.cs,
1209         * class.cs,
1210         * codegen.cs,
1211         * convert.cs,
1212         * cs-parser.jay,
1213         * cs-tokenizer.cs,
1214         * decl.cs,
1215         * delegate.cs,
1216         * doc.cs,
1217         * driver.cs,
1218         * ecore.cs,
1219         * enum.cs,
1220         * expression.cs,
1221         * flowanalysis.cs,
1222         * iterators.cs,
1223         * literal.cs,
1224         * location.cs,
1225         * modifiers.cs,
1226         * namespace.cs,
1227         * parameter.cs,
1228         * pending.cs,
1229         * report.cs,
1230         * rootcontext.cs,
1231         * statement.cs,
1232         * support.cs,
1233         * tree.cs,
1234         * typemanager.cs: Updated.
1235         
1236         * class.cs: (MethodCore.SetYields): Moved here to share.
1237         (PropertyMethod.Define): Moved iterator setup here.
1238         
1239         * iterators.cs: Add orig_method to have full access to parent
1240         container.
1241
1242 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1243
1244         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1245         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1246         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1247         variable of struct type.
1248         * expression.cs (Unary.ResolveOperator): Update to change.
1249         (Indirection.VerifyFixed): Likewise.
1250         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1251         (ParameterReference.VerifyFixed): Value parameters are fixed.
1252         (This.VerifyFixed): Treat 'this' as a value parameter.
1253         * statement.cs (LocalInfo.IsFixed): Remove.
1254
1255 2005-07-01  Martin Baulig  <martin@ximian.com>
1256
1257         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1258         `ec.EmitThis ()' to get the correct scope.
1259
1260 2005-07-01  Martin Baulig  <martin@ximian.com>
1261
1262         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1263         instance is a ParameterReference; fixes #75299.
1264
1265 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1266
1267         Fix #75412.
1268         * expression.cs (Indexers.map): Remove.
1269         (Indexers.Append): Filter out inaccessible setters and getters.
1270         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1271
1272         Fix #75283.
1273         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1274         Refactored from ...
1275         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1276         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1277         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1278         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1279
1280 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1281
1282         Fix #75322
1283         * class.cs (FieldBase.GetInitializerExpression): One more field
1284         for backup.
1285
1286 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1287
1288         * pending.cs: Do not define a proxy if the base method is virtual,
1289         it will be picked up by the runtime (bug 75270).
1290
1291 2005-07-08  Martin Baulig  <martin@ximian.com>
1292
1293         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1294         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1295
1296 2005-07-07  Martin Baulig  <martin@ximian.com>
1297
1298         * generic.cs (ConstructedType.CheckConstraint): Use
1299         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1300         called recursively; fixes #75329.
1301
1302 2005-07-06  Martin Baulig  <martin@ximian.com>
1303
1304         * generic.cs (TypeManager.InferTypeArguments): Added support for
1305         anonymous methods; fixes #75461.
1306
1307 2005-07-01  Martin Baulig  <martin@ximian.com>
1308
1309         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1310         `ec.EmitThis ()' to get the correct scope.
1311
1312 2005-07-01  Martin Baulig  <martin@ximian.com>
1313
1314         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1315         instance is `This'; fixes #75299.
1316
1317 2005-06-30  Martin Baulig  <martin@ximian.com>
1318
1319         * class.cs (Indexer): Implement IIteratorContainer; added support
1320         for iterators in indexers.
1321
1322         * codegen.cs
1323         (EmitContext.CurrentIterator): Make this a property, not a field.
1324
1325         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1326
1327 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1328
1329         * pending.cs: Do not define a proxy if the base method is virtual,
1330         it will be picked up by the runtime (bug 75270).
1331
1332 2005-06-28  Martin Baulig  <martin@ximian.com>
1333
1334         * cs-parser.jay (interface_method_declaration): Avoid a
1335         reduce/reduce conflict by moving some of the code into a separate
1336         `interface_method_declaration_body' rule; fixes #75368.
1337
1338 2005-06-28  Martin Baulig  <martin@ximian.com>
1339
1340         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1341         array check after the check for TypeBuilder's.
1342
1343 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1344
1345         * convert.cs (FindMostEncompassedType): Add two trivial special
1346         cases (number_of_types == 0 || number_of_types == 1).
1347         (FindMostEncompasingType): Likewise.
1348
1349 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1350
1351         Some cleanups preparing for the fix of #75283.
1352         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1353         error testing.
1354         (EventExpr.InstanceResolve): Likewise.
1355         (EventExpr.DoResolve): Remove redundant checks.
1356
1357 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1358
1359         * class.cs: Small fix.
1360
1361 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1362
1363         Fix #75160.
1364         * class.cs (GetPartialBases): Fix return value check of
1365         part.GetClassBases.
1366
1367 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1368
1369         Ensure that partial classes are registered in their enclosing
1370         namespace.  Initial part of fix of #75160.
1371         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1372         Register declspace with namespace here, not in
1373         DeclSpace.RecordDecl.
1374         * cs-parser.jay: Pass namespace to RecordDecl.
1375         * class.cs (PartialContainer.Create): Likewise.
1376         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1377         called.
1378         * decl.cs (Declspace.RecordDecl): Remove.
1379         * namespace.cs (NamespaceEntry.DefineName): Remove.
1380
1381 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1382
1383         * rootcontext.cs: Reset TargetExt as well.
1384
1385 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1386
1387         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1388         -langversion:ISO-1.
1389
1390 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1391
1392         Fix #75080, cs0119.cs.
1393         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1394         of ...
1395         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1396         allowing ExprClass.Type and ExprClass.Namespace for
1397         ResolveFlags.VariableOrValue.
1398         (Expression.Resolve) [1-argument variant]: Change default resolve
1399         flags based on language version.
1400         (Expression.Error_UnexpectedKind): Use a simple string array
1401         rather than an ArrayList.
1402         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1403         not ExprClass.Type.
1404         (TypeOfVoid.DoResolve): Likewise.
1405         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1406         flags argument -- it always has the same value.
1407
1408 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1409
1410         Fix #75081.
1411         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1412         Use it in the error message.
1413         * assign.cs, expression.cs, statement.cs: Update.
1414
1415 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1416
1417         Fix #75088.
1418         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1419         the "almostMatchedMember" case too.
1420         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1421         that failed the accessibility checks to 'almost_match'.
1422
1423 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1424
1425         * attribute.cs: Use internal MethodBuilder methods to set
1426         ExactSpelling and SetLastError on PInvoke methods, instead
1427         of passing them via charset.  Fixes #75060.
1428
1429 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1430
1431         * parameter.cs (Parameter): Remove TODO comment.
1432         (Parameter.DefineParameter): Remove Location parameter.
1433         (Parameters.LabelParameters): Likewise.
1434         * class.cs (Constructor.Emit): Update to change.
1435         (MethodData.Emit): Likewise.
1436         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1437         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1438
1439 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1440
1441         * parameter.cs,
1442           Removed Parameters.Location and added Parameter.Location instead.
1443           Removed Location parameter from Emit() and GetSignature().
1444         * anonymous.cs,
1445           class.cs,
1446           cs-parser.jay,
1447           delegate.cs,
1448           iterators.cs,
1449           statement.cs :
1450           Modified all related calls.
1451
1452 2005-06-21  Martin Baulig  <martin@ximian.com>
1453
1454         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1455         left-hand side is not a nullable type; fixes #75328.
1456
1457 2005-06-21  Martin Baulig  <martin@ximian.com>
1458
1459         * typemanager.cs
1460         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1461         (TypeManager.GetFullNameSignature): Likewise.
1462
1463         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1464         `source.FullName' and `target.FullName' to check whether there are
1465         two conflicting definitions.
1466
1467 2005-06-21  Martin Baulig  <martin@ximian.com>
1468
1469         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1470         a BoxedCast - also for reference types - to be compatible with csc.
1471
1472 2005-06-21  Martin Baulig  <martin@ximian.com>
1473
1474         * expression.cs (MemberAccess.DoResolve): Add support for nested
1475         types in a generic instance; fixes #75320.
1476
1477 2005-06-20  Martin Baulig  <martin@ximian.com>
1478
1479         * generic.cs (TypeManager.InferType): Also walk the class
1480         hierarchy for generic instances; fixes #75261.
1481
1482 2005-06-17  Martin Baulig  <martin@ximian.com>
1483
1484         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1485         to make things work for corlib.
1486
1487 2005-06-15  Martin Baulig  <martin@ximian.com>
1488
1489         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1490         obsolete `SecurityAction' values.
1491
1492 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1493
1494         * rootcontext.cs: Reset TargetExt as well.
1495         
1496 2005-06-09  Martin Baulig  <martin@ximian.com>
1497
1498         * delegate.cs (Delegate.VerifyMethod): Added
1499         `MethodGroupExpr old_mg' argument; inherit its
1500         `HasTypeParameters'; fix #75085.
1501
1502 2005-06-09  Martin Baulig  <martin@ximian.com>
1503
1504         * expression.cs (Invocation.OverloadResolve): Correctly handle
1505         generic methods for the SetMemberIsUsed(); fix #75064.
1506
1507 2005-06-09  Martin Baulig  <martin@ximian.com>
1508
1509         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1510         fixes #75062.
1511
1512 2005-06-08  Martin Baulig  <martin@ximian.com>
1513
1514         * cs-parser.jay (nullable_type_or_conditional): If we put the
1515         nullable back and our `type' is a `ComposedCast', remove the
1516         nullable from it.  Fixes #75156.
1517
1518         * expression.cs (ComposedCast.RemoveNullable): New public method.
1519
1520 2005-06-08  Martin Baulig  <martin@ximian.com>
1521
1522         The big Iterators rewrite :-)
1523
1524         * iterators.cs: Rewrite this to use the anonymous methods framework.
1525
1526         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1527         before the TypeContainers; see 2test-21.cs.
1528
1529         * class.cs
1530         (TypeContainer.DefineType): Don't create a new EmitContext if we
1531         already have one (this only happens if we're an Iterator).
1532         (TypeContainer.Define): Also call Define() on all our iterators.
1533         (Method.CreateEmitContext): Added support for iterators.
1534
1535         * anonymous.cs
1536         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1537         (AnonymousContainer.CreateMethodHost): Moved here from
1538         AnonymousMethod and made abstract.
1539         (AnonymousContainer.CreateScopeType): New abstract method.
1540         (AnonymousContainer.IsIterator): New public property.
1541         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1542         get the ScopeTypeBuilder rather than manually defining it here. 
1543         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1544         iterators here.
1545
1546         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1547         before RootContext.DefineTypes().
1548
1549         * codegen.cs (EmitContext.RemapToProxy): Removed.
1550         (EmitContext.CurrentAnonymousMethod): Changed type from
1551         AnonymousMethod -> AnonymousContainer.
1552         (EmitContext.ResolveTopBlock): Protect from being called twice.
1553         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1554         (EmitContext.EmitThis): Removed the iterators hacks; use the
1555         anonymous methods framework for that.
1556
1557         * statement.cs
1558         (ToplevelBlock.Container): Make this a property, not a field.
1559         (ToplevelBlock.ReParent): New public method; move the
1560         ToplevelBlock into a new container.
1561         (Foreach.TemporaryVariable): Simplify.
1562
1563 2005-06-05  Martin Baulig  <martin@ximian.com>
1564
1565         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1566         (Block.AddTemporaryVariable): New public method; creates a new
1567         `LocalInfo' for a temporary variable.
1568         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1569         variables here.
1570         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1571         non-iterator variables.
1572
1573 2005-06-05  Martin Baulig  <martin@ximian.com>
1574
1575         * statement.cs (Foreach.TemporaryVariable): Create the
1576         LocalBuilder in the Emit phase and not in Resolve since in some
1577         situations, we don't have an ILGenerator during Resolve; see
1578         2test-19.cs for an example.
1579
1580 2005-06-04  Martin Baulig  <martin@ximian.com>
1581
1582         The big Foreach rewrite - Part II.
1583
1584         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1585         with `PropertyInfo ienumerator_getcurrent'.
1586
1587         * codegen.cs (VariableStorage): Removed.
1588
1589         * statement.cs
1590         (Foreach): Derive from Statement, not ExceptionStatement.
1591         (Foreach.CollectionForeach): New nested class.  Moved all the code
1592         dealing with collection foreach here.
1593         (Foreach.ForeachHelperMethods): Removed.
1594         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1595
1596 2005-05-23  Martin Baulig  <martin@ximian.com>
1597
1598         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1599         don't need to.  Fix #75014.
1600
1601 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1602
1603         Improve user-defined conversion handling.
1604         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1605         applicable operators.
1606         (AddConversionOperators): New.  Helper for GetConversionOperators.
1607         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1608         there is only one most encompassed/encompassing type.
1609         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1610         "applicable operator" handling.
1611         (UserConversion): Move cache here from GetConversionOperators.
1612         Directly cache the chosen operator, rather than the whole
1613         MethodGroup.
1614         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1615         case.  Allow conversion of decimal to sbyte and byte too.
1616         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1617         New static methods.  Used to avoid allocating EmptyExpressions in
1618         convert.cs.
1619
1620 2005-05-24  Duncan Mak  <duncan@novell.com>
1621
1622         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1623         another class, used in Convert.ExplicitNumericConversion.
1624         (CastToDecimal): New class, similar to above, but casts to
1625         System.Decimal, used in Convert.ImplicitNumericConversion and also
1626         in explicit convesion from double/float to decimal.
1627
1628         * convert.cs (ImplicitNumericConversion): Handle implicit
1629         conversions to System.Decimal.
1630         (ExplicitNumericConversion): handle explicit conversions to
1631         System.Decimal.
1632
1633         This fixes #68711.
1634         
1635 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1636
1637         * typemanager.cs: Do not throw an exception in the TypeBuilder
1638         case, we take care of it on the TypeCode.
1639
1640 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1641         
1642         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1643         is back.
1644         
1645         * cs-parser.jay: Catch more lexical errors.
1646         
1647         * report.cs: Add one more Error method.
1648         
1649         * rootcontext.cs,
1650         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1651
1652 2005-05-20  Martin Baulig  <martin@ximian.com>
1653
1654         * class.cs (TypeContainer.CircularDepException): Removed.
1655         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1656         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1657         (CS0146) and interface (CS0529) dependencies here.
1658
1659 2005-05-20  Martin Baulig  <martin@ximian.com>
1660
1661         * expression.cs (New.DoResolve): Move the CS0712 check above the
1662         CS0144 check; otherwise it can never be reached.
1663
1664 2005-05-20  Martin Baulig  <martin@ximian.com>
1665
1666         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1667
1668 2005-05-20  Martin Baulig  <martin@ximian.com>
1669
1670         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1671
1672         * typemanager.cs (TypeManager.IsAttributeType): New public method.
1673
1674 2005-05-19  Martin Baulig  <martin@ximian.com>
1675
1676         * delegate.cs
1677         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1678         to disable error reporting.
1679
1680         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1681         here since we don't want to report an error; see the new test-336.cs.
1682
1683 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1684
1685         * statement.cs (ToplevelBlock.GetParameterReference)
1686         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1687         Move here from class Block.
1688         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1689         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1690
1691 2005-05-18  Martin Baulig  <martin@ximian.com>
1692
1693         Fix #74978.
1694
1695         * flowanalysis.cs
1696         (FlowBranching.Reachability): Add non-static public And() and Or()
1697         methods.
1698         (FlowBranchingSwitch): New class; do the `break_origins' thing
1699         like in FlowBranchingLoop.
1700         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1701         reachability, not just locals and parameters.
1702         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1703         switch; MergeBreakOrigins() now takes care of that.
1704
1705 2005-05-18  Martin Baulig  <martin@ximian.com>
1706
1707         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1708         a loop and may leave it, reset the barrier; fixes #74974.
1709
1710 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1711
1712         Fix test-382.cs.  Emit values of decimal constants.
1713         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1714         Carved out of ...
1715         (TypeContainer.AddField): ... this.
1716         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1717         with initializers to include 'Const's.
1718         (ClassPart.RegisterFieldForInitialization): Forward to
1719         PartialContainer.
1720         * const.cs (Const.Const): Pass initializer to base class.
1721         (Const.Define): In case of decimal constants, register them for
1722         initialization in a static constructor.
1723
1724 2005-05-14  Martin Baulig  <martin@ximian.com>
1725
1726         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1727         do not call ResolveUnreachable() on unreachable statements in
1728         here, see the comment in the source code.
1729
1730 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1731
1732         Fix #74934.
1733         * expression.cs (BinaryResolveOperator): If one of the operands of
1734         an equality comparison is 'null' and the other is a pointer type,
1735         convert the null to a NullPointer.
1736         * convert.cs (ImplicitReferenceConversion): If the expression is a
1737         NullLiteral and the target type is a pointer type, return a
1738         NullPointer instead.
1739         (ImplicitConversionStandard): Likewise.
1740
1741 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1742         
1743         * cs-parser.jay: Set readonly context based on special constructs.
1744         
1745         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1746         readonly variable error handling.
1747         
1748         * rootcontext.cs (EmitCode): Don't verify members when error
1749         occurred.
1750         
1751         * statement.cs (LocalInfo): Add reaodnly context information.
1752         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1753
1754 2005-05-17  Martin Baulig  <martin@ximian.com>
1755
1756         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1757         #70970. 
1758
1759 2005-05-13  Martin Baulig  <martin@ximian.com>
1760
1761         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1762         handle unreachable blocks.
1763
1764 2005-05-13  Martin Baulig  <martin@ximian.com>
1765
1766         * class.cs
1767         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1768         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1769         #74905. 
1770
1771 2005-05-13  Martin Baulig  <martin@ximian.com>
1772
1773         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1774         instance variable, not a local.  Fix #74873.
1775         (Block.ResolveUnreachable): Set it to true here.
1776
1777 2005-05-12  Martin Baulig  <martin@ximian.com>
1778
1779         * cs-parser.jay (property_declaration): Pass the `current_class',
1780         not the `current_container' to Property's .ctor.  Fixes #74912.
1781
1782 2005-05-11  Martin Baulig  <martin@ximian.com>
1783
1784         * typemanager.cs (Closure): Copy this from MCS and merge all the
1785         GMCS-specific changes into it.
1786
1787 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1788
1789         Fix #74920.
1790         * typemanager.cs (unmanaged_enclosing_types): New.
1791         (IsUnmanagedType): Avoid infloops by using
1792         'unmanaged_enclosing_types' to talk with recursive invocations.
1793
1794 2005-05-11  Duncan Mak  <duncan@novell.com>
1795
1796         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1797         continuing to process for 'arg'.
1798         (handle_preprocessing_directive): Check the argument of the #endif
1799         directive and report error CS1025 if there are any trailing
1800         characters.
1801
1802         According to the C# spec, having even whitespace after the #endif
1803         directive is illegal; however, because we call arg.TrimEnd ()
1804         beforehand, we have the same behavior as csc, allowing whitespace
1805         after the directive.
1806
1807         Fixes #74892.
1808
1809 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1810
1811         Fix #74863.
1812         
1813         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1814         (Constructor.GetObsoleteAttribute): Implemented correctly.
1815
1816 2005-05-10  Martin Baulig  <martin@ximian.com>
1817
1818         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1819         resolve the type; fixes #74864.
1820         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1821         in DoResolve(); fixes #74862.
1822
1823 2005-05-10  Martin Baulig  <martin@ximian.com>
1824
1825         * support.cs (ReflectionParameters.ParameterModifier): Use
1826         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1827         and `ParameterAttributes.In'.  Fixes #74884.
1828
1829 2005-05-10  Martin Baulig  <martin@ximian.com>
1830
1831         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1832         the cache if we're just looking for `MemberTypes.NestedType' in a
1833         generic instance.
1834
1835         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1836         constraints if we're still resolving the type tree.
1837         (Expression.MemberLookup): If we're resolving the type tree, only
1838         look for `MemberTypes.NestedType' since we're only interested in
1839         getting types.
1840
1841         * class.cs (TypeContainer.DefineType): Don't resolve the type
1842         parameters here; do this later in ResolveType() after the type
1843         tree has been resolved.
1844         (TypeContainer.ResolveType): New public method; this is called
1845         after the type tree is resolved and before the types are being
1846         populated.  We resolve the generic constraints here.
1847         (TypeContainer.DoDefineMember): Check the constraints on our base
1848         class and interfaces.
1849
1850         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1851         set the `ResolvingTypeTree' flag on the EmitContext.
1852
1853         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1854
1855 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1856
1857         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1858         
1859         * expression.cs (Argument.GetParameterModifier): Turned to property.
1860         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1861         
1862         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1863         its C# equivalent.
1864         
1865 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1866
1867         Fix #74852.
1868         * decl.cs (MemberCache.AddMethods): Register override methods,
1869         rather than non-override methods.
1870         * typemanager.cs (RegisterOverride): New.
1871         (IsOverride): Update.
1872
1873 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1874
1875         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1876
1877 2005-05-06  Martin Baulig  <martin@ximian.com>
1878
1879         * attribute.cs
1880         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1881         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1882
1883 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1884
1885         Fix #73105.
1886         
1887         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1888         recursive declaration.
1889         
1890         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1891         
1892 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1893
1894         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1895         
1896         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1897
1898 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1899
1900         Fix #74797.
1901         * decl.cs (DeclSpace.FamilyAccessible): 
1902         Use TypeManager.IsNestedFamilyAccessible.
1903
1904         Fix reopened #64812.
1905         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1906         internal'.
1907
1908 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1909             Abin Thomas  <projectmonokochi@rediffmail.com>
1910             Anoob V E  <projectmonokochi@rediffmail.com>
1911             Harilal P R  <projectmonokochi@rediffmail.com>
1912
1913         Fix #64812.
1914         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1915         allow access to all static members.
1916
1917 2005-05-04  Martin Baulig  <martin@ximian.com>
1918
1919         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1920
1921 2005-05-04  Martin Baulig  <martin@ximian.com>
1922
1923         Fix #74655.
1924
1925         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1926         section at the end; make things work if `default' is not the last
1927         section.        
1928
1929 2005-05-04  Martin Baulig  <martin@ximian.com>
1930
1931         Fix #70400.
1932
1933         * statement.cs (Switch): Replaced the `got_default' field with a
1934         `default_section' one.
1935         (Switch.CheckSwitch): Set `default_section' here.
1936         (Switch.Resolve): If we're a constant switch and the constant is
1937         not found, use the default section.
1938
1939 2005-05-03  Martin Baulig  <martin@ximian.com>
1940
1941         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1942
1943         * statement.cs (Foreach.ArrayForeach): New nested class.
1944         (Foreach.TemporaryVariable): New nested class.
1945         (Foreach.EmitArrayForeach): Removed; this is now in the new
1946         ArrayForeach class.
1947
1948 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1949
1950         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1951         more conservative.
1952         (VerifyPendingMethods): Revert change below.
1953
1954         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1955         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1956         that used to trigger warning -28.  Remove warning -28.
1957         * expression.cs (Invocation.OverloadResolve): Use
1958         TypeManager.IsOverride to distinguish override methods.
1959
1960         Fix #74773.
1961         * pending.cs (VerifyPendingMethods): If a base type implements the
1962         requested interface, don't bother checking individual methods of
1963         the base type.  As a side-effect, this prevents the creation of
1964         unnecessary proxies.
1965
1966 2005-05-02  Martin Baulig  <martin@ximian.com>
1967
1968         Fix #70182.
1969
1970         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1971         Also `And' the locals if the old vector is null.
1972         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1973         null; in this case we basically reset all the variables.        
1974
1975 2005-05-02  Martin Baulig  <martin@ximian.com>
1976
1977         Fix #74529.
1978
1979         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1980         Added `FlowBranching branching' argument; always `and' the
1981         variables instead of `or'ing them unless we're an infinite loop.
1982
1983         * statement.cs (While.Resolve): Create a new sibling unless we're
1984         infinite.       
1985
1986 2005-05-02  Martin Baulig  <martin@ximian.com>
1987
1988         Fix #70140.
1989
1990         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1991         arguments; use it instead of creating a new TopLevelBlock.
1992         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1993         our ConstructorInitializer.
1994
1995         * statement.cs
1996         (TopLevelBlock.TopLevelBranching): New public property.
1997         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1998         and create our `TopLevelBranching'.
1999
2000         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2001         anonymous method host, use `block.TopLevelBranching' rather than
2002         creating a new branching.
2003
2004 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2005
2006         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2007         a ScopeInfo, if any of the current children is a child of the new
2008         entry, move those children there.
2009
2010 2005-04-30  Martin Baulig  <martin@ximian.com>
2011
2012         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2013         at the beginning of a SwitchSection.  Fix #73335.
2014
2015 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2016
2017         Fix #74378
2018         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2019         
2020         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2021         (FieldExpr.DoResolve): Obsolete members are ignored for field
2022         initializers.
2023         
2024 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2025
2026         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2027         of arrays detection.
2028
2029         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2030         verification.
2031         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2032
2033         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2034         arrays report.
2035
2036 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2037
2038         * cs-parser.jay: Use the prefered version of -unsafe in error
2039         message.
2040
2041 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2042
2043         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2044         circumstances.
2045
2046 2005-04-20  John Luke  <john.luke@gmail.com>
2047
2048         * driver.cs: fix typo in error message, --outout to --output
2049
2050 2005-04-30  Martin Baulig  <martin@ximian.com>
2051
2052         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2053         handle the .NET 2.x security attributes.
2054
2055 2005-04-30  Martin Baulig  <martin@ximian.com>
2056
2057         * typemanager.cs
2058         (TypeManager.ExpandInterfaces): Don't add things twice.
2059
2060         * class.cs
2061         (TypeContainer.VerifyClsCompliance): Allow generic instances.
2062
2063 2005-04-29  Martin Baulig  <martin@ximian.com>
2064
2065         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2066
2067         * anonymous.cs: Added support for anonymous generic methods.
2068
2069 2005-04-29  Martin Baulig  <martin@ximian.com>
2070
2071         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2072         generic instances.
2073
2074 2005-04-29  Martin Baulig  <martin@ximian.com>
2075
2076         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2077
2078         * expression.cs (New.DoResolve): Fix the CS0304 check.
2079
2080 2005-04-29  Martin Baulig  <martin@ximian.com>
2081
2082         * typemanager.cs (TypeManager.GetFullName): Updated to the new
2083         naming schema.
2084
2085         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2086         explicit interface implementation, compare the interface types.
2087         (MethodData.Define): Use the new naming scheme from the latest
2088         .NET 2.x beta2.
2089         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2090
2091         * decl.cs (MemberName.GetMemberName): Removed.
2092         (MemberName.MethodName, FullName): New properties.
2093
2094 2005-04-25  Raja R Harinath  <rharinath@novell.com>
2095
2096         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2097
2098 2005-04-22  Martin Baulig  <martin@ximian.com>
2099
2100         * generic.cs (GenericMethod): Create the EmitContext in the
2101         `Define()'; in `Define(MethodBuilder)', create the type parameters
2102         before calling `Define()'.  Fixes #73933.
2103
2104 2005-04-22  Martin Baulig  <martin@ximian.com>
2105
2106         * generic.cs
2107         (Constraints.Resolve): Make things work wrt. the new type lookup system.
2108         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2109
2110         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2111         ConstructedType, check its constraints.
2112
2113 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2114
2115         * codegen.cs (InRefOutArgumentResolving): New field.
2116         
2117         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2118         fields outside contructor.
2119         
2120         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2121         
2122 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2123
2124         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2125         parameter code was not completed ever, so it was not as up-to-date
2126         as local variables.  Must finish it.
2127
2128         The bug fix was to compare the Toplevel of the block, not the
2129         current block.  Thanks for Ben for pointing this out. 
2130
2131 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2132
2133         * decl.cs (AddMethods): Use the declaring type of the problem
2134         method to determine if we want to squash a warning.
2135
2136 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2137
2138         * attribute.cs: Removed debug output.
2139
2140         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2141         
2142         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2143         Report.Stderr.
2144         
2145 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2146
2147         Fix #74481.
2148         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2149         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2150         all null comparisons against reference types.
2151
2152 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2153
2154         Fix# 74565
2155         * class.cs (TypeContainer.CircularDepException) New nested
2156         exception class.
2157         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2158         (TypeContainer.DefineType): Removed error, reset InTransit before
2159         exit.
2160         (Class.DefineType): Throw exception when is in Transit.
2161         Catch exception and report error.
2162         (Struct.DefineType): Throw exception when is in Transit.
2163         Catch exception and report error.
2164         (Interface.DefineType): Throw exception when is in Transit.
2165         Catch exception and report error.
2166
2167         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2168         handle nested exception handlers.
2169
2170         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2171         a catch.
2172
2173         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2174         InFinally and InCatch storage.
2175
2176         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2177         (Catch.Resolve): Set and Restore ec.InCatch.
2178         (Try.Resolve): Set and Restore ec.InFinally.
2179         (Try.HasCatch): True when try has catch.
2180
2181 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2182
2183         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2184           for the same event member, so exclude such cases from warning 419.
2185           Fixed bug #74633.
2186
2187 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2188
2189         * expression.cs (Binary.ResolveOperator): Apply patch from John
2190         Luke to fix bug 59864: operators &, | and ^ on enumerations
2191         require that the same enum type on both sides.
2192
2193         * driver.cs: Add warnings to old flag usage, this is to assist
2194         people who produce Makefiles and hope that the Makefiles will be
2195         used on Windows.
2196
2197         * class.cs (TypeContainer.EmitType): Moved the definition of the
2198         special $PRIVATE$ field from the resolve phase to the Emit phase.
2199         During resolve we do not know if we are a struct with
2200         HasExplicitLayout, we know this only after the attributes for the
2201         type are emitted.
2202
2203         Set the FieldOffset to zero on the dummy field that we create for
2204         the class.   Fixes 74590.
2205
2206 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2207
2208         Fix #73834.
2209         * ecore.cs (PropertyExpr.resolved): New.
2210         (DoResolve): Use it to handle a case of double resolution here.
2211         Handle a case of identical-name-and-type-name.
2212         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2213         resolution by storing the results of expression resolution back
2214         into the "probes" array.
2215
2216 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2217
2218         Fix cs0208-7.cs and cs0208-8.cs.
2219         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2220         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2221         error reporting to point out the reason a struct is not unmanaged.
2222
2223 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2224
2225         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2226           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2227
2228 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2229
2230         Fix #74528.
2231         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2232         IdenticalNameAndTypeName here.
2233         (EventExpr.InstanceResolve): Likewise.
2234
2235 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2236
2237         C# 2.0 DefaultCharSetAttribute implementation
2238         
2239         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2240         which allows us to set GlobalNamespace for every resolve.
2241         (Attribute.ResolveArguments): Cut from Resolve.
2242         (Attribute.GetCharSetValue): Returns CharSet named argument.
2243         (Attribute.DefinePInvokeMethod): Gets default charset from
2244         module settings.
2245         (GlobalAttribute.ResolveAsTypeStep): Override.
2246         (GlobalAttribute.ResolveArguments): Override.
2247         
2248         * class.cs (TypeAttr): Is protected.
2249         
2250         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2251         (ModuleClass.DefaultCharSetType): New memeber.
2252         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2253         
2254         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2255         charset from module.
2256         
2257         * delegate.cs (TypeAttr): Override.
2258         (Delegate.DefineType): Use this TypeAttr.
2259         
2260         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2261         at very early stage (before types are defined) to resolve model
2262         module attributes. It will probably not work with corlib but it
2263         should be ok.
2264         
2265         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2266         charset from module.
2267         
2268         * typemanager.cs (default_charset_type): New type.
2269
2270 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2271
2272         * decl.cs (MemberCache.AddMethods): Don't warn if
2273         System.Object.Finalize has buggy MethodAttributes.
2274
2275         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2276         removed below.
2277
2278 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2279
2280         * doc.cs : detect ambiguous reference to overloaded members.
2281           Fixed bug #71603. MS 1.1 csc does not detect it.
2282
2283 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2284
2285         * doc.cs : delegates must not be referenced with parameters.
2286           Fixed bug #71605.
2287
2288 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2289
2290         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2291
2292 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2293
2294         * driver.cs (MainDriver): Stop processing if the CLS stage found
2295         errors. 
2296
2297         (CompilerCallableEntryPoint.InvokeCompiler): Always
2298         reset after execution;   Take a TextWriter argument for the
2299         output.
2300
2301         * report.cs: Use the error stream instead of hardcoding stderr. 
2302
2303 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2304
2305         * class.cs: Reduce code paths to test, too small of an
2306         optimization to make it worth the extra testing.  Always perform
2307         it. 
2308
2309 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2310
2311         Fix #74510.
2312         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2313         operators that had errors reported on them.
2314
2315 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2316
2317         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2318         argument types.
2319         (Attribute.Resolve): Add named argument type checking.
2320         
2321         * class.cs (FixedField.Define): Use IsPrimitiveType
2322         
2323         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2324         
2325         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2326         unsafe parameter types.
2327         
2328         * statement.cs (Using.ResolveExpression): Add better error description.
2329         
2330         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2331         
2332 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2333
2334         Fix #74484.
2335         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2336         AttributeUsageAttribute in the emitcontext of the attribute class,
2337         not in the emitcontext of the attributable entity it was attached to.
2338         * cs-parser.jay: Use 'current_class', not 'current_container',
2339         when creating a GlobalAttribute.
2340
2341 2005-04-08  Alp Toker  <alp@atoker.com>
2342
2343         * pending.cs: The fix to #58413 failed to compile methods implementing
2344         interfaces with/without params modifiers and vice versa, even though
2345         params modifiers aren't part of the signature. Make the modifier check
2346         less strict as in csc.
2347
2348 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2349             Anoob V E  <projectmonokochi@rediffmail.com>
2350             Harilal P R  <projectmonokochi@rediffmail.com>
2351
2352         Fix #58413.
2353         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2354         modifiers of pending methods.
2355         (PendingImplementation.PendingImplementation): Initialize it.
2356         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2357         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2358         with ParameterData.  Add check for modifiers.
2359         * class.cs (MethodData.Define): Update to changes.
2360
2361 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2362
2363         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2364
2365 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2366
2367         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2368         property.
2369         
2370         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2371         
2372         * rootcontext.cs,
2373         * typemanager.cs: Registered RequiredAttributeAttribute.
2374         
2375 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2376
2377         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2378         Warning CS0169 is back at level 3.
2379         (IMethodData.SetMemberIsUsed): New method.
2380         
2381         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2382         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2383         
2384         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2385
2386         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2387         contants.
2388         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2389         is used.
2390         
2391         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2392         is used.
2393         
2394         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2395         to avoid the problems with nested types.
2396
2397 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2398             Anoob V.E  <projectmonokochi@rediffmail.com>
2399             Harilal P.R  <projectmonokochi@rediffmail.com>
2400             Raja R Harinath  <rharinath@novell.com>
2401
2402         Fix #73820.
2403         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2404         attribute.
2405         * typemanager (GetConstructor): Make public.
2406
2407 2005-04-05  John Luke  <john.luke@gmail.com>
2408             Raja R Harinath  <rharinath@novell.com>
2409
2410         Fix #62232.
2411         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2412         struct too.  Return false quicker in a few cases.
2413         (VerifyUnManaged): Use it.
2414
2415 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2416
2417         Fix #74041.
2418         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2419         not 'unreachable_seen'.
2420
2421 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2422
2423         * attribute.cs (Attribute.GetValue): Removed unused.
2424         
2425         * codegen.cs (CodeGen.TrimExt): Removed unused.
2426         
2427         * cs-parser.jay (output): Removed unused.
2428         
2429         * cs-tokenizer.cs (hex_digits): Removed unused.
2430         
2431         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2432         
2433         * expression.cs (Indirection.LoadExprValue): Removed unused.
2434         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2435         
2436         * iterators.cs (Iterator.param_types): Removed unused.
2437         
2438         * statement.cs (Goto.block): Removed unused.
2439         (ToplevelBlock.did): Removed unused.
2440         (Switch.ResolveConstantSwitch): Removed unused.
2441
2442 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2443
2444         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2445         resetting thingy.
2446
2447 2005-04-19  Martin Baulig  <martin@ximian.com>
2448
2449         Merged r42462 from MCS and made it work for GMCS.
2450
2451         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2452
2453         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2454
2455 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2456
2457         Fix #74232 and cs0208-3.cs.
2458         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2459         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2460         unmanaged type.  Don't use FieldBuilders when 't' is a
2461         TypeBuilder.  Use ModFlags and MemberType fields.
2462         * class.cs (MemberBase.member_type): Rename from MemberType.
2463         (MemberBase.MemberType): New property.  Determines member_type on
2464         demand.
2465         (MemberBase.DoDefine): Don't initialize MemberType here.
2466         (FieldMember.Define): Likewise.
2467
2468 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2469
2470         Fix #74241
2471         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2472         Attributes are emitted there.
2473         
2474 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2475
2476         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2477         keyword in 'partial enum' too.
2478         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2479         is not allowed).
2480         Report from Kamil Skalski <nazgul@omega.pl>.
2481
2482         Fix #74309.
2483         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2484         have partial containers too.
2485
2486         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2487         in block' checks to Block.CheckInvariantMeaningInBlock.
2488         * statement.cs (Block.GetKnownVariableInfo): Make private.
2489         (Block.IsVariableUsedInChildBlock): Remove.
2490         (Block.IsVariableUsedInBlock): Likewise.
2491         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2492         conflicting declaration.
2493         (Block.AddVariable): Make error messages less long-winded and more
2494         specific.  Show location of conflicting declaration.
2495         * parameter.cs (Parameters.Location): New readonly property.
2496
2497 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2498
2499         Clean up semantics of invoking ResolveMemberAccess.
2500         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2501         can have an instance, ensure that we pass in a non-TypeExpression
2502         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2503         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2504         argument.  Update to changes and simplify.
2505         (FieldExpr.Emitinstance): Remove CS0120 check.
2506         (PropertyExpr.EmitInstance): Likewise.
2507         * expression.cs (Argument.Resolve): Likewise.
2508         (Invocation.DoResolve): Update to changes in semantics of
2509         InstanceExpression.
2510
2511 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2512
2513         Fix #74241
2514         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2515         customization.
2516         
2517         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2518
2519 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2520
2521         Fix difference in behaviour with commandline invocation.
2522         * driver.cs (Driver.Reset): New.
2523         (CompilerCallableEntryPoint): Call it.
2524
2525         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2526         variable" warnings if the boolean expression failed to resolve.
2527
2528 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2529
2530         * attribute.cs: Fix the union of several permissions when some of them
2531         are unrestricted (so the result isn't an unrestricted permission set).
2532         Fix #74036.
2533
2534 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2535
2536         * ecore.cs (MemberExpr): New class.  Convert from interface
2537         IMemberExpr.
2538         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2539         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2540         error checks.
2541         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2542         (MethodGroupExpr.IsExplicitImpl): Remove.
2543         (Expression.GetFieldFromEvent): Remove.
2544         (SimpleName.MemberStaticCheck): Remove.
2545         (SimpleName.DoSimpleNameResolve): Update to changes.
2546         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2547         (MemberAccess.IdenticalNameAndTypeName): Remove.
2548         (MemberAccess.error176): Move to MemberExpr.
2549         (MemberAccess.DoResolve): Update to changes.
2550         (BaseAccess.DoResolve): Likewise.
2551
2552 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2553
2554         C# 2.0 Conditional attribute class implementation
2555         
2556         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2557         Analyzes class whether it has attribute which has ConditionalAttribute
2558         and its condition is not defined.
2559         
2560         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2561         (Class.IsExcluded): New method. Search for at least one defined
2562         condition in ConditionalAttribute of attribute class.
2563
2564 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2565
2566         * ecore.cs (PropertyExpr): Derive from Expression, not
2567         ExpressionStatement.
2568         (PropertyExpr.EmitStatement): Remove.
2569
2570 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2571
2572         Fix #74060.
2573         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2574         internal field "value__" of an enum be private.  The examples for
2575         "value__" that I found on MSDN all used FieldAttributes.Private.
2576
2577         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2578         Don't mention IL method attribute names.
2579
2580         Fix #47991.  Remove a TODO.
2581         * statement.cs (Block.Toplevel): Make into a field.
2582         (Block.Parameters): Move into ToplevelBlock.
2583         (Block.known_variables): Rename from child_variable_names.
2584         (Block.Block): Remove variants that take Parameters.  Initialize
2585         'Toplevel' with the immediately surrounding toplevel block.
2586         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2587         LocalInfo parameter.
2588         (Block.GetKnownVariableInfo): New.
2589         (Block.IsVariableNameUsedInChildBlock): Update.
2590         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2591         the block, even though it may not be in scope.
2592         (Block.AddVariable): Remove Parameters parameter.  Use
2593         Toplevel.Parameters instead.
2594         (Block.AddConstant): Remove Parameters parameter.
2595         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2596         (Block.IsParamaterReference): Likewise.
2597         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2598         (ToplevelBlock.Parameters): New.  Moved from Block.
2599         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2600         initialize Parameters to a non-null value.
2601         * cs-parser.jay: Update to changes.
2602         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2603         simple names that mean different things in the same block.  Use
2604         Block.IsVariableNameUsedInBlock.
2605
2606 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2607
2608         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2609
2610 2005-03-26  Raja R Harinath  <harinath@acm.org>
2611
2612         Fix #73038.
2613         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2614         fails to resolve, ensure that the LHS is still resolved as an
2615         lvalue.
2616
2617 2005-03-25  Raja R Harinath  <harinath@acm.org>
2618
2619         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2620         ec.ContainerType.
2621         (Enum.current_ec): Remove.
2622         (Enum.LookupEnumValue): Remove EmitContext argument.
2623         Just uses the one created during DefineType.
2624         (Enum.FindMembers): Update.
2625         * expression.cs (MemberAccess.DoResolve): Update.
2626
2627 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2628
2629         * assign.cs (Assign.DoResolve): Check for CS1717 when
2630         source and target are same (uses Equals).
2631
2632         * expression.cs (LocalVariableReference, ParameterReference,
2633         This): Implemented Equals, GetHashCode.
2634
2635         * statement.cs (Block.GetParameterReference): Removed useless
2636         local variable.
2637
2638 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2639
2640         Fix cs0128.cs
2641         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2642         blocks before deciding whether the error is cs0136 or cs0128.
2643
2644         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2645         (using_alias_directive, using_namespace_directive): Pass
2646         MemberName, not an expression to Namespace.UsingAlias and
2647         Namespace.Using.
2648         (MakeName): Use the MemberName of the namespace.
2649         * namespace.cs (Namespace.MemberName): New.
2650         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2651         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2652         Likewise.
2653         * decl.cs (MemberName.Name): Make readonly.
2654         (MemberName.FromDotted): New "constructor".
2655         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2656         (MemberCore.Name): Compute from MemberName on demand.
2657         (MemberCore.SetMemberName): Provide a way to change the
2658         MemberName.
2659         (MemberCore.AddToContainer): Don't take a fullname parameter.
2660         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2661         fully qualified name of the container to the member name.
2662         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2663         only if the type is a member of the root container.
2664         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2665         MemberName.Left rather than searching for an embedded ".".
2666         (PartialContainer.CreatePart): Update to changes in RootContext.
2667         (MemberBase.ShortName): Turn into a property.  Use
2668         MemberCore.SetMemberName.
2669         (MemberBase.ExplicitInterfaceName): Remove.
2670         (MemberBase.UpdateMemberName): Remove.
2671         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2672         (PropertyBase.SetMemberName): New override.
2673         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2674         (Tree.GetDecl): New.
2675         (Tree.AllDecls): Rename from Decls.
2676         * attribute.cs, enum.cs, report.cs: Update to changes.
2677         * driver.cs (MainDriver): Use MemberName.FromDotted on
2678         RootContext.MainClass.
2679
2680 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2681
2682         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2683         checks.
2684
2685         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2686
2687 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2688
2689         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2690         property accessor modifiers.
2691
2692         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2693         fixed buffer attribute (CS1716).
2694         (PropertyMethod.HasCustomAccessModifier): When property accessor
2695         has custom modifier.
2696
2697         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2698         modifiers.
2699         (PropertyExpr.DoResolveLValue): Add CS0272.
2700
2701 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2702
2703         * convert.cs: When converting to a pointer, use the proper Conv.U
2704         or Conv.I depending on the source data type.
2705
2706         * cs-tokenizer.cs: Make the size for large decimal constants,
2707         fixes #72957.
2708
2709 2005-03-17  Martin Baulig  <martin@ximian.com>
2710
2711         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2712         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2713
2714 2005-03-17  Martin Baulig  <martin@ximian.com>
2715
2716         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2717         to bool so we can return an error condition.
2718         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2719         returned an error.
2720
2721 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2722
2723         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2724         attributes.
2725
2726 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2727
2728         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2729         Refactor to avoid traversing the list of assemblies, and to avoid
2730         string concatenation.
2731         * typemanager.cs (guid_attr_type): Remove.
2732         (negative_hits, pointers, references): Remove hashes.
2733         (type_hash): New.
2734         (GetConstructedType): New.  Uses type_hash to handle constructed
2735         types (arrays, references, pointers).
2736         (GetReferenceType, GetPointerType): Use it.
2737         (GetNestedType): New.  Uses type_hash to handle nested types of
2738         reflected types.
2739         (LookupType, LookupTypeDirect): Remove.
2740         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2741         'types' hash and LookupTypeReflection directly.
2742         (params_string, params_object): Use GetConstructedType.
2743         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2744         top-level types.
2745         (Namespace.Lookup): Use cached_types.
2746         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2747         provided by old TypeManager.LookupType.
2748         * rootcontext.cs (MakeFQN): Remove.
2749         * decl.cs (DeclSpace.MakeFQN): Likewise.
2750         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2751         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2752         TypeManager.GetConstructedType.
2753         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2754
2755 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
2756
2757         * cs-parser.jay: Fix build.
2758
2759 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2760
2761         * class.cs (TypeContainer.CircularDepException) New nested
2762         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2763
2764         * cs-parser.jay: Reports CS1527 for any namespace element.
2765
2766         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2767         Added CS0407.
2768
2769         * expression.cs (ParameterReference.IsAssigned): Changed error to
2770         CS0269.
2771         (Error_WrongNumArguments): Moved CS0245 detection here.
2772
2773         * statement.cs (Return.Resolve): Add CS1622 report.
2774
2775 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2776
2777         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2778
2779 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2780
2781         * attribute.cs expression.cs: Get rid of some allocations.
2782
2783 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2784
2785         * doc.cs : just eliminate the latest change.
2786
2787 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2788
2789         * doc.cs : commented out the latest change. It breaks xml-030.cs
2790
2791 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2792
2793         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2794           fail. So invoke CreateType() in FindDocumentedType().
2795
2796 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2797
2798         * cs-tokenizer.cs : added IsKeyword().
2799         * doc.cs : Detect keyword incorrectly used as identifier.
2800           Allow identifiers prefixed by @.
2801
2802 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2803
2804         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2805         It caused exception in namespace resolving (again!).
2806         
2807         * class.cs (Class.ctor): Removed exit.
2808         (PropertyMethod.ctor): ditto.
2809         
2810         * codegen.cs (Codegen.Reset): Reset static data.
2811         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2812         
2813         * cs-tokenizer.cs (Cleanup): Removed.
2814         
2815         * driver.cs (GetSystemDir): Rewrote to one line command.
2816         It caused problem with unloaded dynamic modules.
2817         (UnixParseOption): Removed Exit.
2818         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2819         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2820         Now can be mcs used as library.
2821         
2822         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2823         empty location.
2824         
2825         * location.cs (Reset): Reset static data.
2826         
2827         * namespace.cs (Reset): Reset static data.
2828         
2829         * report.cs (Report.Reset): Reset static data.
2830         
2831         * rootcontext.cs (RootContext.Reset): Reset static data.
2832         
2833         * tree.cs (RootTypes.ctor): Use Location.Null
2834         
2835         * typemanager.cs (TypeManager.Reset): Reset static data.
2836         (CoreLookupType): Removed Exit.
2837         (TypeHandle.Reset): Reset static data.
2838         
2839 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2840
2841         Fix #73516.
2842         * typemanager.cs (ComputeNamespaces): Import namespaces from
2843         referenced modules too.
2844
2845 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2846
2847         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2848         than '.'.
2849
2850 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2851
2852         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2853         enclosing DeclSpace.  This ensures that a name-lookup populates
2854         more caches and there are fewer 'TypeExpression's.  Carve out
2855         nested type lookup into ...
2856         (LookupNestedTypeInHierarchy): ... this.
2857
2858 2005-04-15  Martin Baulig  <martin@ximian.com>
2859
2860         Merged r41590 from MCS and make it work in the generics land.
2861
2862         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2863         `check' argument.
2864
2865         * class.cs (PartialContainer.UpdateConstraints): Removed.
2866         (PartialContainer.CheckConstraints): Removed.
2867         (PartialContainer.SetParameterInfo): Store the constraints here.
2868         (PartialContainer.DefineTypeParameters): New public method;
2869         resolve the type parameter's constraints here.  Note that the
2870         PartialContainer doesn't have an EmitContext anymore, so we must
2871         do this in the ClassPart.
2872
2873 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2874
2875         Clean up a few partial-class semantics.  
2876         Fixes test-357.cs and cs1618-2.cs.
2877         * cs-parser.jay (struct_declaration): Use 'current_class' as
2878         parent of newly-created struct.  Remove call to Register ().
2879         Use 'pop_current_class' to complete handing the current struct.
2880         (interface_declaration): Likewise.
2881         (class_declaration): Likewise.
2882         (enum_declaration): Use 'current_class' as parent of newly created
2883         enum.
2884         (delegate_declaration): Likewise.
2885         (pop_current_class): New function.  This is used to handle closing
2886         up the 'current_class' and 'current_container', and pointing them
2887         to the enclosing class/container.
2888         (CSharpParser): Initialize 'current_class' too.
2889         * decl.cs (MemberCore): Add check for invariant: a partial
2890         container is not a parsed entity, and thus does not enclose any
2891         parsed members.
2892         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2893         (DeclSpace.BaseTypeExpr): Use it.
2894         (DeclSpace.LookupType): Add check for invariant.
2895         * class.cs (TypeContainer): Add check for invariant: a nested
2896         class should have the same NamespaceEntry as its enclosing class.
2897         (TypeContainer.EmitFieldInitializers): Make virtual.
2898         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2899         MemberCore.
2900         (TypeContainer.Register): Remove.
2901         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2902         null.  Use TypeResolveEmitContext for resolving base types and
2903         interfaces.  Move initialization of Parts.TypeBuilder here from
2904         ...
2905         (TypeContainer.DefineNestedTypes): ... here.
2906         (PartialContainer): Take a Namespace not a NamespaceEntry.
2907         (PartialContainer.Create): Don't use Register.  Call the
2908         appropriate Add... function directly.
2909         (ClassPart): Take both the PartialContainer and the enclosing
2910         class as constructor arguments.
2911         (ClassPart.EmitFieldInitializers): Override.
2912         (ClassPart.PartFindNestedTypes): Remove.
2913         (FieldBase.GetInitializerExpression): Resolve the initializer
2914         expression in the emit context of the enclosing class.
2915         * tree.cs (RootTypes): Remove Register ().
2916         
2917 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2918
2919         * cs-parser.jay: Removed CS0134.
2920         
2921         * driver.cs: Removed CS1901.
2922         
2923         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2924         for predefined types.
2925
2926 2005-03-07  Duncan Mak  <duncan@novell.com>
2927
2928         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2929         well. Fixes bug #73454.
2930
2931 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2932
2933         * cs-tokenizer.cs (xtoken): Add CS1035.
2934         
2935         * class.cs (MethodData.Define): Add CS0683.
2936         (FieldMember.ctor): Add CS0681.
2937
2938 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2939
2940         * ecore.cs (SimpleName.DoResolve): Rename from
2941         SimpleName.DoResolveAllowStatic.
2942         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2943         Pass 'intermediate' flag to MemberStaticCheck.
2944         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2945         of "intermediate" lookups via MemberAccess.
2946         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2947         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2948
2949 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2950
2951         Fix #73394.
2952         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2953         slipped in because of variable names that are identical to a
2954         builtin type's BCL equivalent ('string String;', 'int Int32;').
2955         (PropertyExpr.EmitInstance): Likewise.
2956
2957 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2958
2959         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2960         
2961         * report.cs (warning_ignore_table): Made public.
2962
2963 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2964
2965         Fix #73282.
2966         * class.cs (MethodData.Emit): Pass 'container' to
2967         container.GetObsoleteAttribute instead of 'container.Parent'.
2968
2969 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2970
2971         * cs-parser.jay: Add 1534 error test.
2972
2973         * iterators.cs (Yield.CheckContext): Add error 1629.
2974         (Iterator.ctor): Save unsafe modifier.
2975         (MoveNextMethod.DoEmit): Restore unsafe context.
2976
2977         * namespace.cs (UsingAlias): Better error message.
2978
2979 2005-03-03  Dan Winship  <danw@novell.com>
2980
2981         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2982         the warning message [#73219]
2983
2984 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2985
2986         Fix compile with MCS 1.0.0.0.
2987         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2988         w_restore to not depend on string constant folding.
2989
2990 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2991
2992         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2993         CS0246 check to users who passed 'silent = false'.
2994         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2995         check.
2996         (SimpleName.SimpleNameResolve): Update.
2997         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2998         (MemberAccess.IdenticalNameAndTypeName): Update.
2999         * doc.cs (FindDocumentedTypeNonArray): Update.
3000
3001 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3002
3003         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3004         * parameters.cs (ComputeAndDefineParameters): Remove.
3005         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3006         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3007         Use GetParameterInfo.
3008
3009 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3010
3011         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3012
3013 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3014
3015         Unify DeclSpace.LookupType and DeclSpace.FindType.
3016         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3017         is in charge of defining nested types on demand.
3018         (DeclSpace.LookupType): Use it when the current_type is a
3019         TypeBuilder.  Use LookupTypeDirect for reflected types.
3020         (DeclSpace.FindType): Remove.
3021         (DeclSpace.LookupInterfaceOrClass): Likewise.
3022         (DeclSpace.DefineTypeAndParents): Likewise.
3023         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3024         DeclSpace.LookupType.
3025         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3026         * typemanager.cs (LookupType): Simplify.
3027         (AddUserType): Remove type from negative_hits.
3028         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3029         * class.cs (TypeContainer.FindMembers): Move handling of nested
3030         types ...
3031         (TypeContainer.FindMembers_NestedTypes): ... here.
3032         (TypeContainer.FindNestedType): Implement override.
3033         (ClassPart.FindNestedType): Delegate to PartialContainer.
3034         (ClassPart.PartFindNestedType): Looks up the nested types of the
3035         part alone.
3036
3037 2005-04-14  Martin Baulig  <martin@ximian.com>
3038
3039         * generic.cs (ConstructedType): Moved all the type lookup and
3040         nested class logic into SimpleName.
3041         (ConstructedType.ResolveConstructedType): Our underlying type is
3042         already fully resolved; all the type lookup stuff is in
3043         SimpleName.
3044
3045         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3046         constructed types here instead of in ConstructedType.
3047
3048         * decl.cs (MemberName.GetTypeExpression): Always create a
3049         SimpleName, not a ConstructedType.
3050         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3051
3052 2005-03-02  Martin Baulig  <martin@ximian.com>
3053
3054         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3055         static constructor in static classes.
3056
3057 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3058
3059         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3060         sizeParamIndex is not specified.
3061
3062 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3063
3064         Fix #73117
3065         * report.cs (WarningMessage.IsEnabled): Missing null check.
3066
3067 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3068
3069         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3070         in the fields and not in the properties.
3071
3072 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3073
3074         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3075         fields as well.
3076
3077 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3078
3079         * attribute.cs: Small refactoring (improved robustness).
3080         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3081         (ValidateGuid): Removed.
3082         (Resolve): Removed referenced to above mentioned.
3083         (GetAttributeUsage): Made private and changed to work without
3084         class assistance.
3085         (GetIndexerAttributeValue): Don't crash.
3086         (GetConditionalAttributeValue): Ditto.
3087         (GetClsCompliantAttributeValue): Ditto.
3088         (ExtractSecurityPermissionSet): All attributes exceptions are
3089         error 648.
3090         (GetPropertyValue): New helper.
3091         (GetMethodImplOptions): New method.
3092         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3093         some missing properties.
3094         
3095         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3096         (Method.ApplyAttributeBuilder): Updated.
3097         
3098         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3099         exception.
3100
3101 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3102
3103         Fix #73052.
3104         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3105         non-simple types (array, pointer, reference).
3106
3107 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3108
3109         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3110
3111         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3112         for operators.
3113         (Method.CheckBase): Catch wrong destructor here.
3114         (MethodData.Define): Add errors 550, 668.
3115
3116         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3117
3118         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3119
3120         * pending.cs (VerifyPendingMethods): Add error 551.
3121
3122         * typemanager.cs (CSharpName): Next error report helper.
3123
3124 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3125
3126         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3127         attributes. Removed useless attribute double check.
3128         It saves almost 2MBs for corlib.
3129
3130 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3131
3132         Fix #72924.
3133         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3134         called twice in case of error.
3135
3136 2005-02-23  Chris Toshok  <toshok@ximian.com>
3137
3138         Fix compiler portions of #72827.
3139         * statement.cs (Block.Emit): call Begin/EndScope on the
3140         EmitContext instead of the ILGenerator.
3141
3142         * codegen.cs (EmitContext.BeginScope): new method, call
3143         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3144         we have one.)
3145         (EmitContext.BeginScope): same, but EndScope and CloseScope
3146
3147         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3148         offset and call the superclass's OpenScope(int) with it.
3149         (SymbolWriter.CloseScope): get the current il
3150         offset and call superclass's CloseScope(int) with it.
3151
3152 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3153
3154         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3155         CS1677 for out and ref as well.
3156
3157         * class.cs (Method.Define): Add error CS1599 detection.
3158         
3159         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3160         
3161         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3162         
3163         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3164         
3165         * support.cs.cs (ModifierDesc): New helper method.
3166
3167 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3168             Abin Thomas  <projectmonokochi@rediffmail.com>
3169             Anoob V E  <projectmonokochi@rediffmail.com>
3170             Harilal P R  <projectmonokochi@rediffmail.com>
3171
3172         Fix #57851, #72718.
3173         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3174         MemberLookup (used for error reporting) actually returns a result.
3175         Fix error report number (122, not 112).
3176
3177 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3178             Anoob V E  <projectmonokochi@rediffmail.com>
3179             Harilal P R  <projectmonokochi@rediffmail.com>
3180
3181         Fix #71134.
3182         * pending.cs (PendingImplementation.GetAbstractMethods):
3183         Find NonPublic members too.
3184
3185 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3186
3187         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3188         Fixed error 217.
3189         
3190         * class.cs (MethodCore.CheckMethodAgainstBase):
3191         Add error 239 report.
3192
3193 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3194
3195         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3196         
3197         * class.cs (Operator.Define): Add error 217 report.
3198         
3199 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3200
3201         Fix #68955.
3202         * expression.cs (Invocation.IsApplicable): Make public.
3203         (Invocation.IsParamsMethodApplicable): Likewise.
3204         * delegate.cs (Delegate.VerifyApplicability): Don't use
3205         Invocation.VerifyArgumentCompat for parameter applicability
3206         testing.  Use Invocation.IsApplicable and
3207         Invocation.IsParamsMethodApplicable.
3208
3209 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3210
3211         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3212         
3213         * class.cs (Operator.Define): Add error 217 report.
3214         
3215 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3216
3217         * namespace.cs (UsingEntry.Resolve): Undo change below.
3218
3219 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3220
3221         Fix #72756.
3222         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3223         disable the error message when the extended MemberLookup also
3224         fails.
3225         (Expression.MemberLookupFinal): Update.
3226         (SimpleName.DoSimpleNameResolve): Update.
3227         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3228         Don't use MemberLookupFinal.
3229         (New.DoResolve): Update.
3230         (BaseAccess.CommonResolve): Update.
3231
3232 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3233
3234         Fix #72732.
3235         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3236         occured previously, don't resolve again.
3237
3238 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3239
3240         Fix #69949
3241         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3242         argument. Call ResolveAttributeUsage for unresolved.
3243         when types doesn't match ctor arguments.
3244         
3245         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3246         for nested attribute classes.
3247         (Class.attribute_usage): Removed.
3248         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3249         for attribute class.
3250         
3251         * ecore.cs (IsAttribute): Removed.
3252         
3253         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3254         
3255         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3256         now normal types.
3257         (attribute_types): Removed.
3258         (EmitCode): Global attributes are emited as the latest.
3259
3260 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3261
3262         * class.cs (EmitFieldInitializers): Don't emit field initializer
3263         for default values when optimilization is on.
3264         
3265         * constant.cs (Constant.IsDefaultValue): New property.
3266         
3267         * driver.cs: Add /optimize handling.
3268         
3269         * constant.cs,
3270         * ecore.cs,
3271         * literal.cs: Implement new IsDefaultValue property.
3272         
3273         * rootcontext.cs (Optimize): New field, holds /optimize option.
3274
3275 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3276
3277         Fix crasher in re-opened #72347.
3278         * namespace.cs (Namespace.Lookup): Return null if
3279         DeclSpace.DefineType returns null.
3280
3281         Fix #72678.
3282         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3283
3284 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3285
3286         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3287         now returns null if it cannot resolve to an lvalue.
3288         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3289         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3290         returned null.  Remove check for SimpleName.
3291         (EventExpr.DoResolveLValue): New.
3292         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3293         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3294         error from ...
3295         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3296         avoid CS0131 error.
3297         (Unary.ResolveOperator): Move CS0211 check ...
3298         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3299         CS0131 error.
3300         (Unary.DoResolveLValue): Simplify.
3301         (AddressOf.DoResolveLValue): New.
3302         (ArrayAccess.DoResolveLValue): New.
3303
3304 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3305
3306         * attribute.cs (Attribute.Resolve): Add arguments casting for
3307         when types doesn't match ctor arguments.
3308
3309 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3310
3311         Fix parts of #63202.
3312         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3313         lookup of operator in base type.  Ensure that all checks happen
3314         when the operator resolves to an "op_..." method.
3315
3316 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3317
3318         Fix #71992.
3319         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3320         'ignore_cs0104' parameter.  Pass it to ...
3321         (NamespaceEntry.Lookup): ... this.
3322         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3323         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3324         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3325         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3326         Update.  Request that cs0104 errors be ignored.
3327         (ComposedCast.ResolveAsTypeStep): Update.
3328
3329 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3330
3331         Fix #59209.
3332         * expression.cs (Invocation.BetterFunction): Remove support for
3333         comparing virtual functions and their overrides.
3334         (Invocation.IsOverride): New.
3335         (Invocation.OverloadResolve): Don't consider 'override' functions
3336         during candidate selection.  Store them in a lookaside list.
3337         If the selected method is a 'virtual' function, use the list to
3338         find any overrides that are closer to the LHS type.
3339
3340 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3341
3342         * expression.cs (New.DoResolve): Add complex core type reduction.
3343         (New.Constantify): Converts complex core type syntax like 'new int ()'
3344         to simple constant.
3345         
3346 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3347
3348         * decl.cs (EntryType.EntryType): New constructor to create an
3349         updated copy of a cache entry.
3350         (MemberCache.AddMethods): Use it.
3351         (MemberCache.ClearDeclaredOnly): Remove.
3352         (MemberCache.MemberCache): Update.
3353
3354 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3355
3356         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3357         variable.  This one is represents the actual low-level declaration
3358         of the method, as opposed to the semantic level `IsStatic'.   
3359
3360         An anonymous method which is hosted into a static method might be
3361         actually an instance method.  IsStatic would reflect the
3362         container, while MethodIsStatic represents the actual code
3363         generated.
3364
3365         * expression.cs (ParameterReference): Use the new MethodIsStatic
3366         instead of IsStatic.
3367
3368         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3369         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3370         set on the current EmitContext. 
3371
3372         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3373         resolve our casted expression as an LValue.  This triggers the
3374         proper LValue processing that is later required by Assign.
3375
3376         This fixes 72347.
3377
3378         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3379
3380 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3381
3382         C# 2.0 Fixed buffer implementation
3383
3384         * anonymous.cs: Update after RegisterHelperClass renaming.
3385
3386         * attribute.cs (AttributeTester.fixed_buffer_cache):
3387         Cache of external fixed buffers.
3388         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3389         implementation if field is fixed buffer else null.
3390
3391         * class.cs
3392         (TypeContainer.AddField): Accept FieldMember instead of Field.
3393         (FieldBase.IsFieldClsCompliant): Extracted code from
3394         VerifyClsCompliance descendant customization.
3395         (FixedField): New class handles fixed buffer fields.
3396         (FixedFieldExternal): Keeps information about imported fixed
3397         buffer.
3398         (IFixedField): Make access to internal or external fixed buffer
3399         same.
3400
3401         * cs-parser.jay: Add fixed buffer parsing.
3402
3403         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3404         buffer.
3405
3406         * expression.cs (Indirection): Extended implementation to accept
3407         fixed buffer field.
3408         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3409         (ElementAccess.MakePointerAccess): Get type as parameter.
3410         (DoResolve): Add fixed buffer field expression conversion.
3411         (DoResolveLValue): Ditto.
3412         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3413         (ArrayPtr): Derives from FixedBufferPtr.
3414         (ArrayPtr.Emit): Add extra emit for array elements.
3415
3416         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3417
3418         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3419         for compiler generated types.
3420         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3421
3422         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3423         and consume less memory.
3424         (Fixed.Resolve): Add fixed buffer case.
3425
3426         * typemanager.cs (compiler_generated_attr_ctor,
3427         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3428         (HasElementType): Add our own implementation to work on every
3429         runtime.
3430
3431 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3432
3433         * anonymous.cs (CaptureContext): Track whether `this' has been
3434         referenced.   
3435
3436         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3437         only captured `this' if it was implicitly done (instance
3438         methods/variables were used). 
3439
3440         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3441         `this' must be captured.
3442
3443 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3444  
3445         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3446         is null it means that there has been no need to capture anything,
3447         so we just create a sibling.
3448
3449         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3450
3451         Just a partial fix.  The other half is fairly elusive.
3452         
3453 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3454
3455         Fix #52586, cs0121-4.cs.
3456         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3457         and return a hashtable.
3458         (MemberCache.ClearDeclaredOnly): New.
3459         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3460         the method_hash of a base type too.
3461         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3462         type methods.  Overwrite entries with the same MethodHandle so
3463         that the ReflectedType is correct.  The process leaves in base
3464         virtual functions and their overrides as distinct entries.
3465         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3466         matters since it was boxed in a ArrayList before.
3467         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3468         modifier.
3469         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3470         case of a virtual function and its override (choose the overload
3471         as better).
3472         (Invocation.OverloadResolve): Avoid 'override' members during
3473         'applicable_type' calculation.
3474
3475 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3476
3477         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3478         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3479         GetTypeHandle.  It is possible for a reflected type to derive from
3480         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3481         System.Array during mscorlib compilation).
3482         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3483         contain a method_hash, don't create one either.  Don't create a
3484         deep copy of the base cache's method_hash.
3485         (MemberCache.SetupCache): Rename back from DeepCopy.
3486         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3487         already initialized.  If we see an override function, add its
3488         underlying base virtual function to the member_hash too.
3489
3490 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3491
3492         Combine two near-redundant caches.
3493         * typemanager.cs (method_params): Rename from method_internal_params.
3494         (TypeManager.GetParameterData): New.  Replace
3495         Invocation.GetParameterData.
3496         (TypeManager.LookupParametersByBuilder): Remove.
3497         * expression.cs (Invocation.method_parameter_cache): Remove.
3498         (Invocation.GetParameterData): Remove.
3499         Update to changes.
3500         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3501         Update to changes.
3502
3503 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3504
3505         Fix #72015.
3506         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3507         TypeManager.multicast_delegate_type is null, resolve it by looking
3508         up "System.MulticastDelegate".
3509         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3510
3511 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3512             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3513             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3514
3515         Fix cs0164.cs.
3516         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3517         (LabeledStatement.AddReference): New.  Set 'referenced'.
3518         (Goto.Resolve): Use it.
3519
3520 2005-02-05  John Luke  <john.luke@gmail.com>
3521
3522         * driver.cs: remove duplicate -doc line in Usage ()
3523
3524 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3525
3526         * location.cs (Location.AddFile): Fix CS2002 error report.
3527
3528 2005-02-02  Martin Baulig  <martin@ximian.com>
3529
3530         * delegate.cs (Delegate.DefineType): Report an internal error if
3531         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3532         details.        
3533
3534 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3535
3536         Fix a crasher in a variant of #31984.
3537         * const.cs (Constant.CheckBase): New override that defers the
3538         new-or-override check in case the base type hasn't been populated
3539         yet.
3540         (Constant.Define): Ensure the new-or-override check is performed.
3541
3542 2005-02-01  Duncan Mak  <duncan@ximian.com>
3543
3544         * const.cs (LookupConstantValue): Check that `ce' is not null
3545         before calling GetValue ().
3546
3547 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3548
3549         Fix test-334.cs (#69519).
3550         * cs-parser.jay (using_alias_directive): Pass in an expression to
3551         NamespaceEntry.UsingAlias.
3552         (using_namespace_directive): Pass in an expression to
3553         NamespaceEntry.Using.
3554         (namespace_name): Don't flatten to a string.
3555         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3556         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3557         ResolveAsTypeStep.
3558         (NamespaceEntry.UsingEntry): Likewise.
3559         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3560         changes.
3561         (NamespaceEntry.LookupForUsing): Remove.
3562         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3563         names.
3564         (NamespaceEntry.Lookup): Remove support for dotted names.
3565
3566 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3567
3568         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3569         split into two.
3570         (NamespaceEntry.ImplicitParent): Compute on demand.
3571         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3572         parallels the current.
3573         (NamespaceEntry.LookupForUsing): Use it.
3574         (NamespaceEntry.Lookup): If the current namespace-entry is
3575         implicit, don't search aliases and using tables.
3576
3577 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3578
3579         Fix #31984.
3580         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3581         BaseCache here.
3582         (TypeContainer.BaseCache): Compute on demand.
3583         (TypeContainer.FindMembers): Define constants and types if they're
3584         not already created.
3585         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3586         check.
3587         * const.cs (Constant.Define): Make idempotent.
3588
3589 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3590
3591         * pending.cs: Produce better code (no nops produced by using Ldarg
3592         + value).
3593         
3594         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3595         i - 1' it should be arg + 1.
3596
3597         Fixes bug #71819.
3598
3599 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3600
3601         * attribute.cs (Attribute.CheckAttributeType): Make private
3602         non-virtual.
3603         (Attribute.ResolveType): Make virtual.
3604         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3605         handling of RootContext.Tree.Types.
3606
3607 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3608
3609         Update attribute-handling to use the SimpleName/MemberAccess
3610         mechanisms.
3611         * cs-parser.jay (attribute): Pass in an expression to the
3612         constructors of Attribute and GlobalAttribute.
3613         * attribute.cs (Attribute): Take an expression for the name.
3614         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3615         passed in attribute name expression.
3616         (Attribute.CheckAttributeType): Use it.
3617         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3618         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3619         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3620         argument to prevent error messages if the lookup fails.
3621
3622 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3623
3624         * expression.cs (Indirection): Implemented IVariable interface
3625         to support indirection in AddressOf operator.
3626         (PointerArithmetic.Emit): Add optimalization for case where
3627         result can be precomputed.
3628
3629 2005-01-26  Martin Baulig  <martin@ximian.com>
3630
3631         * class.cs (TypeContainer.AttributeTargets): Return the correct
3632         AttributeTargets depending on our `Kind' instead of throwing an
3633         exception; fixes #71632.
3634
3635 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3636
3637         Fix #71257
3638         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3639         constant members.
3640
3641 2005-03-17  Martin Baulig  <martin@ximian.com>
3642
3643         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3644         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3645
3646 2005-03-17  Martin Baulig  <martin@ximian.com>
3647
3648         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3649         to bool so we can return an error condition.
3650         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3651         returned an error.
3652
3653 2005-03-17  Martin Baulig  <martin@ximian.com>
3654
3655         * generic.cs (TypeMananager.IsIEnumerable): New public method.
3656
3657         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3658         converting from an array-type of T to `IEnumerable<T>'.
3659
3660 2005-03-16  Martin Baulig  <martin@ximian.com>
3661
3662         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3663         (Nullable.LiftedUnaryMutator): New public class.
3664
3665         * expression.cs (UnaryMutator.DoResolve): Added support for
3666         Nullable Types.
3667
3668 2005-03-14  Martin Baulig  <martin@ximian.com>
3669
3670         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3671
3672 2005-03-14  Martin Baulig  <martin@ximian.com>
3673
3674         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3675         the comparision operators `<', `>', `<=' and `>='.
3676
3677 2005-03-13  Martin Baulig  <martin@ximian.com>
3678
3679         * generic.cs
3680         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3681         avoid confusion with the `NullLiteral'.
3682         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3683
3684 2005-03-13  Martin Baulig  <martin@ximian.com>
3685
3686         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3687         comparing arbitrary types with the null literal.
3688
3689 2005-03-13  Martin Baulig  <martin@ximian.com>
3690
3691         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3692         boolean operators '&&', '||', '&' and '|'.
3693         (Nullable.OperatorTrueOrFalse): New public class.
3694
3695         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3696         instead of a `StaticCallExpr'; added support for nullables.
3697
3698 2005-03-10  Martin Baulig  <martin@ximian.com>
3699
3700         * expression.cs
3701         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3702         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
3703
3704 2005-03-07  Martin Baulig  <martin@ximian.com>
3705
3706         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3707         it work if `expr' is not an IMemoryLocation.
3708         (Nullable.Lifted): Implement IMemoryLocation.
3709         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3710         target type.
3711
3712 2005-03-05  Martin Baulig  <martin@ximian.com>
3713
3714         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3715         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3716         (Nullable): Added support for lifted unary and binary operators.
3717
3718         * expression.cs (Unary.DoResolve): Added support for nullable types.
3719         (Binary.DoResolve): Likewise.
3720         (Conditional.DoResolve): Likewise.
3721
3722 2005-03-02  Martin Baulig  <martin@ximian.com>
3723
3724         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3725
3726         * class.cs (ClassPart.SetParameterInfo): Override this.
3727         (PartialContainer.SetParameterInfo): Override this.
3728         (TypeContainer.CheckConstraints): New protected method.
3729         (PartialContainer.CheckConstraints): Override this and check
3730         whether the same contraints were specified in all parts of a
3731         partial generic type definition.
3732         (PartialContainer.UpdateConstraints): New public method.
3733
3734         * generic.cs (TypeParameter.UpdateConstraints): New public method.
3735
3736 2005-03-02  Martin Baulig  <martin@ximian.com>
3737
3738         Committing a patch from Carlos Alberto Cortez to fix #72887.
3739
3740         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3741         casts from `T []' to `int []'.
3742
3743 2005-03-02  Martin Baulig  <martin@ximian.com>
3744
3745         * generic.cs (TypeManager.IsEqual): Make this symmetric.
3746
3747         * expression.cs (Binary.ResolveOperator): When resolving a
3748         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3749         `=='.  Fixes #71866.  See gen-127.cs.
3750
3751 2005-03-02  Martin Baulig  <martin@ximian.com>
3752
3753         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3754         static constructor in static classes.
3755
3756 2005-03-02  Martin Baulig  <martin@ximian.com>
3757
3758         * generic.cs
3759         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3760         (Nullable.LiftedConversion): Added support for user-defined
3761         conversions.
3762
3763         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3764
3765         * cs-parser.jay: Use ComposedCast everywhere instead of
3766         NullableType, so we don't need to check for NullableType
3767         everywhere.
3768         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3769         case where we'll be resolved into a `parenthesized_expression_0'
3770         afterwards.
3771
3772         * convert.cs
3773         (Convert.UserDefinedConversion): Added nullable conversions.
3774
3775 2005-02-28  Martin Baulig  <martin@ximian.com>
3776
3777         * generic.cs (TypeManager.IsNullableType): New static method.
3778         (Nullable): New abstract class.
3779         (Nullable.NullLiteral): New public class.
3780         (Nullable.LiftedConversion): New public class.
3781
3782         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3783         `builtin_types opt_nullable'.
3784
3785         * convert.cs
3786         (Convert.ImplicitConversionStandard): Added nullable conversions.
3787         (Convert.ExplicitConversionStandard): Likewise.
3788         (Convert.ExplicitConversion): Likewise.
3789
3790 2005-02-26  Martin Baulig  <martin@ximian.com>
3791
3792         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3793         begin with a "?", for instance "?[]".  Don't do a type lookup if
3794         `dim' is empty.
3795
3796 2005-02-25  Martin Baulig  <martin@ximian.com>
3797
3798         The first part of Nullable Types :-)
3799
3800         * generic.cs (NullableType): New public class.
3801         (NullCoalescingOperator): New public class.
3802         (TypeArguments.Resolve): Add a CS0306 check.
3803
3804         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3805         (opt_nullable): New rule.
3806         (type): Added `opt_nullable' to `namespace_or_type_name',
3807         `builtin_types' and `pointer_type'.
3808         (array_type): Added `opt_nullable'.
3809         (opt_rank_specifier_or_nullable): New rule; this is the
3810         combination of `opt_rank_specifier' and `opt_nullable'.
3811         (opt_error): New rule; catch errors here.
3812         (nullable_type_or_conditional): New rule; we use this to check for
3813         nullable and still detect the conditional operator.
3814         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3815         instead `opt_rank_specifier'.
3816
3817         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3818         for nullables.
3819
3820 2005-02-24  Martin Baulig  <martin@ximian.com>
3821
3822         * README, README.Changes: Removed; they're old and obsolete.
3823
3824 2005-02-22  Martin Baulig  <martin@ximian.com>
3825
3826         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3827         returned an error, set `constraints' to null to avoid a crash
3828         later on.
3829         (TypeParameter.ResolveType): Likewise.
3830
3831 2005-02-22  Martin Baulig  <martin@ximian.com>
3832
3833         * generic.cs
3834         (Constraints.ResolveTypes): Protect against being called twice.
3835         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3836         (TypeParameter.ResolveType): New public method; calls
3837         constraints.ResolveTypes().
3838         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3839         into the new ResolveType().
3840         (GenericMethod.Define): Call ResolveType() on all our
3841         TypeParameter's.        
3842
3843 2005-02-21  Martin Baulig  <martin@ximian.com>
3844
3845         * generic.cs
3846         (TypeManager.generic_nullable_type): New static public field.
3847         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3848
3849         * rootcontext.cs
3850         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3851
3852 2005-02-15  Martin Baulig  <martin@ximian.com>
3853
3854         * generic.cs (ConstructedType.Constraints): Correctly check
3855         constraints if the argument type is a type parameter; fixes
3856         #72326. 
3857
3858 2005-02-02  Martin Baulig  <martin@ximian.com>
3859
3860         * delegate.cs (Delegate.DefineType): Report an internal error if
3861         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3862         details.        
3863
3864 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3865
3866         * pending.cs: Produce better code (no nops produced by using Ldarg
3867         + value).
3868         
3869         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3870         i - 1' it should be arg + 1.
3871
3872         Fixes bug #71819.
3873         
3874 2005-01-26  Martin Baulig  <martin@ximian.com>
3875
3876         * cs-parser.jay (indexer_declarator): Don't report an error if we
3877         have type parameters since we can be an explicit interface
3878         implementation; fixes #71449.
3879
3880 2005-01-26  Martin Baulig  <martin@ximian.com>
3881
3882         * class.cs (TypeContainer.AttributeTargets): Return the correct
3883         AttributeTargets depending on our `Kind' instead of throwing an
3884         exception; fixes #71632.
3885
3886 2005-01-26  Martin Baulig  <martin@ximian.com>
3887
3888         * delegate.cs (Delegate.DefineType): Correctly define our type
3889         parameters.  Fixes #71483.
3890
3891 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3892
3893         Fix #71602.
3894         * expression.cs (MemberAccess.DoResolve): Don't complain with
3895         cs0572 when the LHS of a member access has identical name and type
3896         name.
3897
3898 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3899
3900         Fix #71651, #71675
3901         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3902         CreatePermission.
3903         Create custom PermissionSet only for PermissionSetAttribute.
3904
3905 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3906
3907         Fix #71649
3908         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3909         delegates in static class.
3910
3911 2005-01-24  Martin Baulig  <martin@ximian.com>
3912
3913         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3914         merging an implicit block, just use its reachability.
3915
3916         * statement.cs (Block.Resolve): Make the unreachable code check
3917         work wrt. implicit blocks; see test-337 from #63842.
3918
3919 2005-01-21  Alp Toker  <alp@atoker.com>
3920  
3921         * cs-parser.jay: destructor_declaration's container is PartialContainer
3922         not Class when partial types are used, so use Kind prop instead of
3923         'is'.
3924         
3925 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3926
3927         * cs-parser.jay: Improve error reporting when an interface
3928         declares new types.
3929
3930 2005-01-20  Dick Porter  <dick@ximian.com>
3931
3932         * support.cs: SeekableStreamReader fix from Sandor Dobos
3933         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3934         chars are read.  Fixes bug 70369.
3935
3936 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3937
3938         * cs-parser.jay (catch_clause): Simplify current_block handling
3939         somewhat.
3940
3941 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3942
3943         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3944         code with ImplicitStandardConversion to handle the implicit
3945         conversion of method groups into valid delegate invocations. 
3946
3947         The problem is that in parameter handling we were using this code
3948         path.  Fixes bug #64698
3949
3950 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3951
3952         * cs-parser.jay: Fix several infelicities.
3953         - Avoid assigning to the parser value stack.  Code like 
3954           '$3 = null' is unclean.  Synthesize a value for the code block
3955           instead. 
3956         - Avoid using oob_stack for storing location information.  Use ...
3957         (_mark_): ... this.  New (empty) rule.  Saves the current location
3958         in $$.
3959         (foreach_statement): Avoid using oob_stack for current_block
3960         handling.  Use technique used in for_statement and
3961         using_statement.  Synthesize a value for the code block to store
3962         additional intermediate information.
3963
3964 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3965
3966         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3967         of a different type is only allowed to private fields of a
3968         containing type, not on fields of a base class.
3969
3970         See test-174.cs and error cs0122-9.cs
3971
3972 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3973
3974         Fix test-335.cs (bug #58126).
3975         * cs-parser.jay (argument): Split out non-expression parts of the
3976         rule into 'non_simple_argument'.
3977         (invocation_expression): Support parenthesized invocations with
3978         multiple arguments, and with single non-simple arguments.
3979
3980 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3981
3982         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3983         places.
3984
3985 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3986
3987         Fix cs0038-1.cs, cs1640-6.cs.
3988         * ecore.cs (Expression.Resolve): Remove special-case for
3989         SimpleName in error-handling.
3990         (Expression.almostMatchedMembers): Relax access permission to
3991         protected.
3992         (Expression.MemberLookupFailed): Handle duplicates in
3993         almostMatchedMembers list.
3994         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3995         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3996         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3997         overload if the passed in MemberInfo is a MethodBase.
3998
3999 2005-01-25  Martin Baulig  <martin@ximian.com>
4000
4001         * doc.cs
4002         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4003
4004 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4005
4006         Fix #70749
4007         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4008         for non-CAS & merge permission sets properly.
4009
4010 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4011
4012         Improve standard-compliance of simple name and member access 
4013         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4014         * ecore.cs (FullNamedExpression): New abstract base class 
4015         for Namespaces and TypeExpressions.
4016         (ResolveFlags.SimpleName): Remove.
4017         (SimpleName): Remove support for dotted names.
4018         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4019         DeclSpace.FindType and DeclSpace.LookupType.
4020         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4021         (Expression.ExprClassName): Make member function.
4022         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4023         a namespace.  Remove creation of dotted "SimpleName"s.
4024         (MemberAccess.DoResolve): Likewise.
4025         * decl.cs (DeclSpace.Cache): Make private.
4026         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4027         (DeclSpace.FindType): Update.
4028         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4029         FullNamedExpression.
4030         * namespace.cs (Namespace): Derive from FullNamedExpression
4031         so that it can be part of expression resolution.
4032         (Namespace.Lookup): Return an FullNamedExpression.
4033         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4034         namespace.
4035         * rootcontext.cs (NamespaceLookup): Remove.
4036         (LookupType): Move to DeclSpace.
4037         * attribute.cs (CheckAttributeType): Update.
4038         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4039         (FindDocumentedTypeNonArray): Likewise.
4040
4041 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4042
4043         Fix cs0509.cs, cs1632.cs.
4044         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4045         is the same as IsInterface.
4046         (TypeContainer.GetClassBases): Likewise.
4047         * statement.cs (LabeledStatement.ig): New field.
4048         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4049         label.
4050         (LabeledStatement.DoEmit): Check that the label was created with
4051         the same ILGenerator.
4052
4053 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4054
4055         Fix #71058
4056         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4057         accessors to its properties.
4058
4059         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4060         from accessors to property.
4061         
4062 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4063
4064         Fix #70722
4065         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4066         only for overrides.
4067         
4068 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4069
4070         * attribute.cs: Check for null and empty strings.  
4071
4072         I have lost another battle to Paolo.
4073
4074 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4075
4076         Fix #70942
4077         * class.cs (PropertyMethod): Set Parent field in ctors.
4078         (SetMethod.InternalParameters): Add unsafe switch hack.
4079         Override MarkForDuplicationCheck where it is appropriate.
4080
4081         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4082         It says whether container allows members with the same name.
4083         Base default is no.
4084         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4085         Removed is_method parameter.
4086
4087 2005-01-06  Duncan Mak  <duncan@ximian.com>
4088
4089         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4090         because the previous change led to incorrect reporting of CS1032
4091         ("Cannot define/undefine preprocessor symbols after first token in
4092         file"). Instead of using `tokens_seen' as the only flag that
4093         triggers CS1040, introduce `comments_seen'. This new flag is used
4094         to signify having seen comments on the current line, so it is
4095         unset after a newline.
4096
4097 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4098
4099         * doc.cs : When searching for a type, find nested type too.
4100           This fixes bug #71040.
4101
4102 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4103
4104         * doc.cs :
4105           - Warn missing member comment on those classes which also does not
4106             have doc comments. Fixed bug #71041.
4107           - Don't warn missing doc comment on default constructor.
4108             Fixed bug #71042.
4109
4110 2005-01-06  Duncan Mak  <duncan@ximian.com>
4111
4112         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4113         comments, set `tokens_seen' to true. This allows us to detect
4114         misplaced preprocessor directives (i.e. not at the beginning of
4115         the a line, nor after whitespaces). In that case, report error
4116         CS1040. This fixes bug #56460.
4117
4118         * cs-parser.jay (interface_member_declaration): Add checks for
4119         IsExplicitImpl, and report CS0541 error if an interface member is
4120         defined as an explicit interface declaration.
4121
4122 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4123
4124         Fix #70817
4125         * class.cs (PropertyMethod): Set Parent field in ctors.
4126         (SetMethod.InternalParameters): Add unsafe switch hack.
4127         
4128         * decl.cs (MemberCore.Parent): Cannot be readonly.
4129
4130 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4131
4132         * decl.cs (DeclSpace.ResolveType): Remove.
4133         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4134         Merge in code from ...
4135         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4136         * class.cs, enum.cs: Update to changes.
4137
4138 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4139
4140         * anonymous.cs: Ensure that we init the scope of our parent if it
4141         has not been initialized yet.
4142
4143 2004-12-30  Duncan Mak  <duncan@ximian.com>
4144
4145         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4146         if field.FieldBuilder is null. Fixes #70758.
4147
4148         * convert.cs: Fixed some typos and updated some of the comments.
4149         (ImplicitStandardConversionExists):
4150         (TryImplicitIntConversion): If `target_type' is an interface and
4151         the type of `ic' implements this interface, return true or a new
4152         BoxedCast instead of null. This fixes #70468.
4153
4154 2004-12-29  Duncan Mak  <duncan@ximian.com>
4155
4156         * expression.cs (Argument.Emit): Check that Expr is
4157         IMemoryLocation before casting to it, and report CS1510 otherwise.
4158
4159         This fixes #70402.
4160
4161 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4162
4163         * statement.cs (Block.ThisVariable): remove the recursion here, to
4164         make the --profile more sane.
4165
4166 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4167
4168         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4169         assembly, by JB Evain.
4170
4171 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4172
4173         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4174           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4175         "parent" refers to enclosing type/class.  "base" refers to superclass.
4176
4177 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4178
4179         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4180         Ensure that we only have GlobalAttributes.
4181         * attribute.cs (Attribute.Emit): Make non-virtual.
4182         (GlobalAttribute.Emit): Remove.
4183         (Attribute.Resolve): Make virtual.
4184         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4185         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4186         the argument. Don't create one.
4187         (Attribute.GetObsoleteAttribute): Likewise.
4188         (Attribute.GetClsCompliantAttributeValue): Likewise.
4189         * class.cs, decl.cs: Update to changes.
4190
4191 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4192
4193         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4194         
4195         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4196         
4197         * statement.cs (Foreach.Resolve): Add error 186 report.
4198
4199 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4200
4201         * expression.cs (Conditional.DoResolve): Add warning 429.
4202         
4203         * statement.cs (If.Resolve): Add warning 665.
4204
4205 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4206
4207         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4208         except when in the parser, and in GlobalAttribute.
4209         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4210         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4211         RootContext.Tree.Types.NamespaceEntry once work is done.
4212         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4213         and resets RootContext.Tree.Types.NamespaceEntry.
4214
4215 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4216
4217         * cs-parser.jay: Don't create a block for every variable.
4218
4219 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4220
4221         * location.cs: Provide extra information.
4222
4223         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4224         variables from the captured environment, it is the ldarg_0.
4225
4226 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4227
4228         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4229         find a conclusion.
4230         
4231         * class.cs: Changed warning level for 169 to avoid developer
4232         displeasure from warning flooding. It will be changed back when they
4233         fix most of current BCL warnings.
4234         
4235         * RootContext.cs: Pushed default WarningLevel to 3.
4236         
4237         * statement.cs: Removed unused variable.
4238
4239 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4240
4241         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4242         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4243         Add error 502 report.
4244         (StaticClass.DefineType): Add error 441 report.
4245         (Class.AllowedModifiersProp): New virtual property as temporary
4246         extension to AllowedModifiers.
4247         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4248         to share implementation with StaticClass and don't call virtual
4249         methods from ctor.
4250         
4251         * driver.cs (MainDriver): Add error 1558 test.
4252
4253         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4254         report. Moved error 36 test here.
4255
4256         * statement.cs (Throw.Resolve): Add error 724 report.
4257
4258         * typemanager.cs: Add out_attribute_type core type.
4259         
4260 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4261
4262         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4263         3018 report.
4264         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4265
4266         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4267         3017 report.
4268         
4269         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4270
4271         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4272         Add error 3023 report.
4273         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4274
4275         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4276         implementation.
4277
4278 2004-12-12  John Luke  <john.luke@gmail.com>
4279
4280         * driver.cs (AddArgs): take -- into account when
4281         adding arguments, fixes bug 65710 
4282
4283 2004-12-12  Martin Baulig  <martin@ximian.com>
4284
4285         * expression.cs (Unary.TryReduceNegative): Added support for
4286         SByteConstant and ByteConstant.
4287         (Unary.Reduce): Check error values from TryReduceNegative().
4288
4289 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4290
4291         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4292         and report exception as error 182.
4293
4294 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4295
4296         * driver.cs (Main): Fix message when there are warnings.
4297
4298 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4299
4300         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4301
4302 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4303
4304         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4305         Reduced number of warnings.
4306         
4307         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4308
4309 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4310
4311         * driver.cs: Removed message.
4312
4313         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4314
4315 2004-12-08    <vargaz@freemail.hu>
4316
4317         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4318
4319 2004-12-08  Martin Baulig  <martin@ximian.com>
4320
4321         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4322         instead of a CS3002 for properties and indexer.
4323
4324 2004-12-08  Martin Baulig  <martin@ximian.com>
4325
4326         * decl.cs (MemberName.ToString): Make this work again.
4327
4328 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4329
4330         * attribute.cs (Resolve): Add error 591 detection.
4331
4332         * class.cs (FieldMember.Define): Add error 1547 detection.
4333         (Indexer.Define): Add error 620 detection.
4334         (Operator.Define): Add error 590 detection.
4335
4336         * ecore.cs: Missing argument for error 79.
4337
4338         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4339         detection.
4340
4341 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4342
4343         Fix #70106
4344         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4345         only.
4346
4347 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4348
4349         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4350           Some operator comments were suppressed.
4351         * doc.cs : Implicit/explicit operator name in doc comments are like
4352           "op_Explicit(type)~returnType", so added suffix handling.
4353
4354 2005-01-21  Alp Toker  <alp@atoker.com>
4355
4356         * cs-parser.jay: destructor_declaration's container is PartialContainer
4357         not Class when partial types are used, so use Kind prop instead of 'is'.
4358
4359 2004-12-12  Martin Baulig  <martin@ximian.com>
4360
4361         * expression.cs (Unary.TryReduceNegative): Added support for
4362         SByteConstant and ByteConstant.
4363         (Unary.Reduce): Check error values from TryReduceNegative().
4364
4365 2004-12-11  Martin Baulig  <martin@ximian.com>
4366
4367         * support.cs (ReflectionParameters.ParameterName): If we have a
4368         `gpd', call `ParameterName' on it.
4369
4370         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4371
4372         * pending.cs (PendingImplementation.DefineProxy): Call
4373         DefineParameter() for all of the MethodBuilder's arguments.
4374
4375 2004-12-09  Martin Baulig  <martin@ximian.com>
4376
4377         * doc.cs (DocUtil): Make this a static class.
4378
4379 2004-12-09  Martin Baulig  <martin@ximian.com>
4380
4381         * expression.cs (Invocation.InferType): Moved the type inference
4382         implementation into TypeManager.
4383
4384         * generics.cs (TypeManager): Moved the type inference
4385         implementation here.
4386
4387 2004-12-09  Martin Baulig  <martin@ximian.com>
4388
4389         * typemanager.cs (TypeManager): Make this a partial class.
4390
4391         * generics.cs
4392         (TypeManager): Move the generics part of `TypeManager' here.
4393
4394 2004-12-08  Martin Baulig  <martin@ximian.com>
4395
4396         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4397         instead of a CS3002 for properties and indexer.  Added CS3024
4398         check for generic interfaces.
4399
4400         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4401         instances are not CLS-compliant.
4402
4403 2004-12-08  Martin Baulig  <martin@ximian.com>
4404
4405         * cs-parser.jay
4406         (void_pointer_expression): New rule for `void*', `void**' etc.
4407         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4408
4409 2004-12-08  Martin Baulig  <martin@ximian.com>
4410
4411         * expression.cs (Invocation.InferType): Removed the hack for
4412         MethodCore.MayUnify().  
4413
4414         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4415         this actually work.
4416
4417         * class.cs (MethodCore.MayUnify): Use
4418         TypeManager.MayBecomeEqualGenericTypes().       
4419
4420 2004-12-08  Martin Baulig  <martin@ximian.com>
4421
4422         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4423         parameter, box it.  Fixes #69233.
4424
4425 2004-12-08  Martin Baulig  <martin@ximian.com>
4426
4427         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4428         have the ctor constraint.  Fixes #68326.
4429
4430 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4431
4432         * cs-parser.jay : interface comment was not consumed because of
4433           extra opt_semicolon before doc handling.
4434
4435 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4436
4437         Fix test-327.cs, test-328.cs, and put in early infrastructure
4438         for eventually fixing #52697.
4439         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4440         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4441         from other methods.
4442         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4443         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4444         (VerifyUsing, error246): Update.
4445         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4446         'NamespaceEntry.LookupNamespaceOrType'.
4447
4448 2004-12-07  Martin Baulig  <martin@ximian.com>
4449
4450         * driver.cs: Call it "BETA SOFTWARE" :-)
4451
4452 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4453
4454         Fix crash on cs0657-17.cs.
4455         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4456         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4457         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4458         the case where the NamespaceEntry gets overwritten.
4459
4460 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4461
4462         Fixed #69195, #56821
4463         * ecore.cs (ResolveBoolean): Tiny refactoring.
4464
4465         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4466         of right expression resolving when left is false constant and
4467         operator is LogicalAnd OR true constant and operator is LogicalOr.
4468
4469         * statement.cs (ResolveUnreachable): Always reports warning.
4470
4471 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4472
4473         * class.cs: Distinguish between 1721 and 1722 (just a little help
4474         for the programmer).
4475
4476 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4477
4478         * delegate.cs: Only allow this on new versions of the language. 
4479
4480 2004-12-02  Duncan Mak  <duncan@ximian.com>
4481
4482         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4483         Expression class.
4484         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4485         here as a static method. Take an additional bool out parameter
4486         `must_do_cs1540_check' for signaling to InstanceResolve.
4487         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4488         member field from PropertyExpr class and made it an argument of
4489         the method instead.
4490         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4491         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4492         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4493         and `remove_accessor' as well as InstanceResolve: report CS0122
4494         where applicable.
4495
4496         Fixes #70129.
4497
4498 2004-12-07  Martin Baulig  <martin@ximian.com>
4499
4500         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4501         and CS0692 where appropriate.
4502
4503 2004-12-06  Martin Baulig  <martin@ximian.com>
4504
4505         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4506         IsDuplicateImplementation() and improved it.
4507
4508         * expression.cs (Invocation.InferTypeArguments): Added
4509         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4510         and removed the "ref" modifier from `infered_types'.
4511
4512         * decl.cs (MemberName.ToString): Removed the exception.
4513
4514 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4515
4516         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4517           comments are allowed.
4518
4519 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4520
4521         * delegate.cs: Add checks for subtypes in paramaters and return values
4522         in VerifyMethod () to add support for Covariance/Contravariance
4523         in delegates.
4524         
4525 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4526
4527         * report.cs: Remove extra closing parenthesis.
4528
4529         * convert.cs (Error_CannotImplicitConversion): If the name of the
4530         types are the same, provide some extra information.
4531
4532 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4533
4534         Fix bug #70102
4535         * attribute.cs (Resolve): Improved implementation of params
4536         attribute arguments.
4537
4538         * support.cs (ParameterData): Add HasParams to be faster.
4539
4540 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4541
4542         all things are for /doc support:
4543
4544         * doc.cs: new file that supports XML documentation generation.
4545         * mcs.exe.sources: added doc.cs.
4546         * driver.cs:
4547           Handle /doc command line option.
4548           Report error 2006 instead of 5 for missing file name for /doc.
4549           Generate XML documentation when required, after type resolution.
4550         * cs-tokenizer.cs:
4551           Added support for picking up documentation (/// and /** ... */),
4552           including a new XmlCommentState enumeration.
4553         * cs-parser.jay:
4554           Added lines to fill Documentation element for field, constant,
4555           property, indexer, method, constructor, destructor, operator, event
4556           and class, struct, interface, delegate, enum.
4557           Added lines to warn incorrect comment.
4558         * rootcontext.cs :
4559           Added Documentation field (passed only when /doc was specified).
4560         * decl.cs:
4561           Added DocComment, DocCommentHeader, GenerateDocComment() and
4562           OnGenerateDocComment() and some supporting private members for
4563           /doc feature to MemberCore.
4564         * class.cs:
4565           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4566         * delegate.cs:
4567           Added overriden DocCommentHeader.
4568         * enum.cs:
4569           Added overriden DocCommentHeader and GenerateDocComment().
4570
4571 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4572
4573         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4574         unwrapping the enumeration values, chain to
4575         DoConstantNumericPromotions again, so we can promote things to the
4576         fundamental types (takes care of enums that are bytes, sbytes).
4577
4578         Fixes bug #62054.
4579
4580 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4581
4582         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4583         Fix long-standing bug in type-lookup.  Use FindType instead of
4584         LookupType when ec.ResolvingTypeTree.
4585         (Attribute.ResolveType, Attribute.Resolve)
4586         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4587         Update to changes.
4588         (Attributes.Search): Remove internal version.  Update.
4589         (Attributes.SearchMulti): Update.
4590         (Attributes.GetClsCompliantAttribute): Remove.
4591         (Attributes.GetIndexerNameAttribute): Remove.
4592         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4593         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4594         * class.cs (Indexer.Define): Likewise.
4595
4596 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4597
4598         Fix bug #68790
4599         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4600         MarshallByReference members access.
4601
4602         * expression.cs: Use CheckMarshallByRefAccess;
4603         Better error CS0197 message.
4604
4605         * report.cs: Print whole related error message.
4606
4607 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4608
4609         * class (GetClassBases): Better error 60 report.
4610         (EventProperty): Disabled warning 67 detection.
4611
4612 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4613
4614         Fix bug #60324
4615         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4616
4617         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4618         precise values.
4619
4620 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4621
4622         Fix bug #49488
4623         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4624
4625         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4626
4627 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4628
4629         * attribute.cs (Attribute.Resolve): Refine error reporting and
4630         report a cs0117 if the identifier does not exist, to distinguish
4631         from 0617 which is a miss-use of the actual identifier.
4632
4633         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4634         between cs0070 and cs0079.
4635
4636         * class.cs (MemberBase.DoDefine): When reporting a wrong
4637         accessibility level, we use MethodCore to compare instead of
4638         Method (this was a regression in some refactoring effort).
4639
4640         So now we correctly report cs0056 again.
4641
4642         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4643         testing the target_type (which was known to be object_type) and
4644         not the source type (which is anonymous_method).
4645
4646         Fixed reporting of error cs1660.
4647
4648         * expression.cs (UserCast.Source): Expose the underlying cast.
4649
4650         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4651         allowed types to find a match to int32 first (most common).
4652
4653         In addition, it ignores any ImplicitUserConversions that did an
4654         internal implicit conversion (as the switch statement allows only
4655         one integral conversion to exist).
4656
4657         * class.cs (PartialContainer.Create): rename `name' to
4658         `member_name' for clarity.  Then replace the string calls with a
4659         call to MemberName.GetPartialName, as now using
4660         MemberName.ToString is an error (this is due to the side effects
4661         it had, that were fixed in the past).
4662
4663         This will restore the error reporting on a number of partial class
4664         errors that were missusing this (and getting an exception as a
4665         results, which is now just a plain textual warning, because
4666         yyparse debug output would crash otherwise).
4667
4668 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4669
4670         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4671
4672 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4673
4674         * rootcontext.cs (LookupType): Make sure to cache lookups that
4675         don't give us a negative result. This saves about 5% of corlib
4676         compilation time.
4677
4678 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4679
4680         * report.cs (AbstractMessage.Print): messages are sent to stderr
4681
4682         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4683         non-interface in the list of interfaces (at this point, either
4684         parent was properly set, or a base class is being listed in the
4685         interfaces section).
4686
4687         This flags error 1722, and resolves the crash from bug 69259.
4688
4689 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4690
4691         * statement.cs (Using.EmitExpressionFinally): make this work right
4692         for valuetypes. Fixes 69926.
4693
4694 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4695
4696         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4697         converted to an enum" here, before we try to change the underlying
4698         type.  This code exists, but it is a different code path than the
4699         one used while encoding constants.
4700
4701         (ImplicitReferenceConversionExists): In addition, resynchronized
4702         the code here, so it matches the same code in
4703         ImplicitReferenceConversionExists for the `from any class-type S
4704         to any interface-type T'.       
4705
4706 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4707
4708         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4709
4710 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4711
4712         * cs-parser.jay: Use verbosity accordingly. 
4713
4714 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4715
4716         * expression.cs (Unary.ResolveOperator): Do not report warning;
4717         AddressOf reads from variable.
4718         
4719         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4720
4721 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4722
4723         Fix bug #69462
4724
4725         * attribute.cs (Attributable): Removed CheckTargets.
4726         (Attributes.Emit): Explicit attribute targets are tested here.
4727
4728         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4729         not enabled for interfaces.
4730
4731         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4732         (GetAssemblyName): Ouch next bug there.
4733
4734 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4735
4736         * expression.cs: Error 275 added.
4737         
4738 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4739
4740         Fix bug #69177 (Implemented decimal constant support)
4741
4742         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4743         (BinaryFold): Add DecimalConstant.
4744
4745         * const.cs (Define): Decimal constant 
4746         (is not constant.
4747         (ChangeType): Add decimal type handling.
4748         (LookupConstantValue): Don't set value for decimal type but
4749         emit DecimalConstantAttribute. Needed for constant optimization.
4750
4751         * constant.cs (ToDecimal): New method.
4752         (ConvertToDecimal): New method.
4753         (IntConstant): Implemented ConvertToDecimal.
4754         (DecimalConstant.Emit): Emit optimized version for decimals in
4755         int range.
4756
4757         * expression.cs (ResolveOperator): Changed order of constant
4758         reduction to work correctly with native types which have
4759         overloaded operators.
4760         (ResolveMemberAccess): Extract constant value from attribute
4761         for decimal type.
4762
4763         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4764
4765         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4766         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4767         (ChangeType): Decimal is special.
4768         (TypeToCoreType): Add decimal type.
4769
4770 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4771
4772         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4773         decimal types.
4774
4775 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4776
4777         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4778         test cs1667-5.cs.
4779
4780 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4781
4782         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4783
4784         * pending.cs (PendingImplementation): Grab only interfaces.
4785
4786 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4787
4788         * statement.cs (ForeachHelperMethods): Add location member and
4789         error 202 detection.
4790
4791 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * expression.cs (DoResolveBase): Fixed wrong warning for out
4794         variables.
4795
4796 2004-12-04  Martin Baulig  <martin@ximian.com>
4797
4798         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4799         to check whether the conversion is ok.
4800
4801         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4802         `Type.EmptyTypes' if we're not a generic TypeContainer.
4803
4804 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4805
4806         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4807         old bug: when converting from the null literal to a pointer,
4808         return an EmptyCast, not the NullLiteral.
4809
4810         This fixes #69921, the recent null_type changes probably made this
4811         bug more prominent.
4812
4813 2004-12-03  Martin Baulig  <martin@ximian.com>
4814
4815         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4816         method as our child, call AnonymousMethod.Compatible() on it.
4817
4818 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4819
4820         * class.cs (FieldBase): Use an unused bit field from the field to
4821         encode the `has_offset' property from the FieldMember.  This saves
4822         a couple of Ks on bootstrap compilation.
4823
4824         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4825         method as our child, return the AnonymousMethod resolved
4826         expression.
4827
4828         * expression.cs (New.DoResolve): Allow return values from
4829         NewDelegate to also include AnonymousMethods.
4830
4831         Fixes #70150.
4832
4833 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4834
4835         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4836         cs1648 report.
4837         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4838         System.Runtime.InteropServices._Exception, since it's a base
4839         interface of the core type System.Exception in the net_2_0 profile.
4840
4841 2004-11-27  Martin Baulig  <martin@ximian.com>
4842
4843         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4844
4845 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4846
4847         * Makefile: Convert to use executable.make.
4848         * gmcs.exe.sources: New.
4849
4850 2004-11-25  Martin Baulig  <martin@ximian.com>
4851
4852         * expression.cs (Invocation.InferType): Added support for byref types.
4853
4854 2004-11-25  Martin Baulig  <martin@ximian.com>
4855
4856         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4857         in TypeManager.TypeToCoreType().
4858
4859 2004-11-25  Martin Baulig  <martin@ximian.com>
4860
4861         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4862         "Dispose" method from the `current_type'.
4863         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4864         DoDefineMembers() instead of using the MethodBuilder; this is
4865         required for generic iterators.
4866
4867         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4868
4869 2004-11-24  Martin Baulig  <martin@ximian.com>
4870
4871         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4872
4873 2004-11-20  Martin Baulig  <martin@ximian.com>
4874
4875         * expression.cs (Invocation.InferType): Correctly infer generic
4876         instances; see gen-103.cs.
4877         (Invocation.InferTypeArguments): If a generic method doesn't have
4878         any unbound type parameters, we don't need to infer anything.
4879
4880 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4881
4882         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4883
4884 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4885
4886         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4887         (TypeHandle.GetMemberCache): New.
4888         (TypeHandle.TypeHandle): Update.
4889         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4890         (TypeManager.LookupParentInterfacesCache):
4891         Rename from LookupInterfaceCache.  Optimize slightly.
4892         (TypeManager.MemberLookup_FindMembers): Update.
4893         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4894         multi-type variant.
4895         (AddCacheContents): Rename from AddHashtable.
4896         * class.cs (TypeContainer.parent_container): Remove.
4897         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4898         (TypeContainer.DoDefineMembers): Don't initialize it.
4899         Update to name changes.
4900         
4901 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4902
4903         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4904         that factors the code to check access modifiers on override.  
4905
4906         (PropertyBase): Use the code here.
4907
4908         Patch from Lluis S'anchez, fixes bug #69361.
4909
4910 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4911
4912         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4913         routine that is used to report the use of a captured variable
4914         whose address has been taken.
4915
4916         There are two checks: one when variables are being captured and
4917         the other check is when the address of a variable is taken. 
4918         
4919         (because an anonymous methods might be resolved before *or* after
4920         the address has been taken) and 
4921
4922         * expression.cs (Conditional.DoResolve): Remove the special
4923         casing that Martin added to trueExpr and falseExpr being both
4924         NullLiteral.  We get the right behavior now just by introducing
4925         the null_type into the compiler. 
4926
4927         * convert.cs (ExplicitConversion): Change the code to use
4928         null_type instead of testing `expr is NullLiteral'.
4929         (ImplicitConversionStandard): use null_type too.
4930         (ImplicitReferenceConversionExists): use null_type too.
4931         (ImplicitReferenceConversion): use null_type too.
4932
4933         * literal.cs: The type of `NullLiteral' is now null_type instead
4934         of object_type. 
4935         (Resolve): Set the type here.
4936
4937         * typemanager.cs: Introduce null_type.
4938
4939 2004-11-18  Martin Baulig  <martin@ximian.com>
4940
4941         * rootcontext.cs
4942         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4943
4944 2004-11-18  Martin Baulig  <martin@ximian.com>
4945
4946         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4947
4948 2004-11-18  Martin Baulig  <martin@ximian.com>
4949
4950         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4951         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4952         call ResolveConstructedType() on it to resolve it without checking
4953         constraints.
4954         (Constraints.ResolveTypes): Check them here.
4955         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4956         but don't check constraints.
4957         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4958         check constraints here.
4959         (ConstructedType.ResolveConstructedType): New public method.  This
4960         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4961         resolve ourselves without checking constraints.
4962
4963         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4964
4965 2004-11-18  Martin Baulig  <martin@ximian.com>
4966
4967         * decl.cs
4968         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4969
4970         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4971
4972 2004-11-18  Martin Baulig  <martin@ximian.com>
4973
4974         * ecore.cs (TypeExpr.ResolveType): Removed.
4975         (Expression.ResolveAsTypeTerminal): We always return a fully
4976         resolved `TypeExpr', so we can just access its `Type'.
4977
4978         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4979
4980 2004-11-17  Martin Baulig  <martin@ximian.com>
4981
4982         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4983         sure we don't return any unresolved TypeExpr's.
4984         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4985         a `TypeExpr'.
4986         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4987
4988         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4989         unresolved `ConstructedType's.
4990
4991 2004-11-17  Martin Baulig  <martin@ximian.com>
4992
4993         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4994
4995 2004-11-17  Martin Baulig  <martin@ximian.com>
4996
4997         * ecore.cs
4998         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4999
5000         * decl.cs (DeclSpace.ResolveType): Removed.
5001         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5002
5003 2004-11-17  Martin Baulig  <martin@ximian.com>
5004
5005         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5006         direction, like FindMembers() does.  Fixes #69546, testcase is in
5007         test-315.cs.    
5008
5009 2004-11-16  Martin Baulig  <martin@ximian.com>
5010
5011         This is based on a patch from Marek Safar, see bug #69082.
5012         Fixes bugs #63705 and #67130.
5013
5014         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5015         method; create a MemberCache for an interface type and cache the
5016         result.
5017
5018         * decl.cs (IMemberContainer.ParentContainer): Removed.
5019         (IMemberContainer.ParentCache): New property.
5020         (MemberCache.SetupCacheForInterface): Removed.
5021         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5022         to create a cache for an interface's "parent".
5023
5024         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5025         interfaces too.
5026
5027 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
5028
5029         * statement.cs: Avoid adding bools to a hashtable.
5030
5031 2004-11-15  Martin Baulig  <martin@ximian.com>
5032
5033         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5034
5035 2004-11-11  Martin Baulig  <martin@ximian.com>
5036
5037         * typemanager.cs (TypeManager.GetMethodName): New method.
5038
5039         * class.cs (MethodData.Define): Include the generic arity in the
5040         name of an explicit interface; also add it to the method name.
5041
5042         * pending.cs (PendingImplementation.InterfaceMethod): The method
5043         name now includes the generic arity.
5044
5045 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
5046
5047         * expression.cs (Invocation.OverloadResolve): Flag error if we are
5048         calling an unsafe method from a safe location.
5049
5050 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
5051
5052         Fix #69167
5053         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5054
5055 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
5056
5057         * namespace.cs (VerifyUsing): use GetPartialName instead of
5058         ToString. 
5059
5060 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
5061
5062         * statement.cs (Return.Resolve): Fix regression in typo: if
5063         `in_exc', we have to request a NeedReturnLabel, this was a typo
5064         introduced in the anonymous method check-in.  Fixes #69131.
5065
5066         * Indexers were using the ShortName when defining themselves,
5067         causing a regression in the compiler bootstrap when applying the
5068         patch from 2004-11-02 (first part), now they use their full name
5069         and the bug is gone.
5070
5071 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
5072
5073         * driver.cs: Strip the path from the names of embedded resources. Fixes
5074         #68519.
5075
5076 2004-11-04  Raja R Harinath  <rharinath@novell.com>
5077
5078         Fix error message regression: cs0104-2.cs.
5079         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5080         (AliasEntry.Resolve): Update.
5081         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
5082         'silent' flag.
5083         (RootContext.LookupType): Update.
5084
5085 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5086
5087         * cs-parser.jay: Add support for handling accessor modifiers
5088         * class: Add support port accessor modifiers and error checking,
5089         define PropertyMethod.Define as virtual (not abstract anymore)
5090         * ecore.cs: Add checking for proeprties access with access modifiers
5091         * iterators.cs: Modify Accessor constructor call based in the modified
5092         constructor
5093 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5094
5095         * expression.cs (StringConcat): Handle being called twice,
5096         as when we have a concat in a field init with more than two
5097         ctors in the class
5098
5099 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5100
5101         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5102         special case explicit implementations, we should always produce
5103         the .property or .event declaration.
5104         
5105         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5106         since it will not return correct data if people use this
5107         unresolved in the presence of using statements (see test-313).
5108
5109         * class.cs (MethodData.Define): If we are an explicit interface
5110         implementation, set the method name to the full name of the
5111         interface plus the name of the method.  
5112
5113         Notice that using the method.MethodName.GetFullName() does not
5114         work, as it will only contain the name as declared on the source
5115         file (it can be a shorthand in the presence of using statements)
5116         and not the fully qualifed type name, for example:
5117
5118         using System;
5119
5120         class D : ICloneable {
5121                 object ICloneable.Clone ()  {
5122                 }
5123         }
5124
5125         Would produce a method called `ICloneable.Clone' instead of
5126         `System.ICloneable.Clone'.
5127
5128         * namespace.cs (Alias.Resolve): Use GetPartialName.
5129         
5130 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5131
5132         * cs-parser.jay: Add error 1055 report.
5133
5134 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5135
5136         * assign.cs (Assign.DoResolve): Only do the transform of
5137         assignment into a New if the types are compatible, if not, fall
5138         through and let the implicit code deal with the errors and with
5139         the necessary conversions. 
5140
5141 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5142
5143         * cs-parser.jay: Add error 1031 report.
5144
5145         * cs-tokenizer.cs: Add location for error 1038.
5146
5147 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5148
5149         * cs-parser.jay: Add error 1016 report.
5150
5151 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5152
5153         * cs-parser.jay: Add errors 1575,1611 report.
5154
5155 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5156
5157         * cs-parser.jay: Add error 1001 report.
5158
5159 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5160
5161         Fix #68850
5162         * attribute.cs (GetMarshal): Add method argument for
5163         caller identification.
5164
5165         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5166         agument for GetMarshal and RuntimeMissingSupport.
5167
5168 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5169
5170         * attribute.cs (ExtractSecurityPermissionSet): Removed
5171         TypeManager.code_access_permission_type.
5172
5173         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5174
5175 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5176
5177         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5178         for obsolete use of a variable here.   Fixes regression on errors
5179         cs0619-25 and cs0619-26.
5180
5181 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5182
5183         Fix #62358, implemented security attribute encoding.
5184
5185         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5186         Tests permitted SecurityAction for assembly or other types.
5187         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5188         data from SecurityPermissionAttribute to PermisionSet class.
5189
5190         * class.cs (ApplyAttributeBuilder): Added special handling
5191         for System.Security.Permissions.SecurityAttribute based types.
5192
5193         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5194         special handling for System.Security.Permissions.SecurityAttribute
5195         based types.
5196
5197         * enum.cs (ApplyAttributeBuilder): Added special handling
5198         for System.Security.Permissions.SecurityAttribute based types.
5199
5200         * parameter.cs (ApplyAttributeBuilder): Added special handling
5201         for System.Security.Permissions.SecurityAttribute based types.
5202
5203         * rootcontext.cs: Next 2 core types.
5204
5205         * typemanager.cs (TypeManager.security_permission_attr_type):
5206         Built in type for the SecurityPermission Attribute.
5207         (code_access_permission_type): Build in type.
5208
5209 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5210
5211         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5212         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5213         all of this information into
5214         EmitContext.EmitCapturedVariableInstance.
5215         
5216         * codegen.cs (EmitCapturedVariableInstance): move here the
5217         funcionality of emitting an ldarg.0 in the presence of a
5218         remapping.   This centralizes the instance emit code.
5219
5220         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5221         then emit a load of this: it means that we have reached the
5222         topmost ScopeInfo: the one that contains the pointer to the
5223         instance of the class hosting the anonymous method.
5224
5225         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5226         captures to the topmost CaptureContext.
5227
5228 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * expression.cs (LocalVariableReference): Move the knowledge about
5231         the iterators into codegen's EmitCapturedVariableInstance.
5232
5233 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5234
5235         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5236         all code paths return a value from an anonymous method (it is the
5237         same as the 161 error, but for anonymous methods).
5238
5239 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5240
5241         The introduction of anonymous methods in the compiler changed
5242         various ways of doing things in the compiler.  The most
5243         significant one is the hard split between the resolution phase
5244         and the emission phases of the compiler.
5245
5246         For instance, routines that referenced local variables no
5247         longer can safely create temporary variables during the
5248         resolution phase: they must do so from the emission phase,
5249         since the variable might have been "captured", hence access to
5250         it can not be done with the local-variable operations from the runtime.
5251         
5252         * statement.cs 
5253
5254         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5255         is a toplevel block.
5256
5257         (ToplevelBlock): A new kind of Block, these are the blocks that
5258         are created by the parser for all toplevel method bodies.  These
5259         include methods, accessors and anonymous methods.
5260
5261         These contain some extra information not found in regular blocks:
5262         A pointer to an optional CaptureContext (for tracking captured
5263         local variables and parameters).  A pointer to the parent
5264         ToplevelBlock.
5265         
5266         (Return.Resolve): Catch missmatches when returning a value from an
5267         anonymous method (error 1662).
5268         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5269         phase.
5270
5271         (Break.Resolve): ditto.
5272
5273         (SwitchLabel): instead of defining the labels during the
5274         resolution phase, we now turned the public ILLabel and ILLabelCode
5275         labels into methods called GetILLabelCode() and GetILLabel() that
5276         only define the label during the Emit phase.
5277
5278         (GotoCase): Track the SwitchLabel instead of the computed label
5279         (its contained therein).  Emit the code by using
5280         SwitchLabel.GetILLabelCode ().
5281
5282         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5283         whether the Local has been captured or not.
5284
5285         (LocalInfo.IsCaptured): New property, used to tell whether the
5286         local has been captured.
5287         
5288         * anonymous.cs: Vastly updated to contain the anonymous method
5289         support.
5290
5291         The main classes here are: CaptureContext which tracks any
5292         captured information for a toplevel block and ScopeInfo used to
5293         track the activation frames for various local variables.   
5294
5295         Each toplevel block has an optional capture context associated
5296         with it.  When a method contains an anonymous method both the
5297         toplevel method and the anonymous method will create a capture
5298         context.   When variables or parameters are captured, they are
5299         recorded on the CaptureContext that owns them, for example:
5300
5301         void Demo () {
5302              int a;
5303              MyDelegate d = delegate {
5304                  a = 1;
5305              }
5306         }
5307
5308         Here `a' will be recorded as captured on the toplevel
5309         CapturedContext, the inner captured context will not have anything
5310         (it will only have data if local variables or parameters from it
5311         are captured in a nested anonymous method.
5312
5313         The ScopeInfo is used to track the activation frames for local
5314         variables, for example:
5315
5316         for (int i = 0; i < 10; i++)
5317                 for (int j = 0; j < 10; j++){
5318                    MyDelegate d = delegate {
5319                         call (i, j);
5320                    }
5321                 }
5322
5323         At runtime this captures a single captured variable `i', but it
5324         captures 10 different versions of the variable `j'.  The variable
5325         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5326         recorded on a child.  
5327
5328         The toplevel ScopeInfo will also track information like the `this'
5329         pointer if instance variables were referenced (this is necessary
5330         as the anonymous method lives inside a nested class in the host
5331         type of the method). 
5332
5333         (AnonymousMethod): Expanded to track the Toplevel, implement
5334         `AnonymousMethod.Compatible' to tell whether an anonymous method
5335         can be converted to a target delegate type. 
5336
5337         The routine now also produces the anonymous method content
5338
5339         (AnonymousDelegate): A helper class that derives from
5340         DelegateCreation, this is used to generate the code necessary to
5341         produce the delegate for the anonymous method that was created. 
5342
5343         * assign.cs: API adjustments for new changes in
5344         Convert.ImplicitStandardConversionExists.
5345
5346         * class.cs: Adjustments to cope with the fact that now toplevel
5347         blocks are of type `ToplevelBlock'. 
5348
5349         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5350         insteda of standard blocks.
5351
5352         Flag errors if params arguments are passed to anonymous methods.
5353
5354         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5355         `CurrentAnonymousMethod' which points to the current Anonymous
5356         Method.  The variable points to the AnonymousMethod class that
5357         holds the code being compiled.  It is set in the new EmitContext
5358         created for the anonymous method.
5359
5360         (EmitContext.Phase): Introduce a variable and an enumeration to
5361         assist in enforcing some rules about when and where we are allowed
5362         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5363         only one that enfonces this right now).
5364
5365         (EmitContext.HaveCaptureInfo): new helper method that returns
5366         whether we have a CapturedContext initialized.
5367
5368         (EmitContext.CaptureVariable): New method used to register that a
5369         LocalInfo must be flagged for capturing. 
5370
5371         (EmitContext.CapturedParameter): New method used to register that a
5372         parameters must be flagged for capturing. 
5373         
5374         (EmitContext.CapturedField): New method used to register that a
5375         field must be flagged for capturing. 
5376
5377         (EmitContext.HaveCapturedVariables,
5378         EmitContext.HaveCapturedFields): Return whether there are captured
5379         variables or fields. 
5380
5381         (EmitContext.EmitMethodHostInstance): This is used to emit the
5382         instance for the anonymous method.  The instance might be null
5383         (static methods), this (for anonymous methods that capture nothing
5384         and happen to live side-by-side with the current method body) or a
5385         more complicated expression if the method has a CaptureContext.
5386
5387         (EmitContext.EmitTopBlock): Routine that drives the emission of
5388         code: it will first resolve the top block, then emit any metadata
5389         and then emit the code.  The split is done so that we can extract
5390         any anonymous methods and flag any captured variables/parameters.
5391         
5392         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5393         during this phase, the ILGenerator should not be used as labels
5394         and local variables declared here might not be accessible to any
5395         code that is part of an anonymous method.  
5396
5397         Exceptions to this include the temporary variables that are
5398         created by some statements internally for holding temporary
5399         variables. 
5400         
5401         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5402         metadata for a cb
5403
5404         (EmitContext.TemporaryReturn): This method is typically called
5405         from the Emit phase, and its the only place where we allow the
5406         ReturnLabel to be defined other than the EmitMeta.  The reason is
5407         that otherwise we would have to duplicate a lot of logic in the
5408         Resolve phases of various methods that today is on the Emit
5409         phase. 
5410
5411         (EmitContext.NeedReturnLabel): This no longer creates the label,
5412         as the ILGenerator is not valid during the resolve phase.
5413
5414         (EmitContext.EmitThis): Extended the knowledge in this class to
5415         work in anonymous methods in addition to iterators. 
5416
5417         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5418         code is necessary on the stack to access the instance to a local
5419         variable (the variable will be accessed as a field).
5420
5421         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5422         EmitContext.EmitAddressOfParameter): Routines to support
5423         parameters (not completed at this point). 
5424         
5425         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5426         will also remove the parameters.
5427
5428         * convert.cs (Convert): Define a `ConstantEC' which points to a
5429         null.  This is just to prefity some code that uses
5430         ImplicitStandardConversion code and do not have an EmitContext
5431         handy.
5432
5433         The idea is to flag explicitly that at that point in time, it is
5434         known that the conversion will not trigger the delegate checking
5435         code in implicit conversions (which requires a valid
5436         EmitContext). 
5437
5438         Everywhere: pass new EmitContext parameter since
5439         ImplicitStandardConversionExists now requires it to check for
5440         anonymous method conversions. 
5441
5442         (Convert.ImplicitStandardConversionExists): If the type of an
5443         expression is the anonymous_method_type, and the type is a
5444         delegate, we invoke the AnonymousMethod.Compatible method to check
5445         whether an implicit conversion is possible. 
5446
5447         (Convert.ImplicitConversionStandard): Only do implicit method
5448         group conversions if the language level is not ISO_1.
5449
5450         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5451         MethodInfo for the Invoke method.  used by Delegate and
5452         AnonymousDelegate.
5453
5454         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5455         method conversions if the target type is a delegate.
5456
5457         Removed extra debugging nops.
5458
5459         (LocalVariableReference): Turn the `local_info' into a public
5460         field. 
5461
5462         Add `prepared' field, the same hack used for FieldExprs to cope
5463         with composed assignments, as Local variables do not necessarily
5464         operate purely on the stack as they used to: they can be captured
5465         fields. 
5466
5467         Add `temp' for a temporary result, like fields.
5468
5469         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5470
5471         It now copes with Local variables that are captured and emits the
5472         proper instance variable to load it from a field in the captured
5473         case. 
5474
5475         (ParameterReference.DoResolveBase): During the resolve phase,
5476         capture parameters if we are in an anonymous method.
5477
5478         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5479         anonymous method, use the EmitContext helper routines to emit the
5480         parameter reference.
5481
5482         * iterators.cs: Set RemapToProxy to true/false during the
5483         EmitDispose class.
5484
5485         * parameters.cs (GetParameterByName): New helper method. 
5486
5487         * typemanager.cs (anonymous_method_type) a new type that
5488         represents an anonyous method.  This is always an internal type,
5489         used as a fencepost to test against the anonymous-methodness of an
5490         expression. 
5491         
5492 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5493
5494         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5495         561 report.
5496         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5497
5498 2004-11-10  Martin Baulig  <martin@ximian.com>
5499
5500         * expression.cs (Invocation.BetterFunction): If two methods have
5501         equal parameter types, but only one of them is generic, the
5502         non-generic one wins.
5503         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5504         instance; just use `Type.IsValueType' to determine whether
5505         something is a struct or not.
5506         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5507         so we can be called multiple times.
5508
5509 2004-11-10  Martin Baulig  <martin@ximian.com>
5510
5511         * generic.cs (TypeParameter.DefineConstraints): New public method.
5512         (TypeParameter.CheckAccessLevel): Override this and return true.
5513         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5514         override ResolveType() anymore.
5515         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5516
5517 2004-11-10  Martin Baulig  <martin@ximian.com>
5518
5519         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5520         call DeclSpace.ResolveNestedType() on it.
5521
5522 2004-11-10  Martin Baulig  <martin@ximian.com>
5523
5524         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5525         non-null, call ParameterModifier() on it.
5526
5527 2004-11-10  Martin Baulig  <martin@ximian.com>
5528
5529         * iterators.cs
5530         (Iterators): Added `current_type' and `this_type' fields.
5531         (Iterators.DefineIterator): Create a new EmitContext and store it
5532         in `ec'; compute `this_type'.
5533
5534 2004-11-10  Martin Baulig  <martin@ximian.com>
5535
5536         * typemanager.cs
5537         (TypeManager.IsPrivateAccessible): New public method.
5538         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5539
5540 2004-11-10  Martin Baulig  <martin@ximian.com>
5541
5542         * class.cs (TypeContainer.DefineType): Call
5543         TypeBuilder.DefineGenericParameters() before resolving the type
5544         parameters.
5545         (MethodData.parent_method): New protected field.
5546         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5547         (MethodData.Define): Compute `parent_method'.
5548
5549         * decl.cs
5550         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5551         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5552         (DeclSpace.ec): New protected field; store the EmitContext here.
5553         (DeclSpace.EmitContext): New public property.
5554         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5555         (DeclSpace.ResolveNestedType): New public method.
5556         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5557         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5558         (DeclSpace.FamilyAccessible): Likewise.
5559         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5560         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5561         EmitContext.
5562
5563         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5564         field.
5565
5566         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5567         (Enum.Emit): Don't create a new EmitContext.
5568
5569 2004-10-18  Martin Baulig  <martin@ximian.com>
5570
5571         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5572         `Type' directly, but call ResolveType() on it.
5573         (Catch.Resolve): Likewise.
5574         (Foreach.Resolve): Likewise.
5575
5576 2004-10-18  Martin Baulig  <martin@ximian.com>
5577
5578         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5579         `Type' directly, but call ResolveType() on it.
5580         (Probe.DoResolve): Likewise.
5581         (ArrayCreation.LookupType): Likewise.
5582         (TypeOf.DoResolve): Likewise.
5583         (SizeOf.DoResolve): Likewise.
5584
5585 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5586
5587         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5588         the ResolveType.
5589
5590 2004-10-17  John Luke  <john.luke@gmail.com>
5591
5592         * class.cs (Operator.GetSignatureForError): use CSharpName
5593
5594         * parameter.cs (Parameter.GetSignatureForError): Returns
5595         correct name even if was not defined.
5596
5597 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5598
5599         Fix #65816.
5600         * class.cs (TypeContainer.EmitContext): New property.
5601         (DefineNestedTypes): Create an emitcontext for each part.
5602         (MethodCore.DoDefineParameters): Use container's emitcontext.
5603         Pass type array to InternalParameters.
5604         (MemberBase.DoDefine): Use container's emitcontext.
5605         (FieldMember.Define): Likewise.
5606         (Event.Define): Likewise.
5607         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5608         Pass type array to InternalParameters.
5609         (SetIndexerMethod.GetParameterInfo): Likewise.
5610         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5611         * delegate.cs (Define): Pass emitcontext to
5612         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5613         array to InternalParameters.
5614         * expression.cs (ParameterReference.DoResolveBase): Pass
5615         emitcontext to GetParameterInfo.
5616         (ComposedCast.DoResolveAsTypeStep): Remove check on
5617         ec.ResolvingTypeTree.
5618         * parameter.cs (Parameter.Resolve): Change argument to
5619         EmitContext.  Use ResolveAsTypeTerminal.
5620         (Parameter.GetSignature): Change argument to EmitContext.
5621         (Parameters.ComputeSignature): Likewise.
5622         (Parameters.ComputeParameterTypes): Likewise.
5623         (Parameters.GetParameterInfo): Likewise.
5624         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5625         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5626         * support.cs (InternalParameters..ctor): Remove variant that takes
5627         a DeclSpace.
5628         * typemanager.cs (system_intptr_expr): New.
5629         (InitExpressionTypes): Initialize it.
5630
5631 2004-10-12  Chris Toshok  <toshok@ximian.com>
5632
5633         * cs-parser.jay: fix location for try_statement and catch_clause.
5634
5635 2004-10-18  Martin Baulig  <martin@ximian.com>
5636
5637         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5638         `Type' directly, but call ResolveType() on it.
5639         (MemberBase.DoDefine): Likewise.
5640
5641         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5642         `Type' directly, but call ResolveType() on it.
5643         (ComposedCast.DoResolveAsTypeStep): Likewise.
5644
5645         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5646         `Type' directly, but call ResolveType() on it.
5647
5648 2004-10-17  John Luke  <john.luke@gmail.com>
5649
5650         * class.cs (Operator.GetSignatureForError): use CSharpName
5651
5652         * parameter.cs (Parameter.GetSignatureForError): Returns
5653         correct name even if was not defined.
5654
5655 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5656
5657         Fix #65816.
5658         * class.cs (TypeContainer.EmitContext): New property.
5659         (DefineNestedTypes): Create an emitcontext for each part.
5660         (MethodCore.DoDefineParameters): Use container's emitcontext.
5661         Pass type array to InternalParameters.
5662         (MemberBase.DoDefine): Use container's emitcontext.
5663         (FieldMember.Define): Likewise.
5664         (Event.Define): Likewise.
5665         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5666         Pass type array to InternalParameters.
5667         (SetIndexerMethod.GetParameterInfo): Likewise.
5668         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5669         * delegate.cs (Define): Pass emitcontext to
5670         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5671         array to InternalParameters.
5672         * expression.cs (ParameterReference.DoResolveBase): Pass
5673         emitcontext to GetParameterInfo.
5674         (ComposedCast.DoResolveAsTypeStep): Remove check on
5675         ec.ResolvingTypeTree.
5676         * parameter.cs (Parameter.Resolve): Change argument to
5677         EmitContext.  Use ResolveAsTypeTerminal.
5678         (Parameter.GetSignature): Change argument to EmitContext.
5679         (Parameters.ComputeSignature): Likewise.
5680         (Parameters.ComputeParameterTypes): Likewise.
5681         (Parameters.GetParameterInfo): Likewise.
5682         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5683         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5684         * support.cs (InternalParameters..ctor): Remove variant that takes
5685         a DeclSpace.
5686         * typemanager.cs (system_intptr_expr): New.
5687         (InitExpressionTypes): Initialize it.
5688
5689 2004-10-12  Chris Toshok  <toshok@ximian.com>
5690
5691         * cs-parser.jay: fix location for try_statement and catch_clause.
5692
5693 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5694
5695         More DeclSpace.ResolveType avoidance.
5696         * decl.cs (MemberCore.InUnsafe): New property.
5697         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5698         with newly created EmitContext.
5699         (FieldMember.Define): Likewise.
5700         * delegate.cs (Delegate.Define): Likewise.
5701         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5702         only if normal name-lookup fails.
5703         (TypeExpr.DoResolve): Enable error-checking.
5704         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5705         (SizeOf.DoResolve): Likewise.
5706         (ComposedCast.DoResolveAsTypeStep): Likewise.
5707         (StackAlloc.DoResolve): Likewise.
5708         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5709         (Block.Unsafe): New property.
5710         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5711         (Unsafe): Set 'unsafe' flag of contained block.
5712         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5713         (Fixed.Resolve): Likewise.
5714         (Catch.Resolve): Likewise.
5715         (Using.ResolveLocalVariableDecls): Likewise.
5716         (Foreach.Resolve): Likewise.
5717
5718 2004-10-05  John Luke <john.luke@gmail.com>
5719
5720         * cs-parser.jay: add location to error CS0175
5721
5722 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5723
5724         * ecore.cs (Expression.Constantity): Add support for turning null
5725         into a constant.
5726
5727         * const.cs (Const.Define): Allow constants to be reference types
5728         as long as the value is Null.
5729
5730 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5731
5732         * namespace.cs (NamespaceEntry.Using): No matter which warning
5733         level is set, check if this namespace name has already been added.
5734
5735 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5736
5737         * expression.cs: reftype [!=]= null should always use br[true,false].
5738         # 67410
5739
5740 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5741
5742         Fix #67108
5743         * attribute.cs: Enum conversion moved to 
5744         GetAttributeArgumentExpression to be applied to the all
5745         expressions.
5746
5747 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5748
5749         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5750         * class.c (TypeContainer.DefineType): Flag error if
5751         base types aren't accessible due to access permissions.
5752         * decl.cs (DeclSpace.ResolveType): Move logic to
5753         Expression.ResolveAsTypeTerminal.
5754         (DeclSpace.ResolveTypeExpr): Thin layer over
5755         Expression.ResolveAsTypeTerminal.
5756         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5757         Refactor code into NestedAccess.  Use it.
5758         (DeclSpace.NestedAccess): New.
5759         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5760         argument to silence errors.  Check access permissions.
5761         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5762         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5763         (Cast.DoResolve): Likewise.
5764         (New.DoResolve): Likewise.
5765         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5766         (TypeOf.DoResolve): Likewise.
5767
5768         * expression.cs (Invocation.BetterConversion): Return the Type of
5769         the better conversion.  Implement section 14.4.2.3 more faithfully.
5770         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5771         section 14.4.2.2 explicit.
5772         (Invocation.OverloadResolve): Update.
5773         (Invocation): Remove is_base field.
5774         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5775         (Invocation.Emit): Likewise.
5776
5777 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5778
5779         * cs-parser.jay: Reverted 642 warning fix.
5780
5781 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5782
5783         Fix bug #66615
5784         * decl.cs (FindMemberWithSameName): Indexer can have more than
5785         1 argument.
5786
5787 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5788
5789         * expression.cs (LocalVariableReference.DoResolveLValue):
5790         Do not report warning 219 for out values.
5791         (EmptyExpression.Null): New member to avoid extra allocations.
5792
5793 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5794
5795         * cs-parser.jay: Fix wrong warning 642 report.
5796
5797         * cs-tokenizer.cs (CheckNextToken): New helper;
5798         Inspect next character if is same as expected.
5799
5800 2004-09-23  Martin Baulig  <martin@ximian.com>
5801
5802         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5803         (Convert.ImplicitReferenceConversionExists): Likewise.
5804
5805 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5806
5807         * Makefile (DISTFILES): Comment out a few missing files.
5808
5809 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5810
5811         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5812         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5813         (gmcs.exe): Invoke bootstrap-libs.
5814         (clean-local): Clean the net_2_0_bootstrap profile too.
5815         (PROGRAM_INSTALL_DIR): New.
5816         (install-local): Use it.
5817
5818 2004-10-13  Martin Baulig  <martin@ximian.com>
5819
5820         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5821         (TypeParameter.DefineType): If we're a method type parameter and
5822         that method is overriding something, "inflate" its constraints.
5823
5824 2004-10-12  Martin Baulig  <martin@ximian.com>
5825
5826         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5827         and have type arguments, create and resolve a ConstructedType.
5828
5829 2004-10-12  Martin Baulig  <martin@ximian.com>
5830
5831         * decl.cs (MemberCache.FindMemberToOverride): Use
5832         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5833         to compare the invocationType.
5834
5835         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5836         When comparing two type parameters, only do the signature-only
5837         comparision for method type parameters.
5838
5839 2004-10-11  Martin Baulig  <martin@ximian.com>
5840
5841         * report.cs: Don't make --fatal abort on warnings, we have
5842         -warnaserror for that.
5843
5844 2004-10-11  Martin Baulig  <martin@ximian.com>
5845
5846         * typemanager.cs
5847         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5848         (TypeManager.IsEqual): Call ourself recursively instead of using
5849         Type.IsEqual(). 
5850
5851 2004-10-11  Martin Baulig  <martin@ximian.com>
5852
5853         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5854         on our own type parameters, not on the ones we inherit from a containing
5855         class.
5856
5857         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5858         the comparision.
5859
5860         * generic.cs (TypeParameter.Define): We may only be called once.
5861
5862         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5863         instead of TypeManager.IsEqual().
5864
5865 2004-09-28  Martin Baulig  <martin@ximian.com>
5866
5867         * generic.cs
5868         (GenericConstraints.EffectiveBaseClass): New public property.
5869         (TypeParameter.GenericConstraints): New public property.
5870         (ConstructedType.CheckConstraints): Improved.
5871
5872         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5873         (Convert.TypeParameterConversion): New private method; use this in
5874         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5875         for all conversions related to type parameters.
5876
5877 2004-09-24  Martin Baulig  <martin@ximian.com>
5878
5879         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5880         type parameter conversions for type parameters which are known to
5881         be reference types.
5882
5883 2004-09-24  Martin Baulig  <martin@ximian.com>
5884
5885         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5886         `IsValueType' properties.
5887
5888         * support.cs (ReflectionConstraints): Use
5889         Type.GetGenericParameterConstraints() instead of the old hack.
5890
5891 2004-09-24  Martin Baulig  <martin@ximian.com>
5892
5893         * generic.cs (GenericConstraints): Moved here and made it an
5894         abstract class.
5895
5896         * support.cs (GenericConstraints): Moved to generic.cs.
5897
5898 2004-09-24  Martin Baulig  <martin@ximian.com>
5899
5900         * support.cs
5901         (ReflectionConstraints): Un-nested this class and made it public.
5902
5903         * typemanager.cs
5904         (TypeManager.GetTypeParameterConstraints): New public method.
5905         (TypeManager.HasConstructorConstraint): Use the attributes.
5906
5907 2004-09-24  Martin Baulig  <martin@ximian.com>
5908
5909         * support.cs (GenericConstraints): Replaced `HasConstructor',
5910         `IsReferenceType' and `IsValueType' with `Attributes'.
5911         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5912         method and made the .ctor public.
5913
5914         * generic.cs (Constraints.Attributes): New public property.
5915         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5916         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5917         `IsValueType' -> `HasValueTypeConstraint'.
5918
5919 2004-09-23  Martin Baulig  <martin@ximian.com>
5920
5921         * generic.cs (Constraints): Reflect latest runtime changes.
5922
5923 2004-09-23  Martin Baulig  <martin@ximian.com>
5924
5925         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5926         (Convert.ImplicitReferenceConversionExists): Likewise.
5927
5928 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5929
5930         * class.cs (Operator.Define): Add error 448 and 559 report.
5931         
5932 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5933
5934         * class.cs (MemberBase.IsTypePermitted): New protected
5935         method for checking error CS0610.
5936
5937 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5938
5939         * class.cs (TypeContainer.HasExplicitLayout): New property
5940         Returns whether container has StructLayout attribute set Explicit.
5941         (FieldMember): New abstract class for consts and fields.
5942         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5943         (Field): Reuse FieldMember.
5944
5945         * const.cs (Const): Reuse FieldMember.
5946
5947         * rootcontext.cs: EmitConstants call moved to class.
5948
5949 2004-09-22  Martin Baulig  <martin@ximian.com>
5950
5951         Marek and me just fixed one of our oldest bugs: #28562 :-)
5952
5953         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5954
5955         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5956         we're an EnumConstant, just return that.
5957         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5958         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5959         to get the value which'll actually be written into the attribute.
5960         However, we have to use GetValue() to access the attribute's value
5961         in the compiler.        
5962
5963 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5964
5965         * constant.cs (Constant.IsNegative): New abstract property
5966         IsNegative.
5967
5968         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5969         (StackAlloc.DoResolve): Reused IsNegative.
5970
5971 2004-09-22  Martin Baulig  <martin@ximian.com>
5972
5973         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5974         public method; like LookupTypeContainer, but also works for
5975         generic instances.
5976
5977         * report.cs (Report.SymbolRelatedToPreviousError): Use
5978         TypeManager.LookupGenericTypeContainer().       
5979
5980 2004-09-22  Martin Baulig  <martin@ximian.com>
5981
5982         Thanks to Peter Sestoft for this bug report.
5983
5984         * expression.cs (Conditional): If both the `trueExpr' and the
5985         `falseExpr' is a NullLiteral, return a NullLiteral.
5986
5987 2004-09-22  Martin Baulig  <martin@ximian.com>
5988
5989         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5990         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5991         for the "get_Current" call.
5992
5993 2004-09-21  Martin Baulig  <martin@ximian.com>
5994
5995         * convert.cs (Convert.ImplicitReferenceConversion): When
5996         converting to an interface type, first check whether we're
5997         converting from a reference type.
5998
5999 2004-09-14  Martin Baulig  <martin@ximian.com>
6000
6001         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6002
6003 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6004
6005         Fixed bug #61902
6006         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6007         called and is obsolete then this member suppress message
6008         when call is inside next [Obsolete] method or type.
6009
6010         * expression.cs: Use TestObsoleteMethodUsage member.
6011
6012 2004-09-14  Martin Baulig  <martin@ximian.com>
6013
6014         * genericparser.cs: Removed.
6015
6016 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6017
6018         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6019
6020 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6021
6022         * attribute.cs (Attribute.Resolve): Add error 653 report.
6023
6024         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6025         report.
6026         (Method.ApplyAttributeBuilder): Add error 685 report.
6027         (Operator.Define): Add error 564 report.
6028
6029         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6030
6031         * expression.cs (Invocation.DoResolve): Add error
6032         245 and 250 report.
6033
6034         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6035         error 674 report.
6036
6037 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6038
6039         * class.cs (ConstructorInitializer.Resolve):
6040         Wrong error number (515->516).
6041
6042 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6043
6044         * class.cs (Indexer.Define): Add error 631 report.
6045
6046 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6047
6048         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6049
6050 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6051
6052         * expression.cs (Probe.DoResolve): Add error CS0241 report.
6053
6054 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * cs-parser.jay: Added error CS0241 report.
6057
6058 2004-09-10  Raja R Harinath  <rharinath@novell.com>
6059
6060         * cs-parser.jay (fixed_statement): Introduce a scope for the
6061         declaration in the 'fixed' statement.
6062
6063 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6064
6065         * cs-parser.jay: Added CS0230 error report.
6066
6067 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6068
6069         * cs-parser.jay: Added errors CS0231 and CS0257 report.
6070
6071 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6072
6073         * expression.cs (Argument.Resolve): Added error CS0192 and
6074         CS0199 report.
6075
6076 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6077
6078         C# 2.0 #pragma warning feature
6079
6080         * cs-tokenizer.cs (PreProcessPragma): New method; 
6081         Handles #pragma directive.
6082
6083         * report.cs (WarningRegions): New class; Support
6084         class for #pragma warning directive. It tests whether
6085         warning is enabled for a given line.
6086
6087 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
6088
6089         * const.cs: Add more descriptive error report, tahnks to
6090         Sebastien. 
6091
6092 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6093
6094         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6095
6096 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
6097
6098         * expression.cs: Apply patch from Ben: Remove dead code from
6099         ArrayCreation, and remove the TurnintoConstant call in const.cs,
6100         as that code just threw an exception anwyays.
6101
6102         * const.cs: Remove the call to the turnintoconstant, for details
6103         see bug: #63144
6104         
6105         * literal.cs: The type of the null-literal is the null type;  So
6106         we use a placeholder type (literal.cs:System.Null, defined here)
6107         for it.
6108
6109         * expression.cs (Conditional.DoResolve): Remove some old code that
6110         is no longer needed, conversions have been fixed.
6111
6112         (ArrayCreationExpression.DoResolve): Return false if we fail to
6113         resolve the inner expression.
6114
6115 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6116
6117         Fix test-290.cs.
6118         * cs-parser.jay (delegate_declaration): Record a delegate
6119         declaration as a type declaration.
6120         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6121
6122 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6123
6124         * parameter.cs: Do not crash if the type can not be resolved. 
6125
6126         * expression.cs: Report errors with unsafe pointers, fixes #64896
6127
6128 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6129
6130         * expression.cs: Pointer arith always needs to do a conv.i
6131         if the operand is a long. fix 65320
6132
6133 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6134
6135         Fixed cs0619-37.cs, cs0619-38.cs
6136
6137         * enum.cs (GetObsoleteAttribute): Removed.
6138
6139         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6140         on Enum member is double staged. The first is tested member
6141         and then enum.
6142
6143 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6144
6145         Fixed #56986, #63631, #65231
6146
6147         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6148         adds member to name container.
6149         (TypeContainer.AddToTypeContainer): New method, adds type to
6150         name container.
6151         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6152         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6153         AddOperator): Simplified by reusing AddToMemberContainer.
6154         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6155         instead of field.
6156         (Method.CheckForDuplications): Fixed implementation to test all
6157         possibilities.
6158         (MemberBase): Detection whether member is explicit interface
6159         implementation is now in constructor.
6160         (MemberBase.UpdateMemberName): Handles IndexerName.
6161         (Accessor): Changed to keep also location information.
6162         (AbstractPropertyEventMethod): Is derived from MemberCore.
6163         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6164         will be emited or not.
6165         (PropertyBase.AreAccessorsDuplicateImplementation):
6166         Tests whether accessors are not in collision with some method.
6167         (Operator): Is derived from MethodCore to simplify common
6168         operations.
6169
6170         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6171         must be performed.
6172         (DeclSpace.AddToContainer): Adds the member to defined_names
6173         table. It tests for duplications and enclosing name conflicts.
6174
6175         * enum.cs (EnumMember): Clean up to reuse the base structures
6176
6177 2004-09-03  Martin Baulig  <martin@ximian.com>
6178
6179         Merged latest changes into gmcs.  Please keep this comment in
6180         here, it makes it easier for me to see what changed in MCS since
6181         the last time I merged.
6182
6183 2004-09-03  Martin Baulig  <martin@ximian.com>
6184
6185         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6186         into TypeContainer, to make partial classes work again.
6187
6188 2004-09-03  Martin Baulig  <martin@ximian.com>
6189
6190         * rootcontext.cs (RootContext.V2): Removed.
6191
6192 2004-03-23  Martin Baulig  <martin@ximian.com>
6193
6194         * expression.cs (Invocation.OverloadResolve): Added `bool
6195         may_fail' argument and use it instead of the Location.IsNull() hack.
6196
6197 2004-09-09  Martin Baulig  <martin@ximian.com>
6198
6199         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6200
6201 2004-09-09  Martin Baulig  <martin@ximian.com>
6202
6203         * generic.cs (TypeParameter.DefineType): Added support for
6204         explicit interface methods.
6205
6206 2004-09-09  Martin Baulig  <martin@ximian.com>
6207
6208         * README.Changes: New document.  Started to list important changes
6209         between MCS and GMCS here.
6210
6211 2004-09-08  Martin Baulig  <martin@ximian.com>
6212
6213         * class.cs
6214         (TypeContainer.CheckRecursiveDefinition): New protected method.
6215         (TypeContainer.DefineType): Move the CS0146 check into
6216         CheckRecursiveDefinition().     
6217
6218 2004-09-06  Martin Baulig  <martin@ximian.com>
6219
6220         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6221         types for the constructor constraint.
6222
6223 2004-09-03  Martin Baulig  <martin@ximian.com>
6224
6225         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6226         into TypeContainer, to make partial classes work again.
6227
6228 2004-09-03  Martin Baulig  <martin@ximian.com>
6229
6230         * rootcontext.cs (RootContext.V2): Removed.
6231
6232 2004-03-23  Martin Baulig  <martin@ximian.com>
6233
6234         * expression.cs (Invocation.OverloadResolve): Added `bool
6235         may_fail' argument and use it instead of the Location.IsNull() hack.
6236
6237 2004-09-03  Martin Baulig  <martin@ximian.com>
6238
6239         Merged latest changes into gmcs.  Please keep this comment in
6240         here, it makes it easier for me to see what changed in MCS since
6241         the last time I merged.
6242
6243 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6244
6245         Fix #61128.
6246         * expression.cs (BetterConversion): Don't allow either conversion 
6247         to be null.  Remove redundant implicit conversion test when 'q ==
6248         null' -- when this function is invoked, we already know that the
6249         implicit conversion exists.
6250         (BetterFunction): Assume that 'best' is non-null.  Remove
6251         redundant reimplementation of IsApplicable when 'best' is null.
6252         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6253         number of arguments.
6254         (IsAncestralType): Extract from OverloadResolve.
6255         (OverloadResolve): Make robust to the MethodGroupExpr being
6256         unsorted.  Implement all the logic of Section 14.5.5.1, and
6257         support overloading of methods from multiple applicable types.
6258         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6259
6260         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6261         (RealError, Warning): Append type of report to related symbol.
6262
6263 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6264
6265         * enum.cs: Fixed CLS-Compliance checks for enum members.
6266         Error tests cs3008-8.cs, cs3014-8.cs
6267
6268 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6269
6270         Fixed bug #62342, #63102
6271         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6272         like ImplementMethod.
6273
6274 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6275
6276         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6277         Fixed bug #65170.
6278
6279 2004-09-02  Martin Baulig  <martin@ximian.com>
6280
6281         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6282         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6283         on the MethodBase.
6284
6285 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6286
6287         C# 2.0 Static classes implemented
6288
6289         * class.cs (TypeContainer): instance_constructors,
6290         initialized_fields, initialized_static_fields,
6291         default_constructor, base_inteface_types are protected to be
6292         accessible from StaticClass.
6293         (TypeContainer.DefineDefaultConstructor): New virtual method
6294         for custom default constructor generating
6295         (StaticClass): New class to handle "Static classes" feature.
6296
6297         * cs-parser.jay: Handle static keyword on class like instance
6298         of StaticClass.
6299
6300         * driver.cs: Added "/langversion" command line switch with two
6301         options (iso-1, default).
6302
6303 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6304
6305         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6306
6307 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6308
6309         * delegate.cs: Style.
6310
6311 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6312
6313         * delegate.cs: Add seperate instance expr field for miguel.
6314
6315 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6316
6317         * PointerArithmetic (Resolve): make sure we are not doing
6318         pointer arith on void*. Also, make sure we are resolved
6319         by not setting eclass until resolve.
6320
6321         All callers: Make sure that PointerArithmetic gets resolved.
6322
6323 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6324
6325         * ArrayCreation (LookupType): If the type does not resolve 
6326         to an array, give an error.
6327
6328 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6329
6330         * statement.cs (Try.Resolve): Fixed bug #64222
6331
6332 2004-08-27  Martin Baulig  <martin@ximian.com>
6333
6334         * class.cs
6335         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6336         crash here.     
6337
6338 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6339
6340         * ecore.cs (Constantify): Get underlying type via
6341         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6342         Windows in special cases.
6343
6344 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6345
6346         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6347         for obtaining also private methods.
6348         (GetRemoveMethod): Used GetRemoveMethod (true)
6349         for obtaining also private methods.
6350
6351 2004-09-02  Martin Baulig  <martin@ximian.com>
6352
6353         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6354         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6355         on the MethodBase.
6356
6357 2004-08-27  Martin Baulig  <martin@ximian.com>
6358
6359         * class.cs
6360         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6361         crash here.     
6362
6363 2004-08-25  Martin Baulig  <martin@ximian.com>
6364
6365         * support.cs (ReflectionParameters..ctor): If this is a generic
6366         method, retrieve and store its type parameters.
6367         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6368         (ReflectionParameters.GenericConstraints): The argument specifies
6369         the type parameter, not the method parameter.
6370         (InternalParameters.GenericConstraints): Likewise.
6371
6372         * generic.cs (TypeParameter.DefineType): Correctly handle
6373         constraints wrt. generic methods in interfaces and their
6374         implementations.        
6375
6376 2004-08-24  Martin Baulig  <martin@ximian.com>
6377
6378         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6379         (Constraints.IsSubclassOf): New internal method.
6380
6381         * typemanager.cs (TypeManager.FindMembers): Added special support
6382         for GenericTypeParameterBuilder's.      
6383         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6384         type parameters.
6385
6386 2004-08-24  Martin Baulig  <martin@ximian.com>
6387
6388         * typemanager.cs
6389         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6390         this for accessibility checks.
6391         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6392         IsNestedFamilyAccessible.
6393         (TypeManager.IsSubclassOf): New method, do what the name actually
6394         says.   
6395
6396 2004-08-24  Martin Baulig  <martin@ximian.com>
6397
6398         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6399         as a SimpleName, include the generic arity.
6400
6401 2004-08-24  Martin Baulig  <martin@ximian.com>
6402
6403         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6404         MethodAttributes.HideBySig for operators.
6405
6406 2004-08-23  Martin Baulig  <martin@ximian.com>
6407
6408         Back to the old error reporting system :-)
6409
6410         * report.cs (Message): Removed.
6411         (Report.MessageData, ErrorData, WarningData): Removed.
6412         (Report.Error, Warning): Back to the old system.
6413
6414 2004-08-23  Martin Baulig  <martin@ximian.com>
6415
6416         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6417
6418         * class.cs (TypeContainer.ParentContainer): New public virtual
6419         method; replaces the explicit interface implementation.
6420         (ClassPart.ParentContainer): Override.
6421
6422 2004-08-23  Martin Baulig  <martin@ximian.com>
6423
6424         * statement.cs (Switch): Added support for constant switches; see
6425         #59428 or test-285.cs.
6426
6427 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6428
6429         Fixed bug #62740.
6430         * statement.cs (GetEnumeratorFilter): Removed useless
6431         logic because C# specs is strict. GetEnumerator must be
6432         public.
6433
6434 2004-08-22  Martin Baulig  <martin@ximian.com>
6435
6436         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6437         a switch and may break, reset the barrier.  Fixes #59867.
6438
6439 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6440
6441         CLS-Compliance speed up (~5% for corlib)
6442
6443         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6444         New method. Tests container for CLS-Compliant names
6445
6446         * class.cs (TypeContainer.VerifyClsName): New method.
6447         Checks whether container name is CLS Compliant.
6448         (Constructor): Implements IMethodData.
6449
6450         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6451         low-case table for CLS Compliance test.
6452         (MemberCache.VerifyClsParameterConflict): New method.
6453         Checks method parameters for CS3006 error.
6454
6455         * enum.cs (EnumMember): Is derived from MemberCore.
6456         (Enum.VerifyClsName): Optimized for better performance.
6457
6458 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6459
6460         * report.cs: Renamed Error_T to Error and changed all
6461         references.
6462
6463 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6464
6465         * class.cs (TypeContainer.IndexerArrayList): New inner class
6466         container for indexers.
6467         (TypeContainer.DefaultIndexerName): New constant for default
6468         indexer name. Replaced all "Item" with this constant.
6469         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6470
6471         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6472         DefaultMemberAttribute constructor.
6473
6474 2004-08-05  Martin Baulig  <martin@ximian.com>
6475
6476         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6477         Fix bug #59429.
6478
6479 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6480
6481         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6482         multi platforms problem.
6483
6484         * compiler.csproj: Included shared files.
6485
6486 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6487
6488         Fix bug 60333, 55971 in the more general way
6489         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6490         Added arg_type argument for constant conversion.
6491         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6492
6493 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6494
6495         Fix bug #59760
6496         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6497         OperatorArrayList, MethodCoreArrayList for typecontainer
6498         containers. Changed class member types to these new types.
6499         (MethodArrayList.DefineMembers): Added test for CS0659.
6500
6501 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6502
6503         * cfold.cs: Synchronize the folding with the code in expression.cs
6504         Binary.DoNumericPromotions for uint operands.
6505
6506         * attribute.cs: Revert patch from Raja, it introduced a regression
6507         while building Blam-1.2.1 (hard to isolate a test case).
6508
6509 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6510
6511         Fix for #55382
6512         * class.cs:
6513         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6514         name collision.
6515         (MethodCore.parent_method): New member. The method we're overriding
6516         if this is an override method.
6517         (MethodCore.CheckBase): Moved from Method class and made common.
6518         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6519         private.
6520         (MethodCore.CheckForDuplications): New abstract method. For custom
6521         member duplication search in a container
6522         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6523         method and its return type.
6524         (Event.conflict_symbol): New member. Symbol with same name in the
6525         parent class.
6526
6527         * decl.cs:
6528         (MemberCache.FindMemberWithSameName): New method. The method
6529         is looking for conflict with inherited symbols.
6530
6531 2004-08-04  Martin Baulig  <martin@ximian.com>
6532
6533         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6534
6535         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6536
6537 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6538
6539         * report.cs (Message): New enum for better error, warning reference in
6540         the code.
6541         (MessageData): New inner abstract class. It generally handles printing of
6542         error and warning messages.
6543         Removed unused Error, Warning, Message methods.
6544
6545 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6546
6547         Fix for cs0592-8.cs test
6548         * attribute.cs
6549         (Attributable.ValidAttributeTargets): Made public.
6550         (Attribute.ExplicitTarget): New member for explicit target value.
6551         (Attribute.CheckTargets): Now we translate explicit attribute
6552         target to Target here.
6553
6554 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6555
6556         * ecore.cs (MethodGroupExpr): new IsBase property.
6557
6558         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6559
6560         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6561         rather than an instance expr.
6562
6563         (DelegateCreation.Emit): Use the method group rather than
6564         the instance expression. Also, if you have base.Foo as the
6565         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6566
6567         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6568
6569         (NewDelegate.DoResolve): Only check for the existance of Invoke
6570         if the method is going to be needed. Use MethodGroupExpr.
6571
6572         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6573
6574         * expression.cs: For pointer arith., make sure to use
6575         the size of the type, not the size of the pointer to
6576         the type.
6577
6578 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6579
6580         Fix for #60722
6581         * class.cs (Class): Added error CS0502 test.
6582
6583 2004-08-03  John Luke  <jluke@cfl.rr.com>
6584             Raja R Harinath  <rharinath@novell.com>
6585
6586         Fix for #60997.
6587         * attribute.cs (Attribute.complained_before): New flag.
6588         (Attribute.ResolveType, Attribute.Resolve),
6589         (Attribute.DefinePInvokeMethod): Set it.
6590         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6591         
6592 2004-08-03  Martin Baulig  <martin@ximian.com>
6593
6594         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6595         use a user-defined operator; we still need to do numeric
6596         promotions in case one argument is a builtin type and the other
6597         one has an implicit conversion to that type.  Fixes #62322.
6598
6599 2004-08-18  Martin Baulig  <martin@ximian.com>
6600
6601         * class.cs (Method.Define): Use the correct method name when
6602         creating the MethodBuilder for a generic method.
6603
6604 2004-08-17  Martin Baulig  <martin@ximian.com>
6605
6606         * generic.cs (Constraints): Support type parameter constraints.
6607
6608 2004-08-16  Martin Baulig  <martin@ximian.com>
6609
6610         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6611         (Token.GENERIC_DIMENSION): New token; this is returned if we
6612         encounter an unbound generic type in a typeof() expression.
6613
6614         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6615         this token is only generated while parsing a typeof() expression.
6616         (typeof_expression): Removed the old unbound_type hack.
6617
6618         * generic.cs (TypeArguments.IsUnbound): New public property.
6619
6620         * decl.cs (MemberName): Added support for unbound types.
6621
6622 2004-08-14  Martin Baulig  <martin@ximian.com>
6623
6624         * typemanager.cs
6625         (TypeManager.IsEqualGenericInstance): New static method.
6626         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6627         just used to check accessibility, so follow the rules of 26.1.6.        
6628
6629         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6630         ConstructedType instead of a TypeExpression if we have type arguments.
6631
6632         * cs-parser.jay (typeof_expression): Support unbound generic types.
6633
6634         * ecore.cs (UnboundTypeExpression): New public class.
6635
6636 2004-08-12  Martin Baulig  <martin@ximian.com>
6637
6638         * typemanager.cs (TypeManager.IsNestedChildOf): Use
6639         TypeManager.IsEqual() rather than `=='.
6640
6641         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6642         generic instances as well.
6643
6644 2004-08-12  Martin Baulig  <martin@ximian.com>
6645
6646         * expression.cs (Invocation.InferType): We can only infer method
6647         type parameters.  Fixes #62647.
6648
6649 2004-08-11  Martin Baulig  <martin@ximian.com>
6650
6651         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6652         before resolving the base classes.
6653
6654 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6655
6656         * Makefile: install .mdb file too.
6657
6658 2004-08-05  Martin Baulig  <martin@ximian.com>
6659
6660         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6661         initializer, the current type is just the TypeBuilder, not the
6662         instantiated generic type.
6663         (FieldExpr.IsFieldInitializer): New public property.
6664
6665 2004-08-04  Martin Baulig  <martin@ximian.com>
6666
6667         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6668
6669         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6670
6671 2004-08-03  Martin Baulig  <martin@ximian.com>
6672
6673         * class.cs (MethodData.Define): If we're an explicit
6674         implementation, remove the generic arity from the type name.
6675
6676 2004-08-03  Martin Baulig  <martin@ximian.com>
6677
6678         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6679         use a user-defined operator; we still need to do numeric
6680         promotions in case one argument is a builtin type and the other
6681         one has an implicit conversion to that type.  Fixes #62322.
6682
6683 2004-08-02  Martin Baulig  <martin@ximian.com>
6684
6685         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6686         `TypeExpr[]' array.
6687         (TypeContainer.GetClassBases): Return the unexpanded list of
6688         interfaces; we expand them later.
6689         (TypeContainer.DefineType): After creating the TypeBuilder, call
6690         TypeManager.ExpandInterfaces() to get an expanded and resolved
6691         list of interfaces.
6692
6693         * ecore.cs (TypeExpr.GetInterfaces): Removed
6694
6695         * generics.cs (Constraints.InterfaceConstraints): Remove.
6696         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6697         register the interface constraints.
6698
6699         * typemanager.cs
6700         (TypeManager.AddUserType): Removed the `ifaces' argument.
6701         (TypeManager.AddTypeParameter): Likewise.
6702         (TypeManager.AddUserInterface): Removed, was unused.
6703         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6704         `TypeExpr[]' array for the interfaces.
6705         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6706         has been defined, returns a list of the resolved interfaces types.
6707         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6708         (TypeManager.GetExplicitInterfaces): Likewise.  
6709
6710 2004-08-02  Martin Baulig  <martin@ximian.com>
6711
6712         * expression.cs (Invocation.EmitCall): If we're invoking a method
6713         on a type parameter, use the new `Constrained' prefix opcode.
6714
6715 2004-08-02  Martin Baulig  <martin@ximian.com>
6716
6717         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6718         (LocalInfo.IsThis): New public property.
6719         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6720
6721 2004-08-01  Martin Baulig  <martin@ximian.com>
6722
6723         * class.cs (TypeContainer.GetClassBases): Don't set the default
6724         here since we may get called from GetPartialBases().
6725         (TypeContainer.DefineType): If GetClassBases() didn't return a
6726         parent, use the default one.
6727
6728 2004-07-30  Martin Baulig  <martin@ximian.com>
6729
6730         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6731
6732         * class.cs (SourceMethod): New public class, derive from the
6733         symbol writer's ISourceMethod.
6734         (Method): Use the new symbol writer API.
6735
6736         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6737         as argument and use the new symbol writer.
6738
6739         * location.cs
6740         (SourceFile): Implement the symbol writer's ISourceFile.
6741         (Location.SymbolDocument): Removed.
6742         (Location.SourceFile): New public property.
6743
6744         * symbolwriter.cs: Use the new symbol writer API.
6745
6746 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6747
6748         * Makefile (install-local): Remove.  Functionality moved to
6749         executable.make.
6750
6751 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6752
6753         * Makefile: Install mcs.exe.config file together with mcs.exe.
6754         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6755         correct runtime version.
6756         
6757 2004-07-25  Martin Baulig  <martin@ximian.com>
6758
6759         * class.cs
6760         (TypeContainer.RegisterOrder): Removed, this was unused.
6761         (TypeContainer, interface_order): Removed.
6762         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6763         TypeContainer as argument since we can also be called with a
6764         `PartialContainer' for a partial class/struct/interface.
6765         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6766         of checking whether we're an `Interface' - we could be a
6767         `PartialContainer'.
6768         (PartialContainer.Register): Override; call
6769         AddClass()/AddStruct()/AddInterface() on our parent.
6770
6771         * cs-parser.jay (interface_member_declaration): Add things to the
6772         `current_container', not the `current_class'.
6773
6774         * rootcontext.cs (RegisterOrder): The overloaded version which
6775         takes an `Interface' was unused, removed.
6776
6777         * typemanager.cs (TypeManager.LookupInterface): Return a
6778         `TypeContainer', not an `Interface'.
6779         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6780         contain a `PartialContainer' for an interface, so check it's
6781         `Kind' to figure out what it is.
6782
6783 2004-07-25  Martin Baulig  <martin@ximian.com>
6784
6785         * class.cs (Class.DefaultTypeAttributes): New public constant.
6786         (Struct.DefaultTypeAttributes): Likewise.
6787         (Interface.DefaultTypeAttributes): Likewise.
6788         (PartialContainer.TypeAttr): Override this and add the
6789         DefaultTypeAttributes.
6790
6791 2004-07-25  Martin Baulig  <martin@ximian.com>
6792
6793         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6794         we can just use the `Parent' field instead.
6795
6796 2004-07-25  Martin Baulig  <martin@ximian.com>
6797
6798         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6799
6800 2004-07-25  Martin Baulig  <martin@ximian.com>
6801
6802         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6803         our parts before defining any methods.
6804         (TypeContainer.VerifyImplements): Make this virtual.
6805         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6806         on our PartialContainer.
6807
6808 2004-07-25  Martin Baulig  <martin@ximian.com>
6809
6810         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6811
6812         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6813         argument, we can just use the `Parent' field instead.
6814
6815         * class.cs
6816         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6817         (MemberBase.DoDefine): Likewise.
6818
6819 2004-07-24  Martin Baulig  <martin@ximian.com>
6820
6821         * decl.cs (MemberCore.Parent): New public field.
6822         (DeclSpace.Parent): Moved to MemberCore.
6823
6824         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6825         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6826         parent's .ctor.
6827         (FieldBase, Field, Operator): Likewise.
6828         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6829         (EventField, Event): Likewise.
6830
6831 2004-07-23  Martin Baulig  <martin@ximian.com>
6832
6833         * class.cs (PartialContainer): New public class.
6834         (ClassPart): New public class.
6835         (TypeContainer): Added support for partial classes.
6836         (TypeContainer.GetClassBases): Splitted some of the functionality
6837         out into GetNormalBases() and GetPartialBases().
6838
6839         * cs-tokenizer.cs (Token.PARTIAL): New token.
6840         (Tokenizer.consume_identifier): Added some hacks to recognize
6841         `partial', but only if it's immediately followed by `class',
6842         `struct' or `interface'.
6843
6844         * cs-parser.jay: Added support for partial clases.
6845
6846 2004-07-23  Martin Baulig  <martin@ximian.com>
6847
6848         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6849         a `DeclSpace' and also made it readonly.
6850         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6851         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6852         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6853
6854         * cs-parser.jay: Pass the `current_class', not the
6855         `current_container' (at the moment, this is still the same thing)
6856         to a new Method, Property, Event, Indexer or Constructor.
6857
6858 2004-07-23  Martin Baulig  <martin@ximian.com>
6859
6860         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6861         and removed the `current_interface' one.
6862         (struct_declaration, class_declaration, interface_declaration):
6863         Set `current_class' to the newly created class/struct/interface;
6864         set their `Bases' and call Register() before parsing their body.
6865
6866 2004-07-23  Martin Baulig  <martin@ximian.com>
6867
6868         * class.cs (Kind): New public enum.
6869         (TypeContainer): Made this class abstract.
6870         (TypeContainer.Kind): New public readonly field.
6871         (TypeContainer.CheckDef): New public method; moved here from
6872         cs-parser.jay.
6873         (TypeContainer.Register): New public abstract method.
6874         (TypeContainer.GetPendingImplementations): New public abstract
6875         method.
6876         (TypeContainer.GetClassBases): Removed the `is_class' and
6877         `is_iface' parameters.
6878         (TypeContainer.DefineNestedTypes): Formerly known as
6879         DoDefineType().
6880         (ClassOrStruct): Made this class abstract.
6881
6882         * tree.cs (RootTypes): New public type. 
6883
6884 2004-07-20  Martin Baulig  <martin@ximian.com>
6885
6886         * tree.cs (Tree.RecordNamespace): Removed.
6887         (Tree.Namespaces): Removed.
6888
6889         * rootcontext.cs (RootContext.IsNamespace): Removed.
6890
6891         * cs-parser.jay (namespace_declaration): Just create a new
6892         NamespaceEntry here.
6893
6894 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6895
6896         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6897         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6898         entry to make sure it runs in the correct runtime version.
6899         
6900 2004-07-18  Martin Baulig  <martin@ximian.com>
6901
6902         * generic.cs (ConstructedType.CheckConstraints): Improved
6903         constraints checking.
6904
6905 2004-07-18  Martin Baulig  <martin@ximian.com>
6906
6907         * expression.cs (Invocation.BetterMethod): Call
6908         TypeManager.TypeToCoreType() on all types and removed my previous
6909         hack; we're already doig the right thing here.
6910
6911 2004-07-17  Martin Baulig  <martin@ximian.com>
6912
6913         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6914
6915 2004-07-16  Martin Baulig  <martin@ximian.com>
6916
6917         * iterators.cs: Added generics support.
6918
6919 2004-07-16  Martin Baulig  <martin@ximian.com>
6920
6921         * iterators.cs: Rewrote this.  We're now using one single Proxy
6922         class for both the IEnumerable and the IEnumerator interface and
6923         `Iterator' derives from Class so we can use the high-level API.
6924
6925         * class.cs (TypeContainer.AddIterator): New method.
6926         (TypeContainer.DoDefineType): New protected virtual method, which
6927         is called from DefineType().
6928         (TypeContainer.DoDefineMembers): Call DefineType() and
6929         DefineMembers() on all our iterators.
6930         (TypeContainer.Emit): Call Emit() on all our iterators.
6931         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6932
6933         * codegen.cs (EmitContext.CurrentIterator): New public field.
6934
6935 2004-07-15  Martin Baulig  <martin@ximian.com>
6936
6937         * typemanager.cs
6938         (TypeManager.not_supported_exception_type): New type.   
6939
6940 2004-07-14  Martin Baulig  <martin@ximian.com>
6941
6942         * typemanager.cs
6943         (TypeManager.generic_ienumerable_type): New type.
6944         (TypeManager.generic_ienumerator_type): New type.
6945
6946         * rootcontext.cs
6947         (RootContext.interfaces_first_stage): Added
6948         "System.Collections.Generic.IEnumerator`1" and
6949         "System.Collections.Generic.IEnumerable`1".     
6950
6951 2004-07-14  Martin Baulig  <martin@ximian.com>
6952
6953         * iterators.cs: Use real error numbers.
6954
6955 2004-07-14  Martin Baulig  <martin@ximian.com>
6956
6957         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6958         requires this to be a System.Collection.IEnumerable and not a
6959         class implementing that interface.
6960         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6961
6962 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6963
6964         * class.cs: Fixed previous fix, it broke some error tests.
6965
6966 2004-07-12  Martin Baulig  <martin@ximian.com>
6967
6968         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6969         Fixes #61293.
6970
6971 2004-07-14  Martin Baulig  <martin@ximian.com>
6972
6973         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6974         an exclamation mark (!) for the generic arity to reflect the
6975         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6976
6977 2004-07-13  Martin Baulig  <martin@ximian.com>
6978
6979         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6980         specifiers being part of a type argument.
6981
6982 2004-07-13  Martin Baulig  <martin@ximian.com>
6983
6984         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6985         name for generic types.
6986
6987 2004-07-13  Martin Baulig  <martin@ximian.com>
6988
6989         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6990         bit to fix #60119.
6991
6992 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6993
6994         * assign.cs (LocalTemporary): Add new argument: is_address,If
6995         `is_address' is true, then the value that we store is the address
6996         to the real value, and not the value itself.
6997         
6998         * ecore.cs (PropertyExpr): use the new local temporary
6999         stuff to allow us to handle X.Y += z (where X is a struct)
7000
7001 2004-07-08  Martin Baulig  <martin@ximian.com>
7002
7003         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7004         not always return, just like we're doing in Using.Resolve().
7005
7006 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7007
7008         * cs-parser.jay (fixed_statement): flag this as Pinned.
7009
7010 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7011
7012         * typemanager.cs (TypeManager): Removed MakePinned method, this
7013         mechanism is replaced with the .NET 2.x compatible mechanism of
7014         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7015
7016         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7017         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7018         `IsFixed' property which has a different meaning.
7019
7020 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7021
7022         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7023         visible from inside a nested class, not just the names of the
7024         immediately enclosing class.
7025         Fix for bug #60730.
7026
7027 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7028
7029         * expression.cs (BetterConversion): Remove buggy special-case
7030         handling of "implicit constant expression conversions".  At this
7031         point, we already know that the conversion is possible -- we're
7032         only checking to see which is better.
7033
7034 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7035
7036         * cs-parser.jay: Added error CS0210 test.
7037
7038 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7039
7040         * cs-parser.jay: Added error CS0134 test.
7041
7042 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7043
7044         Fix bug #52507
7045         * cs-parser.jay: Added error CS0145 test.
7046
7047 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7048
7049         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7050
7051 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7052         
7053         * expression.cs (StackAlloc.Resolve): The argument may not
7054         be a constant; deal with this case.
7055         
7056 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7057
7058         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7059         GetIndexerAttributeValue.
7060         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7061
7062         * class.cs (Indexer.Define): Added error tests for CS0415,
7063         CS0609.
7064
7065 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7066
7067         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7068         property code.
7069
7070 2004-06-23  Martin Baulig  <martin@ximian.com>
7071
7072         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7073         neither return nor throw, reset the barrier as well.  Fixes #60457.
7074
7075 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7076
7077         * class.cs : EventAttributes is now set to None by default.
7078           This fixes bug #60459.
7079
7080 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7081
7082         Fix bug #60219
7083         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7084         Don't throw exception but return null (it's sufficient now).
7085
7086 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7087
7088         * typemanager.cs (GetArgumentTypes): Faster implementation.
7089
7090 2004-06-18  Martin Baulig  <martin@ximian.com>
7091
7092         * attribute.cs (Attribute.Resolve): Check whether we're an
7093         EmptyCast which a Constant child.  Fixes #60333.
7094
7095 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7096
7097         * statement.cs (EmitCollectionForeach): Account for the fact that
7098         not all valuetypes are in areas which we can take the address of.
7099         For these variables, we store to a temporary variable. Also, make
7100         sure that we dont emit a `callvirt' on a valuetype method.
7101
7102 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7103
7104         * expression.cs (StackAlloc.DoReSolve): Added test for
7105         negative parameter (CS0247).
7106
7107 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7108
7109         Fix bug #59792
7110         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7111
7112 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7113
7114         Fix bug #59781
7115         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7116         ulong.
7117
7118 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7119
7120         Fix bug #58254 & cs1555.cs, cs1556.cs
7121         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7122
7123 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7124
7125         * cs-parser.jay: Added error CS1669 test for indexers.
7126
7127 2004-06-18  Martin Baulig  <martin@ximian.com>
7128
7129         * generics.cs (GenericMethod.ctor): Don't take an Attributes
7130         argument.  Fixes #60441.
7131
7132 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
7133         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7134         The name needs to have the actual name of the method in order
7135         for other tests (such as the one in OverloadResolve for Invoke
7136         on a delegate) to work. As well, it does not really help
7137         error reporting because the method group had multiple methods.
7138         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7139         Make profiling work.
7140         
7141 2004-06-13  Martin Baulig  <martin@ximian.com>
7142
7143         * cs-parser.jay: Don't allow generic attributes.
7144
7145 2004-06-13  Martin Baulig  <martin@ximian.com>
7146
7147         * class.cs (MemberBase.DoDefineBase): New protected method.
7148         (MemberBase.DoDefine): Compute the `flags' in the new
7149         DoDefineBase() which must be called first.
7150         (Method.Define): Call DoDefineBase() first so we have the flags
7151         when defining the generic method.
7152
7153         * cs-parser.jay (interface_method_declaration): Support generic methods.
7154
7155 2004-06-13  Martin Baulig  <martin@ximian.com>
7156
7157         * decl.cs (TypeName): Removed.
7158         (MemberName): Removed TypeName and MemberNow; now we just have
7159         MemberName.
7160
7161         * cs-parser.jay: Don't distinguish between type arguments and type
7162         parameters in the grammar and simplified the rules a bit.  The
7163         reduce/reduce conflicts are now gone (except the one we inherited
7164         from mcs).
7165
7166 2004-06-11  Martin Baulig  <martin@ximian.com>
7167
7168         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7169         call this twice: for params and varargs methods.
7170
7171 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7172
7173         * class.cs:
7174         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7175
7176 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7177
7178         * attribute.cs (Attribute.GetValidTargets): Made public.
7179
7180         * class.cs: 
7181         (AbstractPropertyEventMethod): New class for better code sharing.
7182         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7183         CS1667 report.
7184         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7185
7186 2004-06-09  Martin Baulig  <martin@ximian.com>
7187
7188         * cs-parser.jay: Removed a reduce/reduce conflict.
7189
7190 2004-06-03  Martin Baulig  <martin@ximian.com>
7191
7192         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7193         GetSimpleName() and return a SimpleName.
7194
7195         * ecore.cs (SimpleName.Arguments): New public field.
7196         (SimpleName): Added overloaded ctor which takes an additional
7197         TypeArguments argument.
7198         (SimpleName.SimpleNameResolve): Added support for generic methods.
7199         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7200         formerly in MemberAccess.DoResolve(), but we also need it in
7201         SimpleNameResolve().
7202
7203         * expression.cs (MemberAccess.DoResolve): Use the new
7204         MethodGroupExpr.ResolveGeneric().       
7205
7206 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7207
7208         * decl.cs: If possible, use lookuptypedirect here. We can only do
7209         this if there is no `.' after the namespace. Avoids using
7210         LookupType, which does lots of slow processing.
7211         (FindNestedType) New method, does what it says :-).
7212         * namespace.cs: use LookupTypeDirect.
7213         * rootcontext.cs: use membercache, if possible.
7214         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7215
7216 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7217
7218         * expression.cs:
7219         According to the spec, 
7220
7221         In a member access of the form E.I, if E is a single identifier,
7222         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7223         field, property, localvariable, or parameter with the same type as
7224         the meaning of E as a type-name (§3.8), then both possible
7225         meanings of E are permitted.
7226
7227         We did not check that E as a simple-name had the same type as E as
7228         a type name.
7229
7230         This trivial check gives us 5-7% on bootstrap time.
7231
7232 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7233
7234         * expression.cs (Invocation.OverloadResolve): Avoid the
7235         use of hashtables and boxing here by allocating on demand.
7236
7237 2004-05-30  Martin Baulig  <martin@ximian.com>
7238
7239         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7240         we're doing a silent lookup.  Don't try to lookup nested types in
7241         TypeManager.object_type (thanks to Ben Maurer).
7242
7243 2004-05-30  Martin Baulig  <martin@ximian.com>
7244
7245         Committing a patch from Ben Maurer.
7246
7247         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7248
7249 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7250
7251         * convert.cs: add a trivial cache for overload operator resolution.
7252
7253 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7254
7255         * attribute.cs
7256         (AttributeTester.GetObsoleteAttribute): Returns instance of
7257         ObsoleteAttribute when type is obsolete.
7258
7259         * class.cs
7260         (TypeContainer.VerifyObsoleteAttribute): Override.
7261         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7262         (MethodCode.VerifyObsoleteAttribute): Override.
7263         (MemberBase.VerifyObsoleteAttribute): Override.
7264
7265         * decl.cs
7266         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7267         and report proper error.
7268
7269         *delegate.cs
7270         (Delegate.VerifyObsoleteAttribute): Override.
7271
7272         * ecore.cs
7273         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7274         and report proper error.
7275         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7276
7277         * enum.cs
7278         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7279         and enum member.
7280
7281         * expression.cs
7282         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7283         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7284         Added test for ObsoleteAttribute.
7285
7286         * statement.cs
7287         (Catch): Derived from Statement.
7288
7289 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7290
7291         * decl.cs: If possible, use lookuptypedirect here. We can only do
7292         this if there is no `.' after the namespace. Avoids using
7293         LookupType, which does lots of slow processing.
7294         (FindNestedType) New method, does what it says :-).
7295         * namespace.cs: use LookupTypeDirect.
7296         * rootcontext.cs: use membercache, if possible.
7297         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7298
7299 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7300
7301         * expression.cs:
7302         According to the spec, 
7303
7304         In a member access of the form E.I, if E is a single identifier,
7305         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7306         field, property, localvariable, or parameter with the same type as
7307         the meaning of E as a type-name (§3.8), then both possible
7308         meanings of E are permitted.
7309
7310         We did not check that E as a simple-name had the same type as E as
7311         a type name.
7312
7313         This trivial check gives us 5-7% on bootstrap time.
7314
7315 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7316
7317         Fixed bug #59071 & cs0160.cs
7318         * statement.cs (Try.Resolve): Check here whether order of catch
7319         clauses matches their dependencies.
7320
7321 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7322
7323         Fixed bug #58624
7324         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7325         unsafe type.
7326
7327 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7328
7329         * expression.cs (Invocation.OverloadResolve): Avoid the
7330         use of hashtables and boxing here by allocating on demand.
7331
7332 2004-05-30  Martin Baulig  <martin@ximian.com>
7333
7334         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7335         we're doing a silent lookup.  Don't try to lookup nested types in
7336         TypeManager.object_type (thanks to Ben Maurer).
7337
7338 2004-05-30  Martin Baulig  <martin@ximian.com>
7339
7340         Committing a patch from Ben Maurer.
7341
7342         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7343
7344 2004-05-29  Martin Baulig  <martin@ximian.com>
7345
7346         * class.cs (IMethodData.ShouldIgnore): New method.
7347
7348         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7349         `Location' argument, we don't need it anywhere.  Use
7350         `IMethodData.ShouldIgnore ()' instead of
7351         `MethodData.GetMethodFlags ()'.
7352         (TypeManager.AddMethod): Removed.
7353         (TypeManager.AddMethod2): Renamed to AddMethod.
7354
7355 2004-05-29  Martin Baulig  <martin@ximian.com>
7356
7357         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7358
7359         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7360         converting from a class type S to an interface type and we already
7361         have an object on the stack, don't box it again.  Fixes #52578.
7362
7363 2004-05-29  Martin Baulig  <martin@ximian.com>
7364
7365         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7366         Added support for `params' parameters.  Fixes #59267.
7367
7368 2004-05-29  Martin Baulig  <martin@ximian.com>
7369
7370         * literal.cs (NullPointer): Provide a private .ctor which sets
7371         `type' to TypeManager.object_type.  Fixes #59048.
7372
7373 2004-05-29  Martin Baulig  <martin@ximian.com>
7374
7375         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7376         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7377
7378         * ecore.cs (EventExpr.instance_expr): Make the field private.
7379
7380 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7381
7382         Fixed bug #50080 & cs0214-2.cs
7383         * expression.cs (Cast.DoResolve): Check unsafe context here.
7384         
7385         * statement.cs (Resolve.DoResolve): Likewise.
7386
7387 2004-05-26  Martin Baulig  <martin@ximian.com>
7388
7389         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7390
7391         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7392         (RootContext.LookupType): Pass down the `silent' flag.
7393
7394 2004-05-25  Martin Baulig  <martin@ximian.com>
7395
7396         * expression.cs
7397         (MethodGroupExpr.IdenticalTypeName): New public property.
7398         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7399         expression actually refers to a type.
7400
7401 2004-05-25  Martin Baulig  <martin@ximian.com>
7402
7403         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7404         for #56176 and made it actually work.
7405
7406 2004-05-25  Martin Baulig  <martin@ximian.com>
7407
7408         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7409         (FieldExpr, PropertyExpr): Override and implement
7410         CacheTemporaries.  Fixes #52279.
7411
7412 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7413
7414         * location.cs: In the new compiler listing a file twice is a
7415         warning, not an error.
7416
7417 2004-05-24  Martin Baulig  <martin@ximian.com>
7418
7419         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7420         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7421
7422 2004-05-24  Martin Baulig  <martin@ximian.com>
7423
7424         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7425         walking the `using' list.  Fixes #53921.
7426
7427 2004-05-24  Martin Baulig  <martin@ximian.com>
7428
7429         * const.cs (Const.LookupConstantValue): Added support for
7430         EmptyCast's; fixes #55251.
7431
7432 2004-05-24  Martin Baulig  <martin@ximian.com>
7433
7434         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7435         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7436         which does the CS0135 check.  The reason is that we first need to
7437         check whether the variable actually exists.
7438
7439 2004-05-24  Martin Baulig  <martin@ximian.com>
7440
7441         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7442         than RootContext.LookupType() to find the explicit interface
7443         type.  Fixes #58584.
7444
7445 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7446
7447         * Makefile: Simplify.  Use executable.make.
7448         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7449
7450 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7451
7452         * decl.cs:
7453         * enum.cs:
7454         Use the invariant culture when doing String.Compare for CLS case
7455         sensitivity.
7456         
7457 2004-05-23  Martin Baulig  <martin@ximian.com>
7458
7459         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7460         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7461
7462         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7463
7464 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7465
7466         * class.cs (MemberBase.Define): Reuse MemberType member for 
7467         resolved type. Other methods can use it too.
7468
7469 2004-05-23  Martin Baulig  <martin@ximian.com>
7470
7471         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7472         the variable also exists in the current block (otherwise, we need
7473         to report a CS0103).  Fixes #58670.
7474
7475 2004-05-23  Martin Baulig  <martin@ximian.com>
7476
7477         * flowanalysis.cs (Reachability.Reachable): Compute this
7478         on-the-fly rather than storing it as a field.
7479
7480 2004-05-23  Martin Baulig  <martin@ximian.com>
7481
7482         * flowanalysis.cs (Reachability.And): Manually compute the
7483         resulting `barrier' from the reachability.      
7484        
7485 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7486
7487         Fix bug #57835
7488         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7489         instance of ObsoleteAttribute when symbol is obsolete.
7490
7491         * class.cs
7492         (IMethodData): Extended interface for ObsoleteAttribute support.
7493
7494 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7495
7496         * attribute.cs: Fix bug #55970
7497
7498 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7499
7500         Fix bug #52705
7501         * attribute.cs
7502         (GetObsoleteAttribute): New method. Creates the instance of
7503         ObsoleteAttribute.
7504         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7505         ObsoleteAttribute when member is obsolete.
7506         (AttributeTester.Report_ObsoleteMessage): Common method for
7507         Obsolete error/warning reporting.
7508
7509         * class.cs
7510         (TypeContainer.base_classs_type): New member for storing parent type.
7511
7512         * decl.cs
7513         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7514         for this MemberCore.
7515
7516 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7517
7518         * attribute.cs, const.cs: Fix bug #58590
7519
7520 2004-05-21  Martin Baulig  <martin@ximian.com>
7521
7522         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7523         out parameters if the end of the method is unreachable.  Fixes
7524         #58098. 
7525
7526 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7527
7528         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7529         Hari was right, why extra method.
7530
7531 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7532
7533         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7534
7535 2004-05-20  Martin Baulig  <martin@ximian.com>
7536
7537         * delegate.cs: Convert this file to Unix mode - like the original
7538         version in mcs is.
7539
7540 2004-05-20  Martin Baulig  <martin@ximian.com>
7541
7542         * attribute.cs: Convert this file to Unix mode - like the original
7543         version in mcs is.
7544
7545 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7546
7547        Fix bug #58688 (MCS does not report error when the same attribute
7548        is assigned twice)
7549
7550        * attribute.cs (Attribute.Emit): Distinction between null and default.
7551
7552 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7553
7554        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7555        of a top-level attribute without an attribute target.
7556        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7557        Make non-static.
7558        (Attribute.Conditional_GetConditionName), 
7559        (Attribute.Obsolete_GetObsoleteMessage): Update.
7560        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7561        part of ScanForIndexerName.
7562        (Attribute.CanIgnoreInvalidAttribute): New function.
7563        (Attribute.ScanForIndexerName): Move to ...
7564        (Attributes.ScanForIndexerName): ... here.
7565        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7566        (Attributes.Search): New internal variant that can choose not to
7567        complain if types aren't resolved.  The original signature now
7568        complains.
7569        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7570        complaints suppressed.
7571        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7572        only if it not useful.
7573        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7574        top-level for attributes that are shared between the assembly
7575        and a top-level class.
7576        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7577        * class.cs: Update to reflect changes.
7578        (DefineIndexers): Fuse loops.
7579        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7580        a couple more variants of attribute names.
7581
7582 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7583
7584         Fix bug #52585 (Implemented explicit attribute declaration)
7585
7586         * attribute.cs:
7587         (Attributable.ValidAttributeTargets): New abstract method. It gets
7588         list of valid attribute targets for explicit target declaration.
7589         (Attribute.Target): It holds target itself.
7590         (AttributeSection): Removed.
7591         (Attribute.CheckTargets): New method. It checks whether attribute
7592         target is valid for the current element.
7593
7594         * class.cs:
7595         (EventProperty): New class. For events that are declared like
7596         property (with add and remove accessors).
7597         (EventField): New class. For events that are declared like field.
7598         class.cs
7599
7600         * cs-parser.jay: Implemented explicit attribute target declaration.
7601
7602         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7603         Override ValidAttributeTargets.
7604
7605         * parameter.cs:
7606         (ReturnParameter): Class for applying custom attributes on 
7607         the return type.
7608         (ParameterAtribute): New class. Class for applying custom
7609         attributes on the parameter type.
7610
7611 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7612
7613         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7614         definitions. 
7615
7616         (Method): Allow UNSAFE here.
7617
7618         * modifiers.cs: Support unsafe reporting.
7619
7620 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7621
7622         * decl.cs: Fix bug #58478.
7623
7624 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7625
7626         * statement.cs: When checking for unreachable code on an EmptyStatement,
7627         set the location. Fixes bug #58488.
7628
7629 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7630
7631         * driver.cs: Add -pkg handling.
7632
7633         From Gonzalo: UseShelLExecute=false
7634
7635 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7636
7637         * attribute.cs:
7638         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7639         for attribute.
7640         (Attribute.IsClsCompliaceRequired): Moved to base for better
7641         accesibility.
7642         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7643         when attribute is AttributeUsageAttribute.
7644         (Attribute.GetValidTargets): Simplified.
7645         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7646         attribute for this type.
7647         (Attribute.ApplyAttributes): Method renamed to Emit and make
7648         non-static.
7649         (GlobalAttributeSection): New class for special handling of global
7650         attributes (assembly, module).
7651         (AttributeSection.Emit): New method.
7652
7653         * class.cs: Implemented Attributable abstract methods.
7654         (MethodCore.LabelParameters): Moved to Parameter class.
7655         (Accessor): Is back simple class.
7656         (PropertyMethod): Implemented Attributable abstract class.
7657         (DelegateMethod): Implemented Attributable abstract class.
7658         (Event): New constructor for disctintion between normal Event
7659         and Event with accessors.
7660
7661         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7662
7663         * codegen.cs, const.cs, decl.cs, delegate.cs:
7664         (CommonAssemblyModulClass): Implemented Attributable abstract class
7665         and simplified.
7666
7667         * enum.cs: Implement IAttributeSupport interface.
7668         (EnumMember): New class for emum members. Implemented Attributable
7669         abstract class
7670
7671         * parameter.cs:
7672         (ParameterBase): Is abstract.
7673         (ReturnParameter): New class for easier [return:] attribute handling.
7674
7675         * typemanager.cs: Removed builder_to_attr.
7676
7677 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7678
7679         Fix bug #57151.
7680         * attribute.cs (Attribute.GetPositionalValue): New function.
7681         * class.cs (TypeContainer.VerifyMembers): New function.
7682         (TypeContainer.Emit): Use it.
7683         (ClassOrStruct): New base class for Class and Struct.
7684         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7685         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7686         class.
7687         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7688         then each non-static field should have a FieldOffset attribute.
7689         Otherwise, none of the fields should have a FieldOffset attribute.
7690         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7691         and FieldOffset attributes.
7692         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7693         (TypeManager.field_offset_attribute_type): New core types.
7694         (TypeManager.InitCoreTypes): Initialize them.
7695
7696 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7697
7698         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7699         Return correct type.
7700         From bug #58270.
7701
7702 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7703
7704         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7705         be implicitly converted to ulong.
7706         
7707         * expression.cs: The logic for allowing operator &, | and ^ worked
7708         was wrong, it worked before because we did not report an error in
7709         an else branch.  Fixes 57895.
7710
7711         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7712         allow volatile fields to be reference types.
7713
7714 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7715
7716         * driver.cs: Add support for /debug-
7717
7718 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7719
7720         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7721         Add a 'complain' parameter to silence errors.
7722         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7723         silently overlooked type-resolutions.
7724         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7725         to reflect changes.
7726         (Attributes.Search): New function.
7727         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7728         (Attributes.GetAttributeFullName): Remove hack.
7729         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7730         Update to reflect changes.
7731         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7732         Use Attributes.Search instead of nested loops.
7733
7734 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7735
7736         * decl.cs:
7737         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7738         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7739         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7740
7741         * report.cs: (Report.Warning): Renamed to Warning_T because of
7742         parameter collision.
7743
7744 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7745
7746         * expression.cs (MemberAccess.ResolveMemberAccess):
7747         Exit with non-zero status after Report.Error.
7748         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7749         Likewise.
7750         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7751
7752 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7753
7754         * support.cs: Don't hang when the file is empty.
7755
7756 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7757
7758         * support.cs: In SeekableStreamReader, compute the preamble size of the
7759           underlying stream. Position changes should take into account that initial
7760           count of bytes.
7761
7762 2004-05-03  Todd Berman  <tberman@sevenl.net>
7763
7764         * driver.cs: remove unused GetSysVersion function.
7765
7766 2004-05-03  Todd Berman  <tberman@sevenl.net>
7767
7768         * driver.cs: Remove the hack from saturday, as well as the hack
7769         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7770         link_paths to get that bit proper.
7771
7772 2004-05-01  Todd Berman  <tberman@sevenl.net>
7773
7774         * driver.cs: Try a LoadFrom before a Load, this checks the current
7775         path. This is currently a bug in mono that is be fixed, however, this
7776         provides a workaround for now. This will be removed when the bug
7777         is fixed.
7778
7779 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7780
7781         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7782         incomplete key pairs (#57941).
7783
7784 2004-05-01  Todd Berman  <tberman@sevenl.net>
7785
7786         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7787         from the GAC
7788
7789 2004-04-30  Jackson Harper  <jackson@ximian.com>
7790
7791         * codegen.cs: Open keys readonly.
7792         
7793 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7794
7795         * typemanager.cs: don't report cyclic struct layout when a struct
7796         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7797         which has 2 Pango.Rectangle fields.
7798
7799 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7800
7801         * expression.cs: Handle IntPtr comparisons with IL code
7802         rather than a method call.
7803
7804 2004-04-29  Martin Baulig  <martin@ximian.com>
7805
7806         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7807         the list of PropertyInfo's in class hierarchy and find the
7808         accessor.  Fixes #56013.
7809
7810 2004-04-29  Martin Baulig  <martin@ximian.com>
7811
7812         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7813
7814 2004-04-29  Martin Baulig  <martin@ximian.com>
7815
7816         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7817
7818         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7819
7820 2004-04-29  Martin Baulig  <martin@ximian.com>
7821
7822         * class.cs (ConstructorInitializer.Resolve): Check whether the
7823         parent .ctor is accessible.  Fixes #52146.
7824
7825 2004-04-29  Martin Baulig  <martin@ximian.com>
7826
7827         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7828
7829         * statement.cs (Using.EmitLocalVariableDecls): Use
7830         TypeManager.idisposable_type, not typeof (IDisposable).
7831         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7832
7833 2004-04-29  Martin Baulig  <martin@ximian.com>
7834
7835         * class.cs (Event.Define): Don't emit the field and don't set
7836         RTSpecialName and SpecialName for events on interfaces.  Fixes
7837         #57703. 
7838
7839 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7840
7841         Refactor Attribute.ApplyAttributes.
7842         * attribute.cs (Attributable): New base class for objects that can
7843         have Attributes applied on them.
7844         (Attribute): Make AttributeUsage fields public.
7845         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7846         (Attribute.IsInternalCall): New property.
7847         (Attribute.UsageAttr): Convert to a public read-only property.
7848         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7849         (Attribute.ResolveType, Attribute.Resolve)
7850         (Attribute.ScanForIndexerName): Update to reflect changes.
7851         (Attribute.CheckAttributeTarget): Re-format.
7852         (Attribute.ApplyAttributes): Refactor, to various
7853         Attributable.ApplyAttributeBuilder methods.
7854         * decl.cs (MemberCore): Make Attributable.
7855         * class.cs (Accessor): Make Attributable.
7856         (MethodData.ApplyAttributes): Use proper attribute types, not
7857         attribute names.
7858         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7859         (TypeContainer.ApplyAttributeBuilder)
7860         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7861         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7862         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7863         (Operator.ApplyAttributeBuilder): New factored-out methods.
7864         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7865         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7866         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7867         * parameter.cs (ParameterBase): New Attributable base class
7868         that can also represent Return types.
7869         (Parameter): Update to the changes.
7870
7871 2004-04-29  Jackson Harper  <jackson@ximian.com>
7872
7873         * driver.cs: Prefer the corlib system version when looking for
7874         assemblies in the GAC. This is still a hack, but its a better hack
7875         now.
7876         
7877 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7878
7879         * decl.cs, enum.cs: Improved error 3005 reporting.
7880   
7881         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7882         (related_symbols): New private member for list of symbols
7883         related to reported error/warning.
7884         
7885         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7886
7887 2004-04-29  Martin Baulig  <martin@ximian.com>
7888
7889         * ecore.cs (Expression.Constantify): If we're an enum and
7890         TypeManager.TypeToCoreType() doesn't give us another type, use
7891         t.UnderlyingSystemType.  Fixes #56178.  
7892
7893 2004-04-29  Martin Baulig  <martin@ximian.com>
7894
7895         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7896         interfaces and for each interface, only add members directly
7897         declared in that interface.  Fixes #53255.
7898
7899 2004-04-28  Martin Baulig  <martin@ximian.com>
7900
7901         * expression.cs (ConditionalLogicalOperator): Use a temporary
7902         variable for `left' to avoid that we evaluate it more than once;
7903         bug #52588.
7904
7905 2004-04-28  Martin Baulig  <martin@ximian.com>
7906
7907         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7908         `void[]' (CS1547).
7909
7910 2004-04-28  Martin Baulig  <martin@ximian.com>
7911
7912         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7913         void (CS1547).
7914
7915         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7916         whether the type is not void (CS1547).
7917
7918 2004-04-28  Martin Baulig  <martin@ximian.com>
7919
7920         * expression.cs (Unary.DoResolveLValue): Override this and report
7921         CS0131 for anything but Operator.Indirection.
7922
7923 2004-04-28  Martin Baulig  <martin@ximian.com>
7924
7925         Committing a patch from Ben Maurer; see bug #50820.
7926
7927         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7928         check for classes.
7929
7930         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7931         classes.        
7932
7933 2004-04-28  Martin Baulig  <martin@ximian.com>
7934
7935         Committing a patch from Ben Maurer; see bug #50820.
7936
7937         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7938         check for classes.
7939
7940         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7941         classes.        
7942
7943 2004-04-28  Martin Baulig  <martin@ximian.com>
7944
7945         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7946         (Block.AddLabel): Call DoLookupLabel() to only search in the
7947         current block.
7948
7949 2004-04-28  Martin Baulig  <martin@ximian.com>
7950
7951         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7952         comparing StringConstants and NullLiterals in Equality and Inequality.
7953
7954 2004-04-28  Jackson Harper  <jackson@ximian.com>
7955
7956         * driver.cs: Attempt to load referenced assemblies from the
7957         GAC. This is the quick and dirty version of this method that
7958         doesnt take into account versions and just takes the first
7959         canidate found. Will be good enough for now as we will not have more
7960         then one version installed into the GAC until I update this method.
7961
7962 2004-04-28  Martin Baulig  <martin@ximian.com>
7963
7964         * typemanager.cs (TypeManager.CheckStructCycles): New public
7965         static method to check for cycles in the struct layout.
7966
7967         * rootcontext.cs (RootContext.PopulateTypes): Call
7968         TypeManager.CheckStructCycles() for each TypeContainer.
7969         [Note: We only need to visit each type once.]
7970
7971 2004-04-28  Martin Baulig  <martin@ximian.com>
7972
7973         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7974
7975         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7976         success and added `out object value'.  Use a `bool resolved' field
7977         to check whether we've already been called rather than
7978         `ConstantValue != null' since this breaks for NullLiterals.
7979
7980 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7981
7982         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7983         setting of this flag, since the 'set' method may be non-public.
7984
7985 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7986
7987         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7988         check on current_vector.Block.
7989
7990 2004-04-27  Martin Baulig  <martin@ximian.com>
7991
7992         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7993         a field initializer.  Fixes #56459.
7994
7995 2004-04-27  Martin Baulig  <martin@ximian.com>
7996
7997         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7998         we're not attempting to use an indexer.  Fixes #52154.
7999
8000 2004-04-27  Martin Baulig  <martin@ximian.com>
8001
8002         * statement.cs (Return): Don't create a return label if we don't
8003         need it; reverts my change from January 20th.  Thanks to Ben
8004         Maurer for this.
8005
8006 2004-04-27  Martin Baulig  <martin@ximian.com>
8007
8008         According to the spec, `goto' can only leave a nested scope, but
8009         never enter it.
8010
8011         * statement.cs (Block.LookupLabel): Only lookup in the current
8012         block, don't recurse into parent or child blocks.
8013         (Block.AddLabel): Check in parent and child blocks, report
8014         CS0140/CS0158 if we find a duplicate.
8015         (Block): Removed this indexer for label lookups.
8016         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8017         this already does the error reporting for us.
8018
8019         * flowanalysis.cs
8020         (FlowBranching.UsageVector.Block): New public variable; may be null.
8021         (FlowBranching.CreateSibling): Added `Block' argument.
8022         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8023         label for the target of a `goto' and check whether we're not
8024         leaving a `finally'.
8025
8026 2004-04-27  Martin Baulig  <martin@ximian.com>
8027
8028         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8029         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8030         just for returns).
8031
8032 2004-04-27  Martin Baulig  <martin@ximian.com>
8033
8034         * statement.cs (Block.AddLabel): Also check for implicit blocks
8035         and added a CS0158 check.
8036
8037 2004-04-27  Martin Baulig  <martin@ximian.com>
8038
8039         * flowanalysis.cs (FlowBranchingLoop): New class.
8040         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8041         UsageVector's instead of an ArrayList.
8042         (FlowBranching.Label): Likewise.
8043         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8044         (FlowBranching.AddBreakVector): New method.
8045
8046 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8047
8048         * attribute.cs: Small regression fix: only convert the type if we
8049         the type is different, fixes System.Drawing build.
8050
8051 2004-04-27  Martin Baulig  <martin@ximian.com>
8052
8053         * attribute.cs (Attribute.Resolve): If we have a constant value
8054         for a named field or property, implicity convert it to the correct
8055         type.
8056
8057 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8058
8059         * statement.cs (Block.Block): Implicit blocks share
8060         'child_variable_names' fields with parent blocks.
8061         (Block.AddChildVariableNames): Remove.
8062         (Block.AddVariable): Mark variable as "used by a child block" in
8063         every surrounding block.
8064         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8065         been used in a child block, complain about violation of "Invariant
8066         meaning in blocks" rule.
8067         * cs-parser.jay (declare_local_variables): Don't use
8068         AddChildVariableNames.
8069         (foreach_statement): Don't create an implicit block: 'foreach'
8070         introduces a scope.
8071
8072 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8073
8074         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8075         converting from 0L to ulong.  Fixes 57522.
8076
8077 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8078
8079         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8080         derived class hides via 'new' keyword field from base class (test-242.cs).
8081         TODO: Handle this in the more general way.
8082         
8083         * class.cs (CheckBase): Ditto.
8084
8085 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8086
8087         * decl.cs (caching_flags): New member for storing cached values
8088         as bit flags.
8089         (MemberCore.Flags): New enum where bit flags for caching_flags
8090         are defined.
8091         (MemberCore.cls_compliance): Moved to caching_flags.
8092         (DeclSpace.Created): Moved to caching_flags.
8093
8094         * class.cs: Use caching_flags instead of DeclSpace.Created
8095         
8096 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8097
8098         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8099         if we are only a derived class, not a nested class.
8100
8101         * typemanager.cs: Same as above, but do this at the MemberLookup
8102         level (used by field and methods, properties are handled in
8103         PropertyExpr).   Allow for the qualified access if we are a nested
8104         method. 
8105
8106 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8107
8108         * class.cs: Refactoring.
8109         (IMethodData): New inteface; Holds links to parent members
8110         to avoid member duplication (reduced memory allocation).
8111         (Method): Implemented IMethodData interface.
8112         (PropertyBase): New inner classes for get/set methods.
8113         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8114         (Event): New inner classes for add/remove methods.
8115         (Event.DelegateMethod): Implemented IMethodData interface.
8116
8117         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8118         EmitContext (related to class.cs refactoring).
8119
8120 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8121
8122         * delegate.cs (Delegate.VerifyApplicability): If the number of
8123         arguments are the same as the number of parameters, first try to
8124         verify applicability ignoring  any 'params' modifier on the last
8125         parameter.
8126         Fixes #56442.
8127
8128 2004-04-08  Martin Baulig  <martin@ximian.com>
8129
8130         Merged latest changes into gmcs.  Please keep this comment in
8131         here, it makes it easier for me to see what changed in MCS since
8132         the last time I merged.
8133
8134 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8135
8136         * class.cs (TypeContainer.AddIndexer): Use
8137         'ExplicitInterfaceName' to determine if interface name was
8138         explicitly specified.  'InterfaceType' is not initialized at this time.
8139         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8140         Indexers array is already in the required order.  Initialize
8141         'IndexerName' only if there are normal indexers.
8142         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8143         (TypeContainer.Emit): Emit DefaultMember attribute only if
8144         IndexerName is initialized.
8145         Fixes #56300.
8146
8147 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8148
8149         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8150         Fixes #57007
8151
8152 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8153
8154         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8155         attributes.
8156         Fix for #56456.
8157
8158         * attribute.cs (Attribute.Resolve): Check for duplicate named
8159         attributes.
8160         Fix for #56463.
8161
8162 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8163
8164         * iterators.cs (MarkYield): track whether we are in an exception,
8165         and generate code accordingly.  Use a temporary value to store the
8166         result for our state.
8167
8168         I had ignored a bit the interaction of try/catch with iterators
8169         since their behavior was not entirely obvious, but now it is
8170         possible to verify that our behavior is the same as MS .NET 2.0
8171
8172         Fixes 54814
8173
8174 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8175
8176         * iterators.cs: Avoid creating temporaries if there is no work to
8177         do. 
8178
8179         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8180         Enumerations, use TypeManager.EnumToUnderlying and call
8181         recursively. 
8182
8183         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8184         bug #57013
8185
8186         (This.Emit): Use EmitContext.EmitThis to emit our
8187         instance variable.
8188
8189         (This.EmitAssign): Ditto.
8190
8191         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8192         codepaths, we will move all the functionality into
8193         Mono.CSharp.This 
8194
8195         (FieldExpr.EmitAssign): Ditto.
8196
8197         This fixes several hidden bugs that I uncovered while doing a code
8198         review of this today.
8199
8200         * codegen.cs (EmitThis): reworked so the semantics are more clear
8201         and also support value types "this" instances.
8202
8203         * iterators.cs: Changed so that for iterators in value types, we
8204         do not pass the value type as a parameter.  
8205
8206         Initialization of the enumerator helpers is now done in the caller
8207         instead of passing the parameters to the constructors and having
8208         the constructor set the fields.
8209
8210         The fields have now `assembly' visibility instead of private.
8211
8212 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8213
8214         * expression.cs (Argument.Resolve): Check if fields passed as ref
8215         or out are contained in a MarshalByRefObject.
8216
8217         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8218         another compiler type.
8219
8220 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8221
8222         * class.cs (Indexer.Define): use the new name checking method.
8223         Also, return false on an error.
8224         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8225         (is_identifier_[start/part]_character): make static.
8226
8227 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8228
8229         * expression.cs (Binary.ResolveOperator): Do no append strings
8230         twice: since we can be invoked more than once (array evaluation)
8231         on the same concatenation, take care of this here.  Based on a fix
8232         from Ben (bug #56454)
8233
8234 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8235
8236         * codegen.cs: Fix another case where CS1548 must be reported (when 
8237         delay-sign isn't specified and no private is available #56564). Fix
8238         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8239         error when MCS is used on the MS runtime and we need to delay-sign 
8240         (which seems unsupported by AssemblyBuilder - see #56621).
8241
8242 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8243
8244         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8245         (TypeManager.ComputeNamespaces): Faster implementation for
8246         Microsoft runtime.
8247
8248         * compiler.csproj: Updated AssemblyName to mcs.
8249
8250 2004-05-11  Jackson Harper  <jackson@ximian.com>
8251
8252         * Makefile: Preserve MONO_PATH
8253         
8254 2004-05-11  Jackson Harper  <jackson@ximian.com>
8255
8256         * Makefile: Use mono and mcs to build gmcs
8257         
8258 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8259
8260         * codegen.cs: Add patch from Robert Shade
8261         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8262         sync with mcs.
8263
8264 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8265
8266         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8267         incomplete key pairs (#57941).
8268
8269 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8270
8271         * codegen.cs: Fix another case where CS1548 must be reported (when 
8272         delay-sign isn't specified and no private is available #56564). Fix
8273         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8274         error when MCS is used on the MS runtime and we need to delay-sign 
8275         (which seems unsupported by AssemblyBuilder - see #56621).
8276
8277 2004-04-29  Jackson Harper  <jackson@ximian.com>
8278
8279         * Makefile: Set MONO_PATH to use the bootstrap corlib
8280         * driver.cs: Check the GAC for referenced assemblies.
8281                 
8282 2004-04-29  Martin Baulig  <martin@ximian.com>
8283
8284         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8285
8286 2004-04-07  Martin Baulig  <martin@ximian.com>
8287
8288         * expression.cs (Binary.ResolveOperator): Added special case for
8289         Equality/Inequality between a type parameter and a null literal.
8290
8291 2004-04-07  Martin Baulig  <martin@ximian.com>
8292
8293         * convert.cs: Check null literal -> type parameter conversions.
8294
8295 2004-04-07  Martin Baulig  <martin@ximian.com>
8296
8297         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8298         `class' and `struct' constraints.
8299
8300 2004-04-07  Martin Baulig  <martin@ximian.com>
8301
8302         * generic.cs (SpecialConstraint): New public enum.
8303         (Constraints.Resolve): Added support for the `class' and `struct'
8304         constraints.
8305
8306         * cs-parser.jay (type_parameter_constraint): Added support for the
8307         `class' and `struct' constraints.
8308
8309 2004-04-07  Martin Baulig  <martin@ximian.com>
8310
8311         * support.cs (GenericConstraints): Replaced `Types' by
8312         `ClassConstraint' and `InterfaceConstraints'; added
8313         `HasClassConstraint'.   
8314
8315 2004-04-07  Martin Baulig  <martin@ximian.com>
8316
8317         * generic.cs
8318         (Constraints.InterfaceConstraints): New public property.
8319         (Constraints.Types): Make this property public
8320         (TypeParameter): Implement IMemberContainer.
8321         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8322         instead of a TypeBuilder/MethodBuilder; pass the interface
8323         constraints to TypeManager.AddTypeParameter().
8324         (TypeParameter.DefineType): Just take an EmitContext and no
8325         TypeBuilder/MethodBuilder.  Use the new public API.
8326
8327         * typemanager.cs (TypeManager.AddTypeParameter): Added
8328         `TypeExpr[]' argument; add the interfaces to the
8329         `builder_to_ifaces' hash.
8330         (TypeManager.LookupMemberContainer): For
8331         GenericTypeParameterBuilders, get the TypeParameter from the
8332         `builder_to_type_param'.
8333         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8334         the TypeParameter and call FindMembers on it.
8335
8336 2004-04-07  Martin Baulig  <martin@ximian.com>
8337
8338         * class.cs
8339         (MethodCore.GenericMethod): Moved this field here from Method.
8340         (MethodCore.IsDuplicateImplementation): Take the number of type
8341         parameters into account if we're a generic method.
8342
8343         * expression.cs (Invocation.InferTypeArguments): Don't return true
8344         if `arguments' is null; we still need to check whether we actually
8345         don't need to infer anything in this case.
8346         (MemberAccess): Merged the functionality from GenericMemberAccess
8347         into this class.
8348
8349         * generic.cs (GenericMemberAccess): Removed.
8350
8351 2004-04-05  Martin Baulig  <martin@ximian.com>
8352
8353         * decl.cs (MemberCore): For generic classes, interfaces and
8354         structs, `Name' now includes the number of type parameters
8355         ("Stack!1.Node!1").
8356         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8357         encode the number of type arguments in the type name.
8358
8359         * expression.cs (Expression.MemberLookup): Removed the
8360         `num_type_args' argument; we now encode the number of type
8361         arguments in the type name.
8362
8363         * ecore.cs (SimpleName): Encode the number of type arguments in
8364         the type name itself.
8365
8366         * generic.cs (ConstructedType): Likewise.
8367
8368         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8369         `MemberName'; we now include the number of type parameters in the
8370         type name.
8371
8372         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8373         (TypeManager.MemberLookup): Removed the
8374         `num_type_args' argument; we now encode the number of type
8375         arguments in the type name.     
8376
8377 2004-04-03  Martin Baulig  <martin@ximian.com>
8378
8379         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8380         (MemberCore.MemberName): Moved here from MemberBase.
8381         (DeclSpace.SetParameterInfo): Just take the constraints as an
8382         ArrayList; we already have the type parameters in our
8383         `MemberName'; also do the CS0080 reporting here.
8384
8385         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8386         `IDENTIFIER opt_type_parameter_list'; when constructing our
8387         `MemberName', it'll already include our type parameters.
8388         (class_declaration, interface_declaration): Likewise.
8389         (delegate_declaration): Likewise.
8390         (MakeName): Take a MemberName and return a MemberName.
8391         The following two changes are required to avoid shift/reduce conflicts:
8392         (member_name): Don't include a TypeName anymore; ie. this is now
8393         just 'IDENTIFIER opt_type_parameter_list'.
8394         (property_declaration, event_declaration): Use a
8395         `namespace_or_type_name' instead of a `member_name'.            
8396
8397 2004-04-03  Martin Baulig  <martin@ximian.com>
8398
8399         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8400         `MemberName' class.
8401         (TypeName): Formerly known as MemberName.
8402
8403         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8404         instead of a `MemberName'.
8405
8406         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8407         (member_name): New rule; create a MemberName.
8408
8409 2004-04-02  Martin Baulig  <martin@ximian.com>
8410
8411         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8412         (CS0305 and CS0308).
8413
8414 2004-04-02  Martin Baulig  <martin@ximian.com>
8415
8416         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8417         support for nested types.
8418
8419 2004-04-02  Martin Baulig  <martin@ximian.com>
8420
8421         * ecore.cs (IAlias): New public interface.
8422         (TypeExpr, TypeExpression): Implement IAlias.
8423         (TypeAliasExpression): New public class.
8424
8425         * namespace.cs (Namespace): Implement IAlias.
8426         (Namespace.Lookup): Return an IAlias instead on an object.
8427         (Namespace.DefineName): Take an IAlias instead of an object.
8428         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8429         an object.
8430         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8431         Expression.
8432         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8433         object.
8434         (NamespaceEntry.Lookup): Likewise.
8435
8436         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8437         instead of a Type.      
8438
8439         * decl.cs (DeclSpace): Implement IAlias.
8440         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8441
8442         * generic.cs (ConstructedType): Improved error checking.
8443
8444 2004-04-02  Martin Baulig  <martin@ximian.com>
8445
8446         * convert.cs: Added type parameter conversions.
8447
8448         * ecore.cs
8449         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8450         (ClassCast.Emit): If the source type is a type parameter, box it.
8451         If the target type is a type parameter, emit an `unbox.any'
8452         instead of a `classcast'.1      
8453
8454 2004-04-01  Martin Baulig  <martin@ximian.com>
8455
8456         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8457
8458 2004-04-01  Martin Baulig  <martin@ximian.com>
8459
8460         * generic.cs (ConstructedType.CheckConstraints): Use
8461         Convert.ImplicitStandardConversionExists(); user-defined implicit
8462         conversions are not allowed according to the spec.
8463
8464 2004-03-30  Martin Baulig  <martin@ximian.com>
8465
8466         * expression.cs (New): Added support for type parameters.
8467
8468         * typemanager.cs
8469         (TypeManager.activator_type): New public static field.
8470         (TypeManager.activator_create_instance): Likewise.
8471
8472 2004-03-30  Martin Baulig  <martin@ximian.com>
8473
8474         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8475         public method.
8476
8477 2004-03-30  Martin Baulig  <martin@ximian.com>
8478
8479         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8480         the spec here: the argument type must be convertible to the
8481         constraints.
8482
8483 2004-03-30  Martin Baulig  <martin@ximian.com>
8484
8485         * generic.cs
8486         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8487         TypeManager.AddTypeParameter().
8488         (ConstructedType.CheckConstraints): Re-enable this and actually
8489         check whether we have a constructor constraint.
8490
8491         * typemanager.cs
8492         (TypeManager.builder_to_type_param): New static field.
8493         (TypeManager.AddTypeParameter): New static method.
8494         (TypeManager.LookupTypeParameter): New public method.
8495
8496 2004-03-30  Martin Baulig  <martin@ximian.com>
8497
8498         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8499         the new API to actually define the constructor constraint.
8500
8501         * typemanager.cs
8502         (TypeManager.new_constraint_attr_type): New static field.
8503         (TypeManager.InitCoreTypes): Initialize it.
8504
8505 2004-03-30  Martin Baulig  <martin@ximian.com>
8506
8507         * generic.cs (Constraints): Completed error checking, use correct
8508         error numbers.
8509
8510 2004-03-29  Martin Baulig  <martin@ximian.com>
8511
8512         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8513
8514         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8515         public version which takes a `ParameterData pd' instead of an
8516         `ArrayList args'.
8517
8518 2004-03-29  Martin Baulig  <martin@ximian.com>
8519
8520         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8521         not a MethodInfo.       
8522
8523 2004-03-29  Martin Baulig  <martin@ximian.com>
8524
8525         * expression.cs (Argument.ResolveMethodGroup): If we're a
8526         ConstructedType, call GetMemberAccess() on it.  
8527
8528 2004-03-29  Martin Baulig  <martin@ximian.com>
8529
8530         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8531         (MethodCore.CheckGenericOverride): When overriding a generic
8532         method, check whether the constraints match.
8533
8534         * support.cs (GenericConstraints): New public interface.
8535         (ParameterData.GenericConstraints): New public method.
8536
8537         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8538         method parameter and compute our constraints if appropriate.
8539         (Parameter.GenericConstraints): New public property.
8540
8541         * generic.cs (Constraints): Implement GenericConstraints.
8542
8543 2004-03-29  Martin Baulig  <martin@ximian.com>
8544
8545         * decl.cs (MemberCache.FindMemberToOverride): Use
8546         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8547
8548 2004-03-29  Martin Baulig  <martin@ximian.com>
8549
8550         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8551
8552 2004-03-29  Martin Baulig  <martin@ximian.com>
8553
8554         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8555         not allowed on non-generic declarations").
8556
8557 2004-03-29  Martin Baulig  <martin@ximian.com>
8558
8559         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8560         public version of this method.
8561
8562         * class.cs (MethodCore.IsDuplicateImplementation): Use
8563         Invocation.InferTypeArguments() to check this.
8564
8565 2004-03-29  Martin Baulig  <martin@ximian.com>
8566
8567         * convert.cs: Use TypeManager.IsDelegateType() instead of
8568         comparing types correctly.
8569
8570 2004-03-29  Martin Baulig  <martin@ximian.com>
8571
8572         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8573         types directly to make it work for generic instances.
8574
8575         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8576
8577 2004-03-29  Martin Baulig  <martin@ximian.com>
8578
8579         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8580         support for arrays.     
8581
8582 2004-03-24  Martin Baulig  <martin@ximian.com>
8583
8584         * decl.cs (DeclSpace.FindType): Also use
8585         TypeManager.CheckGeneric() for types from the using clauses.
8586
8587 2004-03-23  Martin Baulig  <martin@ximian.com>
8588
8589         * expression.cs (Invocation.OverloadResolve): Added `bool
8590         may_fail' argument and use it instead of the Location.IsNull() hack.
8591
8592 2004-03-23  Martin Baulig  <martin@ximian.com>
8593
8594         * expression.cs (Invocation.InferType): Use correct type inference
8595         rules here.     
8596
8597 2004-03-23  Martin Baulig  <martin@ximian.com>
8598
8599         * ecore.cs (MethodGroupExpr.Name): Use
8600         TypeManager.CSharpSignature() instead of just the name.
8601
8602         * expression.cs (Invocation.OverloadResolve): Provide better error
8603         reporting.
8604         (Invocation.DoResolve): OverloadResolve() never returns null
8605         without reporting an error, so removed the error -6 reporting here.
8606
8607 2004-03-23  Martin Baulig  <martin@ximian.com>
8608
8609         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8610         generic methods.
8611
8612         * cs-parser.jay (delegate_declaration): Support generic delegates.
8613
8614         * delegate.cs: Support generic delegates.
8615
8616 2004-03-22  Martin Baulig  <martin@ximian.com>
8617
8618         * expression.cs (Invocation.InferParamsTypeArguments): New static
8619         method; does type inference for params arguments.
8620
8621 2004-03-21  Martin Baulig  <martin@ximian.com>
8622
8623         * typemanager.cs (TypeManager.IsGenericMethod): New public static
8624         method; checks whether a method is a generic method.    
8625
8626         * expression.cs (Invocation.InferTypeArguments): New static method;
8627         infer type arguments for generic method invocation.
8628
8629         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8630         property; we set this to true if we're resolving a generic method
8631         invocation and the user specified type arguments, ie. we're not
8632         doing type inference.
8633
8634 2004-03-20  Martin Baulig  <martin@ximian.com>
8635
8636         * class.cs (MethodData.DeclaringType): New public property.
8637         (MethodData.Define): Set DeclaringType here.
8638         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8639         instead of OperatorMethodBuilder.DeclaringType.
8640
8641 2004-03-20  Martin Baulig  <martin@ximian.com>
8642
8643         * cs-tokenizer.cs (xtoken): Return a special
8644         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8645
8646         * cs-parser.jay (default_value_expression): Switch to the new
8647         syntax (14.5.13).
8648
8649 2004-03-19  Martin Baulig  <martin@ximian.com>
8650
8651         * decl.cs (MemberName): New class.  We use this to "construct"
8652         namespace_or_type_name's.
8653
8654         * generics.cs (TypeArguments.GetDeclarations): New public method;
8655         returns the type arguments as a string[] and reports a CS0081 if
8656         one of them is not an identifier.
8657
8658         * class.cs (MemberBase): The .ctor now takes the name as a
8659         MemberName instead of a string.
8660         (MemberBase.ExplicitInterfaceName): Changed type from string to
8661         Expression.
8662         (MemberBase.DoDefine): If we're an explicit implementation, the
8663         InterfaceType may be a generic instance.
8664
8665         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8666         (namespace_name): Call MemberName.GetName () to transform the
8667         MemberName into a string and ensure we don't have any type
8668         arguments.
8669         (type_name): Call MemberName.GetTypeExpression() to transfrom the
8670         MemberName into an expression.
8671         (method_header): Use namespace_or_type_name instead of member_name.     
8672
8673 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8674
8675         * rootcontext.cs: Add new types to the boot resolution.
8676
8677         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8678         MulticastDelegate is not allowed.
8679
8680         * typemanager.cs: Add new types to lookup: System.TypedReference
8681         and ArgIterator.
8682
8683         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8684         check for TypedReference or ArgIterator, they are not allowed. 
8685
8686         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8687         makes us properly catch 1510 in some conditions (see bug 56016 for
8688         details). 
8689
8690 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8691
8692         * CryptoConvert.cs: update from corlib version
8693         with endian fixes.
8694
8695 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8696
8697         * class.cs (Indexer.Define): Check indexername declaration
8698
8699 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8700
8701         * attribute.cs (IsClsCompliant): Fixed problem with handling
8702         all three states (compliant, not-compliant, undetected).
8703
8704 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8705
8706         * attribute.cs (Attribute): Location is now public.
8707         (Resolve): Store resolved arguments (pos_values) in attribute class.
8708         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8709         (GetClsCompliantAttributeValue): New method that gets
8710         CLSCompliantAttribute value.
8711         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8712         if exists else null.
8713         (AttributeTester): New class for CLS-Compliant verification routines.
8714
8715         * class.cs (Emit): Add CLS-Compliant verification.
8716         (Method.GetSignatureForError): Implemented.
8717         (Constructor.GetSignatureForError): Implemented
8718         (Constructor.HasCompliantArgs): Returns if constructor has
8719         CLS-Compliant arguments.
8720         (Constructor.Emit): Override.
8721         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8722         is needed to test only parameters.
8723         (FieldBase.GetSignatureForError): Implemented.
8724         (TypeContainer): New member for storing base interfaces.
8725         (TypeContainer.FindMembers): Search in base interfaces too.
8726
8727         * codegen.cs (GetClsComplianceAttribute): New method that gets
8728         assembly or module CLSCompliantAttribute value.
8729         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8730         for assembly.
8731         (ModuleClass.Emit): Add error 3012 test.
8732
8733         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8734
8735         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8736         state for all decl types.
8737         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8738         if CLS-Compliant tests are required.
8739         (IsClsCompliaceRequired): New method. Analyze whether code
8740         must be CLS-Compliant.
8741         (IsExposedFromAssembly): New method. Returns true when MemberCore
8742         is exposed from assembly.
8743         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8744         value or gets cached value.
8745         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8746         is explicitly marked with CLSCompliantAttribute.
8747         (IsIdentifierClsCompliant): New abstract method. This method is
8748         used to testing error 3005.
8749         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8750         for identifier and parameters CLS-Compliant testing.
8751         (VerifyClsCompliance): New method. The main virtual method for
8752         CLS-Compliant verifications.
8753         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8754         null. I don't know why is null (too many public members !).
8755         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8756         and get value of first CLSCompliantAttribute that found.
8757
8758         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8759         (VerifyClsCompliance): Override and add extra tests.
8760
8761         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8762         clscheck- disable CLS-Compliant verification event if assembly is has
8763         CLSCompliantAttribute(true).
8764
8765         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8766         ApllyAttribute is now called in emit section as in the other cases.
8767         Possible future Emit integration.
8768         (IsIdentifierClsCompliant): New override.
8769         (VerifyClsCompliance): New override.
8770         (GetEnumeratorName): Returns full enum name.
8771
8772         * parameter.cs (GetSignatureForError): Implemented.
8773
8774         * report.cs (WarningData): New struct for Warning message information.
8775         (LocationOfPreviousError): New method.
8776         (Warning): New method. Reports warning based on the warning table.
8777         (Error_T): New method. Reports error based on the error table.
8778
8779         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8780         verifications are done here.
8781
8782         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8783
8784         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8785         CLSCompliantAttribute.
8786         (all_imported_types): New member holds all imported types from other
8787         assemblies.
8788         (LoadAllImportedTypes): New method fills static table with exported types
8789         from all referenced assemblies.
8790         (Modules): New property returns all assembly modules.
8791
8792 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8793
8794         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8795         throwing a parser error.
8796
8797         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8798         which removes the hardcoded get_/set_ prefixes for properties, as
8799         IL allows for the properties to be named something else.  
8800
8801         Bug #56013
8802
8803         * expression.cs: Do not override operand before we know if it is
8804         non-null.  Fix 56207
8805
8806 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8807
8808         * typemanager.cs: support for pinned variables.
8809
8810 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8811
8812         * decl.cs, typemanager.cs: Avoid using an arraylist
8813         as a buffer if there is only one result set.
8814
8815 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8816
8817         * expression.cs: Make sure you cant call a static method
8818         with an instance expression, bug #56174.
8819
8820 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8821
8822         * class.cs (IsDuplicateImplementation): Improve error reporting to
8823         flag 663 (method only differs in parameter modifier).
8824
8825         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8826         in preprocessor directives.
8827
8828         * location.cs (LookupFile): Allow for the empty path.
8829
8830         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8831         better approach for some of that patch, but its failing with the
8832         CharSet enumeration.  For now try/catch will do.
8833
8834         * typemanager.cs: Do not crash if a struct does not have fields.
8835         Fixes 56150.
8836
8837 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8838
8839         * expression.cs: cs0213, cant fix a fixed expression.
8840         fixes 50231.
8841
8842 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8843
8844         * cs-parser.jay: detect invalid embeded statements gracefully.
8845         bug #51113.
8846
8847 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8848
8849         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8850         As a regex:
8851         s/
8852         the invocation type may not be a subclass of the tye of the item/
8853         The type of the item must be a subclass of the invocation item.
8854         /g
8855
8856         Fixes bug #50820.
8857
8858 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8859
8860         * attribute.cs: Added methods to get a string and a bool from an
8861         attribute. Required to information from AssemblyKeyFileAttribute,
8862         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8863         * codegen.cs: Modified AssemblyName creation to include support for
8864         strongnames. Catch additional exceptions to report them as CS1548.
8865         * compiler.csproj: Updated include CryptoConvert.cs.
8866         * compiler.csproj.user: Removed file - user specific configuration.
8867         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8868         Mono.Security assembly. The original class is maintained and tested in
8869         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8870         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8871         like CSC 8.0 (C# v2) supports.
8872         * Makefile: Added CryptoConvert.cs to mcs sources.
8873         * rootcontext.cs: Added new options for strongnames.
8874
8875 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8876
8877         * driver.cs: For --expect-error, report error code `2'
8878         if the program compiled with no errors, error code `1' if
8879         it compiled with an error other than the one expected.
8880
8881 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8882
8883         * compiler.csproj: Updated for Visual Studio .NET 2003.
8884         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8885         * compiler.sln: Updated for Visual Studio .NET 2003.
8886
8887 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8888
8889         * expression.cs: Fix bug #47234. We basically need to apply the
8890         rule that we prefer the conversion of null to a reference type
8891         when faced with a conversion to 'object' (csc behaviour).
8892
8893 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8894
8895         * statement.cs: Shorter form for foreach, eliminates
8896         a local variable. r=Martin.
8897
8898 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8899
8900         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8901         checks if we can use brtrue/brfalse to test for 0.
8902         * expression.cs: use the above in the test for using brtrue/brfalse.
8903         cleanup code a bit.
8904
8905 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8906
8907         * expression.cs: Rewrite string concat stuff. Benefits:
8908
8909         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8910         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8911         rather than a concat chain.
8912
8913         * typemanager.cs: Add lookups for more concat overloads.
8914
8915 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8916
8917         * expression.cs: Emit shorter il code for array init.
8918
8919         newarr
8920         dup
8921         // set 1
8922
8923         // set 2
8924
8925         newarr
8926         stloc.x
8927
8928         ldloc.x
8929         // set 1
8930
8931         ldloc.x
8932         // set 2
8933
8934 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8935
8936         * statement.cs: Before, two switch blocks would be merged if the
8937         total size of the blocks (end_item - begin_item + 1) was less than
8938         two times the combined sizes of the blocks.
8939
8940         Now, it will only merge if after the merge at least half of the
8941         slots are filled.
8942
8943         fixes 55885.
8944
8945 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8946
8947         * class.cs : csc build fix for GetMethods(). See bug #52503.
8948
8949 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8950
8951         * expression.cs: Make sure fp comparisons work with NaN.
8952         This fixes bug #54303. Mig approved this patch a long
8953         time ago, but we were not able to test b/c the runtime
8954         had a related bug.
8955
8956 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8957
8958         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8959
8960 2004-03-19  Martin Baulig  <martin@ximian.com>
8961
8962         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8963         two overloads may unify for some type parameter substitutions and
8964         report a CS0408 if appropriate.
8965
8966 2004-03-19  Martin Baulig  <martin@ximian.com>
8967
8968         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8969         error here and not in our caller.
8970
8971 2004-03-19  Martin Baulig  <martin@ximian.com>
8972
8973         * interface.cs: Completely killed this file.
8974         (Interface): We're now a TypeContainer and live in class.cs.
8975
8976         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8977         argument; we're now also called for interfaces.
8978         (TypeContainer.DefineMembers): Allow this method being called
8979         multiple times.
8980         (TypeContainer.GetMethods): New public method; formerly known as
8981         Interface.GetMethod().  This is used by PendingImplementation.
8982         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8983         it's now private and non-static.
8984         (Interface): Moved this here; it's now implemented similar to
8985         Class and Struct.
8986         (Method, Property, Event, Indexer): Added `bool is_interface'
8987         argument to their .ctor's.
8988         (MemberBase.IsInterface): New public field.
8989
8990         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8991         instances instead of InterfaceMethod, InterfaceProperty, etc.
8992         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8993         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8994
8995 2004-03-19  Martin Baulig  <martin@ximian.com>
8996
8997         * class.cs (MethodCore.IsDuplicateImplementation): New private
8998         method which does the CS0111 checking.
8999         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9000         Use IsDuplicateImplementation().
9001
9002 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9003
9004         * decl.cs (FindMemberToOverride): New method to find the correct
9005         method or property to override in the base class.
9006         * class.cs
9007             - Make Method/Property use the above method to find the
9008               version in the base class.
9009             - Remove the InheritableMemberSignatureCompare as it is now
9010               dead code.
9011
9012         This patch makes large code bases much faster to compile, as it is
9013         O(n) rather than O(n^2) to do this validation.
9014
9015         Also, it fixes bug 52458 which is that nested classes are not
9016         taken into account when finding the base class member.
9017
9018         Reviewed/Approved by Martin.
9019
9020 2004-03-17  Martin Baulig  <martin@ximian.com>
9021
9022         * expression.cs (MemberAccess.DoResolve): Take the parent's number
9023         of type arguments into account; use the `real_num_type_args'
9024         approach like in DoResolveAsTypeStep().
9025
9026         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9027         nested types.
9028
9029 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9030
9031         * interface.cs: In all interface classes removed redundant
9032         member initialization.
9033
9034 2004-03-16  Martin Baulig  <martin@ximian.com>
9035
9036         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9037
9038 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9039
9040         * decl.cs (DefineTypeAndParents): New helper method to define a
9041         type's containers before the type itself is defined;  This is a
9042         bug exposed by the recent changes to Windows.Forms when an
9043         implemented interface was defined inside a class that had not been
9044         built yet.   
9045
9046         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9047
9048         (Check): Loop correctly to report errors modifiers
9049         (UNSAFE was not in the loop, since it was the same as TOP).
9050
9051         * interface.cs: Every interface member now takes a ModFlags,
9052         instead of a "is_new" bool, which we set on the base MemberCore. 
9053
9054         Every place where we called "UnsafeOk" in the interface, now we
9055         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9056         the unsafe settings from the member declaration instead of the
9057         container interface. 
9058
9059         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9060
9061         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9062         `set_indexer_name' to the pending bits (one per type).
9063
9064         We fixed a bug today that was picking the wrong method to
9065         override, since for properties the existing InterfaceMethod code
9066         basically ignored the method name.  Now we make sure that the
9067         method name is one of the valid indexer names.
9068
9069 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9070  
9071         * support.cs (SeekableStreamReader): Keep track of stream byte
9072         positions and don't mix them with character offsets to the buffer.
9073
9074         Patch from Gustavo Giráldez
9075
9076 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9077
9078         * interface.cs (InterfaceSetGetBase): Removed double member
9079         initialization, base class does it as well.
9080
9081 2004-03-13  Martin Baulig  <martin@ximian.com>
9082
9083         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9084         when compiling corlib.
9085
9086 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9087
9088         * convert.cs (ExplicitConversion): We were reporting an error on
9089         certain conversions (object_type source to a value type, when the
9090         expression was `null') before we had a chance to pass it through
9091         the user defined conversions.
9092
9093         * driver.cs: Replace / and \ in resource specifications to dots.
9094         Fixes 50752
9095
9096         * class.cs: Add check for duplicate operators.  Fixes 52477
9097
9098 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9101         that are in the middle of the statements, not only at the end.
9102         Fixes #54987
9103
9104         * class.cs (TypeContainer.AddField): No longer set the
9105         `HaveStaticConstructor' flag, now we call it
9106         `UserDefineStaticConstructor' to diferentiate the slightly
9107         semantic difference.
9108
9109         The situation is that we were not adding BeforeFieldInit (from
9110         Modifiers.TypeAttr) to classes that could have it.
9111         BeforeFieldInit should be set to classes that have no static
9112         constructor. 
9113
9114         See:
9115
9116         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9117
9118         And most importantly Zoltan's comment:
9119
9120         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9121
9122         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9123          before its static fields are used', i.e. initialization does not need
9124          to be triggered by the first access to the type. Setting this flag
9125          helps the JIT to compile better code, since it can run the static
9126          constructor at JIT time, and does not need to generate code to call it
9127          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9128          this flag for lots of classes like String. 
9129          
9130          csc sets this flag if the type does not have an explicit static 
9131          constructor. The reasoning seems to be that if there are only static
9132          initalizers for a type, and no static constructor, then the programmer
9133          does not care when this initialization happens, so beforefieldinit
9134          can be used.
9135          
9136          This bug prevents the AOT compiler from being usable, since it 
9137          generates so many calls to mono_runtime_class_init that the AOT code
9138          is much slower than the JITted code. The JITted code is faster, 
9139          because it does not generate these calls if the vtable is type is
9140          already initialized, which is true in the majority of cases. But the
9141          AOT compiler can't do this."
9142
9143 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9144
9145         * class.cs (MethodData.Emit): Refactor the code so symbolic
9146         information is generated for destructors;  For some reasons we
9147         were taking a code path that did not generate symbolic information
9148         before. 
9149
9150 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9151
9152         * class.cs: Create a Constructor.CheckBase method that
9153         takes care of all validation type code. The method
9154         contains some code that was moved from Define.
9155
9156         It also includes new code that checks for duplicate ctors.
9157         This fixes bug #55148.
9158
9159 2004-03-09  Joshua Tauberer <tauberer@for.net>
9160
9161         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9162         a { ... }-style array creation invokes EmitStaticInitializers
9163         which is not good for reference-type arrays.  String, decimal
9164         and now null constants (NullCast) are not counted toward
9165         static initializers.
9166
9167 2004-03-05  Martin Baulig  <martin@ximian.com>
9168
9169         * location.cs (SourceFile.HasLineDirective): New public field;
9170         specifies whether the file contains or is referenced by a "#line"
9171         directive.
9172         (Location.DefineSymbolDocuments): Ignore source files which
9173         either contain or are referenced by a "#line" directive.        
9174
9175 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9176
9177         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9178         direct access to our parent, so check the method inline there.
9179
9180 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9181
9182         * expression.cs (Invocation.EmitCall): Miguel's last commit
9183         caused a regression. If you had:
9184
9185             T t = null;
9186             t.Foo ();
9187
9188         In Foo the implict this would be null.
9189
9190 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9191
9192         * expression.cs (Invocation.EmitCall): If the method is not
9193         virtual, do not emit a CallVirt to it, use Call.
9194
9195         * typemanager.cs (GetFullNameSignature): Improve the method to
9196         cope with ".ctor" and replace it with the type name.
9197
9198         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9199         as an argument the ConstructorBuilder where it is being defined,
9200         to catch the recursive constructor invocations.
9201
9202 2004-03-16  Martin Baulig  <martin@ximian.com>
9203
9204         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9205         ConstructedType, call ResolveType() on it to get the type rather
9206         than just using `expr.Type'.
9207
9208 2004-03-16  Martin Baulig  <martin@ximian.com>
9209
9210         * generics.cs (ConstructedType.GetMemberAccess): Take the
9211         EmitContext instead on the TypeExpr and use
9212         ec.TypeContainer.CurrentType/ec.ContainerType.
9213
9214 2004-03-16  Martin Baulig  <martin@ximian.com>
9215
9216         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9217         parameters before aliases.
9218
9219 2004-03-16  Martin Baulig  <martin@ximian.com>
9220
9221         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9222         New oublic function; checks whether two generic instances may become
9223         equal under some instantiations (26.3.1).
9224
9225         * class.cs (TypeContainer.Define): Call
9226         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9227         error.
9228
9229 2004-03-16  Martin Baulig  <martin@ximian.com>
9230
9231         * class.cs (TypeContainer.GetClassBases): Moved
9232         Error_TypeParameterAsBase() here and also check whether the base
9233         class is not an attribute.
9234
9235 2004-03-16  Martin Baulig  <martin@ximian.com>
9236
9237         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9238
9239 2004-03-16  Martin Baulig  <martin@ximian.com>
9240
9241         * class.cs (Error_TypeParameterAsBase): Use correct error number
9242         here (CS0689).  
9243
9244 2004-03-16  Martin Baulig  <martin@ximian.com>
9245
9246         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9247         for generics.
9248
9249         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9250         error reporting.
9251
9252 2004-03-15  Martin Baulig  <martin@ximian.com>
9253
9254         * typemanager.cs (TypeManager.GetFullName): New public method.
9255         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9256         argument; only return members with the correct number of type
9257         arguments.
9258         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9259         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9260         whether the number of type arguments matches.
9261
9262         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9263         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9264
9265         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9266         field; it's set by the protected .ctor when we're actually a
9267         GenericMemberAccess.
9268         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9269         arguments and pass it to MemberLookupFinal ().
9270
9271         * ecore.cs (Expression.MemberLookup): Added `int
9272         num_type_arguments' argument; only return members with the correct
9273         number of type arguments.
9274         (Expression.MemberLookupFailed): Check whether the MemberLookup
9275         failed because we did not have the correct number of type
9276         arguments; report CS0305 in this case.
9277
9278         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9279         `e.ResolveAsTypeTerminal()' already did so.
9280
9281 2004-03-15  Martin Baulig  <martin@ximian.com>
9282
9283         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9284         we're a ConstructedType; in this case, the caller must report an
9285         error (for instance CS0131).
9286
9287         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9288         (TypeArguments.Resolve): Actually report errors here.
9289
9290 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9291
9292         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9293         `set_indexer_name' to the pending bits (one per type).
9294
9295         We fixed a bug today that was picking the wrong method to
9296         override, since for properties the existing InterfaceMethod code
9297         basically ignored the method name.  Now we make sure that the
9298         method name is one of the valid indexer names.
9299
9300 2004-03-15  Martin Baulig  <martin@ximian.com>
9301
9302         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9303         for generic instances.
9304
9305 2004-03-13  Martin Baulig  <martin@ximian.com>
9306
9307         * class.cs (TypeContainer.DefineType): Call
9308         TypeManager.AddUserType() immediately after creating the
9309         TypeBuilder; pass all type parameters when creating the
9310         CurrentType.
9311
9312         * decl.cs (DeclSpace.FindNestedType): New public method.
9313         (DeclSpace.FindType): Added `int num_type_args' argument; only
9314         return types with the correct number of type parameters.
9315         (DeclSpace.CountTypeParams): New public property.
9316
9317         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9318         the number of type parameters; defaults to zero.
9319
9320         * generic.cs (TypeArguments.Count): New public property.
9321         (ConstructedType.DoResolveAsTypeStep): First call
9322         ds.FindNestedType() to find out whether we're nested in the
9323         current generic type; in this case, we inherit all type parameters
9324         from the current class.
9325
9326         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9327         num_type_args' argument.
9328         (RootContext.LookupType): Added overloaded version which takes the
9329         number of type arguments; only return types with the correct
9330         number of type arguments.
9331
9332         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9333         checks whether `Type t' has `int num_type_args'.
9334
9335 2004-03-13  Martin Baulig  <martin@ximian.com>
9336
9337         * generic.cs (GenericMethod.DefineType): New method; calls
9338         DefineType() on all the type parameters.
9339
9340         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9341         (MethodData.Define): If we're a generic method, call
9342         GenericMethod.DefineType() to define the type parameters.       
9343
9344 2004-03-10  Martin Baulig  <martin@ximian.com>
9345
9346         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9347         instead of IsAssignableFrom.    
9348
9349 2004-03-10  Martin Baulig  <martin@ximian.com>
9350
9351         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9352
9353         * support.cs (ParameterData.HasArrayParameter): New property.
9354         (ReflectionParameters.ctor): Take a MethodBase instead of a
9355         ParameterInfo[].  If we have any type parameters, get the generic
9356         method definition and ask it whether we have variable arguments.
9357
9358 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9361         routines to check if a type is an enumerable/enumerator allow
9362         classes that implement the IEnumerable or IEnumerator interfaces.
9363
9364         * class.cs (Property, Operator): Implement IIteratorContainer, and
9365         implement SetYields.
9366
9367         (Property.Define): Do the block swapping for get_methods in the
9368         context of iterators.   We need to check if Properties also
9369         include indexers or not.
9370
9371         (Operator): Assign the Block before invoking the
9372         OperatorMethod.Define, so we can trigger the Iterator code
9373         replacement. 
9374
9375         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9376         Property and Operator classes are not created when we parse the
9377         declarator but until we have the block completed, so we use a
9378         singleton SimpleIteratorContainer.Simple to flag whether the
9379         SetYields has been invoked.
9380
9381         We propagate this setting then to the Property or the Operator to
9382         allow the `yield' to function.
9383
9384 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9385
9386         * codegen.cs: Implemented attribute support for modules.
9387         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9388         Assembly/Module functionality.
9389
9390         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9391         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9392         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9393
9394 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9395
9396         * interface.cs (FindMembers): The operation is performed on all base
9397         interfaces and not only on the first. It is required for future CLS Compliance patch.
9398
9399 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9400
9401         * statement.cs, codegen.cs:
9402         This patch deals with patterns such as:
9403
9404         public class List : IEnumerable {
9405
9406                 public MyEnumerator GetEnumerator () {
9407                         return new MyEnumerator(this);
9408                 }
9409
9410                 IEnumerator IEnumerable.GetEnumerator () {
9411                         ...
9412                 }
9413                 
9414                 public struct MyEnumerator : IEnumerator {
9415                         ...
9416                 }
9417         }
9418
9419         Before, there were a few things we did wrong:
9420         1) we would emit callvirt on a struct, which is illegal
9421         2) we emited ldarg when we needed to emit ldarga
9422         3) we would mistakenly call the interface methods on an enumerator
9423         type that derived from IEnumerator and was in another assembly. For example:
9424
9425         public class MyEnumerator : IEnumerator
9426
9427         Would have the interface methods called, even if there were public impls of the
9428         method. In a struct, this lead to invalid IL code.
9429
9430 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9431
9432         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9433           renamed to Emit.
9434
9435         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9436
9437 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9438
9439         * cs-parser.jay: Fix small regression: we were not testing V2
9440         compiler features correctly.
9441
9442         * interface.cs: If the emit context is null, then create one
9443
9444 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9445
9446         * decl.cs (GetSignatureForError): New virtual method to get full name
9447           for error messages.
9448
9449         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9450           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9451
9452         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9453           Duplicated members and code in these classes has been removed.
9454           Better encapsulation in these classes.
9455
9456 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9457
9458         * assign.cs (Assign.DoResolve): When dealing with compound
9459         assignments, there is a new rule in ECMA C# 2.4 (might have been
9460         there before, but it is documented here) that states that in:
9461
9462         a op= b;
9463
9464         If b is of type int, and the `op' is a shift-operator, then the
9465         above is evaluated as:
9466
9467         a = (int) a op b 
9468
9469         * expression.cs (Binary.ResolveOperator): Instead of testing for
9470         int/uint/long/ulong, try to implicitly convert to any of those
9471         types and use that in pointer arithmetic.
9472
9473         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9474         method to print information for from the type, not from the
9475         null-method we were given.
9476
9477 2004-02-01  Duncan Mak  <duncan@ximian.com>
9478
9479         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9480         parsing for cmd, fixes bug #53694.
9481
9482 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9483
9484         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9485         in the member name duplication tests. Property and operator name duplication
9486         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9487
9488 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9489
9490         * interface.cs (PopulateMethod): Fixed crash when interface method
9491         returns not existing type (error test cs0246-3.cs).
9492
9493 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9494
9495         * cs-parser.jay (interface_accessors): Re-write actions to also
9496         store attributes attached to get and set methods. Fix spelling
9497         while at it.
9498
9499         (inteface_property_declaration): Modify accordingly.
9500
9501         (InterfaceAccessorInfo): New helper class to store information to pass
9502         around between rules that use interface_accessors.
9503
9504         * interface.cs (Emit): Apply attributes on the get and set
9505         accessors of properties and indexers too.
9506
9507         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9508         right MethodBuilder when applying attributes to the get and set accessors.
9509
9510 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9511
9512         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9513
9514 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9515
9516         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9517
9518 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9521         changes that treat `yield' specially when present before `break'
9522         or `return' tokens.
9523
9524         * cs-tokenizer.cs: yield is no longer a keyword.
9525
9526 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9527
9528         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9529         setting for default constructors.
9530         For default constructors are almost every time set wrong Modifier. The
9531         generated IL code has been alright. But inside mcs this values was
9532         wrong and this was reason why several of my CLS Compliance tests
9533         failed.
9534
9535 2004-02-27  Martin Baulig  <martin@ximian.com>
9536
9537         * generics.cs (ConstructedType.ResolveType): Make the nested type
9538         stuff actually work.
9539
9540 2004-02-25  Martin Baulig  <martin@ximian.com>
9541
9542         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9543         property; returns the type parameters just from the current type,
9544         ie. with the ones from outer classes.
9545         (DeclSpace.LookupGeneric): First search in the current class, then
9546         in outer classes.
9547         (DeclSpace.initialize_type_params): When hiding a type parameter
9548         from an outer class, put it into the `type_param_list' anyways.
9549
9550         * expression.cs (MemberAccess.expr): Made this field protected.
9551
9552         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9553         the type parameters from the current class.
9554
9555         * generic.cs (ConstructedType.ResolveType): Support nested generic
9556         types by taking the type parameters which we inherit from outer
9557         classes into account.
9558         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9559         support for nested generic types.
9560
9561 2004-02-23  Martin Baulig  <martin@ximian.com>
9562
9563         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9564         field and check whether we're nested inside a generic type.
9565         (DeclSpace.ResolveType): If we're resolving to a generic type
9566         definition, create a ConstructedType and return its resolved type.
9567         (DeclSpace.initialize_type_params): New private method;
9568         initializes the `type_param_list' field from the type parameters
9569         from this and all enclosing classes.
9570         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9571         we're already initialized.
9572
9573 2004-02-23  Martin Baulig  <martin@ximian.com>
9574
9575         * class.cs (Method.Define): Create the generic method before
9576         calling DoDefine().
9577         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9578         the TypeContainer one); we use this for generic methods.
9579
9580         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9581         parent's TypeBuilder.
9582
9583 2004-02-18  Martin Baulig  <martin@ximian.com>
9584
9585         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9586         to check for equality.
9587
9588 2004-02-05  Martin Baulig  <martin@ximian.com>
9589
9590         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9591         `ec.TypeContainer.CurrentType', use it instead of
9592         `ec.ContainerType' to check whether we're in the type's ctor.
9593
9594 2004-01-29  Martin Baulig  <martin@ximian.com>
9595
9596         * expression.cs (Invocation.DoResolve): If we're a
9597         `ConstructedType', then we're actually a generic method, so
9598         rewrite the expr as a GenericMemberAccess.
9599
9600         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9601         here; manually parse it into a string.
9602
9603 2004-01-28  Martin Baulig  <martin@ximian.com>
9604
9605         * typemanager.cs (TypeManager.IsEqual): New static method.
9606         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9607         check for equality instead of using `=='.
9608
9609 2004-01-26  Martin Baulig  <martin@ximian.com>
9610
9611         * decl.cs (DeclSpace.CurrentType): New public field.
9612
9613         * expression.cs (This.ResolveBase): If we have an
9614         `ec.TypeContainer.CurrentType', use it instead of
9615         `ec.ContainerType'.
9616
9617         * class.cs (TypeContainer.DefineType): If we're a generic type,
9618         create the `CurrentType' (unresolved).
9619         (TypeContainer.GenericType): New private field.
9620         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9621         it and store it in `GenericType' before creating the MemberCache.
9622         (TypeContainer.GetMembers): If we have a `GenericType', call
9623         TypeManager.FindMembers() on it.
9624
9625         * interface.cs (Interface.GenericType): New private field.
9626         (Interface.DefineType): If we're a generic type, create the
9627         `CurrentType' (unresolved).
9628         (Interface.DefineMembers): If we have a `CurrentType', resolve it
9629         and store it in `GenericType' before creating the MemberCache.
9630         (Interface.GetMembers): If we have a `GenericType', call
9631         TypeManager.FindMembers() on it.
9632
9633 2004-01-22  Martin Baulig  <martin@ximian.com>
9634
9635         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9636         not a QualifiedIdentifier.  This is what `type_name_expression'
9637         was previously doing.
9638         (type_name_expression): Removed; the code is now in
9639         `namespace_or_type_name'.
9640         (qualified_identifier): Removed, use `namespace_or_type_name'
9641         instead.
9642         (QualifiedIdentifier): Removed this class.      
9643
9644 2004-01-22  Martin Baulig  <martin@ximian.com>
9645
9646         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9647         not a string as alias name.
9648
9649 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9650
9651         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9652         #52730 bug, and instead compute correctly the need to use a
9653         temporary variable when requesting an address based on the
9654         static/instace modified of the field and the constructor.
9655  
9656 2004-01-21  Martin Baulig  <martin@ximian.com>
9657
9658         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9659         class and namespace before looking up aliases.  Fixes #52517.
9660
9661 2004-01-21  Martin Baulig  <martin@ximian.com>
9662
9663         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9664         assinged in a 'try'; fixes exception4.cs.
9665
9666 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9667         * class.cs : Implemented parameter-less constructor for TypeContainer
9668
9669         * decl.cs: Attributes are now stored here. New property OptAttributes
9670
9671         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9672
9673         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9674
9675 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9676
9677         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9678           (CSharpSignature): New method for indexer and property signature.
9679
9680 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9681
9682         * pending.cs (IsVirtualFilter): Faster implementation.
9683
9684 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9685
9686         * typemanager.cs: Avoid inclusion of same assembly more than once.
9687
9688 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9689
9690         * cs-parser.jay: Fixed problem where the last assembly attribute
9691           has been applied also to following declaration (class, struct, etc.)
9692           
9693 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9694
9695         * class.cs: Added error CS0538, CS0539 reporting.
9696         Fixed crash on Microsoft runtime when field type is void.
9697
9698         * cs-parser.jay: Added error CS0537 reporting.
9699
9700         * pending.cs: Added error CS0535 reporting.
9701         Improved error report for errors CS0536, CS0534.
9702
9703 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9704
9705         Merge a few bits from the Anonymous Method MCS tree.
9706
9707         * statement.cs (ToplevelBlock): New class for toplevel methods,
9708         will hold anonymous methods, lifted variables.
9709
9710         * cs-parser.jay: Create toplevel blocks for delegates and for
9711         regular blocks of code. 
9712
9713 2004-01-20  Martin Baulig  <martin@ximian.com>
9714
9715         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9716         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9717         and `NeedExplicitReturn'; added `IsLastStatement'.
9718         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9719         have a `ReturnLabel' or we're not unreachable.
9720
9721         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9722         child's reachability; don't just override ours with it.  Fixes
9723         #58058 (lluis's example).
9724         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9725         InFinally(), InLoop(), InSwitch() and
9726         BreakCrossesTryCatchBoundary() methods.
9727
9728         * statement.cs (Return): Do all error checking in Resolve().
9729         Unless we are the last statement in a top-level block, always
9730         create a return label and jump to it.
9731         (Break, Continue): Do all error checking in Resolve(); also make
9732         sure we aren't leaving a `finally'.
9733         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9734         statement in a top-level block.
9735         (Block.Flags): Added `IsDestructor'.
9736         (Block.IsDestructor): New public property.
9737
9738 2004-01-20  Martin Baulig  <martin@ximian.com>
9739
9740         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9741
9742 2004-01-20  Martin Baulig  <martin@ximian.com>
9743
9744         * statement.cs (Statement.ResolveUnreachable): New public method.
9745         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9746         (Block.Resolve): Resolve unreachable statements.
9747
9748 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9749
9750         * expression.cs: We need to fix the case where we do
9751         not have a temp variable here.
9752
9753         * assign.cs: Only expression compound assignments need
9754         temporary variables.
9755
9756 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9757
9758         * flowanalysis.cs: Reduce memory allocation in a few ways:
9759           - A block with no variables should not allocate a bit
9760             vector for itself.
9761           - A method with no out parameters does not need any tracking
9762             for assignment of the parameters, so we need not allocate
9763             any data for it.
9764           - The arrays:
9765                 public readonly Type[] VariableTypes;
9766                 public readonly string[] VariableNames;
9767             Are redundant. The data is already stored in the variable
9768             map, so we need not allocate another array for it.
9769           - We need to add alot of checks for if (params | locals) == null
9770             due to the first two changes.
9771
9772 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9773
9774         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9775         implement IMemoryLocation, we store a copy on a local variable and
9776         take the address of it.  Patch from Benjamin Jemlich
9777
9778         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9779         to use a special "type_name_expression" rule which reduces the
9780         number of "QualifiedIdentifier" classes created, and instead
9781         directly creates MemberAccess expressions.
9782
9783 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9784
9785         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9786         that fixes #52853.  Null literal assignment to ValueType
9787
9788         * class.cs (MethodData.Emit): Instead of checking the name of the
9789         method to determine if its a destructor, create a new derived
9790         class from Method called Destructor, and test for that.  
9791
9792         * cs-parser.jay: Create a Destructor object instead of a Method.  
9793
9794         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9795
9796         Fixes: 52933
9797
9798 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9799
9800         * expression.cs (Binary.ResolveOperator): Perform an implicit
9801         conversion from MethodGroups to their delegate types on the
9802         Addition operation.
9803
9804         * delegate.cs: Introduce a new class DelegateCreation that is the
9805         base class for `NewDelegate' and `ImplicitDelegateCreation',
9806         factor some code in here.
9807
9808         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9809         conversion from MethodGroups to compatible delegate types. 
9810
9811         * ecore.cs (Expression.Resolve): Do not flag error 654
9812         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9813         we allow conversions from MethodGroups to delegate types now.
9814
9815         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9816         assignments in v2 either.
9817
9818 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9819
9820         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9821         static read-only fields in ctors.
9822
9823         Applied patch from Benjamin Jemlich 
9824
9825         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9826
9827 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9830         here to return true, as they can be used like this:
9831
9832                 (XXX) int.MEMBER ()
9833
9834         Fixed 49836 and all the other dups
9835
9836 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9837
9838         * driver.cs: Implement /win32res and /win32icon.
9839
9840 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9841
9842         * cs-parser.jay: Add a rule to improve error handling for the
9843         common mistake of placing modifiers after the type.
9844
9845 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9846
9847         * cs-parser.jay (interface_event_declaration): Catch
9848         initialization of events on interfaces, and report cs0068
9849
9850         * cs-parser.jay (interface_event_declaration): Catch
9851         initialization of events. 
9852
9853         * ecore.cs: Better report missing constructors.
9854
9855         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9856         the error reporting done in the wrong place.  Fix.
9857
9858         * expression.cs (Binary.ResolveOperator): Catch the 
9859         operator + (E x, E y) error earlier, and later allow for implicit
9860         conversions in operator +/- (E e, U x) from U to the underlying
9861         type of E.
9862
9863         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9864         52596, if the container class is abstract, the default constructor
9865         is protected otherwise its public (before, we were always public).
9866
9867         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9868         fixed statement.
9869
9870         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9871         Jemlich that fixes bug #52597, MCS was generating invalid code for
9872         idisposable structs.   Thanks to Ben for following up with this
9873         bug as well.
9874
9875 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9876
9877         * driver.cs: Allow assemblies without code to be generated, fixes
9878         52230.
9879
9880 2004-01-07  Nick Drochak <ndrochak@gol.com>
9881
9882         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9883
9884 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9885
9886         * cs-parser.jay: Add rules to improve error reporting if fields or
9887         methods are declared at the namespace level (error 116)
9888
9889         * Add rules to catch event add/remove
9890
9891 2004-01-04  David Sheldon <dave-mono@earth.li>
9892
9893   * expression.cs: Added matching ")" to error message for 
9894   CS0077
9895
9896 2004-01-03 Todd Berman <tberman@gentoo.org>
9897
9898         * ecore.cs, attribute.cs:
9899         Applying fix from #52429.
9900
9901 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9902
9903         * ecore.cs, expression.cs, statement.cs:
9904         Total rewrite of how we handle branching. We
9905         now handle complex boolean expressions with fewer
9906         jumps. As well if (x == 0) no longer emits a ceq.
9907
9908         if (x is Foo) is much faster now, because we generate
9909         better code.
9910
9911         Overall, we get a pretty big improvement on our benchmark
9912         tests. The code we generate is smaller and more readable.
9913
9914         I did a full two-stage bootstrap. The patch was reviewed
9915         by Martin and Miguel.
9916
9917 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9918
9919         * cs-parser.jay: Make primary_expression not take a QI.
9920         we dont need this because the member_access rule covers
9921         us here. So we replace the rule with just IDENTIFIER.
9922
9923         This has two good effects. First, we remove a s/r conflict.
9924         Second, we allocate many fewer QualifiedIdentifier objects.
9925
9926 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9927
9928         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9929         set the correct information via SRE. This prevents
9930         hanging on the MS runtime. Fixes #29374.
9931
9932 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9933
9934         * convert.cs: correctly handle conversions to value types
9935         from Enum and ValueType as unboxing conversions.
9936
9937         Fixes bug #52569. Patch by Benjamin Jemlich.
9938
9939 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9940
9941         * expression.cs (BetterConversion): Prefer int -> uint
9942         over int -> ulong (csc's behaviour). This fixed bug #52046.
9943
9944 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9945
9946         * decl.cs (MemberCache.FindMembers): now returns a
9947         MemberInfo [].
9948
9949         * typemanager.cs: In general, go with with ^^.
9950         (CopyNewMethods): take an IList.
9951         (RealMemberLookup): Only allocate an arraylist
9952         if we copy from two sets of methods.
9953
9954         This change basically does two things:
9955         1) Fewer array lists allocated due to CopyNewMethods.
9956         2) the explicit cast in MemberList costed ALOT.
9957
9958 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9959
9960         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9961         a hashtable to avoid needless string allocations when an identifier is
9962         used more than once (the common case).
9963
9964 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9965
9966         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9967         is broken, it will not return anything. So, we
9968         have to use the information we have in mcs to
9969         do the task.
9970
9971         * typemanager.cs: Add a cache for GetInterfaces,
9972         since this will now be used more often (due to ^^)
9973
9974         (GetExplicitInterfaces) New method that gets the
9975         declared, not effective, interfaces on a type
9976         builder (eg, if you have interface IFoo, interface
9977         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9978         { IBar }.
9979
9980         This patch makes MCS able to bootstrap itself on
9981         Windows again.
9982
9983 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9984
9985         * expression.cs: Remove the Nop's that Miguel put
9986         in by mistake.
9987
9988 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9989
9990         * report.cs, codegen.cs: Give the real stack trace to
9991         the error when an exception is thrown.
9992
9993 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9994
9995         * decl.cs: only allocate hashtables for ifaces if 
9996         it is an iface!
9997
9998 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9999
10000         * expression.cs: fix the error from cs0121-2.cs
10001         (a parent interface has two child interfaces that
10002         have a function with the same name and 0 params
10003         and the function is called through the parent).
10004
10005 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10006
10007         * class.cs, rootcontext.cs, typmanager.cs: do not
10008         leak pointers.
10009
10010 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10011
10012         * codegen.cs: remove stack for the ec flow branching.
10013         It is already a linked list, so no need.
10014
10015 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10016
10017         * Makefile: Allow custom profiler here.
10018
10019 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10020
10021         * typemanager.cs (LookupType):
10022           - Use a static char [], because split takes
10023             a param array for args, so it was allocating
10024             every time.
10025           - Do not store true in a hashtable, it boxes.
10026
10027 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10028
10029         * flowanalysis.cs: bytify common enums.
10030
10031 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10032
10033         * modifiers.cs: Add a new set of flags for the
10034         flags allowed on explicit interface impls.
10035         * cs-parser.jay: catch the use of modifiers in
10036         interfaces correctly.
10037         * class.cs: catch private void IFoo.Blah ().
10038
10039         All related to bug #50572.
10040
10041 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10042
10043         * decl.cs: Rewrite the consistant accessability checking.
10044         Accessability is not linear, it must be implemented in
10045         a tableish way. Fixes #49704.
10046
10047 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10048
10049         * expression.cs: Handle negation in a checked context.
10050         We must use subtraction from zero. Fixes #38674.
10051
10052 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10053
10054         * class.cs: Ignore static void main in DLLs.
10055         * rootcontext.cs: Handle the target type here,
10056         since we are have to access it from class.cs
10057         * driver.cs: account for the above.
10058
10059 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10060
10061         * report.cs: Give line numbers and files if available.
10062
10063 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10064
10065         * driver.cs: Implement /addmodule.
10066
10067         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10068         ModuleBuilders.
10069
10070 2003-12-20  Martin Baulig  <martin@ximian.com>
10071
10072         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10073         (FieldBase.IsAssigned): Removed this field.
10074         (FieldBase.SetAssigned): New public method.
10075         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10076
10077 2003-12-20  Martin Baulig  <martin@ximian.com>
10078
10079         * expression.cs (LocalVariableReference.DoResolve): Don't set
10080         `vi.Used' if we're called from DoResolveLValue().
10081
10082         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10083         returns the usage vector it just merged into the current one -
10084         pass this one to UsageWarning().
10085         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10086         of the `EmitContext', don't call this recursively on our children.
10087
10088 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10089
10090         * driver.cs: Implement /target:module.
10091
10092 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10093
10094         * support.cs (CharArrayHashtable): New helper class.
10095
10096         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10097         char arrays, not strings, so we can avoid creating a string in
10098         consume_identifier if the identifier is a keyword.
10099
10100 2003-12-16  Martin Baulig  <martin@ximian.com>
10101
10102         * statement.cs (LocalInfo.Assigned): Removed this property.
10103         (LocalInfo.Flags): Removed `Assigned'.
10104         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10105         and uses flow analysis.
10106         (Block.UsageWarning): Made this method private.
10107         (Block.Resolve): Call UsageWarning() if appropriate.
10108
10109         * expression.cs (LocalVariableReference.DoResolve): Always set
10110         LocalInfo.Used here.
10111
10112 2003-12-13  Martin Baulig  <martin@ximian.com>
10113
10114         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10115         any value here; we're now using flow analysis to figure out
10116         whether a statement/block returns a value.
10117
10118 2003-12-13  Martin Baulig  <martin@ximian.com>
10119
10120         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10121         working again.
10122         (FlowBranching.MergeFinally): Don't call
10123         `branching.CheckOutParameters()' here, this is called in
10124         MergeTopBlock().
10125         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10126         when adding the `finally' vector.       
10127
10128 2003-12-13  Martin Baulig  <martin@ximian.com>
10129
10130         * flowanalysis.cs
10131         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10132         actually work and also fix #48962.
10133
10134 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10135
10136         * decl.cs: Do not check System.Object for nested types,
10137         since we know it does not have any. Big bang for buck:
10138
10139         BEFORE:
10140            Run 1:   8.35 seconds
10141            Run 2:   8.32 seconds
10142            corlib:  17.99 seconds
10143         AFTER:
10144            Run 1:   8.17 seconds
10145            Run 2:   8.17 seconds
10146            corlib:  17.39 seconds
10147
10148 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10149
10150         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10151         time we are returning 0 members, so we save alot here.
10152
10153 2003-12-11  Martin Baulig  <martin@ximian.com>
10154
10155         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10156         `MergeChild()', also just take the `FlowBranching' as argument;
10157         call Merge() on it and return the result.
10158         (FlowBranching.Merge): We don't need to do anything if we just
10159         have one sibling.
10160
10161 2003-12-11  Martin Baulig  <martin@ximian.com>
10162
10163         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10164         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10165         Maurer for this idea.
10166
10167 2003-12-11  Martin Baulig  <martin@ximian.com>
10168
10169         * flowanalysis.cs (MergeResult): This class is now gone; we now
10170         use the `UsageVector' for this.  The reason for this is that if a
10171         branching just has one sibling, we don't need to "merge" them at
10172         all - that's the next step to do.
10173         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10174         `MergeResult'.
10175
10176 2003-12-11  Martin Baulig  <martin@ximian.com>
10177
10178         Reworked flow analyis and made it more precise and bug-free.  The
10179         most important change is that we're now using a special `Reachability'
10180         class instead of having "magic" meanings of `FlowReturns'.  I'll
10181         do some more cleanups and optimizations and also add some more
10182         documentation this week.
10183
10184         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10185         largely reworked this class.
10186         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10187         the new `Reachability' class instead of having "magic" values here.
10188         (FlowBranching): We're now using an instance of `Reachability'
10189         instead of having separate `Returns', `Breaks' etc. fields.
10190
10191         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10192         based on flow analysis; ignore the return value of block.Emit ().
10193
10194 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10195
10196         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10197         if they are private.
10198
10199 2003-12-09  Martin Baulig  <martin@ximian.com>
10200
10201         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10202         call them directly on the UsageVector.
10203
10204 2003-12-09  Martin Baulig  <martin@ximian.com>
10205
10206         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10207         Changed return type from `FlowReturns' to `Reachability'.
10208
10209 2003-12-09  Martin Baulig  <martin@ximian.com>
10210
10211         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10212         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10213         `Reachable' fields with a single `Reachability' one.
10214
10215 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10216
10217         * class.cs (FindMembers): Remove foreach's.
10218
10219         Bootstrap times:
10220
10221         BEFORE
10222                 Run 1:   8.74 seconds
10223                 Run 2:   8.71 seconds
10224
10225         AFTER
10226                 Run 1:   8.64 seconds
10227                 Run 2:   8.58 seconds
10228
10229
10230 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10231
10232         * cs-parser.jay:
10233         * gen-treedump.cs:
10234         * statement.cs:
10235         This patch does a few things:
10236                 1. EmptyStatement is now a singleton, so it is never reallocated.
10237                 2. All blah is EmptyStatement constructs have been changed to
10238                    blah == EmptyStatement.Value, which is much faster and valid
10239                    now that EmptyStatement is a singleton.
10240                 3. When resolving a block, rather than allocating a new array for
10241                    the non-empty statements, empty statements are replaced with
10242                    EmptyStatement.Value
10243                 4. Some recursive functions have been made non-recursive.
10244         Mainly the performance impact is from (3), however (1) and (2) are needed for
10245         this to work. (4) does not make a big difference in normal situations, however
10246         it makes the profile look saner.
10247
10248         Bootstrap times:
10249
10250         BEFORE
10251         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10252         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10253         Total memory allocated: 56397 KB
10254
10255         AFTER
10256         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10257         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10258         Total memory allocated: 55666 KB
10259
10260 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10261
10262         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10263         than the hashtable in a hashtable version
10264
10265         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10266         we always end up concating a string. This results in a huge perf
10267         loss, because many strings have to be tracked by the GC. In this
10268         patch, we first use a hashtable that works with two keys, so that
10269         the strings do not need to be concat'ed.
10270
10271         Bootstrap times:
10272         BEFORE
10273                 Run 1:   8.74 seconds
10274                 Run 2:   8.71 seconds
10275
10276         AFTER
10277                 Run 1:   8.65 seconds
10278                 Run 2:   8.56 seconds
10279
10280 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10281
10282         * Makefile: Add a new target `do-time' that does a quick and simple
10283         profile, leaving easy to parse output.
10284
10285 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10286
10287         * codegen.cs (Init): Create the dynamic assembly with 
10288         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10289
10290 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10291
10292         * support.cs: Make the PtrHashtable use only one
10293         instance of its comparer.
10294
10295 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10296
10297         * typemanager.cs: Fix lookup of GetNamespaces.
10298
10299 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10300
10301         * expression.cs: Removed redundant line.
10302
10303         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10304         ArrayLists, use for loops with bounds.  
10305
10306         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10307         arraylist.
10308
10309         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10310         arraylists, use for loop with bounds.
10311
10312         The above three changes give us a 0.071 second performance
10313         improvement out of 3.294 seconds down to 3.223.  On my machine
10314         the above changes reduced the memory usage by 1,387 KB during
10315         compiler bootstrap.
10316
10317         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10318         QualifiedIdentifiers.  Before we created a new string through
10319         concatenation, and mostly later on, the result would be
10320         manipulated by DecomposeQI through string manipulation.
10321
10322         This reduced the compiler memory usage for bootstrapping from
10323         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10324         compile times in 0.05 seconds.
10325
10326 2003-11-28  Dick Porter  <dick@ximian.com>
10327
10328         * support.cs: Do string compares with the Invariant culture.
10329
10330         * rootcontext.cs: 
10331         * gen-treedump.cs: 
10332         * expression.cs: 
10333         * driver.cs: 
10334         * decl.cs: 
10335         * codegen.cs: 
10336         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10337         the comparison is done with the Invariant culture.
10338
10339 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10340
10341         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10342         GetEnumerator method.
10343
10344         (ProbeCollectionType): Iterate starting at the most specific type
10345         upwards looking for a GetEnumerator
10346
10347         * expression.cs: Shift count can be up to 31 for int/uint and 63
10348         for long/ulong.
10349
10350 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10351
10352         * statement.cs (Block.LookupLabel): Also look for the label on the
10353         children blocks.  Use a hash table to keep track of visited
10354         nodes. 
10355
10356         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10357         we actually did transform the other operand, otherwise fall back
10358         to the common codepath that casts to long.
10359
10360         * cs-tokenizer.cs: Use the same code pattern as the int case.
10361         Maybe I should do the parsing myself, and avoid depending on the
10362         Parse routines to get this done.
10363
10364 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10367         which fixes bug 51347.  This time test it.
10368
10369         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10370         attributes for example can not tell the difference between these.
10371         The difference was only a syntax feature of the language. 
10372
10373         * attribute.cs: Apply attributes to delegates.
10374
10375         * delegate.cs: Call the apply attributes method.
10376
10377 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10380         comparing 0 vs Byte.MinValue, not the value
10381
10382         (ImplicitConversionRequired): When reporting a conversion error,
10383         use error 31 to print out the constant error instead of the
10384         simpler 29.
10385
10386         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10387         which fixes bug 51347.
10388
10389 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10390
10391         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10392         which fixes the -warnaserror command line option.
10393
10394 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * cfold.cs (DoNumericPromotions): During constant folding of
10397         additions on UIntConstant, special case intconstants with
10398         IntConstants like we do on the expression binary operator. 
10399
10400 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10401
10402         * convert.cs (ImplicitReferenceConversion): We were missing a case
10403         (System.Enum are not value types or class types, so we need to
10404         classify them separatedly).
10405
10406         * driver.cs: We do not support error 2007.
10407
10408 2003-11-12 Jackson Harper <jackson@ximian.com>
10409
10410         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10411         system directory. Also use the full file name so users can
10412         libraries names mscorlib-o-tron.dll in a non system dir.
10413         
10414 2004-01-04  David Sheldon <dave-mono@earth.li>
10415
10416         * expression.cs: Added matching ")" to error message for CS0077.
10417
10418 2003-12-19  Martin Baulig  <martin@ximian.com>
10419
10420         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10421         static method; see documentation in the method.
10422         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10423
10424         * convert.cs (Convert.ImplicitReferenceConversion,
10425         Convert.ImplicitReferenceConversionExists): Add support for
10426         generic type declarations; see gen-36.cs.
10427
10428 2003-12-19  Martin Baulig  <martin@ximian.com>
10429
10430         * pending.cs (Pending.InterfaceMethod): Use
10431         `Type.IsAssignableFrom()' instead of `=='.
10432
10433 2003-12-18  Martin Baulig  <martin@ximian.com>
10434
10435         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10436         byref types first.
10437
10438         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10439         `expr_type.Equals (target_type)' instead of `=='.
10440
10441 2003-12-08  Martin Baulig  <martin@ximian.com>
10442
10443         * generics.cs (Constraints.Types): Removed.
10444         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10445         to Type's.
10446         (Constraints.ResolveTypes): New public method; resolves the
10447         TypeExpr's to Type's.
10448         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10449         longer takes the constraints.
10450         (TypeParameter.DefineMethod): Likewise.
10451         (TypeParameter.DefineType): New public method.  Calls
10452         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10453         the constraints.
10454
10455 2003-12-08  Martin Baulig  <martin@ximian.com>
10456
10457         * convert.cs (Convert.ImplicitConversionStandard): Use
10458         `expr_type.Equals (target_type)' instead of `=='.
10459
10460 2003-12-08  Martin Baulig  <martin@ximian.com>
10461
10462         * typemanager.cs (TypeManager.GetReferenceType): Call
10463         `Type.MakeByRefType ()'.
10464
10465 2003-12-08  Martin Baulig  <martin@ximian.com>
10466
10467         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10468         just has some special meaning in some situations.  For instance,
10469         it is allowed to use `where' as the name of a variable etc.
10470
10471 2003-12-04  Martin Baulig  <martin@ximian.com>
10472
10473         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10474         `Type.MakeArrayType()' for array types.
10475
10476 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10477
10478         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10479         debugging message.
10480
10481         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10482         corlib to compile.
10483
10484 2003-11-16  Martin Baulig  <martin@ximian.com>
10485
10486         * codegen.cs (EmitContext.IsGeneric): Removed.
10487
10488         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10489         ResolveGeneric() on the DeclSpace.
10490
10491 2003-11-16  Martin Baulig  <martin@ximian.com>
10492
10493         * generic.cs (TypeArguments.Resolve):
10494         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10495         `ResolveType()' on it to get the Type.
10496
10497 2003-11-15  Martin Baulig  <martin@ximian.com>
10498
10499         * generic.cs (ConstructedType.GetInterfaces): Override this.
10500
10501 2003-11-14  Martin Baulig  <martin@ximian.com>
10502
10503         * interface.cs (Interface.DefineType): Define all type parameters
10504         before adding the interfaces we inherit.
10505
10506 2003-11-11  Martin Baulig  <martin@ximian.com>
10507
10508         * generic.cs (ConstructedType.ResolveType): Always call
10509         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10510
10511 2003-11-10  Martin Baulig  <martin@ximian.com>
10512
10513         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10514         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10515         calling `ResolveType()' on them, directly assign their `Type'.
10516
10517 2003-11-08  Martin Baulig  <martin@ximian.com>
10518
10519         * generic.cs (ConstructedType): Override `IsClass' etc.
10520
10521 2003-11-08  Martin Baulig  <martin@ximian.com>
10522
10523         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10524         return value and the `out parent' parameter.
10525         (TypeContainer.DefineType): Moved the CS0644 check into
10526         GetClassBases().  Don't pass the interface types to the
10527         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10528         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10529
10530         * ecore.cs (TypeExpr.IsAttribute): New property.
10531         (TypeExpr.GetInterfaces): New method.
10532
10533         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10534         TypeExpr instead of a Type.
10535         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10536         (Interface.DefineType): Don't pass the interface types to the
10537         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10538         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10539
10540         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10541         instead of a `Type[]'.
10542         (TypeManager.RegisterBuilder): Likewise.
10543         (TypeManager.AddUserInterface): Likewise.
10544         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10545         `Type[]' and also return a `TypeExpr[]'.
10546         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10547
10548 2003-11-08  Martin Baulig  <martin@ximian.com>
10549
10550         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10551         Expression.     
10552
10553 2003-11-08  Martin Baulig  <martin@ximian.com>
10554
10555         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10556         TypeManager.ResolveExpressionTypes().
10557
10558         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10559         instead of an Expression.
10560         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10561         (TypeExpression): New public class; formerly known as `TypeExpr'.
10562
10563         * expression.cs (ComposedCast): Derive from TypeExpr.
10564
10565         * typemanager.cs (TypeManager.system_*_expr): These are now
10566         TypExpr's instead of Expression's.
10567         (TypeManager.ResolveExpressionTypes): New public static function;
10568         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10569         of them.        
10570
10571 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10572
10573         * expression.cs (New.DoResolve): Do not dereference value that
10574         might be a null return.
10575
10576         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10577         sure that the constant value has the right type.  Fixes an
10578         unreported bug, similar to 50425.
10579
10580         * const.cs (Const.LookupConstantValue): Call
10581         ImplicitStandardConversionExists before doing a conversion to
10582         avoid havng the TypeManager.ChangeType do conversions.
10583
10584         Reduced the number of casts used
10585
10586         (Const.ChangeType): New routine to enable reuse of the constant
10587         type changing code from statement.
10588
10589         * typemanager.cs (ChangeType): Move common initialization to
10590         static global variables.
10591
10592         Fixes #50425.
10593
10594         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10595         every value type to go through, even if it was void.  Fix that. 
10596
10597         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10598         character of the define, and the is_identifier_part_character for
10599         the rest of the string.
10600
10601 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10602
10603         * expression.cs (UnaryMutator.EmitCode): When I updated
10604         LocalVariableReference.DoResolve, I overdid it, and dropped an
10605         optimization done on local variable references.
10606
10607 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10608
10609         * ecore.cs: Convert the return from Ldlen into an int.
10610
10611 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10614         the accessibility, this is a special case for toplevel non-public
10615         classes (internal for instance).
10616
10617 2003-10-20  Nick Drochak <ndrochak@gol.com>
10618
10619         * ecore.cs: Fix typo and build.  Needed another right paren.
10620
10621 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10622
10623         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10624         `internal' case regular and protected, but not allowing protected
10625         to be evaluated later.  Bug 49840
10626
10627 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10628
10629         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10630         to kb.Nlast, and not the kb.nFirst to isolate the switch
10631         statement.
10632
10633         Extract the underlying type, so enumerations of long/ulong are
10634         treated like long/ulong.
10635
10636 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * expression.cs (New): Overload the meaning of RequestedType to
10639         track the possible creation of the NewDelegate type, since
10640         DoResolve is invoked more than once for new constructors on field
10641         initialization.
10642
10643         See bugs: #48800 and #37014
10644
10645         * cs-parser.jay (declare_local_constants): Take an arraylist
10646         instead of a single constant.
10647
10648         (local_constant_declaration): It should take a
10649         constant_declarators, not a constant_declarator.  Fixes 49487
10650
10651         * convert.cs: Fix error report.
10652
10653 2003-10-13 Jackson Harper <jackson@ximian.com>
10654
10655         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10656         bug #49611
10657         
10658 2003-11-03  Martin Baulig  <martin@ximian.com>
10659
10660         * expression.cs (ArrayAccess.GetStoreOpcode): Added
10661         `out bool has_type_arg'; if set, we need to pass the type to
10662         ig.Emit().
10663         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10664         Stelem_Any/Ldelem_Any for generic parameters.   
10665
10666 2003-11-02  Martin Baulig  <martin@ximian.com>
10667
10668         * expression.cs (Invocation.EmitCall): Use
10669         `TypeManager.IsValueType()' to check whether it's a value type.
10670         Don't set `struct_call' when calling a method on a type parameter.
10671
10672 2003-11-02  Martin Baulig  <martin@ximian.com>
10673
10674         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10675         and removed the TypeBuilder argument.
10676
10677         * typemanager.cs (TypeManager.IsValueType): Return
10678         `t.IsGenericParameter || t.IsValueType'.
10679
10680 2003-10-25  Martin Baulig  <martin@ximian.com>
10681
10682         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10683         call ConstructedType.Resolve() on it.
10684
10685         * generic.cs (ConstructedType.Resolve): Set `type' on success.
10686
10687 2003-10-25  Martin Baulig  <martin@ximian.com>
10688
10689         * class.cs (TypeContainer.GetClassBases): Changed
10690         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
10691         CS8214 reporting here.
10692         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10693         instead of a `Type' for our parent.  In case of a recursive
10694         declaration (see tests/gen-23.cs for an example), our parent is a
10695         ConstructedType and it doesn't have its type set.  So, first
10696         create our own TypeBuilder, then call constructed.Resolve() to get
10697         the parent's type and finally TypeBuilder.SetParent() it.
10698
10699         * ecore.cs (TypeExpr.Name): New public virtual property.
10700
10701         * generic.cs
10702         (ConstructedType): We're now a TypeExpr and not just an Expression.
10703         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10704         arguments here; this is done later.
10705         (ConstructedType.Resolve): New public method to resolve the type
10706         arguments and bind them.
10707
10708 2003-10-21  Martin Baulig  <martin@ximian.com>
10709
10710         * convert.cs: Use `TypeManager.IsValueType' instead of
10711         'type.IsValueType' everywhere.
10712
10713         * typemanager.cs (TypeManager.IsValueType): Return true for type
10714         parameters.  The reason for this is that we need to box a type
10715         parameter when converting it to a reference type.
10716
10717         * cs-parser.jay: Added support for default value expressions.
10718
10719         * generics.cs (DefaultValueExpression): New public class.       
10720
10721 2003-10-17  Martin Baulig  <martin@ximian.com>
10722
10723         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10724         TypeContainer so we can also use this for Interfaces.
10725         (TypeParameter.Resolve): Likewise.
10726
10727         * interface.cs (Interface.DefineType): Added support for generic
10728         interfaces.
10729
10730         * cs-parser.jay: Added support for generic structs and interfaces.
10731
10732 2003-10-17  Martin Baulig  <martin@ximian.com>
10733
10734         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10735         call generic methods :-)
10736
10737 2003-10-16  Martin Baulig  <martin@ximian.com>
10738
10739         * cs-parser.jay (namespace_or_type_name): Only create a
10740         GenericMemberAccess if we actually have type arguments.
10741
10742 2003-10-13  Martin Baulig  <martin@ximian.com>
10743
10744         * class.cs (Method.Define): If we're a generic method, call
10745         TypeBuilder.DefineGenericMethod () before resolving
10746         the parameters.
10747         (MethodData): Added .ctor which takes an additional MethodBuilder
10748         argument; this is used for generic methods.
10749         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10750         we already have a MethodBuilder.
10751
10752 2003-10-10  Martin Baulig  <martin@ximian.com>
10753
10754         * class.cs (Method): Added .ctor which takes a `GenericMethod'
10755         instead of a `DeclSpace'.  This is used for generic methods.
10756
10757         * cs-parser.jay (method_header): Added support for generic
10758         methods; create a `GenericMethod' instance and pass it to the
10759         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10760         parameters and locals.
10761
10762         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10763         since we already have the location.  Check whether we're a generic
10764         type declaration or a generic method and create the correct type
10765         parameter.
10766
10767         * generic.cs (TypeParameter.DefineMethod): New public method.
10768         (GenericMethod): New public class; derives from DeclSpace and is
10769         used for generic methods.       
10770
10771 2003-10-09  Martin Baulig  <martin@ximian.com>
10772
10773         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10774         to the .ctor.
10775         (MethodCore.DoDefineParameters): Removed the TypeContainer
10776         argument; use the DeclSpace which was passed to the .ctor instead.
10777         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10778         TypeContainer; we only need a DeclSpace here.
10779
10780 2003-10-09  Martin Baulig  <martin@ximian.com>
10781
10782         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10783         to the .ctor.
10784         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10785         EmitContext's .ctor.    
10786
10787 2003-10-09  Martin Baulig  <martin@ximian.com>
10788
10789         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10790         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10791         AsAccessible(), moved them as well.
10792
10793         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10794
10795 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10798         generation for >=, as spotted by Paolo, bug 48679.  
10799         Patch from David Waite.
10800
10801         * cs-tokenizer.cs: Add handling for #pragma.
10802
10803         * cs-parser.jay: Allow for both yield and yield return in the
10804         syntax.  The anti-cobolization of C# fight will go on!
10805
10806         * class.cs (TypeBuilder.DefineType): Catch error condition here
10807         (Parent.DefineType erroring out and returning null).
10808
10809         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10810         coping with enumerations variables, we were mistakenly processing
10811         them as a regular value type instead of built-in types.  Fixes the
10812         bug #48063
10813
10814         * typemanager.cs (IsBuiltinOrEnum): New method.
10815
10816 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * cs-parser.jay: Upgrade: yield now needs the return clause.
10819
10820 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10821
10822         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10823
10824 2003-09-29  Martin Baulig  <martin@ximian.com>
10825
10826         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10827         inflated generic methods.
10828
10829         * generics.cs (ConstructedType): Distinguish between open and
10830         closed constructed types; correctly resolve the arguments.
10831
10832 2003-09-22  Martin Baulig  <martin@ximian.com>
10833
10834         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10835         all type arguments meet their constraints.
10836
10837 2003-09-19  Martin Baulig  <martin@ximian.com>
10838
10839         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10840         `MemberCache parent' argument.  Normally, an interface doesn't
10841         have a parent type except System.Object, but we use this in gmcs
10842         for generic type parameters.
10843
10844 2003-09-18  Martin Baulig  <martin@ximian.com>
10845
10846         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10847         on `type.IsInterface'; don't check whether the type has a parent
10848         to determine whether it's an interface.
10849
10850 2003-09-17  Martin Baulig  <martin@ximian.com>
10851
10852         * generic.cs (ConstructedType.ToString): Always use `name' as the
10853         type name.
10854
10855 2003-09-15  Martin Baulig  <martin@ximian.com>
10856
10857         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10858
10859         * generic.cs (Constraints.Resolve): New public method; this is
10860         called to resolve the constraint types and to check whether all
10861         the constraints are correct.
10862         (Constraints.Types): New public property.
10863         (TypeParameter.Resolve): New public method; resolves all the
10864         type's constraints.
10865
10866         * class.cs (TypeContainer.DefineType): Call
10867         TypeParameter.Resolve() before actually defining the type.
10868
10869 2003-09-15  Martin Baulig  <martin@ximian.com>
10870
10871         * class.cs (TypeContainer.DefineType): Added an error flag to
10872         avoid reporting duplicate CS0146's ("class definition is
10873         circular.").
10874
10875         * driver.cs (Driver.MainDriver): Abort if
10876         RootContext.ResolveTree() reported any errors.
10877
10878 2003-09-07  Martin Baulig  <martin@ximian.com>
10879
10880         * report.cs (Error, Warning): Added overloaded versions which take
10881         a `params object[] args' and call String.Format().
10882
10883 2003-09-07  Martin Baulig  <martin@ximian.com>
10884
10885         * decl.cs (DeclSpace..ctor): Don't call
10886         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10887         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10888         (DeclSpace.RecordDecl): New method.
10889
10890         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10891
10892 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10893
10894         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10895         value attributes to be applied to ParameterBuilders.
10896
10897         * class.cs (MethodCore.LabelParameters): Make static and more
10898         generic so that it can be used from other places - like interface
10899         methods, for instance.
10900
10901         * interface.cs (Interface.Emit): Call LabelParameters before
10902         emitting attributes on the InterfaceMethod.
10903
10904 2003-09-07  Martin Baulig  <martin@ximian.com>
10905
10906         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10907         if the number of type parameters doesn't match.
10908
10909 2003-09-04  Martin Baulig  <martin@ximian.com>
10910
10911         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10912         for arrays of generic type params (ie. `!0[]').
10913
10914 2003-09-04  Martin Baulig  <martin@ximian.com>
10915
10916         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10917         for the moment.
10918
10919 2003-09-04  Martin Baulig  <martin@ximian.com>
10920
10921         * decl.cs (DeclSpace.LookupGeneric): New method.
10922         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10923         moment.
10924
10925         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10926         argument, not just a string.
10927         (TypeParameter.Define): New public method; this is called to
10928         actually define the generic parameter; after this, you can use the
10929         new `Type' property to get the type.
10930
10931 2003-09-04  Martin Baulig  <martin@ximian.com>
10932
10933         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10934         is now an ArrayList; initialize the result of the `TypeParameters'
10935         property here.
10936         (DeclSpace.GetGenericData): Removed.
10937         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10938         implement this in a different way.
10939         (DeclSpace.GetTypeParameters): Removed; there's now a
10940         `TypeParameters' property.
10941         (DeclSpace.TypeParameters): New public property.
10942
10943         * generic.cs (Constraints): Make this class public.
10944         (TypeParameter): New public class.
10945
10946 2003-09-04  Martin Baulig  <martin@ximian.com>
10947
10948         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10949         generic parameters.
10950
10951         * class.cs (TypeContainer.DefineType): Call
10952         TypeBuilder.DefineGenericParameter () on all generic parameters if
10953         this is a generic type.
10954
10955 2003-08-28  Martin Baulig  <martin@ximian.com>
10956
10957         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10958         sample-stack.il".
10959
10960         * sample-hello.cs: Compile this with gmcs: "gmcs
10961         /r:sample-stack.dll sample-hello.cs".
10962
10963 2003-08-28  Martin Baulig  <martin@ximian.com>
10964
10965         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10966         the parameters to the generic type.
10967
10968 2003-08-28  Martin Baulig  <martin@ximian.com>
10969
10970         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10971
10972 2003-08-28  Martin Baulig  <martin@ximian.com>
10973
10974         * cs-parser.jay (opt_type_argument_list): Use
10975         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10976         (primary_expression): Replace `qualified_identifier' with `type_name'.
10977         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10978
10979         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10980         parser to check whether it is syntactically a type parameter list;
10981         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10982         this case.
10983
10984 2003-08-26  Martin Baulig  <martin@ximian.com>
10985
10986         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10987         resolving aliases; fixes #47927.
10988
10989 2003-08-26  Martin Baulig  <martin@ximian.com>
10990
10991         * statement.cs (Using.DoResolve): This is internally emitting a
10992         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10993         do not always return.  Fixes #47681.
10994
10995 2003-08-26  Martin Baulig  <martin@ximian.com>
10996
10997         * decl.cs (MemberCore): Moved WarningNotHiding(),
10998         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10999         into MemberBase.
11000         (AdditionResult): Make this nested in DeclSpace.
11001         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11002         argument; call NamespaceEntry.Define() unless we're nested in a
11003         class or struct.
11004
11005         * namespace.cs (Namespace.DefineName): New public function.  This
11006         is called from DeclSpace's .ctor to add 
11007         (Namespace.Lookup): Include DeclSpaces in the lookup.
11008
11009         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11010
11011         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11012
11013 2003-08-25  Martin Baulig  <martin@ximian.com>
11014
11015         * convert.cs (Convert.ExplicitReferenceConversion): When
11016         converting from an interface type to a class, unbox if the target
11017         type is a struct type.  Fixes #47822.
11018
11019 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11020
11021         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11022         #47854.
11023
11024 2003-08-22  Martin Baulig  <martin@ximian.com>
11025
11026         * class.cs (TypeManager.DefineType): When defining a nested type,
11027         call DefineType() on our parent; fixes #47801.
11028
11029 2003-08-22  Martin Baulig  <martin@ximian.com>
11030
11031         * class.cs (MethodData.Define): While checking if a method is an
11032         interface implementation, improve the test a bit more to fix #47654.
11033
11034 2003-08-22  Martin Baulig  <martin@ximian.com>
11035
11036         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11037         correctly; fixes #47722.
11038
11039 2003-08-22  Martin Baulig  <martin@ximian.com>
11040
11041         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11042         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11043
11044         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11045
11046 2003-08-22  Martin Baulig  <martin@ximian.com>
11047
11048         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11049         can only be assigned in static constructors.  Fixes #47161.
11050
11051 2003-08-22  Martin Baulig  <martin@ximian.com>
11052
11053         Rewrote and improved the flow analysis code.
11054
11055         * flowbranching.cs (FlowBranching): Make this class abstract.
11056         (FlowBranching.CreateBranching): New static function to create a
11057         new flow branching.
11058         (FlowBranchingBlock, FlowBranchingException): New classes.
11059         (FlowBranching.UsageVector.Type): New public readonly field.
11060         (FlowBranching.UsageVector.Breaks): Removed the setter.
11061         (FlowBranching.UsageVector.Returns): Removed the setter.
11062         (FlowBranching.UsageVector): Added Break(), Return(),
11063         NeverReachable() and Throw() methods to modify the reachability.
11064         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11065         done by FlowBranching.Merge().
11066         (FlowBranching.UsageVector.MergeChild): New method; merges the
11067         merge result into the current vector.
11068         (FlowBranching.Merge): New abstract method to merge a branching.
11069
11070 2003-08-12  Martin Baulig  <martin@ximian.com>
11071
11072         * expression.cs (Indirection.CacheTemporaries): Create the
11073         LocalTemporary with the pointer type, not its element type.
11074
11075 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11078         token was a keyword or not.
11079
11080         Add `error' options where an IDENTIFIER was expected;  Provide
11081         CheckToken and CheckIdentifierToken convenience error reporting
11082         functions. 
11083
11084         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11085
11086         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11087         NameSpaceEntry NameSpaceEntry.
11088
11089         (LookupInterfaceOrClass): Avoid creating a full qualified name
11090         from namespace and name: avoid doing lookups when we know the
11091         namespace is non-existant.   Use new Tree.LookupByNamespace which
11092         looks up DeclSpaces based on their namespace, name pair.
11093
11094         * driver.cs: Provide a new `parser verbose' to display the
11095         exception thrown during parsing.  This is turned off by default
11096         now, so the output of a failure from mcs is more graceful.
11097
11098         * namespace.cs: Track all the namespaces defined in a hashtable
11099         for quick lookup.
11100
11101         (IsNamespace): New method
11102
11103 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11106         we know that we need to concatenate (full typename can never be
11107         null). 
11108
11109         * class.cs: ditto.
11110
11111         * statement.cs: Use a bitfield;  Do not initialize to null things
11112         which are done by the constructor by default.
11113
11114         * cs-parser.jay: bug fix, parameter was 4, not 3.
11115
11116         * expression.cs: Just use the property;
11117
11118         * statement.cs: No need for GetVariableInfo method.
11119
11120 2003-08-08  Martin Baulig  <martin@ximian.com>
11121
11122         * flowanalysis.cs (FlowReturns): This is now nested in the
11123         `FlowBranching' class.
11124         (MyBitVector): Moved this here from statement.cs.
11125         (FlowBranching.SiblingType): New enum type.
11126         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11127
11128 2003-08-07  Martin Baulig  <martin@ximian.com>
11129
11130         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11131         `FlowBranching' class and called `BranchingType'.
11132
11133 2003-08-07  Martin Baulig  <martin@ximian.com>
11134
11135         * flowanalysis.cs: Moved all the control flow analysis code into
11136         its own file.
11137
11138 2003-08-07  Martin Baulig  <martin@ximian.com>
11139
11140         * assign.cs (Assign.DoResolve): `target' must either be an
11141         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11142         #37319.
11143
11144 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11145
11146         * expression.cs (BinaryMethod): This kind of expression is created by the
11147         Binary class if it determines that the operator has to be handled
11148         by a method.
11149
11150         (BinaryDelegate): This kind of expression is created if we are
11151         dealing with a + or - operator on delegates.
11152
11153         (Binary): remove method, argumetns, and DelegateOperator: when
11154         dealing with methods, 
11155
11156         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11157
11158         * statement.cs (Block): use bitfields for the three extra booleans
11159         we had in use.   Remove unused topblock parameter.
11160
11161         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11162
11163         * assign.cs: Drop extra unneeded tests.
11164
11165 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11166
11167         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11168
11169         * statement.cs (Foreach): Use VariableStorage instead of
11170         LocalBuilders.   
11171
11172         * codegen.cs (VariableStorage): New class used by clients that
11173         require a variable stored: locals or fields for variables that
11174         need to live across yield.
11175
11176         Maybe provide a convenience api for EmitThis+EmitLoad?
11177
11178         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11179         these bad boys.
11180
11181 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11182
11183         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11184         RemapParameterLValue): New methods that are used to turn a
11185         precomputed FieldInfo into an expression like this:
11186
11187                 instance.FieldInfo
11188
11189         The idea is to use this instead of making LocalVariableReference
11190         have more than one meaning.
11191
11192         * cs-parser.jay: Add error production to BASE.
11193
11194         * ecore.cs: Deal with TypeManager.GetField returning null, which
11195         is now a valid return value.
11196
11197         (FieldExprNoAddress): New expression for Fields whose address can
11198         not be taken.
11199
11200         * expression.cs (LocalVariableReference): During the resolve
11201         phases, create new expressions if we are in a remapping context.
11202         Remove code that dealt with remapping here.
11203
11204         (ParameterReference): same.
11205
11206         (ProxyInstance): New expression, like the `This' expression, but
11207         it is born fully resolved.  We know what we are doing, so remove
11208         the errors that are targeted to user-provided uses of `this'.
11209
11210         * statement.cs (Foreach): our variable is now stored as an
11211         Expression;  During resolution, follow the protocol, dont just
11212         assume it will return this.
11213
11214 2003-08-06  Martin Baulig  <martin@ximian.com>
11215
11216         * support.cs (SeekableStreamReader.cs): New public class.
11217
11218         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11219         SeekableStreamReader instead of the normal StreamReader.
11220
11221 2003-08-04  Martin Baulig  <martin@ximian.com>
11222
11223         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11224         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11225         deambiguate casts and delegate invocations.
11226         (parenthesized_expression): Use the new tokens to ensure this is
11227         not a cast of method invocation.
11228
11229         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11230         when reading a `)' and Deambiguate_CloseParens () was previously
11231         called.
11232
11233         * expression.cs (ParenthesizedExpression): New class.  This is
11234         just used for the CS0075 test.
11235         (Binary.DoResolve): Check for CS0075.   
11236
11237 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11238
11239         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11240         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11241         reference comparison.
11242
11243         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11244         examine the ReturnType for equality - this is necessary in the
11245         cases of implicit and explicit operators whose signature also
11246         includes the return type.
11247
11248 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11249
11250         * namespace.cs: Cache the result of the namespace computation,
11251         instead of computing it every time.
11252
11253 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * decl.cs: Use a global arraylist that we reuse over invocations
11256         to avoid excesive memory consumption.  Reduces memory usage on an
11257         mcs compile by one meg (45 average).
11258
11259         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11260         private, work around that.
11261
11262 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11263
11264         * literal.cs (IntLiteral): Define Zero and One static literals. 
11265
11266         * cs-parser.jay (integer_literal): use static literals to reduce
11267         memory usage for the most used literals (0, 1 and -1).  211kb
11268         reduced in memory usage.
11269
11270         Replace all calls to `new ArrayList' with `new
11271         ArrayList(4)' which is a good average number for most allocations,
11272         and also requires only 16 bytes of memory for its buffer by
11273         default. 
11274
11275         This reduced MCS memory usage in seven megabytes for the RSS after
11276         bootstrapping.
11277
11278 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11279
11280         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11281         handle params methods the correct way by forming only one
11282         applicable set with params and normal methods in them. Earlier we
11283         were looking at params methods only if we found no normal methods
11284         which was not the correct thing to do.
11285
11286         (Invocation.BetterFunction): Take separate arguments indicating
11287         when candidate and the best method are params methods in their
11288         expanded form.
11289
11290         This fixes bugs #43367 and #46199.
11291
11292         * attribute.cs: Documentation updates.
11293
11294         (CheckAttribute): Rename to CheckAttributeTarget.
11295         (GetValidPlaces): Rename to GetValidTargets.
11296
11297         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11298         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11299
11300         Fixes bug #44468.
11301
11302 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11303
11304         * codegen.cs: Compute IsGeneric correctly.
11305
11306         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11307         resolution. 
11308
11309         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11310         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11311         regressions, and I was chasing more bugs than I required.
11312
11313         * interface.cs: Use expressions for base type names (like classes
11314         and structs have been doing for a while now), and resolve that.
11315         This patch should probably go into head as well.
11316
11317         This makes it one less user of FindType.
11318
11319 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11320
11321         This compiler can not self host currently.  Need to fix that.
11322         
11323         * Makefile: compile to `gmcs.exe'
11324
11325         * driver.cs: Turn on v2 by default on gmcs.
11326
11327         * generic.cs (ConstructedType): Does no longer take a container
11328         type argument;  That will be taken care of later.
11329
11330         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11331         Use SimpleName to resolve for now, so we can continue the work on
11332         the parser, until we get Type.GetType that understands generics.
11333
11334         (ConstructedType.ToString): Implement
11335
11336         (TypeArguments.Resolve): Resolve the child expressions as types. 
11337         
11338         * cs-parser.jay: Rename interface_constraints to
11339         type_parameter_constraints
11340
11341         (namespace_or_type_name): Only use constructed types for the basic
11342         construction, we will deal with identifier<...> later.
11343
11344         (type/type_name): No longer call DecomposeQI, as
11345         namespace_or_type_name is always decoded now.
11346         
11347 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11348
11349         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11350         closely: we eliminate methods in base types when we have an
11351         applicable method in a top-level type.
11352
11353         Please see section 14.5.5.1 for an exact description of what goes
11354         on. 
11355
11356         This fixes bug #45127 and a host of other related to corlib compilation.
11357
11358         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11359         array is the method corresponding to the top-level type (this is
11360         because of the changes made to icall.c) so we change this
11361         accordingly.
11362
11363         (MethodGroupExpr.Name): This too.
11364
11365         * typemanager.cs (GetElementType): New method which does the right
11366         thing when compiling corlib. 
11367
11368         * everywhere: Make use of the above in the relevant places.
11369
11370 2003-07-22  Martin Baulig  <martin@ximian.com>
11371
11372         * cs-parser.jay (invocation_expression): Moved
11373         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11374         `cast_expression', but create a InvocationOrCast which later
11375         resolves to either an Invocation or a Cast.
11376
11377         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11378         method; call this before EmitStatement() to make sure that this
11379         expression can be used as a statement.
11380
11381         * expression.cs (InvocationOrCast): New class; resolves to either
11382         an Invocation or a Cast.
11383
11384         * statement.cs (StatementExpression): Call ResolveStatement() on
11385         the ExpressionStatement before emitting it.
11386
11387 2003-07-21  Martin Baulig  <martin@ximian.com>
11388
11389         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11390         `ref' and `out' attributes match; fixes #46220.
11391         (MemberAccess.ResolveMemberAccess): You can't reference a type
11392         through an expression; fixes #33180.
11393         (Indexers.GetIndexersForType): Don't return the indexers from
11394         interfaces the class implements; fixes #46502.
11395
11396 2003-07-21  Martin Baulig  <martin@ximian.com>
11397
11398         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11399         CS0661 checks; fixes bug #30442.
11400
11401 2003-07-21  Martin Baulig  <martin@ximian.com>
11402
11403         * decl.cs (AdditionResult): Added `Error'.
11404
11405         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11406
11407         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11408         cs0031.cs actually work.
11409
11410  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11411  
11412         * cs-parser.jay (namespace_name): do not use
11413         namespace_or_type_name, use qualified_identifier, because
11414         namespace_or_type_name will soon return a composed expression
11415         instead of a string.
11416  
11417         (namespace_or_type_name): Instead of returning a string, now this
11418         production returns an expression.
11419  
11420         * codegen.cs (EmitContext): Setup IsGeneric property based on
11421         whether our DeclSpace is generic, our the method is generic.
11422  
11423         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11424         the method is generic.
11425  
11426         * cs-parser.jay (type_arguments, opt_type_argument_list,
11427         type_parameters, type_parameter_list, opt_type_parameter_list,
11428         type_parameter,, opt_type_parameter_constraints_clauses,
11429         type_parameter_constraints_clauses,
11430         type_parameter_constraint_clause, type_parameter_constraint,
11431         interface_constraints): Add new production
11432  
11433         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11434         DeclSpace is generic or not.
11435  
11436         (DeclSpace.SetParameterInfo): New routine, used to set the
11437         parameter info for a type.
11438  
11439         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11440         returns a GenericTypeExpr
11441  
11442         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11443         generic, lookup the generic argument.
11444  
11445         * attribute.cs: Do not allow TypeParameterExpressions in
11446         Attributes.
11447  
11448         * class.cs: Do not allow the Main method to be defined in a
11449         Generic container.
11450  
11451         * expression.cs (SizeOf): Do not allow generic types to be used as
11452         arguments to sizeof.
11453  
11454         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11455         it: whether a type is generic or not.  Only works for types we are
11456         currently building for now.
11457         
11458 2003-07-20  Martin Baulig  <martin@ximian.com>
11459
11460         * namespace.cs: Fixed that bug which caused a crash when compiling
11461         the debugger's GUI.
11462
11463 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11464
11465         * typemanager.cs (LookupTypeReflection): Never expose types which
11466         are NotPublic, NestedPrivate, NestedAssembly, or
11467         NestedFamANDAssem.  We used to return these, and later do a check
11468         that would report a meaningful error, but the problem is that we
11469         would not get the real match, if there was a name override.
11470
11471 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11472
11473         * namespace.cs (Namespace, Name): Do not compute the namespace
11474         name dynamically, compute it in the constructor.  This reduced
11475         memory usage by 1697 KB.
11476
11477         * driver.cs: Use --pause to pause at the end.
11478
11479 2003-07-17  Peter Williams  <peter@newton.cx>
11480
11481         * Makefile: Change the name of the test target so that it doesn't
11482         conflict with the recursive test target.
11483
11484 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11485
11486         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11487         AddressOf): Do not use EmitThis, that was wrong, use the actual
11488         this pointer.
11489
11490 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * class.cs (MethodData.Define): While checking if a method is an
11493         interface implementation, improve the test: If we are not public
11494         (use new test here: use the computed MethodAttributes directly,
11495         instead of the parsed modifier flags) check if the `implementing'
11496         method comes from an interface or not.
11497
11498         * pending.cs (VerifyPendingMethods): Slightly better error
11499         message.
11500
11501         * makefile: add test target that does the mcs bootstrap.
11502
11503 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11504
11505         * interface.cs (Define): Do nothing here since there are no
11506         members to populate etc. Move the attribute emission out of here
11507         since this was just totally the wrong place to put it. Attribute
11508         application happens during the 'Emit' phase, not in the 'Define'
11509         phase.
11510
11511         (Emit): Add this method and move the attribute emission here
11512
11513         * rootcontext.cs (EmitCode): Call the Emit method on interface
11514         types too.
11515
11516 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11517
11518         * expression.cs (OverloadResolve): Report error only if Location
11519         is not 'Null' which means that there was a probe going on.
11520
11521 2003-07-14  Martin Baulig  <martin@ximian.com>
11522
11523         * expression.cs (ConditionalLogicalOperator): New public class to
11524         implement user defined conditional logical operators.
11525         This is section 14.11.2 in the spec and bug #40505.
11526
11527 2003-07-14  Martin Baulig  <martin@ximian.com>
11528
11529         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11530
11531 2003-07-14  Martin Baulig  <martin@ximian.com>
11532
11533         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11534
11535         * ecore.cs (IVariable.VerifyFixed): New interface method.
11536
11537         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11538         operator, check whether the variable is actually fixed.  Fixes bug
11539         #36055.  Set a variable definitely assigned when taking its
11540         address as required by the spec.
11541
11542         * statement.cs (LocalInfo.IsFixed): New field.
11543         (LocalInfo.MakePinned): Set `IsFixed' to true.
11544
11545 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11546
11547         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11548         for .ctors, ensure that we only ask for members declared in the
11549         attribute type (BindingFlags.DeclaredOnly).
11550
11551         Fixes bug #43632.
11552
11553         * expression.cs (Error_WrongNumArguments): Report error 1501
11554         correctly the way CSC does.
11555
11556 2003-07-13  Martin Baulig  <martin@ximian.com>
11557
11558         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11559         lookup on the fully qualified name, to make things like "X.X" work
11560         where "X.X" is a fully qualified type name, but we also have a
11561         namespace "X" in the using list.  Fixes #41975.
11562
11563 2003-07-13  Martin Baulig  <martin@ximian.com>
11564
11565         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11566         function. If we're a CompoundAssign, we need to create an embedded
11567         CompoundAssign, not an embedded Assign.
11568         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11569         Fixes #45854.
11570
11571 2003-07-13  Martin Baulig  <martin@ximian.com>
11572
11573         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11574         work to fix bug #46088.
11575
11576 2003-07-13  Ravi Pratap <ravi@ximian.com>
11577
11578         * class.cs (Operator.Emit): Do not emit attributes here - it is
11579         taken care of by the Method class that we delegate too. This takes
11580         care of bug #45876.
11581
11582 2003-07-10  Martin Baulig  <martin@ximian.com>
11583
11584         * expression.cs (TypeOfVoid): New class.
11585         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11586
11587 2003-07-10  Martin Baulig  <martin@ximian.com>
11588
11589         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11590         bug #35957.
11591
11592 2003-07-10  Martin Baulig  <martin@ximian.com>
11593
11594         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11595         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11596
11597         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11598
11599         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11600
11601 2003-07-10  Martin Baulig  <martin@ximian.com>
11602
11603         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11604         of decimal.  Fixes #42850.
11605
11606         NOTE: I also fixed the created byte blob, but this doesn't work on
11607         the MS runtime and csc never produces any byte blobs for decimal
11608         arrays.
11609
11610 2003-07-10  Martin Baulig  <martin@ximian.com>
11611
11612         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11613         structs; fixes #32068.
11614         (Block.AddChildVariableNames): Fixed #44302.
11615
11616 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11617
11618         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11619
11620 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * attribute.cs: And this test is onger needed.
11623
11624 2003-07-08  Martin Baulig  <martin@ximian.com>
11625
11626         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11627         inaccessible types.  Fixes #36313.
11628
11629         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11630
11631         * namespace.cs (NamespaceEntry): Create implicit entries for all
11632         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11633         implicit entries for N1.N2 and N1.
11634
11635 2003-07-08  Martin Baulig  <martin@ximian.com>
11636
11637         Rewrote the handling of namespaces to fix a lot of the issues
11638         wrt. `using' aliases etc.
11639
11640         * namespace.cs (Namespace): Splitted this class into a
11641         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11642
11643         * typemanager.cs (TypeManager.IsNamespace): Removed.
11644         (TypeManager.ComputeNamespaces): Only compute namespaces from
11645         loaded assemblies here, not the namespaces from the assembly we're
11646         currently compiling.
11647
11648 2003-07-08  Martin Baulig  <martin@ximian.com>
11649
11650         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11651
11652 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11655         already fixed it.  
11656
11657         I thought about the memory savings here, but LookupTypeReflection
11658         is used under already very constrained scenarios.  Compiling
11659         corlib or mcs only exposes one hit, so it would not really reduce
11660         any memory consumption.
11661
11662 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11663
11664         * typemanager.cs: fixes bug #45889 by only adding public types from
11665         other assemblies to the list of known types.
11666
11667 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11668
11669         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11670         on the type we resolved.
11671
11672 2003-07-05  Martin Baulig  <martin@ximian.com>
11673
11674         * pending.cs (PendingImplementation.ParentImplements): Don't
11675         create the proxy if the parent is abstract.
11676
11677         * class.cs (TypeContainer.DefineIndexers): Process explicit
11678         interface implementations first.  Fixes #37714.
11679
11680 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11681
11682         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11683         defined recursively;  but since we modify the input parameters
11684         (left is set to `this' temporarily), we reset this value if the
11685         left_is_explicit is false, which gives the original semantics to
11686         the code.  
11687
11688         * literal.cs (NullPointer): new class used to represent a null
11689         literal in a pointer context.
11690
11691         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11692         type is a pointer, use a NullPointer object instead of a
11693         NullLiteral.   Closes 43687
11694
11695         (ExplicitConversion): Convert pointer values using
11696         the conv opcode to the proper type.
11697
11698         * ecore.cs (New): change ValueTypeVariable property into a method,
11699         that returns whether the valuetype is suitable for being used.
11700
11701         * expression.cs (Binary.DoNumericPromotions): Only return if we
11702         the int constant was a valid uint, and we can return both left and
11703         right as uints.  If not, we continue processing, to trigger the
11704         type conversion.  This fixes 39018.
11705
11706         * statement.cs (Block.EmitMeta): During constant resolution, set
11707         the CurrentBlock property on the emitcontext, so that we resolve
11708         constants propertly.
11709
11710 2003-07-02  Martin Baulig  <martin@ximian.com>
11711
11712         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11713         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11714
11715         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11716         than emitting it here.
11717
11718         * statement.cs: Fixed some more flow analysis bugs.
11719
11720 2003-07-02  Martin Baulig  <martin@ximian.com>
11721
11722         * class.cs (MethodData.Define): When implementing interface
11723         methods, set Final unless we're Virtual.
11724
11725         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11726         check work for interface methods.
11727
11728 2003-07-01  Martin Baulig  <martin@ximian.com>
11729
11730         * ecore.cs (EmitContext.This): Replaced this property with a
11731         GetThis() method which takes a Location argument.  This ensures
11732         that we get the correct error location for a CS0188.
11733
11734 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11735
11736         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11737         ImplicitStandardConversion.
11738
11739         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11740
11741 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11742
11743         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11744         optimization.
11745
11746 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11747
11748         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11749         constructors.
11750
11751         (MethodData.Define): Turn off initlocals for unsafe methods.
11752
11753 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11756         complete;  Fixes #37521.
11757
11758         * delegate.cs: Use Modifiers.TypeAttr to compute the
11759         TypeAttributes, instead of rolling our own.  This makes the flags
11760         correct for the delegates.
11761
11762 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11763
11764         * class.cs (Constructor.Define): Set the private flag for static
11765         constructors as well.
11766
11767         * cs-parser.jay (statement_expression): Set the return value to
11768         null, to avoid a crash when we catch an error.
11769
11770 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11771
11772         * cs-parser.jay: Applied patch from Jackson that adds support for
11773         extern and unsafe modifiers to destructor declarations.
11774
11775         * expression.cs: Report error 21 if the user is trying to index a
11776         System.Array.
11777
11778         * driver.cs: Add an error message, suggested by the bug report.
11779
11780         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11781         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11782
11783 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11784
11785         * namespace.cs: Add some information to reduce FAQs.
11786
11787 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11788
11789         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11790         underlying enumeration types.  Fixes #43915.
11791
11792         * expression.cs: Treat ushort/short as legal values to be used in
11793         bitwise operations.
11794
11795 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11796
11797         * delegate.cs: transfer custom attributes for paramenters from
11798         the delegate declaration to Invoke and BeginInvoke.
11799
11800 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11801
11802         * attribute.cs: handle custom marshalers and emit marshal info
11803         for fields, too.
11804
11805 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11806
11807         * makefile.gnu: Added anonymous.cs to the compiler sources.
11808
11809 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11810
11811         * iterators.cs: Change the name of the proxy class to include two
11812         underscores.
11813
11814         * cs-parser.jay: Update grammar to include anonymous methods.
11815
11816         * anonymous.cs: new file.
11817
11818 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11819
11820         * class.cs (Field.Define): Add missing test for pointers and
11821         safety. 
11822
11823 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11824
11825         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11826         we use the stobj opcode.
11827
11828         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11829         since it wasn't the correct fix. 
11830
11831         It still is puzzling that we are required to use stobj for IntPtr
11832         which seems to be a ValueType.
11833
11834 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11835
11836         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11837         during regular simple name resolution.   Now, the trick is that
11838         instead of returning for processing the simplename, we do a
11839         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11840         contextual lookup type).   If a match is found, return that, if
11841         not, return for further composition.
11842
11843         This fixes long-standing 30485.
11844
11845         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11846         using the address to initialize an object, do an Stobj instead of
11847         using the regular Stelem.
11848
11849         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11850         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11851         Because if we are a BaseIndexerAccess that value will be true.
11852         Fixes 43643.
11853
11854         * statement.cs (GotoCase.Resolve): Return after reporting an
11855         error, do not attempt to continue. 
11856
11857         * expression.cs (PointerArithmetic.Emit): If our operand is a
11858         long, convert our constants to match the operand before
11859         multiplying.  Convert to I type before adding.   Fixes 43670.
11860
11861 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11862
11863         * enum.cs (ImplicitConversionExists) : Rename to
11864         ImplicitEnumConversionExists to remove ambiguity. 
11865
11866         * ecore.cs (NullCast): New type of cast expression class which
11867         basically is very similar to EmptyCast with the difference being
11868         it still is a constant since it is used only to cast a null to
11869         something else
11870         (eg. (string) null)
11871
11872         * convert.cs (ImplicitReferenceConversion): When casting a null
11873         literal, we return a NullCast.
11874
11875         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11876         should be around anymore.
11877
11878         The renaming (reported was slightly wrong). Corrections:
11879
11880         ConvertImplicitStandard -> ImplicitConversionStandard
11881         ConvertExplicitStandard -> ExplicitConversionStandard
11882
11883         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11884         before passing them in !
11885
11886         * convert.cs (ImplicitConversionStandard): When comparing for
11887         equal expr and target types, ensure that expr is not a
11888         NullLiteral.
11889
11890         In general, we must not be checking (expr_type ==
11891         target_type) in the top level conversion methods
11892         (ImplicitConversion, ExplicitConversion etc). This checking is
11893         done in the methods that they delegate to.
11894
11895 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11896
11897         * convert.cs: Move Error_CannotConvertType,
11898         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11899         ImplicitNumericConversion, ImplicitConversionExists,
11900         ImplicitUserConversionExists, StandardConversionExists,
11901         FindMostEncompassedType, FindMostSpecificSource,
11902         FindMostSpecificTarget, ImplicitUserConversion,
11903         ExplicitUserConversion, GetConversionOperators,
11904         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11905         TryImplicitIntConversion, Error_CannotConvertImplicit,
11906         ConvertImplicitRequired, ConvertNumericExplicit,
11907         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11908         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11909         its own file.
11910
11911         Perform the following renames:
11912
11913         StandardConversionExists -> ImplicitStandardConversionExists
11914         ConvertImplicit -> ImplicitConversion
11915         ConvertImplicitStandard -> ImplicitStandardConversion
11916         TryImplicitIntConversion -> ImplicitIntConversion
11917         ConvertImplicitRequired -> ImplicitConversionRequired
11918         ConvertNumericExplicit -> ExplicitNumericConversion
11919         ConvertReferenceExplicit -> ExplicitReferenceConversion
11920         ConvertExplicit -> ExplicitConversion
11921         ConvertExplicitStandard -> ExplicitStandardConversion
11922
11923 2003-05-19  Martin Baulig  <martin@ximian.com>
11924
11925         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11926         (TypeInfo): Added support for structs having structs as fields.
11927
11928         * ecore.cs (FieldExpr): Implement IVariable.
11929         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11930         VariableInfo for the field.
11931
11932 2003-05-18  Martin Baulig  <martin@ximian.com>
11933
11934         * expression.cs (This.DoResolve): Report a CS0027 if we're
11935         emitting a field initializer.
11936
11937 2003-05-18  Martin Baulig  <martin@ximian.com>
11938
11939         * expression.cs (This.ResolveBase): New public function.
11940         (This.DoResolve): Check for CS0188.
11941
11942         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11943         This.Resolve().
11944
11945         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11946         `instance_expression' to null if we don't have any non-static
11947         methods.
11948
11949 2003-05-18  Martin Baulig  <martin@ximian.com>
11950
11951         Reworked the way how local variables and parameters are handled by
11952         the flow analysis code.
11953
11954         * statement.cs (TypeInfo, VariableMap): New public classes.
11955         (VariableInfo): New public class.  This is now responsible for
11956         checking whether a variable has been assigned.  It is used for
11957         parameters and local variables.
11958         (Block.EmitMeta): Take the InternalParameters as argument; compute
11959         the layout of the flow vectors here.
11960         (Block.LocalMap, Block.ParameterMap): New public properties.
11961         (FlowBranching): The .ctor doesn't get the InternalParameters
11962         anymore since Block.EmitMeta() now computes the layout of the flow
11963         vector.
11964         (MyStructInfo): This class is now known as `StructInfo' and nested
11965         in `TypeInfo'; we don't access this directly anymore.
11966
11967         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11968         property and removed IsAssigned(), IsFieldAssigned(),
11969         SetAssigned() and SetFieldAssigned(); we now call them on the
11970         VariableInfo so we don't need to duplicate this code everywhere.
11971
11972         * expression.cs (ParameterReference): Added `Block block' argument
11973         to the .ctor.
11974         (LocalVariableReference, ParameterReference, This): The new
11975         VariableInfo class is now responsible for all the definite
11976         assignment stuff.
11977
11978         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11979         IsParameterAssigned, SetParameterAssigned): Removed.
11980
11981 2003-05-18  Martin Baulig  <martin@ximian.com>
11982
11983         * typemanager.cs (InitCoreTypes): Try calling
11984         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11985         the 3-args-version.  Corlib now also needs our `void_type'.
11986         (GetMethod): Added overloaded version which takes an optional
11987         `bool report_errors' to allow lookups of optional methods.
11988
11989 2003-05-12  Martin Baulig  <martin@ximian.com>
11990
11991         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11992         only used for locals and not for parameters.
11993
11994 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11995
11996         * support.cs (InternalParameters.ParameterType): Return the
11997         ExternalType of the parameter.
11998
11999         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12000         they were unused.
12001
12002 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12003
12004         * class.cs (MethodData.Define): Do not set the `newslot' on
12005         interface members, if they are also flagged as "override".
12006
12007         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12008         better code for ++i and i++.  This only works for static fields
12009         and local variables.
12010
12011         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12012         want to pull the DeclSpace out of the builder_to_declspace instead
12013         of the TypeBuilder (like in TypeContainer.FindMembers).
12014
12015         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12016         instead of LookupTypeContainer.  Fixes the crash on .NET for
12017         looking up interface members.
12018
12019         * const.cs: Create our own emit context during the Definition
12020         stage, so that constants are evaluated in the proper context, when
12021         a recursive definition happens.
12022
12023 2003-05-11  Martin Baulig  <martin@ximian.com>
12024
12025         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12026         new block for a switch section.
12027         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12028         the adding/lookup in the switch block.  Fixes #39828.
12029
12030 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12031
12032         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12033         functionality: I needed to convert the data after I had performed
12034         the add/sub operation into the operands type size.
12035
12036         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12037         pass the type for the box operation, otherwise the resulting
12038         object would have been of type object.
12039
12040         (BoxedCast): Add constructor to specify the type to box as.
12041
12042 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12043
12044         * iterators.cs: I was reusing the `count' variable inadvertently,
12045         take steps to not allow this to happen.
12046
12047 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12048
12049         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12050         by creating an array at the point where the params starts and
12051         putting all those arguments there, then adjusting the size of the
12052         array.
12053
12054 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12055
12056         * expression.cs (New.AddressOf): Implement interface
12057         IMemoryLocation.  This is used when the `new' operator is used in
12058         the context of an invocation to a method on a value type.
12059
12060         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12061         example. 
12062
12063         * namespace.cs: Also check the using aliases here.
12064
12065         * driver.cs: Move the test for using validity after the types have
12066         been entered, so we do a single pass that also includes the using
12067         aliases. 
12068
12069         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12070         in the regular case.   CreateSiblingForFinally is doing extra
12071         error checking.
12072
12073         * attribute.cs (GetAttributeArgumentExpression): Store the result
12074         on an out value, and use the return value to indicate failure
12075         instead of using null (which is a valid return for Constant.GetValue).
12076
12077         * statement.cs: Perform the analysis flow for the increment
12078         portion after the statement, because this will be the real flow of
12079         execution.  Fixes #42385
12080
12081         * codegen.cs (EmitContext.EmitArgument,
12082         EmitContext.EmitStoreArgument): New helper functions when the
12083         RemapToProxy flag is set.
12084
12085         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12086         function.
12087
12088         Add support for remapping parameters. 
12089
12090         * iterators.cs: Propagate parameter values;  Store parameter
12091         values in the proxy classes.
12092
12093 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12094
12095         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12096         need a proxy reference;  I do not know what I was thinking
12097
12098         * cs-parser.jay (constructor_initializer): catch another error,
12099         and display nice message.
12100
12101         (field_declaration): catch void field declaration
12102         to flag a better error. 
12103
12104         * class.cs (MemberBase.CheckBase): Report an error instead of a
12105         warning if a new protected member is declared in a struct. 
12106         (Field.Define): catch the error of readonly/volatile.
12107
12108         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12109
12110         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12111         volatile variable is taken
12112
12113 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12114
12115         * statement.cs (Fixed.Resolve): Report an error if we are not in
12116         an unsafe context.
12117
12118 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * typemanager.cs: reuse the code that handles type clashes for
12121         delegates and enumerations.
12122
12123         * class.cs (Report28): Always report.
12124
12125         * expression.cs (EncodeAsAttribute): Allow nulls here.
12126
12127 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12128
12129         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12130         the functionality for testing whether an expression is valid for
12131         an attribute here.  Also handle the case of arrays of elements
12132         being stored. 
12133
12134         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12135         encoding a linear array into an array of objects that are suitable
12136         to be passed to an CustomAttributeBuilder.
12137
12138         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12139
12140         * ecore.cs: (FieldExpr): Handle field remapping here.
12141
12142         * iteratators.cs: Pass the instance variable (if the method is an
12143         instance method) to the constructors, so we can access the field
12144         variables on the class.
12145
12146         TODO: Test this with structs.  I think the THIS variable on
12147         structs might have to be a pointer, and not a refenrece
12148
12149 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12150
12151         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12152         local variables to fields in a proxy class.
12153
12154         * iterators.cs (PopulateProxy): Rename our internal fields to
12155         <XXX>.  
12156         Create a <THIS> field if we are an instance method, so we can
12157         reference our parent container variables.
12158         (MapVariable): Called back from the EmitContext code to enter a
12159         new variable to field mapping into the proxy class (we just create
12160         a FieldBuilder).
12161
12162         * expression.cs
12163         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12164         for using the remapped locals to fields.
12165
12166         I placed the code here, because that gives the same semantics to
12167         local variables, and only changes the Emit code.
12168
12169         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12170         statements inside iterators.
12171         (VariableInfo): Add a FieldBuilder for the cases when we are
12172         remapping local variables to fields in a proxy class
12173
12174         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12175         current_block != null.
12176
12177         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12178         not cope with strings, as it has been moved to the
12179         TableSwitchEmit.  Fixed bug in switch generation.
12180
12181         * expression.cs (New.DoResolve): Provide more context for the user
12182         when reporting an error.
12183
12184         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12185         pointers. 
12186
12187         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12188         check the permissions for it.  Note than in a type-resolution
12189         context the check was already present in DeclSpace.ResolveType,
12190         but was missing from the MemberAccess.
12191
12192         (ArrayCreation.CheckIndices): warn if the user has
12193         more nested levels of expressions, but there are no more
12194         dimensions specified.  Avoids crash on bug 41906.
12195
12196 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12197
12198         * statement.cs (Block): replace Implicit bool, for a generic
12199         flags.   
12200         New flag: `Unchecked'.  This is used during the EmitMeta phase
12201         (which is out-of-line with the regular Resolve/Emit process for a
12202         statement, as this is done ahead of time, but still gets a chance
12203         to call constant resolve).
12204
12205         (Block.Flags): new enum for adding a new flag.
12206
12207         (Block.EmitMeta): track the state of unchecked.
12208
12209         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12210         to enable constant resolution to work there as well.
12211
12212 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12213
12214         * typemanager.cs (ienumerable_type): Also look up
12215         System.Collections.IEnumerable. 
12216
12217 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12218
12219         TODO: Test more than one conditional per method.
12220
12221         * class.cs (Indexer.Define): Report the location where the user is
12222         referencing the unsupported feature.
12223
12224         (MethodData): Overload the use of `conditionals' to
12225         minimize the creation of needless ArrayLists.   This saves roughly
12226         212kb on my machine.
12227
12228         (Method): Implement the new IIteratorContainer interface.
12229         (Method.SetYields): Implement the method by setting the ModFlags
12230         to contain METHOD_YIELDS.
12231
12232         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12233         which just got set to null.
12234
12235         * iterators.cs: New file.
12236
12237         (Yield, YieldBreak): New statements.
12238
12239         * statement.cs (Return.Resolve): Flag an error if we are used in
12240         an iterator method.
12241
12242         * codegen.cs (InIterator): New flag set if the code is being
12243         compiled in an iterator method.
12244
12245         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12246         internal modifier, and we just use it to avoid adding extra
12247         fields, as this is seldom used.  
12248
12249         * cs-parser.jay: Add yield_statement (yield and yield break).
12250
12251         * driver.cs: New flag -v2 to turn on version 2 features. 
12252
12253         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12254         hashtable when v2 is enabled.
12255
12256 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12257
12258         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12259         there is already a namespace defined with this name.
12260
12261         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12262         people upgraded their corlibs.
12263
12264         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12265         always use fully qualified types, no need to use the compiler
12266         front end.
12267
12268         (TypeManager.IsNamespace): Use binarysearch.
12269
12270         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12271         AddDelegate): I did not quite use the new IsValid API properly: I
12272         have to pass the short-name and the fullname.  I was passing only
12273         the basename instead of the fullname sometimes. 
12274
12275         (TypeContainer.DefineType): call NamespaceClash.
12276
12277         * interface.cs (Interface.DefineType): use NamespaceClash before
12278         defining the type.
12279
12280         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12281         defining the type.
12282
12283         * enum.cs: (Enum.DefineType): use NamespaceClash before
12284         defining the type.
12285
12286         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12287         speed increase.  First, use the negative_hits cache when we get a
12288         negative.  Second, add the type with its full original name
12289         instead of the new . and + encoded name (reflection uses + to
12290         separate type from a nested type).  Use LookupTypeReflection
12291         directly which bypasses the type->name hashtable (that we already
12292         know does not contain the type.
12293
12294         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12295         location/container type. 
12296
12297         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12298
12299 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12300
12301         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12302
12303         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12304         method is being referenced in the method group from a static
12305         context, and report error 120 if so.
12306
12307         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12308         Error118. 
12309
12310         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12311         is created, we create the A namespace).
12312
12313         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12314         Fixes #41591
12315
12316 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12317
12318         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12319         invocation to ModuleBuilder.GetType with the same values will
12320         return a new type instance, so we need to cache its return
12321         values. 
12322
12323         * expression.cs (Binary.ResolveOperator): Only allow the compare
12324         operators on enums if they are of the same type.
12325
12326         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12327         types of ValueType on their own case.  Before we were giving them
12328         the same treatment as objects.
12329
12330         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12331         fullname.  Short name is used to compare against container name.
12332         Fullname is used to check against defined namespace names.
12333
12334         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12335         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12336
12337         (Method.CheckBase): Call parent.
12338         (MemberBase.CheckBase): Check for protected members on sealed
12339         classes.
12340         (PropertyBase.CheckBase): Call parent.
12341         (Field.Define): Call parent.
12342
12343         * report.cs: Negative error codes are now mapped to 8000 - code,
12344         so that the display is render more nicely.
12345
12346         * typemanager.cs: Do not use try/catch, instead report a regular
12347         error. 
12348
12349         (GetPointerType, GetReferenceType): These methods provide
12350         mechanisms to obtain the T* and T& from a T.  We had the code
12351         previously scattered around the code base, and it also used
12352         TypeManager.LookupType that would go through plenty of caches.
12353         This one goes directly to the type source.
12354
12355         In some places we did the Type.GetType followed by
12356         ModuleBuilder.GetType, but not in others, so this unifies the
12357         processing as well.
12358
12359         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12360         statements now that we have namespace information.
12361
12362         * typemanager.cs (IsNamespace): New method, returns whether the
12363         string presented is a namespace or not.
12364
12365         (ComputeNamespaces): New public entry point, computes the list of
12366         available namespaces, using the GetNamespaces API call in Mono, or
12367         the slower version in MS.NET.   
12368
12369         Now before we start the semantic analysis phase, we have a
12370         complete list of namespaces including everything that the user has
12371         provided.
12372
12373         Deleted old code to cache namespaces in .nsc files.
12374
12375 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12378         class/struct location definition Location for the implicit
12379         constructor location.
12380
12381         (Operator.Define): Use the location of the operator for the
12382         implicit Method definition.
12383
12384         (Constructor.Emit): use the constructor location for the implicit
12385         base initializer constructor.
12386
12387         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12388         and the Expression class now contains two new methods:
12389
12390         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12391         isolate type lookup from the rest of the resolution process.
12392
12393         Since we use Expressions to hold type definitions due to the way
12394         we parse the input we have historically overloaded Resolve to
12395         perform the Type lookups if a special flag is passed.  Now this is
12396         eliminated and two methods take their place. 
12397
12398         The differences in the two methods between xStep and xTerminal is
12399         that xStep is involved in our current lookup system that uses
12400         SimpleNames to compose a name, while xTerminal is used just to
12401         catch the case where the simplename lookup failed.
12402
12403 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * expression.cs (ResolveMemberAccess): Remove redundant code.
12406         TypeExpr expressions are always born fully resolved.
12407
12408         * interface.cs (PopulateMethod): Do not lookup the types twice.
12409         We were doing it once during SemanticAnalysis and once during
12410         PopulateMethod.
12411
12412         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12413         in local variable type definitions, were being returned as a
12414         SimpleName (we decomposed everything into a string), that is
12415         because primary_expression was being used instead of a type in the
12416         grammar (reduce/reduce conflicts).
12417
12418         The part that was wrong is that we converted the expression into a
12419         string (an oversimplification in one hand, compounded with primary
12420         expressions doing string concatenation).
12421
12422         So things like:
12423
12424         A.B.C [] x;
12425
12426         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12427         using clauses from working on this particular context.  And a type
12428         was being matched directly against "A.B.C[]".
12429
12430         We now use the correct approach, and allow for ComposedCast to be
12431         part of the unary expression.  So the "A.B.C []" become a composed
12432         cast of "A.B.C" (as a nested group of MemberAccess with a
12433         SimpleName at the end) plus the rank composition "[]". 
12434
12435         Also fixes 35567
12436
12437 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12440         for the access level checking.
12441
12442         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12443         `TypeContainer container', because I kept getting confused when I
12444         was debugging this code.
12445
12446         * expression.cs (Indexers): Instead of tracking getters/setters,
12447         we now track them in parallel.  We create one arraylist less, but
12448         most importantly it is possible now for the LValue code to find a
12449         matching get for a set.
12450
12451         (IndexerAccess.DoResolveLValue): Update the code.
12452         GetIndexersForType has been modified already to extract all the
12453         indexers from a type.  The code assumed it did not.
12454
12455         Also make the code set the correct return type for the indexer.
12456         This was fixed a long time ago for properties, but was missing for
12457         indexers.  It used to be void_type.
12458
12459         (Binary.Emit): Test first for doubles instead of
12460         floats, as they are more common.
12461
12462         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12463         when dealing with floats and the <=, >= operators.  This fixes bug
12464         #39314 
12465
12466         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12467         to load the array value by emitting a load on the foreach variable
12468         type.  This was incorrect.  
12469
12470         We now emit the code to load an element using the the array
12471         variable type, and then we emit the conversion operator.
12472
12473         Fixed #40176
12474
12475 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12476
12477         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12478
12479 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12482         test for protection before we test for signatures. 
12483
12484         (MethodSignature.ToString): implement.
12485
12486         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12487         to the case where we reduced into a LongConstant.
12488
12489         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12490         depend on whether the information is acurrate, because the
12491         Microsoft runtime will always claim that the array type is public,
12492         regardless of the real state.
12493
12494         If the type is a pointer, another problem happens: the type is
12495         reported as non-public in Microsoft.  
12496
12497         In both cases we have to call CheckAccessLevel recursively with
12498         the underlying type as the argument to be tested.
12499
12500 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12501
12502         * assign.cs (Assign.Emit): If we are dealing with a compound
12503         assignment expression, we should use the code path that stores the
12504         intermediate result in a temporary value.  This fixes #40903.
12505
12506         *expression.cs (Indirection.ToString): Provide ToString method for
12507         debugging. 
12508
12509 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12510
12511         * class.cs: Null out fields holding references to Block objects so
12512         they can be garbage collected.
12513
12514         * expression.cs (OverloadResolve): Remove unused local.
12515
12516 2003-04-07  Martin Baulig  <martin@ximian.com>
12517
12518         * codegen.cs (EmitContext.CurrentFile): New public field.
12519         (EmitContext.Mark): Use the CurrentFile to check whether the
12520         location is in the correct file.
12521         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12522
12523 2003-04-07  Martin Baulig  <martin@ximian.com>
12524
12525         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12526
12527         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12528         location.  [FIXME: The location argument which gets passed to this
12529         method is sometimes wrong!]
12530
12531 2003-04-07  Nick Drochak <ndrochak@gol.com>
12532
12533         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12534
12535 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12536
12537         * expression.cs (Indirection.EmitAssign): We were using the
12538         temporary, but returning immediately instead of continuing the
12539         EmitAssing flow.
12540
12541 2003-04-06  Martin Baulig  <martin@ximian.com>
12542
12543         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12544         if it's a nested child, but also deriving from the outer class.
12545         See test 190.cs.
12546
12547         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12548         nested child, but also deriving from the outer class.  See
12549         test-190.cs.
12550         (FilterWithClosure): We may access private members of the outer
12551         class if we're a nested child and deriving from the outer class.
12552         (RealMemberLookup): Only set `closure_private_ok' if the
12553         `original_bf' contained BindingFlags.NonPublic.
12554
12555 2003-04-05  Martin Baulig  <martin@ximian.com>
12556
12557         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12558         probe if its a type parameter, and if so, flag an error.
12559
12560         * decl.cs: Move here the SetParameterInfo code from class.cs.
12561         Handle IsGeneric here.
12562
12563         Handle a variety of errors in the parameter info definition.
12564
12565         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12566         type parameters here.
12567
12568         * cs-parser.jay (class_declaration): report errors for parameters
12569         here as well.
12570
12571 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12572
12573         * generic.cs: New file, contains support code for generics.
12574
12575         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12576         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12577
12578         Update parser for the above removals.
12579
12580         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12581         now taken care of in the parser.
12582
12583 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12584
12585         * class.cs (Event.Define): Do not allow abstract events to have
12586         initializers. 
12587
12588 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12591         block in event declarations.
12592
12593         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12594         value type, get its address.
12595
12596         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12597         leaving a class on the stack instead of a boolean value (int
12598         0/1).  Change the code so we compare against null, and then the
12599         result against zero.
12600
12601         * class.cs (TypeContainer.GetClassBases): We were checking for the
12602         parent class being sealed too late.
12603
12604         * expression.cs (Binary.Emit): For <= and >= when dealing with
12605         floating point values, use cgt.un and clt.un instead of cgt and
12606         clt alone.
12607
12608 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12609
12610         * statement.cs: Apply the same optimization as MS: skip the 
12611         GetEnumerator returning an IEnumerator, and use the one returning a 
12612         CharEnumerator instead. This allows us to avoid the try-finally block 
12613         and the boxing.
12614
12615 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12616
12617         * cs-parser.jay: Attributes cannot be applied to
12618                          namespaces. Fixes #40473
12619
12620 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12621
12622         * class.cs:
12623         (Add*): check if the name is valid using the full name for constants,
12624         fields, properties and events.
12625
12626 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12627
12628         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12629         char constants to be part of the enumeration.
12630
12631         * expression.cs (Conditional.DoResolve): Add support for operator
12632         true. Implements the missing functionality from 14.12
12633
12634         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12635         operator true/false as required by the spec.
12636
12637         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12638         implicit conversion to boolean.
12639
12640         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12641         also one where the type implements `operator true'. 
12642
12643         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12644         get an expression that will invoke operator true based on an
12645         expression.  
12646
12647         (GetConversionOperators): Removed the hack that called op_True
12648         here.  
12649
12650         (Expression.ResolveBoolean): Move this from Statement.
12651
12652 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12653
12654         * ecore.cs (FieldExpr): do not allow initialization of initonly
12655         fields on derived classes
12656
12657 2003-03-13  Martin Baulig  <martin@ximian.com>
12658
12659         * statement.cs (Block.Emit): Call ig.BeginScope() and
12660         ig.EndScope() when compiling with debugging info; call
12661         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12662
12663 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12664
12665         * expression.cs (Indexers): Do not construct immediately, allow
12666         for new members to be appended as we go.  Fixes 38143
12667
12668 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12669
12670         * expression.cs: save/restore context when resolving an unchecked
12671         expression.
12672
12673 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12674
12675         * cfold.cs: Catch division by zero in modulus operator during
12676         constant folding.
12677
12678 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * interface.cs (Interface.DefineMembers): Avoid defining members
12681         twice. 
12682
12683 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * driver.cs: handle the +/- options for -noconfig
12686
12687         * statement.cs (Unckeched.Resolve): Also track the state of
12688         unchecked in the Resolve phase.
12689
12690 2003-02-27  Martin Baulig  <martin@ximian.com>
12691
12692         * ecore.cs (Expression.MemberLookup): Don't create a
12693         MethodGroupExpr for something which is not a method.  Fixes #38291.
12694
12695 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * class.cs (MemberBase.CheckParameters): Also check that the type
12698         is unmanaged if it is a pointer.
12699
12700         * expression.cs (SizeOf.Resolve): Add location information.
12701
12702         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12703         a managed type is declared.
12704
12705         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12706         parameter modifiers as well.  Fixes bug 38606
12707
12708         * class.cs: Very sad.  Am backing out the speed up changes
12709         introduced by the ArrayList -> Array in the TypeContainer, as they
12710         were not actually that much faster, and introduced a bug (no error
12711         reports on duplicated methods).
12712
12713         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12714         source first, this will guarantee that we have a valid expression
12715         before calling in lower levels functions that will require a
12716         resolved object.  Then use this original_source in the
12717         target.ResolveLValue instead of the original source that was
12718         passed to us.
12719
12720         Another change.  Use target.Resolve instead of LValueResolve.
12721         Although we are resolving for LValues, we will let the Assign code
12722         take care of that (it will be called again from Resolve).  This
12723         basically allows code like this:
12724
12725         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12726         class Y { void A (X x) { x [0] += o; }
12727
12728         The problem was that the indexer was trying to resolve for
12729         set_Item (idx, object o) and never finding one.  The real set_Item
12730         was set_Item (idx, X).  By delaying the process we get the right
12731         semantics. 
12732
12733         Fixes bug 36505
12734
12735 2003-02-23  Martin Baulig  <martin@ximian.com>
12736
12737         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12738         while calling DoEmit ().
12739
12740         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12741         source files; if you use the #line directive inside a method, the
12742         compiler stops emitting line numbers for the debugger until it
12743         reaches the end of the method or another #line directive which
12744         restores the original file.
12745
12746 2003-02-23  Martin Baulig  <martin@ximian.com>
12747
12748         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12749
12750 2003-02-23  Martin Baulig  <martin@ximian.com>
12751
12752         * statement.cs (Block.AddChildVariableNames): We need to call this
12753         recursively, not just for our immediate children.
12754
12755 2003-02-23  Martin Baulig  <martin@ximian.com>
12756
12757         * class.cs (Event.Define): Always make the field private, like csc does.
12758
12759         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12760         actually work, fixes bug #37521.
12761
12762 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * delegate.cs: When creating the various temporary "Parameters"
12765         classes, make sure that we call the ComputeAndDefineParameterTypes
12766         on those new parameters (just like we do with the formal ones), to
12767         allow them to be resolved in the context of the DeclSpace.
12768
12769         This fixes the bug that Dick observed in Bugzilla #38530.
12770
12771 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12772
12773         * expression.cs (ResolveMemberAccess): When resolving a constant,
12774         do not attempt to pull a constant if the value was not able to
12775         generate a valid constant.
12776
12777         * const.cs (LookupConstantValue): Do not report more errors than required.
12778
12779 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12780
12781         * expression.cs: fixes bug #38328.
12782
12783 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12784
12785         * class.cs: Changed all the various members that can be part of a
12786         class from being an ArrayList to be an Array of the right type.
12787         During the DefineType type_list, interface_list, delegate_list and
12788         enum_list are turned into types, interfaces, delegates and enums
12789         arrays.  
12790
12791         And during the member population, indexer_list, event_list,
12792         constant_list, field_list, instance_constructor_list, method_list,
12793         operator_list and property_list are turned into their real arrays.
12794
12795         Although we could probably perform this operation earlier, for
12796         good error reporting we need to keep the lists and remove the
12797         lists for longer than required.
12798
12799         This optimization was triggered by Paolo profiling the compiler
12800         speed on the output of `gen-sample-program.pl' perl script. 
12801
12802         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12803         not crash in methods like MemberLookupFailed that use this field.  
12804
12805         This problem arises when the compiler fails to resolve a type
12806         during interface type definition for example.
12807
12808 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12809
12810         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12811         inherit from System.Object, so we have to stop at null, not only
12812         when reaching System.Object.
12813
12814 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12815
12816         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12817         DeclaredOnly because the parent indexer might have had a different
12818         name, but did not loop until the top of the hierarchy was reached.
12819
12820         The problem this one fixes is 35492: when a class implemented an
12821         indexer from an interface, we were getting the interface method
12822         (which was abstract) and we were flagging an error (can not invoke
12823         abstract method).
12824
12825         This also keeps bug 33089 functioning, and test-148 functioning.
12826
12827         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12828         out if a method is special is to see if it is declared in a
12829         property or event, or whether it is one of the predefined operator
12830         names.   This should fix correctly #36804.
12831
12832 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12833
12834         The goal here is to remove the dependency on EmptyCast.Peel ().
12835         Killing it completely.
12836
12837         The problem is that currently in a number of places where
12838         constants are expected, we have to "probe" for an EmptyCast, and
12839         Peel, which is not the correct thing to do, as this will be
12840         repetitive and will likely lead to errors. 
12841
12842         The idea is to remove any EmptyCasts that are used in casts that
12843         can be reduced to constants, so we only have to cope with
12844         constants. 
12845
12846         This bug hunt was triggered by Bug 37363 and the desire to remove
12847         the duplicate pattern where we were "peeling" emptycasts to check
12848         whether they were constants.  Now constants will always be
12849         constants.
12850
12851         * ecore.cs: Use an enumconstant here instead of wrapping with
12852         EmptyCast.  
12853
12854         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12855         throwing me off.  By handling this we can get rid of a few hacks.
12856
12857         * statement.cs (Switch): Removed Peel() code.
12858
12859 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * class.cs: Location information for error 508
12862
12863         * expression.cs (New.DoResolve): Add a guard against double
12864         resolution of an expression.  
12865
12866         The New DoResolve might be called twice when initializing field
12867         expressions (see EmitFieldInitializers, the call to
12868         GetInitializerExpression will perform a resolve on the expression,
12869         and later the assign will trigger another resolution
12870
12871         This leads to bugs (#37014)
12872
12873         * delegate.cs: The signature for EndInvoke should contain any ref
12874         or out parameters as well.  We were not doing this in the past. 
12875
12876         * class.cs (Field.Define): Do not overwrite the type definition
12877         inside the `volatile' group.  Turns out that volatile enumerations
12878         were changing the type here to perform a validity test, which
12879         broke conversions. 
12880
12881 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12882
12883         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12884         and structs, we do not want to load the instance variable
12885
12886         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12887         enum_type has to be handled like an object reference (implicit
12888         conversions exists from this to object), but the regular IsClass
12889         and IsValueType tests will never return true for this one.
12890
12891         Also we use TypeManager.IsValueType instead of type.IsValueType,
12892         just for consistency with the rest of the code (this is only
12893         needed if we ever use the construct exposed by test-180.cs inside
12894         corlib, which we dont today).
12895
12896 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12897
12898         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12899         just InternalCall.
12900
12901 2003-02-09  Martin Baulig  <martin@ximian.com>
12902
12903         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12904         (Namespace.DefineNamespaces): New static public method; this is
12905         called when we're compiling with debugging to add all namespaces
12906         to the symbol file.
12907
12908         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12909         pass it to the Namespace's .ctor.
12910
12911         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12912         and MethodBase arguments; pass the namespace ID to the symwriter;
12913         pass the MethodBase instead of the token to the symwriter.
12914         (SymbolWriter.DefineNamespace): New method to add a namespace to
12915         the symbol file.
12916
12917 2003-02-09  Martin Baulig  <martin@ximian.com>
12918
12919         * symbolwriter.cs: New file.  This is a wrapper around
12920         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12921         methods here in near future.
12922
12923 2003-02-09  Martin Baulig  <martin@ximian.com>
12924
12925         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12926         ILGenerator.MarkSequencePoint() which are actually used by the
12927         symbol writer.
12928
12929 2003-02-09  Martin Baulig  <martin@ximian.com>
12930
12931         * location.cs (SourceFile): New public sealed class.  This
12932         contains the name and an index which is used in the location's token.
12933         (Location): Reserve an appropriate number of bits in the token for
12934         the source file instead of walking over that list, this gives us a
12935         really huge performance improvement when compiling with debugging.
12936
12937         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12938         `SourceFile' argument instead of a string.
12939         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12940         but don't parse/tokenize here, we need to generate the list of all
12941         source files before we do that.
12942         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12943         the files.
12944
12945         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12946         instead of a string.
12947
12948         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12949         of a string.
12950
12951 2003-02-09  Martin Baulig  <martin@ximian.com>
12952
12953         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12954         filename on `#line default'.
12955
12956 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12957
12958         * statement.cs: don't clear the pinned var when the fixed statement
12959         returns from the method (fixes bug#37752).
12960
12961 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12962
12963         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12964         to IsValueType.
12965
12966 2003-02-07  Martin Baulig  <martin@ximian.com>
12967
12968         * driver.cs: Removed the `--debug-args' command line argument.
12969
12970         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12971         automatically by the AsssemblyBuilder.
12972         (CodeGen.InitializeSymbolWriter): We don't need to call any
12973         initialization function on the symbol writer anymore.  This method
12974         doesn't take any arguments.
12975
12976 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12977
12978         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12979         from referenced assemblies as well.
12980
12981 2003-02-02  Martin Baulig  <martin@ximian.com>
12982
12983         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12984
12985 2003-02-02  Martin Baulig  <martin@ximian.com>
12986
12987         * class.cs (Constructor.Emit): Open the symbol writer before
12988         emitting the constructor initializer.
12989         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12990         single-stepping through constructor initializers.
12991
12992 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12993
12994         * class.cs: Handle error 549: do not allow virtual methods in
12995         sealed classes. 
12996
12997 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12998
12999         * decl.cs: Check access levels when resolving types
13000
13001 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13002
13003         * statement.cs: Add parameters and locals set in catch blocks that might 
13004         return to set vector
13005
13006 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13007
13008         * class.cs (Operator): Set the SpecialName flags for operators.
13009
13010         * expression.cs (Invocation.DoResolve): Only block calls to
13011         accessors and operators on SpecialName methods.
13012
13013         (Cast.TryReduce): Handle conversions from char constants.
13014
13015
13016 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13017
13018         * statement.cs: small memory and time optimization in FlowBranching.
13019
13020 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13021
13022         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13023         problem that the last fix but in the other sid (Set).
13024
13025         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13026         access when there is no indexer in the hierarchy.
13027
13028 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13029
13030         * class.cs: Combine some if statements.
13031
13032 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13033
13034         * driver.cs: fixed bug #37187.
13035
13036 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13037
13038         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13039         any indexer, it's needed to build a list with all the indexers in the
13040         hierarchy (AllGetters), else we have problems. Fixes #35653.
13041
13042 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * class.cs (MethodData.Define): It is wrong for an interface
13045         implementation to be static in both cases: explicit and implicit.
13046         We were only handling this in one case.
13047
13048         Improve the if situation there to not have negations.
13049
13050         * class.cs (Field.Define): Turns out that we do not need to check
13051         the unsafe bit on field definition, only on usage.  Remove the test.
13052
13053 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13054
13055         * driver.cs: use assembly.Location instead of Codebase (the latest
13056         patch made mcs fail when using MS assemblies).
13057
13058 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13059
13060         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13061         get the path to *corlib.dll.
13062
13063 2003-01-21  Nick Drochak <ndrochak@gol.com>
13064
13065         * cs-tokenizer.cs:
13066         * pending.cs:
13067         * typemanager.cs: Remove compiler warnings
13068
13069 2003-01-20  Duncan Mak  <duncan@ximian.com>
13070
13071         * AssemblyInfo.cs: Bump the version number to 0.19.
13072
13073 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13074
13075         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13076
13077 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13078
13079         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13080
13081 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * cs-parser.jay: Small fix: we were not comparing the constructor
13084         name correctly.   Thanks to Zoltan for the initial pointer.
13085
13086 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13087
13088         * cs-tokenizer.cs: Set file name when specified with #line
13089
13090 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13091
13092         * cs-parser.jay: Only perform the constructor checks here if we
13093         are named like the class;  This will help provider a better
13094         error.  The constructor path is taken when a type definition is
13095         not found, but most likely the user forgot to add the type, so
13096         report that rather than the constructor error.
13097
13098 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13099
13100         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13101         allocations.
13102
13103 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13104
13105         * cs-parser.jay: Add cleanup call.
13106
13107 2003-01-13  Duncan Mak  <duncan@ximian.com>
13108
13109         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13110         consistent with other methods.
13111
13112 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13113
13114         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13115
13116 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13117
13118         * attribute.cs: only set GuidAttr to true when we have a
13119         GuidAttribute.
13120
13121 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13122
13123         * ecore.cs:
13124         * expression.cs:
13125         * typemanager.cs: fixes to allow mcs compile corlib with the new
13126         Type.IsSubclassOf fix.
13127
13128 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13129
13130         * expression.cs (LocalVariableReference.DoResolve): Classify a
13131         constant as a value, not as a variable.   Also, set the type for
13132         the variable.
13133
13134         * cs-parser.jay (fixed_statement): take a type instead of a
13135         pointer_type, so we can produce a better error message later.
13136
13137         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13138         as an error.  
13139
13140         (For.DoEmit): Make inifinite loops have a
13141         non-conditional branch back.
13142
13143         (Fixed.DoEmit): First populate the pinned variables, then emit the
13144         statement, then clear the variables.  Before I was emitting the
13145         code once for each fixed piece.
13146
13147
13148 2003-01-08  Martin Baulig  <martin@ximian.com>
13149
13150         * statement.cs (FlowBranching.MergeChild): A break in a
13151         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13152
13153 2003-01-08  Martin Baulig  <martin@ximian.com>
13154
13155         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13156         lives in the same number space than `param_map'.  Fixes #36154.
13157
13158 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * cs-parser.jay (constructor_declaration): Set the
13161         Constructor.ModFlags before probing for it.  This makes the
13162         compiler report 514, 515 and 132 (the code was there, but got
13163         broken). 
13164
13165         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13166         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13167         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13168
13169 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13170
13171         * enum.cs: create the enum static fields using the enum type.
13172
13173 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13174
13175         * class.cs: don't try to create the ParamBuilder for the return
13176         type if it's not needed (and handle it breaking for the ms runtime
13177         anyway).
13178
13179 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13180
13181         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13182
13183 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13186         the command.   This showed up while compiling the JANET source
13187         code, which used \r as its only newline separator.
13188
13189 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13190
13191         * class.cs (Method.Define): If we are an operator (because it
13192         reuses our code), then set the SpecialName and HideBySig.  #36128
13193
13194 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13195
13196         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13197         exception, report error 120 `object reference required'.
13198
13199         * driver.cs: Add --pause option, used during to measure the size
13200         of the process as it goes with --timestamp.
13201
13202         * expression.cs (Invocation.DoResolve): Do not allow methods with
13203         SpecialName to be invoked.
13204
13205 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13206
13207         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13208         number before adding it.
13209
13210 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13211
13212         * ecore.cs (StandardImplicitConversion): When in an unsafe
13213         context, we allow conversion between void * to any other pointer
13214         type. This fixes bug #35973.
13215
13216 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13217
13218         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13219         is not thrown when extensionless outputs are used 
13220
13221 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13222
13223         * rootcontext.cs: fixed compilation of corlib.
13224
13225 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * attribute.cs (Attributes.Contains): Add new method.
13228
13229         * class.cs (MethodCore.LabelParameters): if the parameter is an
13230         `out' parameter, check that no attribute `[In]' has been passed.
13231
13232         * enum.cs: Handle the `value__' name in an enumeration.
13233
13234 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13235
13236         * decl.cs: Added special case to allow overrides on "protected
13237         internal" methods
13238
13239 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13240
13241         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13242         since it makes much more sense.
13243
13244         (Attributes.ctor): Don't require a Location parameter.
13245
13246         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13247
13248         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13249         since we already have that information per attribute.
13250
13251         * everywhere : make appropriate changes.
13252
13253         * class.cs (LabelParameters): Write the code which actually
13254         applies attributes to the return type. We can't do this on the MS
13255         .NET runtime so we flag a warning in the case an exception is
13256         thrown.
13257
13258 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13259
13260         * const.cs: Handle implicit null conversions here too.
13261
13262 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13263
13264         * class.cs (MethodCore.LabelParameters): Remove the extra
13265         Type [] parameter since it is completely unnecessary. Instead
13266         pass in the method's attributes so that we can extract
13267         the "return" attribute.
13268
13269 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13270
13271         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13272         of ignoring it and letting the compile continue.
13273
13274         * typemanager.cs (ChangeType): use an extra argument to return an
13275         error condition instead of throwing an exception.
13276
13277 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13278
13279         * expression.cs (Unary.TryReduce): mimic the code for the regular
13280         code path.  Perform an implicit cast in the cases where we can
13281         implicitly convert to one of the integral types, and then reduce
13282         based on that constant.   This fixes bug #35483.
13283
13284 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13285
13286         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13287
13288 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13289
13290         * namespace.cs: fixed bug #35489.
13291
13292 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13293
13294         * class.cs: Remove some dead code.
13295
13296         * cs-parser.jay: Estimate the number of methods needed
13297         (RootContext.MethodCount);
13298
13299         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13300         numbers instead of StringBuilders.
13301
13302         * support.cs (PtrHashtable): Add constructor with initial size;
13303         We can now reduce reallocations of the method table.
13304
13305 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13306
13307         * attribute.cs (ApplyAttributes): Keep track of the emitted
13308         attributes on a per-target basis. This fixes bug #35413.
13309
13310 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13311
13312         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13313         default to the Windows 1252 encoding.
13314
13315         (UnixParseOption): Support version, thanks to Alp for the missing
13316         pointer. 
13317
13318         * AssemblyInfo.cs: Add nice assembly information.
13319
13320         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13321         (bug 35169).
13322
13323         * cs-parser.jay: Allow a trailing comma before the close bracked
13324         in the attribute_section production.
13325
13326         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13327         address of the instance was being taken, I will take this out,
13328         because we take the address of the object immediately here.
13329
13330 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13331
13332         * typemanager.cs (AreMultipleAllowed): Take care of the most
13333         obvious case where attribute type is not in the current assembly -
13334         stupid me ;-)
13335
13336 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13339         definitions, instead of doing that afterwards.  
13340
13341         Also we use a nice little hack, depending on the constructor, we
13342         know if we are a "composed" name or a simple name.  Hence, we
13343         avoid the IndexOf test, and we avoid 
13344
13345         * codegen.cs: Add code to assist in a bug reporter to track down
13346         the source of a compiler crash. 
13347
13348 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13349
13350         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13351         types have been emitted for a given element and flag an error
13352         if something which does not have AllowMultiple set is used more
13353         than once.
13354
13355         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13356         attribute types and their corresponding AllowMultiple properties
13357
13358         (AreMultipleAllowed): Check the property for a given type.
13359
13360         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13361         property in the case we have a TypeContainer.
13362
13363         (Attributes.AddAttribute): Detect duplicates and just skip on
13364         adding them. This trivial fix catches a pretty gross error in our
13365         attribute emission - global attributes were being emitted twice!
13366
13367         Bugzilla bug #33187 is now fixed.
13368
13369 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13370
13371         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13372         instead of pp_and).
13373
13374         * expression.cs (Binary.ResolveOperator): I can only use the
13375         Concat (string, string, string) and Concat (string, string,
13376         string, string) if the child is actually a concatenation of
13377         strings. 
13378
13379 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13382         context where we need a 2-character lookahead.
13383
13384         * pending.cs (PendingImplementation): Rework so we can keep track
13385         of interface types all the time, and flag those which were
13386         implemented by parents as optional.
13387
13388 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13389
13390         * expression.cs (Binary.ResolveOperator): Use
13391         String.Concat(string,string,string) or
13392         String.Concat(string,string,string,string) when possible. 
13393
13394         * typemanager: More helper methods.
13395
13396
13397 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13398
13399         * pending.cs: remove the bogus return from GetMissingInterfaces()
13400         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13401
13402 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13403
13404         * namespace.cs: avoid duplicated 'using xxx' being added to
13405         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13406         when we get more than one 'using' statement for the same namespace.
13407         Report a CS0105 warning for it.
13408
13409 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13410
13411         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13412         of calling getChar/putback, uses internal knowledge of it.    
13413
13414         (xtoken): Reorder tokenizer so most common patterns are checked
13415         first.  This reduces the compilation time in another 5% (from 8.11s
13416         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13417
13418         The parsing time is 22% of the compilation in mcs, and from that
13419         64% is spent on the tokenization process.  
13420
13421         I tried using a binary search for keywords, but this is slower
13422         than the hashtable.  Another option would be to do a couple of
13423         things:
13424
13425                 * Not use a StringBuilder, instead use an array of chars,
13426                   with a set value.  Notice that this way we could catch
13427                   the 645 error without having to do it *afterwards*.
13428
13429                 * We could write a hand-parser to avoid the hashtable
13430                   compares altogether.
13431
13432         The identifier consumption process takes 37% of the tokenization
13433         time.  Another 15% is spent on is_number.  56% of the time spent
13434         on is_number is spent on Int64.Parse:
13435
13436                 * We could probably choose based on the string length to
13437                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13438                   computations. 
13439
13440         Another 3% is spend on wrapping `xtoken' in the `token' function.
13441
13442         Handle 0xa0 as whitespace (#34752)
13443
13444 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13445
13446         * typemanager.cs (IsCLRType): New routine to tell whether a type
13447         is one of the builtin types.  
13448
13449         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13450         typecode in more places instead of doing pointer comparissions.
13451         We could leverage some knowledge about the way the typecodes are
13452         laid out.
13453
13454         New code to cache namespaces in assemblies, it is currently not
13455         invoked, to be used soon.
13456
13457         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13458
13459         * expression.cs (Binary.ResolveOperator): specially handle
13460         strings, and do not perform user-defined operator overloading for
13461         built-in types.
13462
13463 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13464
13465         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13466         internalcall as it is a pretty simple operation;  Avoid whenever
13467         possible to call Char.IsLetter.
13468
13469         (consume_identifier): Cut by half the number of
13470         hashtable calls by merging the is_keyword and GetKeyword behavior.
13471
13472         Do not short-circuit, because if we do, we
13473         report errors (ie, #if false && true would produce an invalid
13474         directive error);
13475
13476
13477 2002-11-24  Martin Baulig  <martin@ximian.com>
13478
13479         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13480         check constant ranges and report a CS0221.  Fixes #33186.
13481
13482 2002-11-24  Martin Baulig  <martin@ximian.com>
13483
13484         * cs-parser.jay: Make this work for uninitialized variable
13485         declarations in the `for' initializer.  Fixes #32416.
13486
13487 2002-11-24  Martin Baulig  <martin@ximian.com>
13488
13489         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13490         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13491
13492 2002-11-24  Martin Baulig  <martin@ximian.com>
13493
13494         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13495         argument; if true, we also check for user-defined conversions.
13496         This is only needed if both arguments are of a user-defined type.
13497         Fixes #30443, added test-175.cs.
13498         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13499
13500         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13501
13502 2002-11-24  Martin Baulig  <martin@ximian.com>
13503
13504         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13505         function to get the store opcode.
13506         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13507         only emit the Ldelema if the store opcode is Stobj.  You must run
13508         both test-34 and test-167 to test this.  Fixes #34529.
13509
13510 2002-11-23  Martin Baulig  <martin@ximian.com>
13511
13512         * ecore.cs (Expression.MemberLookup): Added additional
13513         `qualifier_type' argument which is used when we're being called
13514         from MemberAccess.DoResolve() and null if we're called from a
13515         SimpleName lookup.
13516         (Expression.MemberLookupFailed): New method to report errors; this
13517         does the CS1540 check and reports the correct error message.
13518
13519         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13520         argument for the CS1540 check and redone the way how we're dealing
13521         with private members.  See the comment in the source code for details.
13522         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13523         `closure_start_type' to `closure_qualifier_type' and check whether
13524         it's not null.  It was not this filter being broken, it was just
13525         being called with the wrong arguments.
13526
13527         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13528         and pass it the correct `qualifier_type'; this also does the error
13529         handling for us.
13530
13531 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * expression.cs (Invocation.EmitParams): If the we are dealing
13534         with a non-built-in value type, load its address as well.
13535
13536         (ArrayCreation): Use a a pretty constant instead
13537         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13538         static initializers.  
13539
13540         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13541         because they are not really value types, just glorified integers. 
13542
13543         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13544
13545         * ecore.cs: Remove redundant code for enumerations, make them use
13546         the same code path as everything else, fixes the casting issue
13547         with enumerations in Windows.Forms.
13548
13549         * attribute.cs: Do only cast to string if it is a string, the
13550         validation happens later.
13551
13552         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13553         people upgrade their corlibs.
13554
13555         * ecore.cs: Oops, enumerations were not following the entire code path
13556
13557 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13558
13559         * typemanager.cs (FilterWithClosure): Commented out the test for
13560         1540 in typemanager.cs, as it has problems when accessing
13561         protected methods from a parent class (see test-174.cs). 
13562
13563         * attribute.cs (Attribute.ValidateGuid): new method.
13564         (Attribute.Resolve): Use above.
13565
13566 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13567
13568         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13569
13570         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13571         handling for enumerations, as we only needed the TypeContainer
13572         functionality to begin with (this is required for the fix below to
13573         work for enums that reference constants in a container class for
13574         example). 
13575
13576         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13577
13578         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13579         a valid TypeBuilder to perform lookups on.o
13580
13581         * class.cs (InheritableMemberSignatureCompare): Use true in the
13582         call to GetGetMethod and GetSetMethod, because we are comparing
13583         the signature, and we need to get the methods *even* if they are
13584         private. 
13585
13586         (PropertyBase.CheckBase): ditto.
13587
13588         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13589         GotoCase.Resolve): Use Peel on EmpytCasts.
13590
13591         * ecore.cs (EmptyCast): drop child, add Peel method.
13592
13593 2002-11-17  Martin Baulig  <martin@ximian.com>
13594
13595         * ecore.cs (EmptyCast.Child): New public property.
13596
13597         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13598         label resolved to an EmptyCast.  Fixes #34162.
13599         (GotoCase.Resolve): Likewise.
13600         (Block.EmitMeta): Likewise.
13601
13602 2002-11-17  Martin Baulig  <martin@ximian.com>
13603
13604         * expression.cs (Invocation.BetterConversion): Prefer int over
13605         uint; short over ushort; long over ulong for integer literals.
13606         Use ImplicitConversionExists instead of StandardConversionExists
13607         since we also need to check for user-defined implicit conversions.
13608         Fixes #34165.  Added test-173.cs.
13609
13610 2002-11-16  Martin Baulig  <martin@ximian.com>
13611
13612         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13613         with the `true' and `false' literals.  Fixes #33151.
13614
13615 2002-11-16  Martin Baulig  <martin@ximian.com>
13616
13617         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13618         October 22nd; don't do the cs1540 check for static members.
13619
13620         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13621         now using our own filter here and doing the cs1540 check again.
13622
13623 2002-11-16  Martin Baulig  <martin@ximian.com>
13624
13625         * support.cs (InternalParameters): Don't crash if we don't have
13626         any fixed parameters.  Fixes #33532.
13627
13628 2002-11-16  Martin Baulig  <martin@ximian.com>
13629
13630         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13631         when looking up static methods to make this work on Windows.
13632         Fixes #33773.
13633
13634 2002-11-16  Martin Baulig  <martin@ximian.com>
13635
13636         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13637         a setter rather than using PropertyInfo.CanWrite.
13638
13639 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13640
13641         * class.cs: Allow acces to block member by subclasses. Fixes build
13642         breaker.
13643
13644 2002-11-14  Martin Baulig  <martin@ximian.com>
13645
13646         * class.cs (Constructor.Emit): Added the extern/block check.
13647         Fixes bug #33678.
13648
13649 2002-11-14  Martin Baulig  <martin@ximian.com>
13650
13651         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13652         iteration while looking for indexers, this is needed because the
13653         indexer may have a different name in our base classes.  Fixed the
13654         error reporting (no indexers at all, not get accessor, no
13655         overloaded match).  Fixes bug #33089.
13656         (IndexerAccess.DoResolveLValue): Likewise.
13657
13658 2002-11-14  Martin Baulig  <martin@ximian.com>
13659
13660         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13661         indexers.  Fixes the first part of bug #33089.
13662         (MethodSignature.InheritableMemberSignatureCompare): Added support
13663         for properties.
13664
13665 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13666
13667         * attribute.cs (Attribute.Resolve): Catch the
13668         NullReferenceException and report it since it isn't supposed to
13669         happen. 
13670
13671 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13674         LogicalOr and LogicalAnd that can benefit from recursively
13675         handling EmitBranchable.  The code now should be nice for Paolo.
13676
13677 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13680         the Type lookups, as we perform quite a number of lookups on
13681         non-Types.  This can be removed once we can deterministically tell
13682         whether we have a type or a namespace in advance.
13683
13684         But this might require special hacks from our corlib.
13685
13686         * TODO: updated.
13687
13688         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13689         and double which avoids a conversion from an integer to a double.
13690
13691         * expression.cs: tiny optimization, avoid calling IsConstant,
13692         because it effectively performs the lookup twice.
13693
13694 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13695
13696         But a bogus return here to keep the semantics of the old code
13697         until the Mono runtime is fixed.
13698
13699         * pending.cs (GetMissingInterfaces): New method used to remove all
13700         the interfaces that are already implemented by our parent
13701         classes from the list of pending methods. 
13702
13703         * interface.cs: Add checks for calls after ResolveTypeExpr.
13704
13705 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * class.cs (Class.Emit): Report warning 67: event not used if the
13708         warning level is beyond 3.
13709
13710         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13711         being a NullLiteral.
13712
13713         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13714         specifiers. 
13715
13716         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13717         path that might fail if a type can not be resolved.
13718
13719         * expression.cs (Binary.Emit): Emit unsigned versions of the
13720         operators. 
13721
13722         * driver.cs: use error 5.
13723
13724 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13725
13726         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13727
13728 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13729
13730         * cs-parser.jay (switch_section): A beautiful patch from Martin
13731         Baulig that fixed 33094.
13732
13733 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13736         Check whether the base is abstract and report an error if so.
13737
13738         * expression.cs (IndexerAccess.DoResolveLValue,
13739         IndexerAccess.DoResolve): ditto. 
13740
13741         (Invocation.DoResolve): ditto.
13742
13743         (Invocation.FullMethodDesc): Improve the report string.
13744
13745         * statement.cs (Block): Eliminate IsVariableDefined as it is
13746         basically just a wrapper for GetVariableInfo.
13747
13748         * ecore.cs (SimpleName): Use new 
13749
13750         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13751         type, as we return the actual parameter ref/unref state on a
13752         different call.
13753
13754 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13755
13756         * support.cs: Return proper flags REF/OUT fixing the previous
13757         commit.  
13758
13759         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13760         not used to mean `ref' but `ref or out' in ParameterReference
13761
13762         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13763         full type signature instead of calling TypeManger.CSharpName
13764         ourselves. 
13765
13766         * support.cs (InternalParameters.ParameterDesc): Do not compare
13767         directly to the modflags, because REF/OUT will actually be bitsets
13768         if set. 
13769
13770         * delegate.cs (VerifyMethod): Check also the modifiers.
13771
13772         * cs-tokenizer.cs: Fix bug where floating point values with an
13773         exponent where a sign was missing was ignored.
13774
13775         * driver.cs: Allow multiple assemblies to be specified in a single
13776         /r: argument
13777
13778 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13779
13780         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13781         because identifiers after a parenthesis would end up in this kind
13782         of production, and we needed to desamiguate it for having casts
13783         like:
13784
13785                 (UserDefinedType *) xxx
13786
13787 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13788
13789         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13790         we should set on the Bindingflags.NonPublic, but not turn on
13791         private_ok.  private_ok controls whether a Private member is
13792         returned (this is chekced on the filter routine), while the
13793         BindingFlags.NonPublic just controls whether private/protected
13794         will be allowed.   This fixes the problem part of the problem of
13795         private properties being allowed to be used in derived classes.
13796
13797         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13798         so we can call the children DoResolveLValue method (this will
13799         properly signal errors on lvalue assignments to base properties)
13800
13801         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13802         getter are null, and we have a property info, we know that this
13803         happened because the lookup failed, so we report an error 122 for
13804         protection level violation.
13805
13806         We also silently return if setter and getter are null in the
13807         resolve functions, this condition only happens if we have flagged
13808         the error before.  This is the other half of the problem. 
13809
13810         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13811         not have accessibility information, that is why we were returning
13812         true in the filter function in typemanager.cs.
13813
13814         To properly report 122 (property is inaccessible because of its
13815         protection level) correctly, we report this error in ResolveAccess
13816         by failing if both the setter and the getter are lacking (ie, the
13817         lookup failed). 
13818
13819         DoResolve and DoLResolve have been modified to check for both
13820         setter/getter being null and returning silently, the reason being
13821         that I did not want to put the knowledge about this error in upper
13822         layers, like:
13823
13824         int old = Report.Errors;
13825         x = new PropertyExpr (...);
13826         if (old != Report.Errors)
13827                 return null;
13828         else
13829                 return x;
13830
13831         So the property expr is returned, but it is invalid, so the error
13832         will be flagged during the resolve process. 
13833
13834         * class.cs: Remove InheritablePropertySignatureCompare from the
13835         class, as we no longer depend on the property signature to compute
13836         whether it is possible to implement a method or not.
13837
13838         The reason is that calling PropertyInfo.GetGetMethod will return
13839         null (in .NET, in Mono it works, and we should change this), in
13840         cases where the Get Method does not exist in that particular
13841         class.
13842
13843         So this code:
13844
13845         class X { public virtual int A { get { return 1; } } }
13846         class Y : X { }
13847         class Z : Y { public override int A { get { return 2; } } }
13848
13849         Would fail in Z because the parent (Y) would not have the property
13850         defined.  So we avoid this completely now (because the alternative
13851         fix was ugly and slow), and we now depend exclusively on the
13852         method names.
13853
13854         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13855         reference method, instead of using the property.
13856
13857         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13858         routines are gone now.
13859
13860         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13861         names, they were incorrectly named.
13862
13863         * cs-tokenizer.cs: Return are more gentle token on failure. 
13864
13865         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13866         had an out-of-sync index variable, which caused it to remove from
13867         the list of pending methods the wrong method sometimes.
13868
13869 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13870
13871         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13872         CanWrite, because those refer to this particular instance of the
13873         property, and do not take into account the fact that we can
13874         override single members of a property.
13875
13876         Constructor requires an EmitContext.  The resolution process does
13877         not happen here, but we need to compute the accessors before,
13878         because the resolution does not always happen for properties.
13879
13880         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13881         subclass, before we did not update this flag, but we did update
13882         bindingflags. 
13883
13884         (GetAccessors): Drop this routine, as it did not work in the
13885         presence of partially overwritten set/get methods. 
13886
13887         Notice that this broke the cs1540 detection, but that will require
13888         more thinking. 
13889
13890 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13891
13892         * class.cs:
13893         * codegen.cs:
13894         * driver.cs: issue a warning instead of an error if we don't support
13895         debugging for the platform. Also ignore a couple of errors that may
13896         arise when trying to write the symbols. Undo my previous patch.
13897
13898 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13899
13900         * driver.cs: ignore /debug switch except for Unix platforms.
13901
13902 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13903
13904         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13905
13906 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13907
13908         * driver.cs: Do not make mcs-debug conditional, so we do not break
13909         builds that use it.
13910
13911         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13912         review this patch.  But basically after all the children variables
13913         have been merged, the value of "Breaks" was not being set to
13914         new_breaks for Switch blocks.  I think that it should be set after
13915         it has executed.  Currently I set this to the value of new_breaks,
13916         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13917         conservative, but I do not understand this code very well.
13918
13919         I did not break anything in the build, so that is good ;-)
13920
13921         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13922
13923 2002-10-20  Mark Crichton  <crichton@gimp.org>
13924
13925         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13926
13927 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13928
13929         * cfold.cs: Fixed compile blocker.
13930
13931 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13932
13933         * driver.cs: I was chekcing the key, not the file.
13934
13935 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13936
13937         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13938         message that we were generating - we just need to silently return
13939         a null.
13940
13941 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * class.cs (Event.Define): Change my previous commit, as this
13944         breaks the debugger.  This is a temporary hack, as it seems like
13945         the compiler is generating events incorrectly to begin with.
13946
13947         * expression.cs (Binary.ResolveOperator): Added support for 
13948         "U operator - (E x, E y)"
13949
13950         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13951         y)".
13952
13953         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13954         init-only variables, but this path did not take into account that
13955         there might be also instance readonly variables.  Correct this
13956         problem. 
13957
13958         This fixes bug 32253
13959
13960         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13961         delegates as well.
13962
13963         * driver.cs: Change the extension for modules to `netmodule'
13964
13965         * cs-parser.jay: Improved slightly the location tracking for
13966         the debugger symbols.
13967
13968         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13969         modifiers that were specified instead of the hardcoded value
13970         (FamAndAssem).  This was basically ignoring the static modifier,
13971         and others.  Fixes 32429.
13972
13973         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13974         fixed a bug in the process (32476)
13975
13976         * expression.cs (ArrayAccess.EmitAssign): Patch from
13977         hwang_rob@yahoo.ca that fixes bug 31834.3
13978
13979 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13980
13981         * driver.cs: Make the module extension .netmodule.
13982
13983 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13984
13985         * driver.cs: Report an error if the resource file is not found
13986         instead of crashing.
13987
13988         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13989         false, like Emit does.
13990
13991 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13992
13993         * typemanager.cs: Remove unused private member.  Also reported mcs
13994         bug to report this as a warning like csc.
13995
13996 2002-10-15  Martin Baulig  <martin@gnome.org>
13997
13998         * statement.cs (Statement.Emit): Made this a virtual method; emits
13999         the line number info and calls DoEmit().
14000         (Statement.DoEmit): New protected abstract method, formerly knows
14001         as Statement.Emit().
14002
14003         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14004
14005 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14006
14007         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14008         have fixed a remaining problem: not every AddXXXX was adding a
14009         fully qualified name.  
14010
14011         Now everyone registers a fully qualified name in the DeclSpace as
14012         being defined instead of the partial name.  
14013
14014         Downsides: we are slower than we need to be due to the excess
14015         copies and the names being registered this way.  
14016
14017         The reason for this is that we currently depend (on the corlib
14018         bootstrap for instance) that types are fully qualified, because
14019         we dump all the types in the namespace, and we should really have
14020         types inserted into the proper namespace, so we can only store the
14021         basenames in the defined_names array.
14022
14023 2002-10-10  Martin Baulig  <martin@gnome.org>
14024
14025         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14026         from bug #31834, see the bug report for a testcase which is
14027         miscompiled.
14028
14029 2002-10-10  Martin Baulig  <martin@gnome.org>
14030
14031         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14032         flow analysis code for this.
14033
14034         * statement.cs (Do, While, For): Tell the flow analysis code about
14035         infinite loops.
14036         (FlowBranching.UsageVector): Added support for infinite loops.
14037         (Block.Resolve): Moved the dead code elimination here and use flow
14038         analysis to do it.
14039
14040 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * class.cs (Field.Define): Catch cycles on struct type
14043         definitions. 
14044
14045         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14046         fields if the fields are static.  We only need to check instance
14047         fields. 
14048
14049         * expression.cs (As.DoResolve): Test for reference type.
14050
14051         * statement.cs (Using.ResolveExpression): Use
14052         ConvertImplicitRequired, not ConvertImplicit which reports an
14053         error on failture
14054         (Using.ResolveLocalVariableDecls): ditto.
14055
14056         * expression.cs (Binary.ResolveOperator): Report errors in a few
14057         places where we had to.
14058
14059         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14060
14061 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * expression.cs: Use StoreFromPtr instead of extracting the type
14064         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14065
14066         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14067         an enumeration value to a System.Enum, but System.Enum is not a
14068         value type, but an class type, so we need to box.
14069
14070         (Expression.ConvertExplicit): One codepath could return
14071         errors but not flag them.  Fix this.  Fixes #31853
14072
14073         * parameter.cs (Resolve): Do not allow void as a parameter type.
14074
14075 2002-10-06  Martin Baulig  <martin@gnome.org>
14076
14077         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14078         if it's a class type and not a struct.  Fixes #31815.
14079
14080 2002-10-06  Martin Baulig  <martin@gnome.org>
14081
14082         * statement.cs: Reworked the flow analysis code a bit to make it
14083         usable for dead code elimination.
14084
14085 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14086
14087         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14088
14089 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14090
14091         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14092         to fix the test 165, will investigate deeper.
14093
14094 2002-10-04  Martin Baulig  <martin@gnome.org>
14095
14096         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14097         finally blocks actually work.
14098         (Try.Resolve): We don't need to create a sibling for `finally' if
14099         there is no finally block.
14100
14101 2002-10-04  Martin Baulig  <martin@gnome.org>
14102
14103         * class.cs (Constructor.Define): The default accessibility for a
14104         non-default constructor is private, not public.
14105
14106 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * class.cs (Constructor): Make AllowedModifiers public, add
14109         EXTERN.
14110
14111         * cs-parser.jay: Perform the modifiers test here, as the
14112         constructor for the Constructor class usually receives a zero
14113         because of the way we create it (first we create, later we
14114         customize, and we were never checking the modifiers).
14115
14116         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14117         is a version of LookupTypeReflection that includes the type-name
14118         cache.  This can be used as a fast path for functions that know
14119         the fully qualified name and are only calling into *.GetType() to
14120         obtain a composed type.
14121
14122         This is also used by TypeManager.LookupType during its type
14123         composition.
14124
14125         (LookupType): We now also track the real type name, as sometimes
14126         we can get a quey for the real type name from things like
14127         ComposedCast.  This fixes bug 31422.
14128
14129         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14130         complete type fullname, it does not have to go through the type
14131         resolution system to obtain the composed version of the type (for
14132         obtaining arrays or pointers).
14133
14134         (Conditional.Emit): Use the EmitBoolExpression to
14135         generate nicer code, as requested by Paolo.
14136
14137         (ArrayCreation.CheckIndices): Use the patch from
14138         hwang_rob@yahoo.ca to validate the array initializers. 
14139
14140 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14141
14142         * class.cs (ConstructorInitializer.Emit): simplify code by using
14143         Invocation.EmitCall, and at the same time, fix the bugs in calling
14144         parent constructors that took variable arguments. 
14145
14146         * ecore.cs (Expression.ConvertNumericExplicit,
14147         Expression.ImplicitNumericConversion): Remove the code that
14148         manually wrapped decimal (InternalTypeConstructor call is now gone
14149         as well).
14150
14151         * expression.cs (Cast.TryReduce): Also handle decimal types when
14152         trying to perform a constant fold on the type.
14153
14154         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14155
14156         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14157         that only turned off an error report, and did nothing else. 
14158
14159 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * driver.cs: Handle and ignore /fullpaths
14162
14163 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14164
14165         * expression.cs (Binary.ResolveOperator): Catch the case where
14166         DoNumericPromotions returns true, 
14167
14168         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14169
14170 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14171
14172         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14173         report error 70.
14174
14175 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14176
14177         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14178         conversion exists, but it is also required that the conversion be
14179         performed.  This manifested in "(Type64Enum) 2".  
14180
14181         * class.cs (TypeManager.AddMethod): The fix is not to change
14182         AddEnum, because that one was using a fully qualified name (every
14183         DeclSpace derivative does), but to change the AddMethod routine
14184         that was using an un-namespaced name.  This now correctly reports
14185         the duplicated name.
14186
14187         Revert patch until I can properly fix it.  The issue
14188         is that we have a shared Type space across all namespaces
14189         currently, which is wrong.
14190
14191         Options include making the Namespace a DeclSpace, and merge
14192         current_namespace/current_container in the parser.
14193
14194 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14195
14196         * cs-parser.jay: Improve error reporting when we get a different
14197         kind of expression in local_variable_type and
14198         local_variable_pointer_type. 
14199
14200         Propagate this to avoid missleading errors being reported.
14201
14202         * ecore.cs (ImplicitReferenceConversion): treat
14203         TypeManager.value_type as a target just like object_type.   As
14204         code like this:
14205
14206         ValueType v = 1;
14207
14208         Is valid, and needs to result in the int 1 being boxed before it
14209         is assigned to the value type v.
14210
14211         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14212         to validate the enumeration name.
14213
14214         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14215         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14216         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14217
14218         * ecore.cs (TryImplicitIntConversion): When doing an
14219         implicit-enumeration-conversion, check if the type is 64-bits and
14220         perform a conversion before passing to EnumConstant.
14221
14222 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14223
14224         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14225         report ambiguous type references.  Unlike the MS version, we
14226         report what the ambiguity is.   Innovation at work ;-)
14227
14228         (DeclSpace.FindType): Require a location argument to
14229         display when we display an ambiguous error.
14230
14231         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14232
14233         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14234
14235         * expression.cs (EmitDynamicInitializers): Apply patch from
14236         hwang_rob@yahoo.ca that fixes the order in which we emit our
14237         initializers. 
14238
14239 2002-09-21  Martin Baulig  <martin@gnome.org>
14240
14241         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14242         delegate takes no arguments.
14243
14244 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14245
14246         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14247         from integers.
14248
14249         * expression.cs: Extract the underlying type.
14250
14251         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14252
14253         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14254
14255 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * class.cs (TypeContainer.DefineType): We can not use the nice
14258         PackingSize with the size set to 1 DefineType method, because it
14259         will not allow us to define the interfaces that the struct
14260         implements.
14261
14262         This completes the fixing of bug 27287
14263
14264         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14265         means also structs.  This fixes part of the problem. 
14266         (Expresion.ImplicitReferenceConversionExists): ditto.
14267
14268         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14269         error if there were no errors reported during the type lookup
14270         process, to avoid duplicates or redundant errors.  Without this
14271         you would get an ambiguous errors plus a type not found.  We have
14272         beaten the user enough with the first error.  
14273
14274         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14275         reference. 
14276
14277         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14278         during the resolution process, stop the lookup, this avoids
14279         repeated error reports (same error twice).
14280
14281         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14282
14283         * typemanager.cs (LookupType): Redo the type lookup code to match
14284         the needs of System.Reflection.  
14285
14286         The issue is that System.Reflection requires references to nested
14287         types to begin with a "+" sign instead of a dot.  So toplevel
14288         types look like: "NameSpace.TopLevelClass", and nested ones look
14289         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14290         levels. 
14291
14292 2002-09-19  Martin Baulig  <martin@gnome.org>
14293
14294         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14295         says that a method always returns or always throws an exception,
14296         don't report the CS0161.
14297
14298         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14299         set `Returns = new_returns'.
14300
14301 2002-09-19  Martin Baulig  <martin@gnome.org>
14302
14303         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14304         to an enum constant, check for a CS0176.
14305
14306 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14307
14308         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14309         for operators that must be in pairs and report errors.
14310
14311         * ecore.cs (SimpleName.DoResolveType): During the initial type
14312         resolution process, when we define types recursively, we must
14313         check first for types in our current scope before we perform
14314         lookups in the enclosing scopes.
14315
14316         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14317
14318         (Invocation.VerifyArgumentsCompat): Call
14319         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14320         I thought we were supposed to always call this, but there are a
14321         few places in the code where we dont do it.
14322
14323 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * driver.cs: Add support in -linkres and -resource to specify the
14326         name of the identifier.
14327
14328 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * ecore.cs (StandardConversionExists): Sync with the conversion
14331         code: allow anything-* to void* conversions.
14332
14333         (FindMostSpecificSource): Use an Expression argument
14334         instead of a Type, because we might be handed over a Literal which
14335         gets a few more implicit conversions that plain types do not.  So
14336         this information was being lost.
14337
14338         Also, we drop the temporary type-holder expression when not
14339         required.
14340
14341 2002-09-17  Martin Baulig  <martin@gnome.org>
14342
14343         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14344         this is an explicit interface implementation.
14345
14346 2002-09-17  Martin Baulig  <martin@gnome.org>
14347
14348         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14349         different `IndexerName' attributes.
14350
14351         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14352         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14353         virtual CommonResolve().
14354
14355 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14356
14357         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14358         and convert that to the UnderlyingType.
14359
14360         * statement.cs (Foreach.Resolve): Indexers are just like variables
14361         or PropertyAccesses.
14362
14363         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14364         inside quoted strings, we were not doing this before.
14365
14366 2002-09-16  Martin Baulig  <martin@gnome.org>
14367
14368         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14369         resolve it.  This is needed for the definite assignment check of the
14370         instance expression, fixes bug #29846.
14371         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14372
14373 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14374
14375         * parameter.cs: Fix compile error.  Cannot reference static member
14376         from an instance object.  Is this an mcs bug?
14377
14378 2002-09-14  Martin Baulig  <martin@gnome.org>
14379
14380         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14381         multiple times.  Fixes bug #30295, added test-166.cs.
14382
14383 2002-09-14  Martin Baulig  <martin@gnome.org>
14384
14385         * statement.cs (Block.Emit): Don't emit unreachable code.
14386         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14387         `break' statements.
14388         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14389
14390 2002-09-14  Martin Baulig  <martin@gnome.org>
14391
14392         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14393         is set.
14394
14395 2002-09-14  Martin Baulig  <martin@gnome.org>
14396
14397         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14398         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14399         be false on the ms runtime.
14400
14401 2002-09-13  Martin Baulig  <martin@gnome.org>
14402
14403         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14404         the CS0038 error message.
14405
14406 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14409         constant inside, return it.
14410
14411 2002-09-12  Martin Baulig  <martin@gnome.org>
14412
14413         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14414         implicit conversion can be done between enum types.
14415
14416         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14417         check whether an implicit conversion to the current enum's UnderlyingType
14418         exists and report an error if not.
14419
14420         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14421         without debugging support.
14422
14423         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14424         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14425
14426 2002-09-12  Martin Baulig  <martin@gnome.org>
14427
14428         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14429
14430         * ecore.cs (IMemberExpr.DeclaringType): New property.
14431         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14432         nonstatic member of an outer type (CS0038).
14433
14434 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * driver.cs: Activate the using-error detector at warning level
14437         4 (at least for MS-compatible APIs).
14438
14439         * namespace.cs (VerifyUsing): Small buglett fix.
14440
14441         * pending.cs (PendingImplementation): pass the container pointer. 
14442
14443         * interface.cs (GetMethods): Allow for recursive definition.  Long
14444         term, I would like to move every type to support recursive
14445         definitions, not the current ordering mechanism that we have right
14446         now.
14447
14448         The situation is this: Attributes are handled before interfaces,
14449         so we can apply attributes to interfaces.  But some attributes
14450         implement interfaces, we will now handle the simple cases
14451         (recursive definitions will just get an error).  
14452
14453         * parameter.cs: Only invalidate types at the end if we fail to
14454         lookup all types.  
14455
14456 2002-09-09  Martin Baulig  <martin@gnome.org>
14457
14458         * ecore.cs (PropertyExpr.Emit): Also check for
14459         TypeManager.system_int_array_get_length so this'll also work when
14460         compiling corlib.  Fixes #30003.
14461
14462 2002-09-09  Martin Baulig  <martin@gnome.org>
14463
14464         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14465         and throw an exception if we can't get the type's size.  Fixed #30040,
14466         added test-165.cs.
14467
14468 2002-09-09  Martin Baulig  <martin@gnome.org>
14469
14470         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14471
14472         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14473         context.  Fixes bug #30027.
14474
14475         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14476         virtual functions.  Fixes bug #30043, added test-164.cs.
14477
14478 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14479
14480         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14481
14482 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14483
14484         * driver.cs: Use an object to get the windows codepage since it's not a
14485         static property.
14486
14487 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * statement.cs (For.Emit): for infinite loops (test == null)
14490         return whether there is a break inside, not always "true".
14491
14492         * namespace.cs (UsingEntry): New struct to hold the name of the
14493         using definition, the location where it is defined, and whether it
14494         has been used in a successful type lookup.
14495
14496         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14497         strings.
14498
14499         * decl.cs: ditto.
14500
14501 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14502
14503         * attribute.cs : Fix incorrect code which relied on catching
14504         a NullReferenceException to detect a null being passed in
14505         where an object was expected.
14506
14507 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * statement.cs (Try): flag the catch variable as assigned
14510
14511         * expression.cs (Cast): Simplified by using ResolveType instead of
14512         manually resolving.
14513
14514         * statement.cs (Catch): Fix bug by using ResolveType.
14515
14516 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14517
14518         * expression.cs (BetterConversion): Special case for when we have
14519         a NullLiteral as the argument and we have to choose between string
14520         and object types - we choose string the way csc does.
14521
14522         * attribute.cs (Attribute.Resolve): Catch the
14523         NullReferenceException and report error #182 since the Mono
14524         runtime no more has the bug and having this exception raised means
14525         we tried to select a constructor which takes an object and is
14526         passed a null.
14527
14528 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14529
14530         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14531         message (1502, 1503) when we can't locate a method after overload
14532         resolution. This is much more informative and closes the bug
14533         Miguel reported.
14534
14535         * interface.cs (PopulateMethod): Return if there are no argument
14536         types. Fixes a NullReferenceException bug.
14537
14538         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14539         expressions too. Previously we were checking only in one place for
14540         positional arguments leaving out named arguments.
14541
14542         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14543         type to the enum type is not allowed. Remove code corresponding to
14544         that.
14545
14546         (ConvertNumericExplicit): Allow explicit conversions from
14547         the underlying type to enum type. This precisely follows the spec
14548         and closes a bug filed by Gonzalo.
14549
14550 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14551
14552         * compiler.csproj:
14553         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14554
14555 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14558         it was important that we stored the right value after the
14559         reduction in `converted'.
14560
14561 2002-09-04  Martin Baulig  <martin@gnome.org>
14562
14563         * location.cs (Location.SymbolDocument): Use full pathnames for the
14564         source files.
14565
14566 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14567
14568         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14569         of the expression resolve mechanism, because that will catch the
14570         SimpleName error failures.
14571
14572         (Conditional): If we can not resolve the
14573         expression, return, do not crash.
14574
14575 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14576
14577         * cs-tokenizer.cs:
14578         (location): display token name instead of its number.
14579
14580 2002-08-28  Martin Baulig  <martin@gnome.org>
14581
14582         * expression.cs (Binary.ResolveOperator): Don't silently return
14583         but return an error if an operator cannot be applied between two
14584         enum types.
14585
14586 2002-08-28  Martin Baulig  <martin@gnome.org>
14587
14588         * class.cs (Constructor.Define): Set the permission attributes
14589         correctly instead of making all constructors public.
14590
14591 2002-08-28  Martin Baulig  <martin@gnome.org>
14592
14593         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14594         for private members before reporting a CS0103; if we find anything,
14595         it's a CS0122.
14596
14597 2002-08-28  Martin Baulig  <martin@gnome.org>
14598
14599         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14600         to check whether `closure_start_type == closure_invocation_type',
14601         we also need to check whether `m.DeclaringType == closure_invocation_type'
14602         before bypassing the permission checks.  We might be accessing
14603         protected/private members from the base class.
14604         (TypeManager.RealMemberLookup): Only set private_ok if private
14605         members were requested via BindingFlags.NonPublic.
14606
14607         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14608
14609         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14610         MethodGroupExpr.IsExplicitImpl if appropriate.
14611         (Invocation.DoResolve): Don't report the CS0120 for explicit
14612         interface implementations.
14613
14614 2002-08-27  Martin Baulig  <martin@gnome.org>
14615
14616         * expression.cs (Invocation.DoResolve): If this is a static
14617         method and we don't have an InstanceExpression, we must report
14618         a CS0120.
14619
14620 2002-08-25  Martin Baulig  <martin@gnome.org>
14621
14622         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14623         `==' between a valuetype and an object.
14624
14625 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * ecore.cs (TypeExpr): Provide a ToString method.
14628
14629 2002-08-24  Martin Baulig  <martin@gnome.org>
14630
14631         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14632         now called proggie.dbg and it's a binary file.
14633
14634 2002-08-23  Martin Baulig  <martin@gnome.org>
14635
14636         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14637
14638 2002-08-23  Martin Baulig  <martin@gnome.org>
14639
14640         * struct.cs (MyStructInfo.ctor): Make this work with empty
14641         structs; it's not allowed to use foreach() on null.
14642
14643 2002-08-23  Martin Baulig  <martin@gnome.org>
14644
14645         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14646         writer the full pathname of the generated assembly.
14647
14648 2002-08-23  Martin Baulig  <martin@gnome.org>
14649
14650         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14651         A `finally' block never returns or breaks; improved handling of
14652         unreachable code.
14653
14654 2002-08-23  Martin Baulig  <martin@gnome.org>
14655
14656         * statement.cs (Throw.Resolve): Allow `throw null'.
14657
14658 2002-08-23  Martin Baulig  <martin@gnome.org>
14659
14660         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14661         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14662         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14663         MemberLookup would return a wrong event if this is an explicit
14664         interface implementation and the class has an event with the same
14665         name.
14666
14667 2002-08-23  Martin Baulig  <martin@gnome.org>
14668
14669         * statement.cs (Block.AddChildVariableNames): New public method.
14670         (Block.AddChildVariableName): Likewise.
14671         (Block.IsVariableNameUsedInChildBlock): Likewise.
14672         (Block.AddVariable): Check whether a variable name has already
14673         been used in a child block.
14674
14675         * cs-parser.jay (declare_local_variables): Mark all variable names
14676         from the current block as being used in a child block in the
14677         implicit block.
14678
14679 2002-08-23  Martin Baulig  <martin@gnome.org>
14680
14681         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14682         find the symbol writer.
14683
14684         * driver.cs: csc also allows the arguments to /define being
14685         separated by commas, not only by semicolons.
14686
14687 2002-08-23  Martin Baulig  <martin@gnome.org>
14688
14689         * interface.cs (Interface.GetMembers): Added static check for events.
14690
14691 2002-08-15  Martin Baulig  <martin@gnome.org>
14692
14693         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14694         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14695
14696         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14697         why the MethodData.EmitDestructor() change was necessary.
14698
14699 2002-08-20  Martin Baulig  <martin@gnome.org>
14700
14701         * class.cs (TypeContainer.FindMembers): Added static check for events.
14702
14703         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14704
14705         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14706         use Type.GetEvents(), not Type.FindMembers().
14707
14708 2002-08-20  Martin Baulig  <martin@gnome.org>
14709
14710         * decl.cs (MemberCache): Added a special method cache which will
14711         be used for method-only searched.  This ensures that a method
14712         search will return a MethodInfo with the correct ReflectedType for
14713         inherited methods.      
14714
14715 2002-08-20  Martin Baulig  <martin@gnome.org>
14716
14717         * decl.cs (DeclSpace.FindMembers): Made this public.
14718
14719 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14720
14721         * delegate.cs: fixed build on windows.
14722         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14723
14724 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14725
14726         * ecore.cs (StandardConversionExists): Return a false
14727         if we are trying to convert the void type to anything else
14728         since that is not allowed.
14729
14730         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14731         we flag error 70 in the event an event is trying to be accessed
14732         directly from outside the declaring type.
14733
14734 2002-08-20  Martin Baulig  <martin@gnome.org>
14735
14736         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14737         MemberCache from typemanager.cs to decl.cs.
14738
14739 2002-08-19  Martin Baulig  <martin@gnome.org>
14740
14741         * class.cs (TypeContainer): Implement IMemberContainer.
14742         (TypeContainer.DefineMembers): Create the MemberCache.
14743         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14744         return public members if BindingFlags.Public was given, check
14745         whether members are static.
14746
14747 2002-08-16  Martin Baulig  <martin@gnome.org>
14748
14749         * decl.cs (DeclSpace.Define): Splitted this in Define and
14750         DefineMembers.  DefineMembers is called first and initializes the
14751         MemberCache.
14752
14753         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14754         DefineMembers() on all our DeclSpaces.
14755
14756         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14757         but call DefineMembers() on all nested interfaces.  We call their
14758         Define() in our new Define() function.
14759
14760         * interface.cs (Interface): Implement IMemberContainer.
14761         (Interface.Define): Moved all code except the attribute stuf to
14762         DefineMembers().
14763         (Interface.DefineMembers): Initialize the member cache.
14764
14765         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14766         need this anymore since we can use MemberCache.FindMembers directly.
14767
14768 2002-08-19  Martin Baulig  <martin@gnome.org>
14769
14770         * typemanager.cs (MemberCache): When creating the cache for an
14771         interface type, add all inherited members.
14772         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14773         to `out bool used_cache' and documented it.
14774         (TypeManager.MemberLookup): If we already used the cache in the first
14775         iteration, we don't need to do the interfaces check.
14776
14777 2002-08-19  Martin Baulig  <martin@gnome.org>
14778
14779         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14780         here from IMemberFinder and don't implement this interface anymore.
14781         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14782
14783         * typemanager.cs (IMemberFinder): This interface is now only used by
14784         classes which actually support the member cache.
14785         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14786         since we only put DeclSpaces into this Hashtable.
14787         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14788         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14789
14790 2002-08-16  Martin Baulig  <martin@gnome.org>
14791
14792         * typemanager.cs (ICachingMemberFinder): Removed.
14793         (IMemberFinder.MemberCache): New property.
14794         (TypeManager.FindMembers): Merged this with RealFindMembers().
14795         This function will never be called from TypeManager.MemberLookup()
14796         so we can't use the cache here, just the IMemberFinder.
14797         (TypeManager.MemberLookup_FindMembers): Check whether the
14798         IMemberFinder has a MemberCache and call the cache's FindMembers
14799         function.
14800         (MemberCache): Rewrote larger parts of this yet another time and
14801         cleaned it up a bit.
14802
14803 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14804
14805         * driver.cs (LoadArgs): Support quoting.
14806
14807         (Usage): Show the CSC-like command line arguments.
14808
14809         Improved a few error messages.
14810
14811 2002-08-15  Martin Baulig  <martin@gnome.org>
14812
14813         * typemanager.cs (IMemberContainer.Type): New property.
14814         (IMemberContainer.IsInterface): New property.
14815
14816         The following changes are conditional to BROKEN_RUNTIME, which is
14817         defined at the top of the file.
14818
14819         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14820         class'es members, but add all members from TypeHandle.ObjectType
14821         if we're an interface.
14822         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14823         is the current type.
14824         (MemberCache.CacheEntry.Container): Removed this field.
14825         (TypeHandle.GetMembers): Include inherited members.
14826
14827 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14828
14829         * typemanager.cs: fixed compilation and added a comment on a field that
14830         is never used.
14831
14832 2002-08-15  Martin Baulig  <martin@gnome.org>
14833
14834         * class.cs (ConstructorInitializer.Resolve): In the
14835         Expression.MemberLookup call, use the queried_type as
14836         invocation_type.
14837
14838         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14839         declared' attribute, it's always true.
14840         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14841         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14842         temporary wrapper for FindMembers which tells MemberLookup whether
14843         members from the base classes are included in the return value.
14844         This will go away soon.
14845         (TypeManager.MemberLookup): Use this temporary hack here; once the
14846         new MemberCache is completed, we don't need to do the DeclaredOnly
14847         looping here anymore since the MemberCache will take care of this.
14848         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14849         (MemberCache): When creating the MemberCache for a class, get
14850         members from the current class and all its base classes.
14851         (MemberCache.CacheEntry.Container): New field.  This is a
14852         temporary hack until the Mono runtime is fixed to distinguish
14853         between ReflectedType and DeclaringType.  It allows us to use MCS
14854         with both the MS runtime and the unfixed Mono runtime without
14855         problems and without accecting performance.
14856         (MemberCache.SearchMembers): The DeclaredOnly looping from
14857         TypeManager.MemberLookup is now done here.      
14858
14859 2002-08-14  Martin Baulig  <martin@gnome.org>
14860
14861         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14862         Type.GetFields on dynamic types but get the fields from the
14863         corresponding TypeContainer.
14864         (MyStructInfo.GetStructInfo): Added check for enum types.
14865
14866         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14867         (MemberList.SyncRoot): Implemented.
14868         (TypeManager.FilterWithClosure): No need to check permissions if
14869         closure_start_type == closure_invocation_type, don't crash if
14870         closure_invocation_type is null.
14871
14872 2002-08-13  Martin Baulig  <martin@gnome.org>
14873
14874         Rewrote TypeContainer.FindMembers to use a member cache.  This
14875         gives us a speed increase of about 35% for the self-hosting MCS
14876         build and of about 15-20% for the class libs (both on GNU/Linux).
14877
14878         * report.cs (Timer): New class to get enhanced profiling.  This
14879         whole class is "TIMER" conditional since it remarkably slows down
14880         compilation speed.
14881
14882         * class.cs (MemberList): New class.  This is an IList wrapper
14883         which we're now using instead of passing MemberInfo[]'s around to
14884         avoid copying this array unnecessarily.
14885         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14886         (ICachingMemberFinder, IMemberContainer): New interface.
14887         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14888         has already been checked, otherwise use it for the name comparision.
14889         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14890         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14891         if possible.  Returns a MemberList, not a MemberInfo [].
14892         (TypeHandle): New class, implements IMemberContainer.  We create
14893         one instance of this class per type, it contains a MemberCache
14894         which is used to do the member lookups.
14895         (MemberCache): New class.  Each instance of this class contains
14896         all members of a type and a name-based hash table.
14897         (MemberCache.FindMembers): This is our new member lookup
14898         function.  First, it looks up all members of the requested name in
14899         the hash table.  Then, it walks this list and sorts out all
14900         applicable members and returns them.
14901
14902 2002-08-13  Martin Baulig  <martin@gnome.org>
14903
14904         In addition to a nice code cleanup, this gives us a performance
14905         increase of about 1.4% on GNU/Linux - not much, but it's already
14906         half a second for the self-hosting MCS compilation.
14907
14908         * typemanager.cs (IMemberFinder): New interface.  It is used by
14909         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14910         Enum, Delegate or Interface.
14911         (TypeManager.finder_to_member_finder): New PtrHashtable.
14912         (TypeManager.finder_to_container): Removed.
14913         (TypeManager.finder_to_delegate): Removed.
14914         (TypeManager.finder_to_interface): Removed.
14915         (TypeManager.finder_to_enum): Removed.
14916
14917         * interface.cs (Interface): Implement IMemberFinder.
14918
14919         * delegate.cs (Delegate): Implement IMemberFinder.
14920
14921         * enum.cs (Enum): Implement IMemberFinder.
14922
14923         * class.cs (TypeContainer): Implement IMemberFinder.
14924
14925 2002-08-12  Martin Baulig  <martin@gnome.org>
14926
14927         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14928
14929 2002-08-12  Martin Baulig  <martin@gnome.org>
14930
14931         * ecore.cs (ITypeExpression): New interface for expressions which
14932         resolve to a type.
14933         (TypeExpression): Renamed to TypeLookupExpression.
14934         (Expression.DoResolve): If we're doing a types-only lookup, the
14935         expression must implement the ITypeExpression interface and we
14936         call DoResolveType() on it.
14937         (SimpleName): Implement the new ITypeExpression interface.
14938         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14939         hack, the situation that we're only looking up types can't happen
14940         anymore when this method is called.  Moved the type lookup code to
14941         DoResolveType() and call it.
14942         (SimpleName.DoResolveType): This ITypeExpression interface method
14943         is now doing the types-only lookup.
14944         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14945         (ResolveFlags): Added MaskExprClass.
14946
14947         * expression.cs (MemberAccess): Implement the ITypeExpression
14948         interface.
14949         (MemberAccess.DoResolve): Added support for a types-only lookup
14950         when we're called via ITypeExpression.DoResolveType().
14951         (ComposedCast): Implement the ITypeExpression interface.
14952
14953         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14954         Expression.Resolve() with ResolveFlags.Type instead.
14955
14956 2002-08-12  Martin Baulig  <martin@gnome.org>
14957
14958         * interface.cs (Interface.Define): Apply attributes.
14959
14960         * attribute.cs (Attribute.ApplyAttributes): Added support for
14961         interface attributes.
14962
14963 2002-08-11  Martin Baulig  <martin@gnome.org>
14964
14965         * statement.cs (Block.Emit): Only check the "this" variable if we
14966         do not always throw an exception.
14967
14968         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14969         whether the property has a set accessor.
14970
14971 2002-08-11  Martin Baulig  <martin@gnome.org>
14972
14973         Added control flow analysis support for structs.
14974
14975         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14976         with control flow analysis turned off.
14977         (IVariable): New interface.
14978         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14979         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14980         (FieldExpr.DoResolve): Resolve the instance expression with flow
14981         analysis turned off and do the definite assignment check after the
14982         resolving when we know what the expression will resolve to.
14983
14984         * expression.cs (LocalVariableReference, ParameterReference):
14985         Implement the new IVariable interface, only call the flow analysis
14986         code if ec.DoFlowAnalysis is true.
14987         (This): Added constructor which takes a Block argument.  Implement
14988         the new IVariable interface.
14989         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14990         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14991         This does the definite assignment checks for struct members.
14992
14993         * class.cs (Constructor.Emit): If this is a non-static `struct'
14994         constructor which doesn't have any initializer, call
14995         Block.AddThisVariable() to tell the flow analysis code that all
14996         struct elements must be initialized before control returns from
14997         the constructor.
14998
14999         * statement.cs (MyStructInfo): New public class.
15000         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15001         argument to this indexer.  If non-zero, check an individual struct
15002         member, not the whole struct.
15003         (FlowBranching.CheckOutParameters): Check struct members.
15004         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15005         overloaded versions of these methods which take an additional
15006         `int field_idx' argument to check struct members.
15007         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15008         overloaded versions of these methods which take an additional
15009         `string field_name' argument to check struct member.s
15010         (VariableInfo): Implement the IVariable interface.
15011         (VariableInfo.StructInfo): New public property.  Returns the
15012         MyStructInfo instance of the variable if it's a struct or null.
15013         (Block.AddThisVariable): New public method.  This is called from
15014         Constructor.Emit() for non-static `struct' constructor which do
15015         not have any initializer.  It creates a special variable for the
15016         "this" instance variable which will be checked by the flow
15017         analysis code to ensure that all of the struct's fields are
15018         initialized before control returns from the constructor.
15019         (UsageVector): Added support for struct members.  If a
15020         variable/parameter is a struct with N members, we reserve a slot
15021         in the usage vector for each member.  A struct is considered fully
15022         initialized if either the struct itself (slot 0) or all its
15023         members are initialized.
15024
15025 2002-08-08  Martin Baulig  <martin@gnome.org>
15026
15027         * driver.cs (Driver.MainDriver): Only report an error CS5001
15028         if there were no compilation errors.
15029
15030         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15031         `UnsafeContext' property to determine whether the parent is in
15032         unsafe context rather than checking the parent's ModFlags:
15033         classes nested in an unsafe class are unsafe as well.
15034
15035 2002-08-08  Martin Baulig  <martin@gnome.org>
15036
15037         * statement.cs (UsageVector.MergeChildren): Distinguish between
15038         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15039         we return.  Added test17() and test18() to test-154.cs.
15040
15041 2002-08-08  Martin Baulig  <martin@gnome.org>
15042
15043         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15044         Family access, make sure the invoking type isn't a subclass of the
15045         queried type (that'd be a CS1540).
15046
15047         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15048         this method which takes an additional `Type invocation_type'.
15049
15050         * expression.cs (BaseAccess.DoResolve): Use the base type as
15051         invocation and query type.
15052         (MemberAccess.DoResolve): If the lookup failed and we're about to
15053         report a CS0122, try a lookup with the ec.ContainerType - if this
15054         succeeds, we must report a CS1540.
15055
15056 2002-08-08  Martin Baulig  <martin@gnome.org>
15057
15058         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15059         (MethodGroupExpr): Implement the IMemberExpr interface.
15060
15061         * expression (MemberAccess.ResolveMemberAccess): No need to have
15062         any special code for MethodGroupExprs anymore, they're now
15063         IMemberExprs.   
15064
15065 2002-08-08  Martin Baulig  <martin@gnome.org>
15066
15067         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15068         Family, FamANDAssem and FamORAssem permissions.
15069         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15070
15071 2002-08-08  Martin Baulig  <martin@gnome.org>
15072
15073         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15074         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15075         or loop block.
15076
15077 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15078
15079         * driver.cs: implemented /resource option to embed managed resources.
15080
15081 2002-08-07  Martin Baulig  <martin@gnome.org>
15082
15083         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15084         (FieldBase.HasFieldInitializer): New public property.
15085         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15086         returns the field initializer and makes sure it is only resolved once.
15087         (TypeContainer.EmitFieldInitializers): Call
15088         FieldBase.GetInitializerExpression to get the initializer, this ensures
15089         that it isn't resolved multiple times.
15090
15091         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15092         the resolving process (SimpleName/MemberLookup) that we're currently
15093         emitting a field initializer (which must not access any instance members,
15094         this is an error CS0236).
15095
15096         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15097         argument, if the `IsFieldInitializer' flag is set, we must report and
15098         error CS0236 and not an error CS0120.   
15099
15100 2002-08-07  Martin Baulig  <martin@gnome.org>
15101
15102         * ecore.cs (IMemberExpr): New public interface.
15103         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15104         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15105         if the expression is an IMemberExpr.
15106
15107         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15108         to be null, implicitly default to `this' if we're non-static in
15109         this case.  Simplified the code a lot by using the new IMemberExpr
15110         interface.  Also fixed bug #28176 here.
15111
15112 2002-08-06  Martin Baulig  <martin@gnome.org>
15113
15114         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15115         ParameterReferences during semantic analysis so that we can do a
15116         type-only search when resolving Cast, TypeOf and SizeOf.
15117         (block): Pass the `current_local_parameters' to the Block's
15118         constructor.
15119
15120         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15121         argument to the constructor.
15122         (ConstructorInitializer.Resolve): Create a temporary implicit
15123         block with the parameters.
15124
15125         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15126         references here if we aren't doing a type-only search.
15127
15128         * statement.cs (Block): Added constructor which takes a
15129         `Parameters parameters' argument.
15130         (Block.Parameters): New public property.
15131
15132         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15133         to `Parameters' and made it public readonly.
15134
15135 2002-08-06  Martin Baulig  <martin@gnome.org>
15136
15137         * ecore.cs (Expression.Warning): Made this public as well.
15138
15139         * report.cs (Report.Debug): Print the contents of collections.
15140
15141 2002-08-06  Martin Baulig  <martin@gnome.org>
15142
15143         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15144         used to tell Resolve() which kinds of expressions it may return.
15145         (Expression.Resolve): Added overloaded version of this method which
15146         takes a `ResolveFlags flags' argument.  This can be used to tell
15147         Resolve() which kinds of expressions it may return.  Reports a
15148         CS0118 on error.
15149         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15150         ResolveFlags.SimpleName.
15151         (Expression.Error118): Added overloaded version of this method which
15152         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15153         which kinds of expressions are allowed.
15154
15155         * expression.cs (Argument.ResolveMethodGroup): New public method.
15156         Resolves an argument, but allows a MethodGroup to be returned.
15157         This is used when invoking a delegate.
15158
15159         * TODO: Updated a bit.
15160
15161 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15162
15163         Fixed compilation with csc.
15164
15165         * ecore.cs: Expression.Error made public. Is this correct? Should
15166         Warning be made public too?
15167
15168         * expression.cs: use ea.Location instead of ea.loc.
15169         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15170
15171 2002-08-06  Martin Baulig  <martin@gnome.org>
15172
15173         * ecore.cs (Expression.loc): Moved the location here instead of
15174         duplicating it in all derived classes.
15175         (Expression.Location): New public property.
15176         (Expression.Error, Expression.Warning): Made them non-static and
15177         removed the location argument.
15178         (Expression.Warning): Added overloaded version which takes an
15179         `int level' argument.
15180         (Expression.Error118): Make this non-static and removed the
15181         expression and location arguments.
15182         (TypeExpr): Added location argument to the constructor.
15183
15184         * expression.cs (StaticCallExpr): Added location argument to
15185         the constructor.
15186         (Indirection, PointerArithmetic): Likewise.
15187         (CheckedExpr, UnCheckedExpr): Likewise.
15188         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15189         (StringPtr): Likewise.
15190
15191
15192 2002-08-05  Martin Baulig  <martin@gnome.org>
15193
15194         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15195
15196         * assign.cs (Assign.DoResolve): Check whether the source
15197         expression is a value or variable.
15198
15199         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15200         while resolving the corresponding blocks.
15201
15202         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15203         an error, don't silently return null.
15204
15205         * statement.cs (Block.AddVariable): Do the error reporting here
15206         and distinguish between CS0128 and CS0136.
15207         (Block.DoResolve): Report all unused labels (warning CS0164).
15208         (LabeledStatement): Pass the location to the constructor.
15209         (LabeledStatement.HasBeenReferenced): New property.
15210         (LabeledStatement.Resolve): Set it to true here.
15211
15212         * statement.cs (Return.Emit): Return success even after reporting
15213         a type mismatch error (CS0126 or CS0127), this is what csc does and
15214         it avoids confusing the users with any consecutive errors.
15215
15216 2002-08-05  Martin Baulig  <martin@gnome.org>
15217
15218         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15219
15220         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15221
15222         * expression.cs (MemberAccess.DoResolve): Silently return if an
15223         error has already been reported.
15224
15225         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15226         error has already been reported.
15227
15228 2002-08-05  Martin Baulig  <martin@gnome.org>
15229
15230         * statement.cs (UsageVector): Only initialize the `parameters'
15231         vector if we actually have any "out" parameters.
15232
15233 2002-08-05  Martin Baulig  <martin@gnome.org>
15234
15235         * expression.cs (Binary.ResolveOperator): When combining delegates,
15236         they must have the same type.
15237
15238 2002-08-05  Martin Baulig  <martin@gnome.org>
15239
15240         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15241         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15242         work with the ms runtime and we also don't need it: if we're a
15243         PropertyBuilder and not in the `indexer_arguments' hash, then we
15244         are a property and not an indexer.
15245
15246         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15247         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15248         since the latter one doesn't work with the ms runtime.
15249
15250 2002-08-03  Martin Baulig  <martin@gnome.org>
15251
15252         Fixed bugs #27998 and #22735.
15253
15254         * class.cs (Method.IsOperator): New public field.
15255         (Method.CheckBase): Report CS0111 if there's already a method
15256         with the same parameters in the current class.  Report CS0508 when
15257         attempting to change the return type of an inherited method.
15258         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15259         and it's not marked abstract or extern.
15260         (PropertyBase): New abstract base class for Property and Indexer.
15261         (PropertyBase.CheckBase): Moved here from Property and made it work
15262         for indexers.
15263         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15264         the same so we can reuse it there.
15265         (Property, Indexer): Derive from PropertyBase.
15266         (MethodSignature.inheritable_property_signature_filter): New delegate
15267         to find properties and indexers.
15268
15269         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15270         argument and improved error reporting.
15271
15272         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15273         EmptyReadOnlyParameters and made it a property.
15274
15275         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15276         version of this method which takes a `PropertyInfo indexer'.
15277         (TypeManager.RegisterIndexer): New method.
15278
15279         * class.cs: Added myself as author of this file :-)
15280
15281 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15282
15283         * class.cs: fixed compilation on windoze.
15284
15285 2002-08-03  Martin Baulig  <martin@gnome.org>
15286
15287         * interface.cs (Interface.GetInterfaceBases): Check whether all
15288         base interfaces are at least as accessible than the current one.
15289
15290         * class.cs (TypeContainer.GetClassBases): Check whether base types
15291         are at least as accessible than the current type.
15292         (TypeContainer.AsAccessible): Implemented and made non-static.
15293         (MemberBase.CheckParameters): Report errors if the accessibility
15294         checks fail.
15295
15296         * delegate.cs (Delegate.Delegate): The default visibility is
15297         internal for top-level types and private for nested types.
15298         (Delegate.Define): Report errors if the accessibility checks fail.
15299
15300         * enum.cs (Enum.Enum): The default visibility is internal for
15301         top-level types and private for nested types.
15302         (Enum.DefineType): Compute the correct visibility.
15303
15304         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15305         function which takes a `bool is_toplevel' instead of a TypeContainer.
15306
15307         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15308         builtin type.
15309
15310 2002-08-02  Martin Baulig  <martin@gnome.org>
15311
15312         * expression.cs (LocalVariableReferenc): Added constructor which
15313         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15314         (LocalVariableReference.IsReadOnly): New property.
15315         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15316         variable is readonly, use our own readonly flag to do this; you can
15317         use the new constructor to get a writable reference to a read-only
15318         variable.
15319
15320         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15321         reference to the local variable.
15322
15323 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15324
15325         * rootcontext.cs (ResolveCore): Also include System.Exception
15326
15327         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15328         we reach an EmptyStatement.
15329
15330         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15331         is also fine.
15332
15333         * expression.cs (Binary.ResolveOperator): Check error result in
15334         two places.
15335
15336         use brtrue/brfalse directly and avoid compares to null.
15337
15338 2002-08-02  Martin Baulig  <martin@gnome.org>
15339
15340         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15341         Fixes bug #28407, added test-155.cs.
15342
15343 2002-08-01  Martin Baulig  <martin@gnome.org>
15344
15345         * class.cs (Event.EmitDefaultMethod): Make this work with static
15346         events.  Fixes #28311, added verify-3.cs.
15347
15348 2002-08-01  Martin Baulig  <martin@gnome.org>
15349
15350         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15351         `is_disposable' fields.
15352         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15353         `hm.is_disposable' if we're using the collection pattern.
15354         (Foreach.EmitCollectionForeach): Use the correct type for the
15355         enumerator's local variable, only emit the try/finally block if
15356         necessary (fixes #27713).
15357
15358 2002-08-01  Martin Baulig  <martin@gnome.org>
15359
15360         * ecore.cs (Expression.report118): Renamed to Error118 and made
15361         it public static.
15362
15363         * statement.cs (Throw.Resolve): Check whether the expression is of
15364         the correct type (CS0118) and whether the type derives from
15365         System.Exception (CS0155).
15366         (Catch.Resolve): New method.  Do the type lookup here and check
15367         whether it derives from System.Exception (CS0155).
15368         (Catch.CatchType, Catch.IsGeneral): New public properties.
15369
15370         * typemanager.cs (TypeManager.exception_type): Added.
15371
15372 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * driver.cs: Updated About function.
15375
15376 2002-07-31  Martin Baulig  <martin@gnome.org>
15377
15378         Implemented Control Flow Analysis.
15379
15380         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15381         (EmitContext.CurrentBranching): Added.
15382         (EmitContext.StartFlowBranching): Added.
15383         (EmitContext.EndFlowBranching): Added.
15384         (EmitContext.KillFlowBranching): Added.
15385         (EmitContext.IsVariableAssigned): Added.
15386         (EmitContext.SetVariableAssigned): Added.
15387         (EmitContext.IsParameterAssigned): Added.
15388         (EmitContext.SetParameterAssigned): Added.
15389         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15390         Added control flow analysis stuff here.
15391
15392         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15393         resolve the expression as lvalue.
15394         (LocalVariableReference.DoResolve): Check whether the variable has
15395         already been assigned.
15396         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15397         the parameter as assigned here.
15398         (ParameterReference.DoResolve): Check whether the parameter has already
15399         been assigned.
15400         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15401         expression as lvalue.
15402
15403         * statement.cs (FlowBranching): New class for the flow analysis code.
15404         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15405         (LabeledStatement.IsDefined): New public property.
15406         (LabeledStatement.AddUsageVector): New public method to tell flow
15407         analyis that the label may be reached via a forward jump.
15408         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15409         flow analysis.
15410         (VariableInfo.Number): New public field.  This is used by flow analysis
15411         to number all locals of a block.
15412         (Block.CountVariables): New public property.  This is the number of
15413         local variables in this block (including the locals from all parent
15414         blocks).
15415         (Block.EmitMeta): Number all the variables.
15416
15417         * statement.cs: Added flow analysis support to all classes.
15418
15419 2002-07-31  Martin Baulig  <martin@gnome.org>
15420
15421         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15422         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15423         then use this argument.
15424
15425         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15426
15427         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15428         use this to specify /define options.
15429
15430 2002-07-29  Martin Baulig  <martin@gnome.org>
15431
15432         * statement.cs (Fixed): Moved all code that does variable lookups
15433         and resolvings from Emit to Resolve.
15434
15435         * statement.cs (For): Moved all code that does variable lookups
15436         and resolvings from Emit to Resolve.
15437
15438         * statement.cs (Using): Moved all code that does variable lookups
15439         and resolvings from Emit to Resolve.
15440
15441 2002-07-29  Martin Baulig  <martin@gnome.org>
15442
15443         * attribute.cs (Attribute.Resolve): Explicitly catch a
15444         System.NullReferenceException when creating the
15445         CustromAttributeBuilder and report a different warning message.
15446
15447 2002-07-29  Martin Baulig  <martin@gnome.org>
15448
15449         * support.cs (ParameterData.ParameterName): Added method to
15450         get the name of a parameter.
15451
15452         * typemanager.cs (TypeManager.IsValueType): New public method.
15453
15454 2002-07-29  Martin Baulig  <martin@gnome.org>
15455
15456         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15457         is a flag which specifies that it's either ref or out.
15458         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15459         the out parameter to `out Parameter.Modifier mod', also set the
15460         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15461
15462         * support.cs (InternalParameters.ParameterModifier): Distinguish
15463         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15464         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15465
15466         * expression.cs (Argument.GetParameterModifier): Distinguish
15467         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15468         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15469
15470 2002-07-29  Martin Baulig  <martin@gnome.org>
15471
15472         * expression.cs (ParameterReference.ParameterReference): Added
15473         `Location loc' argument to the constructor.
15474
15475         * cs-parser.jay: Pass location to ParameterReference.
15476
15477 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15478
15479         * statement.cs (Try): Initialize the location.
15480
15481         * cs-parser.jay: pass location to Try.
15482
15483         * expression.cs (Unary.Reduce): Change the prototype to return
15484         whether a constant fold could be performed or not.  The result is
15485         returned in an out parameters.  In the case of Indirection and
15486         AddressOf, we want to perform the full tests.
15487
15488 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15489
15490         * statement.cs (Statement.Emit): Flag dead code.
15491
15492 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15493
15494         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15495
15496 2002-07-27  Martin Baulig  <martin@gnome.org>
15497
15498         * class.cs (MethodData.Define): Put back call to
15499         TypeManager.AddMethod(), accidentally commented this out.
15500
15501         * report.cs (Debug): New public method to print debugging information,
15502         this is `[Conditional ("DEBUG")]'.
15503
15504 2002-07-26  Martin Baulig  <martin@gnome.org>
15505
15506         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15507         (switch_statement): Push the current_block to the switch_stack and
15508         pop it again when we're done with the switch.
15509         (switch_section): The new block is a child of the current_block.
15510         Fixes bug #24007, added test-152.cs.
15511
15512 2002-07-27  Martin Baulig  <martin@gnome.org>
15513
15514         * expression.cs (Invocation.EmitArguments): When calling a varargs
15515         function with only its fixed arguments, we need to pass an empty
15516         array.
15517
15518 2002-07-27  Martin Baulig  <martin@gnome.org>
15519
15520         Mono 0.13 has been released.
15521
15522 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15523
15524         * driver.cs: Rename --resource to --linkres, because that is what
15525         we do currently, we dont support --resource yet.
15526
15527         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15528
15529 2002-07-25  Martin Baulig  <martin@gnome.org>
15530
15531         * class.cs (MethodData): New public class.  This is a `method builder'
15532         class for a method or one accessor of a Property/Indexer/Event.
15533         (MethodData.GetMethodFlags): Moved here from MemberBase.
15534         (MethodData.ApplyAttributes): Likewise.
15535         (MethodData.ApplyObsoleteAttribute): Likewise.
15536         (MethodData.ApplyConditionalAttribute): Likewise.
15537         (MethodData.ApplyDllImportAttribute): Likewise.
15538         (MethodData.CheckAbstractAndExternal): Likewise.
15539         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15540         (MethodData.Emit): Formerly known as Method.Emit().
15541         (MemberBase): Moved everything which was specific to a single
15542         accessor/method to MethodData.
15543         (Method): Create a new MethodData and call Define() and Emit() on it.
15544         (Property, Indexer, Event): Create a new MethodData objects for each
15545         accessor and call Define() and Emit() on them.
15546
15547 2002-07-25  Martin Baulig  <martin@gnome.org>
15548
15549         Made MethodCore derive from MemberBase to reuse the code from there.
15550         MemberBase now also checks for attributes.
15551
15552         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15553         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15554         as virtual.
15555         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15556         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15557         (MemberBase.ApplyAttributes): New virtual method; applies the
15558         attributes to a method or accessor.
15559         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15560         (MemberBase.ApplyConditionalAttribute): Likewise.
15561         (MemberBase.ApplyDllImportAttribute): Likewise.
15562         (MemberBase.CheckAbstractAndExternal): Likewise.
15563         (MethodCore.ParameterTypes): This is now a property instead of a
15564         method, it's initialized from DoDefineParameters().
15565         (MethodCore.ParameterInfo): Removed the set accessor.
15566         (MethodCore.DoDefineParameters): New protected virtual method to
15567         initialize ParameterTypes and ParameterInfo.
15568         (Method.GetReturnType): We can now simply return the MemberType.
15569         (Method.GetMethodFlags): Override the MemberBase version and add
15570         the conditional flags.
15571         (Method.CheckBase): Moved some code from Define() here, call
15572         DoDefineParameters() here.
15573         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15574         here to avoid some larger code duplication.
15575         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15576         ensure that abstract and external accessors don't declare a body.
15577
15578         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15579         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15580         lookup in the attribute's parent classes, so we need to abort as soon
15581         as we found the first match.
15582         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15583         the attribute has no arguments.
15584
15585         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15586         of a Method.
15587
15588 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15589
15590         * cs-parser.jay: reverted previous patch.
15591
15592 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15593
15594         * cs-parser.jay: fixed bug #22119.
15595
15596 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15597
15598         * attribute.cs: fixed compilation. The error was:
15599         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15600         be assigned to before control leaves the current method."
15601         [FIXME:  Filed as bug #28186: MCS must report this error.]
15602
15603 2002-07-25  Martin Baulig  <martin@gnome.org>
15604
15605         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15606         method to pull the condition name ouf of a Conditional attribute.
15607         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15608         the obsolete message and error flag out of an Obsolete attribute.
15609
15610         * class.cs (Method.GetMethodFlags): New public method to get the
15611         TypeManager.MethodFlags for this method.
15612         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15613         private methods.
15614         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15615         if we're overriding a virtual function, set the new private variable
15616         `parent_method'; call the new TypeManager.AddMethod().
15617
15618         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15619         the MethodBuilder and the Method in a PtrHashtable.
15620         (TypeManager.builder_to_method): Added for this purpose.
15621         (TypeManager.MethodFlags): Added IsObsoleteError.
15622         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15623         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15624         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15625         the message from the attribute.
15626
15627 2002-07-24  Martin Baulig  <martin@gnome.org>
15628
15629         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15630         preprocessor directives, ensure that the argument to #define/#undef is
15631         exactly one identifier and that it's actually an identifier.
15632
15633         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15634         did not work ....
15635
15636 2002-07-24  Martin Baulig  <martin@gnome.org>
15637
15638         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15639         initialize it to TypeManager.object_type in the constructor.
15640         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15641         of the `hm.get_current' method if we're using the collection pattern.
15642         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15643         for the explicit conversion to make it work when we're using the collection
15644         pattern and the `Current' property has a different return type than `object'.
15645         Fixes #27713.
15646
15647 2002-07-24  Martin Baulig  <martin@gnome.org>
15648
15649         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15650         does not match, but don't report any errors.  This method is called in
15651         order for all methods in a MethodGroupExpr until a matching method is
15652         found, so we don't want to bail out if the first method doesn't match.
15653         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15654         matches, report the 123.  Fixes #28070.
15655
15656 2002-07-24  Martin Baulig  <martin@gnome.org>
15657
15658         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15659         TypeManager.TypeToCoreType() to the top of the method so the
15660         following equality checks will work.  Fixes #28107.
15661
15662 2002-07-24  Martin Baulig  <martin@gnome.org>
15663
15664         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15665         operand is of type uint, and the other operand is of type sbyte,
15666         short or int, the operands are converted to type long." -
15667         Actually do what this comment already told us.  Fixes bug #28106,
15668         added test-150.cs.
15669
15670 2002-07-24  Martin Baulig  <martin@gnome.org>
15671
15672         * class.cs (MethodBase): New abstract class.  This is now a base
15673         class for Property, Indexer and Event to avoid some code duplication
15674         in their Define() and DefineMethods() methods.
15675         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15676         generic methods for Define() and DefineMethods().
15677         (FieldBase): Derive from MemberBase, not MemberCore.
15678         (Property): Derive from MemberBase, not MemberCore.
15679         (Property.DefineMethod): Moved all the code from this method to the
15680         new MethodBase.DefineAccessor(), just call it with appropriate
15681         argumetnts.
15682         (Property.Define): Call the new Property.DoDefine(), this does some
15683         sanity checks and we don't need to duplicate the code everywhere.
15684         (Event): Derive from MemberBase, not MemberCore.
15685         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15686         accessors, this will also make them work with interface events.
15687         (Indexer): Derive from MemberBase, not MemberCore.
15688         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15689         (Indexer.Define): Use the new MethodBase functions.
15690
15691         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15692         argument to the constructor.
15693         (Interface.FindMembers): Added support for interface events.
15694         (Interface.PopluateEvent): Implemented.
15695
15696         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15697
15698 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15699
15700         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15701         but this is required to check for a method name being the same as
15702         the containing class.  
15703
15704         Handle this now.
15705
15706 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15707
15708         * interface.cs: initialize variable.
15709
15710 2002-07-23  Martin Baulig  <martin@gnome.org>
15711
15712         Implemented the IndexerName attribute in interfaces.
15713
15714         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15715         name if this is an explicit interface implementation.
15716         (Indexer.InterfaceIndexerName): New public variable.  If we're
15717         implementing an interface indexer, this is the IndexerName in that
15718         interface.  Otherwise, it's the IndexerName.
15719         (Indexer.DefineMethod): If we're implementing interface indexer,
15720         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15721         and Pending.ImplementIndexer methods.
15722         (Indexer.Define): Also define the PropertyBuilder if we're
15723         implementing an interface indexer and this is neither an explicit
15724         interface implementation nor do the IndexerName match the one in
15725         the interface.
15726
15727         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15728         If a method is defined here, then we always need to create a proxy
15729         for it.  This is used when implementing interface indexers.
15730         (Pending.IsInterfaceIndexer): New public method.
15731         (Pending.ImplementIndexer): New public method.
15732         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15733         This is used when implementing interface indexers to define a proxy
15734         if necessary.
15735         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15736         define a proxy if necessary.
15737
15738         * interface.cs (Interface.IndexerName): New public variable.
15739         (Interface.PopulateIndexer): Set the IndexerName.
15740         (Interface.DefineIndexers): New private method.  Populate all the
15741         indexers and make sure their IndexerNames match.
15742
15743         * typemanager.cs (IndexerPropertyName): Added support for interface
15744         indexers.
15745
15746 2002-07-22  Martin Baulig  <martin@gnome.org>
15747
15748         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15749         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15750         ret if HasReturnLabel.
15751         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15752         variables.
15753
15754         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15755         and set the ec.LoopBeginTryCatchLevel.
15756         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15757         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15758         the current ec.TryCatchLevel, the branch goes out of an exception
15759         block.  In this case, we need to use Leave and not Br.
15760
15761 2002-07-22  Martin Baulig  <martin@gnome.org>
15762
15763         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15764         block unless the block does not always return or it is contained in
15765         another try { ... } catch { ... } block.  Fixes bug #26506.
15766         Added verify-1.cs to the test suite.
15767
15768 2002-07-22  Martin Baulig  <martin@gnome.org>
15769
15770         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15771         then we do not always return.  Fixes bug #24985.
15772
15773 2002-07-22  Martin Baulig  <martin@gnome.org>
15774
15775         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15776         lookup on a per-class level; ie. walk up the class hierarchy until we
15777         found at least one applicable method, then choose the best among them.
15778         Fixes bug #24463 and test-29.cs.
15779
15780 2002-07-22  Martin Baulig  <martin@gnome.org>
15781
15782         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15783         return types of the methods.  The return type is not part of the
15784         signature and we must not check it to make the `new' modifier work.
15785         Fixes bug #27999, also added test-147.cs.
15786         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15787
15788         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15789         on the method's return type.
15790
15791 2002-07-21  Martin Baulig  <martin@gnome.org>
15792
15793         * assign.cs: Make this work if the rightmost source is a constant and
15794         we need to do an implicit type conversion.  Also adding a few more tests
15795         to test-38.cs which should have caught this.
15796
15797         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15798         target in the makefile for this.  The makefile.gnu is primarily intended
15799         for end-users who don't want to debug the compiler.
15800
15801 2002-07-21  Martin Baulig  <martin@gnome.org>
15802
15803         * assign.cs: Improved the Assign class so it can now handle embedded
15804         assignments (X = Y = Z = something).  As a side-effect this'll now also
15805         consume less local variables.  test-38.cs now passes with MCS, added
15806         a few new test cases to that test.
15807
15808 2002-07-20  Martin Baulig  <martin@gnome.org>
15809
15810         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15811         instructions.  Fixes bug #27977, also added test-146.cs.
15812
15813 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15814
15815         * cs-tokenizer.cs: fixed getHex ().
15816
15817 2002-07-19  Martin Baulig  <martin@gnome.org>
15818
15819         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15820         not Type.GetType() to lookup the array type.  This is needed when
15821         we're constructing an array of a user-defined type.
15822         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15823         single-dimensional arrays, but also for single-dimensial arrays of
15824         type decimal.
15825
15826 2002-07-19  Martin Baulig  <martin@gnome.org>
15827
15828         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15829         this function is called, it's not allowed to share LocalBuilders
15830         among ILGenerators.
15831
15832 2002-07-19  Martin Baulig  <martin@gnome.org>
15833
15834         * expression.cs (Argument.Resolve): Report an error 118 when trying
15835         to pass a type as argument.
15836
15837 2002-07-18  Martin Baulig  <martin@gnome.org>
15838
15839         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15840         Conv_R_Un for the signed `long' type.
15841
15842 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15843
15844         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15845         `expr' for the temporary result, as that will fail if we do
15846         multiple resolves on the same expression.
15847
15848 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15849
15850         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15851         ec.TypeContainer for looking up aliases. 
15852
15853         * class.cs (TypeContainer): Remove LookupAlias from here.
15854
15855         * decl.cs (DeclSpace); Move here.
15856
15857 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * class.cs (FindMembers): Only call filter if the constructor
15860         bulider is not null.
15861
15862         Also handle delegates in `NestedTypes' now.  Now we will perform
15863         type lookups using the standard resolution process.  This also
15864         fixes a bug.
15865
15866         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15867         This uses Expressions (the limited kind that can be parsed by the
15868         tree) instead of strings.
15869
15870         * expression.cs (ComposedCast.ToString): Implement, used to flag
15871         errors since now we have to render expressions.
15872
15873         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15874         FormArrayType. 
15875
15876         * ecore.cs (SimpleName.ToString): ditto.
15877
15878         * cs-parser.jay: Instead of using strings to assemble types, use
15879         Expressions to assemble the type (using SimpleName, ComposedCast,
15880         MemberAccess).  This should fix the type lookups in declarations,
15881         because we were using a different code path for this.
15882
15883         * statement.cs (Block.Resolve): Continue processing statements
15884         even when there is an error.
15885
15886 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * class.cs (Event.Define): Also remove the `remove' method from
15889         the list of pending items.
15890
15891         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15892         generate more compact code. 
15893
15894 2002-07-17  Martin Baulig  <martin@gnome.org>
15895
15896         * const.cs (Const.LookupConstantValue): Add support for constant
15897         `unchecked' and `checked' expressions.
15898         Also adding test case test-140.cs for this.
15899
15900 2002-07-17  Martin Baulig  <martin@gnome.org>
15901
15902         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15903         check whether mi.ReturnType implements the IEnumerator interface; the
15904         `==' and the IsAssignableFrom() will fail in this situation.
15905
15906 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15907
15908         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15909         here too.
15910
15911 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15912
15913         * expression.cs: fixed bug #27811.
15914
15915 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15918         Molaro: when we are a ref, the value already contains a pointer
15919         value, do not take the address of it.
15920
15921 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15922         * removed mb-parser.jay and mb-tokenizer.cs
15923
15924 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15925
15926         * expression.cs: check against the building corlib void type.
15927
15928 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15929
15930         * ecore.cs: fix for valuetype static readonly fields: when 
15931         initializing them, we need their address, not the address of a copy.
15932
15933 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15934
15935         * typemanager.cs: register also enum_type in corlib.
15936
15937 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15938
15939         * class.cs: allow calling this (but not base) initializers in structs.
15940
15941 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15942
15943         * ecore.cs: make sure we compare against the building base types
15944         in GetTypeSize ().
15945
15946 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15947
15948         * typemanager.cs: fix TypeToCoreType() to handle void and object
15949         (corlib gets no more typerefs after this change).
15950
15951 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15952
15953         * expression.cs (ArrayCreation.EmitArrayArguments): use
15954         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15955
15956         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15957         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15958         array indexes, the runtime actually forbids them.
15959
15960         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15961         for array arguments here.
15962
15963         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15964         instead of the default for ValueTypes.
15965
15966         (New.DoEmit): Use IsValueType instead of
15967         IsSubclassOf (value_type)
15968         (New.DoResolve): ditto.
15969         (Invocation.EmitCall): ditto.
15970
15971         * assign.cs (Assign): ditto.
15972
15973         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15974         Statements *are* currently doing part of their resolution during
15975         Emit.  
15976
15977         Expressions do always resolve during resolve, but statements are
15978         only required to propagate resolution to their children.
15979
15980 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15981
15982         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15983
15984         (LoadAssembly): Do not add the dll if it is already specified
15985
15986         (MainDriver): Add the System directory to the link path at the end,
15987         after all the other -L arguments. 
15988
15989         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15990         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15991         ldelem.u1) and using the opposite for sbytes.
15992
15993         This fixes Digger, and we can finally run it.
15994
15995         * driver.cs (UnixParseOption): Move the option parsing here.  
15996         (CSCParseOption): Implement CSC-like parsing of options.
15997
15998         We now support both modes of operation, the old Unix way, and the
15999         new CSC-like way.  This should help those who wanted to make cross
16000         platform makefiles.
16001
16002         The only thing broken is that /r:, /reference: and /lib: are not
16003         implemented, because I want to make those have the same semantics
16004         as the CSC compiler has, and kill once and for all the confussion
16005         around this.   Will be doing this tomorrow.
16006
16007         * statement.cs (Unsafe.Resolve): The state is checked during
16008         resolve, not emit, so we have to set the flags for IsUnsfe here.
16009
16010 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16011
16012         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16013         not catch the Error_ObjectRefRequired in SimpleName (as it is
16014         possible to have a class/instance variable name that later gets
16015         deambiguated), we have to check this here.      
16016
16017 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16018
16019         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16020         make static and put into Expression.
16021
16022         (Event.Define): Register the private field of the event with the 
16023         TypeManager so that GetFieldFromEvent can get at it.
16024
16025         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16026         keep track of the private field associated with an event which
16027         has no accessors.
16028
16029         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16030         private field.
16031
16032         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16033
16034 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16035
16036         * expression.cs (Binary.EmitBranchable): this routine emits the
16037         Binary expression in a branchable context.  This basically means:
16038         we need to branch somewhere, not just get the value on the stack.
16039
16040         This works together with Statement.EmitBoolExpression.
16041
16042         * statement.cs (Statement.EmitBoolExpression): Use
16043         EmitBranchable. 
16044
16045 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * statement.cs (For): Reduce the number of jumps in loops.
16048
16049         (For): Implement loop inversion for the For statement.
16050
16051         (Break): We can be breaking out of a Try/Catch controlled section
16052         (foreach might have an implicit try/catch clause), so we need to
16053         use Leave instead of Br.
16054
16055         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16056         now).  If the instace expression supports IMemoryLocation, we use
16057         the AddressOf method from the IMemoryLocation to extract the
16058         address instead of emitting the instance.
16059
16060         This showed up with `This', as we were emitting the instance
16061         always (Emit) instead of the Address of This.  Particularly
16062         interesting when This is a value type, as we dont want the Emit
16063         effect (which was to load the object).
16064
16065 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16068
16069         * statement.cs (Checked): Set the CheckedState during the resolve
16070         process too, as the ConvCast operations track the checked state on
16071         the resolve process, and not emit.
16072
16073         * cs-parser.jay (namespace_member_declaration): Flag that we have
16074         found a declaration when we do.  This is used to flag error 1529
16075
16076         * driver.cs: Report ok when we display the help only.
16077
16078 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16079
16080         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16081
16082 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * cs-tokenizer.cs (define): We also have to track locally the
16085         defines.  AllDefines is just used for the Conditional Attribute,
16086         but we also need the local defines for the current source code. 
16087
16088 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * statement.cs (While, For, Do): These loops can exit through a
16091         Break statement, use this information to tell whether the
16092         statement is the last piece of code.
16093
16094         (Break): Flag that we break.
16095
16096         * codegen.cs (EmitContexts): New `Breaks' state variable.
16097
16098 2002-07-03  Martin Baulig  <martin@gnome.org>
16099
16100         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16101         modifiers in method declarations in structs.  Otherwise, you won't
16102         be able to override things like Object.Equals().
16103
16104 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16105
16106         * class.cs (Method, Property, Indexer): Do not allow the public
16107         modifier to be used in explicit interface implementations.
16108
16109         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16110         override modifiers in method declarations in structs
16111
16112 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16113
16114         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16115         integer or real overflow, report an error
16116
16117 2002-07-02  Martin Baulig  <martin@gnome.org>
16118
16119         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16120         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16121         to tell the runtime about our newly created System.Object and
16122         System.ValueType types.
16123
16124 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16125
16126         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16127         struct instead of Ldarg/Starg.
16128
16129 2002-07-02  Martin Baulig  <martin@gnome.org>
16130
16131         * expression.cs (Indirection.Indirection): Call
16132         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16133
16134 2002-07-02  Martin Baulig  <martin@gnome.org>
16135
16136         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16137         ValueType, call TypeManager.TypeToCoreType() on it.
16138         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16139         the OpCodes.Newarr argument.
16140
16141 2002-07-02  Martin Baulig  <martin@gnome.org>
16142
16143         * expression.cs (Invocation.EmitCall): When compiling corlib,
16144         replace all calls to the system's System.Array type to calls to
16145         the newly created one.
16146
16147         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16148         System.Array methods.
16149         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16150         from the system's System.Array type which must be replaced.
16151
16152 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16153
16154         * typemanager.cs: load unverifiable_code_ctor so we can build
16155         corlib using the correct type. Avoid using GetTypeCode() with
16156         TypeBuilders.
16157         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16158         TypeManager.object_type to allow building corlib.
16159
16160 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16161
16162         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16163
16164 2002-07-01  Martin Baulig  <martin@gnome.org>
16165
16166         * class.cs: Make the last change actually work, we need to check
16167         whether `ifaces != null' to avoid a crash.
16168
16169 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16170
16171         * class.cs: when we build structs without fields that implement
16172         interfaces, we need to add the interfaces separately, since there is
16173         no API to both set the size and add the interfaces at type creation
16174         time.
16175
16176 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16177
16178         * expression.cs: the dimension arguments to the array constructors
16179         need to be converted if they are a long.
16180
16181 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16182
16183         * class.cs: don't emit ldarg.0 if there is no parent constructor
16184         (fixes showstopper for corlib).
16185
16186 2002-06-29  Martin Baulig  <martin@gnome.org>
16187
16188         MCS now compiles corlib on GNU/Linux :-)
16189
16190         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16191         ie. check for MethodImplOptions.InternalCall.
16192
16193         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16194         and TypeManager.attribute_type are null, so we must explicitly check
16195         whether parent is not null to find out whether it's an attribute type.
16196         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16197         and SetBuilder, not only if the property is neither abstract nor external.
16198         This is necessary to set the MethodImplOptions on the accessor methods.
16199         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16200         SetBuilder, see Property.Emit().
16201
16202         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16203         populate "System.Object", "System.ValueType" and "System.Attribute" since
16204         they've already been populated from BootCorlib_PopulateCoreTypes().
16205
16206 2002-06-29  Martin Baulig  <martin@gnome.org>
16207
16208         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16209         is the NullLiteral, we also need to make sure that target_type is not
16210         an enum type.   
16211
16212 2002-06-29  Martin Baulig  <martin@gnome.org>
16213
16214         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16215         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16216         before calling BootstrapCorlib_ResolveDelegate ().
16217
16218 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16219
16220         * statement.cs: fixed build-breaker. All tests passed ok.
16221
16222 2002-06-27  Martin Baulig  <martin@gnome.org>
16223
16224         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16225         for System.Decimal when compiling corlib.
16226
16227 2002-06-27  Martin Baulig  <martin@gnome.org>
16228
16229         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16230         switch blocks which contain nothing but a default clause.
16231
16232 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16233
16234        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16235
16236 2002-06-27  Martin Baulig  <martin@gnome.org>
16237
16238         * ecore.cs (PropertyExpr.PropertyExpr): Call
16239         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16240
16241         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16242         is already a TypeBuilder.
16243
16244 2002-06-27  Martin Baulig  <martin@gnome.org>
16245
16246         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16247         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16248         the "from an array-type to System.Array" case.  This makes it work
16249         when compiling corlib.
16250
16251 2002-06-27  Martin Baulig  <martin@gnome.org>
16252
16253         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16254         non-static PropertyExpr, set its InstanceExpression.  This makes
16255         the `ICollection.Count' property work in System/Array.cs.
16256
16257 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16258
16259         * driver.cs: Made error handling more consistent.  Errors now
16260         tracked by Report class, so many methods which used to return int
16261         now return void.  Main() now prints success/failure and 
16262         errors/warnings message.
16263
16264         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16265         the magic number return values (123 and 124).  Now, if the
16266         expected error occurs, the compiler exits with success (exit value
16267         0).  If the compilation completes without seeing that particular
16268         error, the compiler exits with failure (exit value 1).  The
16269         makefile in mcs/errors has been changed to handle the new behaviour.
16270
16271         * report.cs: Made 'expected error' number a property and renamed
16272         it from 'Probe' to 'ExpectedError'.
16273
16274         * genericparser.cs: Removed error handling support, since it is
16275         now all done by Report class.
16276
16277         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16278         class, so parse() no longer returns an int.
16279
16280         * namespace.cs: Use Report.Error instead of GenericParser.error
16281
16282 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16285         TypeContainer.AddOperator): At the front of the list put the
16286         explicit implementations, so they get resolved/defined first. 
16287
16288 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16289
16290         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16291         interface type is implemented by this TypeContainer.  Used during
16292         explicit interface implementation.
16293
16294         (Property.Define, Indexer.Define, Method.Define): Validate that
16295         the given interface in the explicit implementation is one of the
16296         base classes for the containing type.
16297
16298         Also if we are explicitly implementing an interface, but there is
16299         no match in the pending implementation table, report an error.
16300
16301         (Property.Define): Only define the property if we are
16302         not explicitly implementing a property from an interface.  Use the
16303         correct name also for those properties (the same CSC uses,
16304         although that is really not needed).
16305
16306         (Property.Emit): Do not emit attributes for explicitly implemented
16307         properties, as there is no TypeBuilder.
16308
16309         (Indexer.Emit): ditto.
16310
16311         Hiding then means that we do not really *implement* a pending
16312         implementation, which makes code fail.
16313
16314 2002-06-22  Martin Baulig  <martin@gnome.org>
16315
16316         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16317         the return value of Object.GetType().  [FIXME: we need to do this whenever
16318         we get a type back from the reflection library].
16319
16320 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16321
16322         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16323
16324 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16325
16326         * attribute.cs: Return null if we can not look up the type.
16327
16328         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16329         the interface types found.
16330
16331         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16332         interface types found.
16333
16334         * typemanager.cs (GetInterfaces): Make this routine returns alll
16335         the interfaces and work around the lame differences between
16336         System.Type and System.Reflection.Emit.TypeBuilder in the results
16337         result for GetInterfaces.
16338
16339         (ExpandInterfaces): Given an array of interface types, expand and
16340         eliminate repeated ocurrences of an interface.  This expands in
16341         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16342         be IA, IB, IC.
16343
16344 2002-06-21  Martin Baulig  <martin@gnome.org>
16345
16346         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16347         on System.Enum.
16348
16349 2002-06-21  Martin Baulig  <martin@gnome.org>
16350
16351         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16352         and called with one of the core types, return the corresponding typebuilder for
16353         that type.
16354
16355         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16356         element type.
16357
16358 2002-06-21  Martin Baulig  <martin@gnome.org>
16359
16360         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16361         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16362         (Expression.ConvertReferenceExplicit): Likewise.
16363
16364         * expression.cs (ElementAccess.DoResolve): Likewise.
16365         (ElementAccess.DoResolveLValue): Likewise.
16366
16367 2002-06-10  Martin Baulig  <martin@gnome.org>
16368
16369         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16370         add the "value" parameter to the parameter list.
16371
16372         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16373         to our caller.
16374
16375 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16378         the argument to an int, uint, long or ulong, per the spec.  Also
16379         catch negative constants in array creation.
16380
16381 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16382
16383         * class.cs: do not allow the same interface to appear twice in
16384         the definition list.
16385
16386 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16387
16388         * ecore.cs: don't use ldlen with System.Array.
16389
16390 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16391
16392         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16393
16394 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16395
16396         * modifiers.cs: produce correct field attributes for protected
16397         internal. Easy fix so miguel can work on ther harder stuff:-)
16398
16399 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16400
16401         * pending.cs: New file.  Move the code from class.cs here.
16402         Support clearning the pending flag for all methods (when not doing
16403         explicit interface implementation).
16404
16405 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16406
16407         * rootcontext.cs: added a couple more types needed to bootstrap.
16408
16409 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16410
16411         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16412         constructor in the type, instead of any constructor in the type
16413         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16414         a bug in the Mono runtime when applying the params attribute). 
16415
16416 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16417         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16418
16419 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16420
16421         * expression.cs (Unary.ResolveOperator): Use TypeManager
16422         to resolve the type.
16423
16424 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16425
16426         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16427         attached.
16428
16429         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16430         with each member too.
16431
16432         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16433         field builders too - this takes care of the enum member case.
16434
16435 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16436
16437         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16438         address-of operator on both value types and pointers.
16439
16440 2002-06-10  Martin Baulig  <martin@gnome.org>
16441
16442         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16443         PropertyBuilder to the `property_builders' list.
16444
16445         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16446         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16447         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16448         find any indexers which are inherited from an interface.
16449
16450 2002-06-09  Martin Baulig  <martin@gnome.org>
16451
16452         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16453         the same type as the constant if necessary.  There's also a test-130.cs
16454         for this.
16455
16456         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16457
16458         * typemanager.cs (TypeManager.ChangeType): Previously known as
16459         Enum.ChangeEnumType().
16460
16461 2002-06-09  Martin Baulig  <martin@gnome.org>
16462
16463         * expression.cs (Cast.TryReduce): Added support for consts.
16464
16465 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16466
16467         * class.cs (Accessor): Hold attributes information so we can pass
16468         it along.
16469
16470         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16471         Modify to pass in attributes attached to the methods.
16472
16473         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16474
16475         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16476         to handle the Accessor kind :-)
16477
16478         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16479
16480 2002-06-08  Martin Baulig  <martin@gnome.org>
16481
16482         * expression.cs (Unary.TryReduceNegative): Added support for
16483         ULongConstants.
16484
16485 2002-06-08  Martin Baulig  <martin@gnome.org>
16486
16487         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16488         name can't be found in the `defined_names' - the caller will do a
16489         MemberLookup in this case and thus find methods in System.Enum
16490         such as Enum.IsDefined().
16491
16492 2002-06-08  Martin Baulig  <martin@gnome.org>
16493
16494         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16495         Convert.ChangeType() which works with TypeBuilder created types.
16496         (Enum.LookupEnumValue, Enum.Define): Use it here.
16497
16498         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16499         `TypeBuilder.BaseType != null' check.
16500         (TypeContainer.FindMembers): Only lookup parent members if we
16501         actually have a parent.
16502         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16503         (ConstructorInitializer.Resolve): Likewise.
16504
16505         * interface.cs (Interface.FindMembers): Added
16506         `TypeBuilder.BaseType != null' check.
16507
16508         * rootcontext.cs (RootContext.ResolveCore): Added
16509         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16510         classes_second_stage.
16511
16512         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16513         debug_type and trace_type when compiling with --nostdlib.       
16514
16515 2002-06-07  Martin Baulig  <martin@gnome.org>
16516
16517         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16518         (AddField): Set it to true when adding a non-static field.
16519         (DefineType): Use `have_nonstatic_fields' to find out whether we
16520         have non-static fields, not `Fields != null'.
16521
16522 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16525         dereferencing a null on the static-field code path)
16526
16527 2002-05-30  Martin Baulig  <martin@gnome.org>
16528
16529         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16530         to take command line arguments.  Use reflection to call the new
16531         custom `Initialize' function on the symbol writer and pass it the
16532         command line arguments.
16533
16534         * driver.cs (--debug-args): New command line argument to pass command
16535         line arguments to the symbol writer.
16536
16537 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16538
16539         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16540         the target type for indexers and properties.  Thanks to Joe for
16541         catching this.
16542
16543 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * typemanager.cs (MethodFlags): returns the method flags
16546         (Obsolete/ShouldIgnore) that control warning emission and whether
16547         the invocation should be made, or ignored. 
16548
16549         * expression.cs (Invocation.Emit): Remove previous hack, we should
16550         not do this on matching a base type, we should do this based on an attribute
16551
16552         Only emit calls to System.Diagnostics.Debug and
16553         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16554         on the command line.
16555
16556         * rootcontext.cs: Global settings for tracing and debugging.
16557
16558         * cs-tokenizer.cs (define): New utility function to track
16559         defines.   Set the global settings for TRACE and DEBUG if found.
16560
16561 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16562
16563         * interface.cs (Populate*): Pass in the TypeContainer as well as
16564         the DeclSpace as parameters so that we can create EmitContexts and
16565         then use that to apply attributes etc.
16566
16567         (PopulateMethod, PopulateEvent, PopulateProperty)
16568         (PopulateIndexer): Apply attributes everywhere.
16569
16570         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16571         etc.
16572
16573         (ApplyAttributes): Update accordingly.
16574
16575         We now apply interface attributes for all members too.
16576
16577 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16578
16579         * class.cs (Indexer.Define); Correctly check if we are explicit
16580         implementation (instead of checking the Name for a ".", we
16581         directly look up if the InterfaceType was specified).
16582
16583         Delay the creation of the PropertyBuilder.
16584
16585         Only create the PropertyBuilder if we are not an explicit
16586         interface implementation.   This means that explicit interface
16587         implementation members do not participate in regular function
16588         lookups, and hence fixes another major ambiguity problem in
16589         overload resolution (that was the visible effect).
16590
16591         (DefineMethod): Return whether we are doing an interface
16592         implementation. 
16593
16594         * typemanager.cs: Temporary hack until we get attributes in
16595         interfaces (Ravi is working on that) and we get IndexerName
16596         support in interfaces.
16597
16598         * interface.cs: Register the indexers as properties.
16599
16600         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16601         warning, I have verified that this is a bug in the .NET runtime
16602         (JavaScript suffers of the same problem).
16603
16604         * typemanager.cs (MemberLookup): When looking up members for
16605         interfaces, the parent of an interface is the implicit
16606         System.Object (so we succeed in searches of Object methods in an
16607         interface method invocation.  Example:  IEnumerable x;  x.ToString
16608         ()) 
16609
16610 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * class.cs (Event): Events should also register if they do
16613         implement the methods that an interface requires.
16614
16615         * typemanager.cs (MemberLookup); use the new GetInterfaces
16616         method. 
16617
16618         (GetInterfaces): The code used to lookup interfaces for a type is
16619         used in more than one place, factor it here. 
16620
16621         * driver.cs: Track the errors at the bottom of the file, we kept
16622         on going.
16623
16624         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16625         instance if the method we are calling is static!
16626
16627 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16628
16629         * attribute.cs (ApplyAttributes): Make this function filter out
16630         the IndexerName attribute (as that attribute in reality is never
16631         applied) and return the string constant for the IndexerName
16632         attribute. 
16633
16634         * class.cs (TypeContainer.Emit): Validate that all the indexers
16635         have the same IndexerName attribute, and if so, set the
16636         DefaultName attribute on the class. 
16637
16638         * typemanager.cs: The return value might contain other stuff (not
16639         only methods).  For instance, consider a method with an "Item"
16640         property and an Item method.
16641
16642         * class.cs: If there is a problem with the parameter types,
16643         return. 
16644
16645 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16646
16647         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16648         looks at user defined conversion after making a call to 
16649         StandardConversionExists - we need this for overload resolution.
16650
16651         * expression.cs : Update accordingly the various method calls.
16652
16653         This fixes 2 bugs filed against implicit user defined conversions 
16654
16655 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16656
16657         * statement.cs: Track the result of the assignment.
16658
16659 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * expression.cs (MemberAccess): Improved error reporting for
16662         inaccessible members.
16663
16664 2002-05-22  Martin Baulig  <martin@gnome.org>
16665
16666         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16667         itself with debugging support.
16668
16669 2002-05-22  Martin Baulig  <martin@gnome.org>
16670
16671         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16672         Removed, this isn't needed anymore.
16673
16674 2002-05-20  Martin Baulig  <martin@gnome.org>
16675
16676         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16677         be underlying type for an enum.
16678
16679 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16680
16681         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16682         that splits out the loading of just the core types.
16683
16684         * rootcontext.cs (ResolveCore): Split the struct resolution in
16685         two, so we can load the enumeration underlying types before any
16686         enums are used.
16687
16688         * expression.cs (Is): Bandaid until we fix properly Switch (see
16689         bug #24985 for details).
16690
16691         * typemanager.cs (ImplementsInterface): The hashtable will contain
16692         a null if there are no interfaces implemented.
16693
16694 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * cs-parser.jay (indexer_declarator): It is fine to have array
16697         parameters
16698
16699 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * typemanager.cs: (RegisterBuilder): New function used to register
16702         TypeBuilders that implement interfaces.  Since
16703         TypeBuilder.GetInterfaces (as usual) does not work with lame
16704         Reflection.Emit. 
16705         (AddUserType): register interfaces.
16706
16707         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16708         dealing with TypeBuilder.  Also, arrays are showing up as
16709         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16710         methods can not be invoked on them!
16711
16712         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16713         (ImplicitReferenceConversionExists): Split out from
16714         StandardConversionExists. 
16715
16716         * expression.cs (As): We were only implementing one of the three
16717         cases for the as operator.  We now implement them all.
16718         (Is): Implement the various other cases for Is as well.
16719
16720         * typemanager.cs (CACHE): New define used to control if we want or
16721         not the FindMembers cache.  Seems to have a negative impact on
16722         performance currently
16723
16724         (MemberLookup): Nested types have full acess to
16725         enclosing type members
16726
16727         Remove code that coped with instance/static returns for events, we
16728         now catch this in RealFindMembers.
16729
16730         (RealFindMembers): only perform static lookup if the instance
16731         lookup did not return a type or an event.  
16732
16733 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16734
16735         * assign.cs (CompoundAssign): We pass more semantic information
16736         now to Compound Assignments than we did before: now we have all
16737         the information at hand, and now we resolve the target *before* we
16738         do the expression expansion, which allows the "CacheValue" method
16739         to have the effect we intended (before, a [x] += 1 would generate
16740         two differen ArrayAccess expressions from the ElementAccess,
16741         during the resolution process).
16742
16743         (CompoundAssign.DoResolve): Resolve target and original_source here.
16744
16745 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16746
16747         * expression.cs (ArrayAccess): dropped debugging information. 
16748
16749         * typemanager.cs: Small bug fix: I was always returning i_members,
16750         instead of one of i_members or s_members (depending on which had
16751         the content).
16752
16753         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16754         method is invoked before any code generation takes place, and it
16755         is a mechanism to inform that the expression will be invoked more
16756         than once, and that the method should use temporary values to
16757         avoid having side effects
16758
16759         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16760
16761         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16762         implementation.
16763
16764         * expression.cs (Indirection, ArrayAccess): Add support for
16765         CacheTemporaries in these two bad boys. 
16766
16767         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16768         ldobj or ldind_ref.  
16769         (StoreFromPtr): Handle stobj as well.
16770
16771         * expression.cs (UnaryMutator): Share more code.
16772
16773         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16774         down: I was not tracking the Filter function as well, which
16775         was affecting the results of the cache.
16776
16777 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * attribute.cs: Remove the hack to handle the CharSet property on
16780         StructLayouts. 
16781
16782 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * attribute.cs (DoResolve): More uglyness, we now only try to
16785         resolve the attribute partially, to extract the CharSet
16786         information (only if we are a StructLayout attribute).  Otherwise 
16787
16788         (GetExtraTypeInfo): Add some code to conditionally kill in the
16789         future this.   I am more and more convinced that the .NET
16790         framework has special code to handle the attribute setting on
16791         certain elements.
16792
16793         * expression.cs (IsParamsMethodApplicable): Revert my previous
16794         foreach change here, it was wrong.
16795
16796 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16797
16798         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16799         (pp_expr): do not abort on unknown input, just return.
16800         (eval): abort if there are pending chars.
16801
16802         * attribute.cs (Attribute.Resolve): Positional parameters are
16803         optional.  Deal with that case.
16804
16805         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16806         the Ansi/Unicode/Auto information for the type.
16807
16808         (TypeContainer.DefineType): instantiate the EmitContext here, as
16809         we will be using it during the type definition (to resolve
16810         attributes) and during the emit phase.
16811
16812         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16813         to pull type information out of the attributes
16814
16815         (Attribute.Resolve): track the constructor builder, and allow for
16816         multiple invocations (structs and classes will use this).
16817
16818         * ecore.cs (MemberLookupFinal): new version with all the
16819         parameters customizable.
16820
16821         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16822         constructors.  Return if the result value is null (as the error
16823         would have been flagged already by MemberLookupFinal)
16824
16825         Do not allow instances of abstract classes or interfaces to be
16826         created.
16827
16828         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16829         We have to compare the assembly property here when dealing with
16830         FamANDAssem and Assembly access modifiers, because we might be
16831         creating an assembly from *modules* (that means that we are not
16832         getting TypeBuilders for types defined in other modules that are
16833         part of this assembly).
16834
16835         (Method.Emit): If the method is marked abstract and has a body,
16836         emit an error. 
16837
16838         (TypeContainer.DefineMembers): If both the defined member and the
16839         parent name match are methods, then do not emit any warnings: let
16840         the Method.Define routine take care of flagging warnings.  But if
16841         there is a mismatch (method overrides something else, or method is
16842         overriwritten by something, then emit warning).
16843
16844         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16845         set to null, this means `do not check for the return type on the
16846         signature'. 
16847
16848         (Method.Define): set the return type for the method signature to
16849         null, so that we get methods with the same name and parameters and
16850         different return types.  This is used to flag warning 114 (you are
16851         hiding a method, and you probably want to use the new/override
16852         keywords instead).
16853
16854         * typemanager.cs (MemberLookup): Implemented proper access
16855         control, closing a long standing set of bug reports.  The problem
16856         was that the Framework only has two bits: Public and NonPublic,
16857         and NonPublic includes private and protected methods, but we need
16858         to enforce the FamANDAssem, FamOrAssem and Family. 
16859
16860 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * statement.cs (GotoCase): Return true: Ammounts to giving up
16863         knowledge on whether we return or not, and letting the other case
16864         be responsible for it.
16865
16866 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * driver.cs: Do not load directories for each file processed, only
16869         do it if there is a pattern.
16870
16871         * ecore.cs: Report readonly assigns here as well, as we might have
16872         been resolved only by MemberAccess.
16873
16874         (SimpleName.SimpleNameResolve): Also be useful for LValue
16875         resolution.   We need this to propagate assign to local readonly variables
16876
16877         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16878         do not want to reuse potential criteria memory.
16879
16880         * class.cs (MyEventBuilder): Set reflected_type;
16881
16882         * ecore.cs (Constantify): Added support for constifying bools.
16883
16884         (RootContext.LookupType): Added a cache for values looked up in
16885         the declaration space.
16886
16887         * typemanager.cs (FindMembers): Now is a front-end to
16888         RealFindMembers, and provides a two-level hashtable-based cache to
16889         the request.  
16890
16891         15% performance improvement: from 22.5 to 19.2 seconds.
16892
16893         * expression.cs (IsParamsMethodApplicable): use foreach.
16894         (Invocation.DoResolve): ditto.
16895         (New.DoResolve): ditto.
16896         (ArrayCreation.DoResolve): ditto.
16897
16898         * ecore.cs (FindMostEncompassingType): use foreach.
16899
16900         * delegate.cs (NewDelegate.DoResolve): Use foreach
16901
16902         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16903         (RemoveMethods): use foreach.
16904
16905         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16906         nested foreach statements instead of for, and also break out of
16907         the inner loop once a match is found.
16908
16909         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16910
16911 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16914         we actually unwrap the expression to allow for extra information
16915         to be extracted. 
16916
16917         * expression.cs: Use Shr_Un on unsigned operations. 
16918
16919 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16920
16921         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16922         applicable operators was not being considered correctly. This closes
16923         the bug Miguel reported.
16924
16925 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16926
16927         * attribute.cs: check that the type derives from System.Attribute
16928         and report the correct error in that case (moved the duplicate code to
16929         its own method, too).
16930
16931 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16932
16933         * attribute.cs: lookup attribute type name as the spec says: first the
16934         bare attribute name and then name + "Attribute" (nant compiles with
16935         mcs after this fix).
16936
16937 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16938
16939         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16940         Because of the way we parse things, we should try to see if a
16941         UIntConstant can fit in an integer.
16942
16943 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16944
16945         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16946         when we are in an explicit context.
16947
16948         (ConvertReferenceExplicit): When converting from Iface type S to Class
16949         T make sure the rules are implemented as an OR.
16950
16951         * parameter.cs (ParameterType): Make it a property for now although the
16952         purpose really isn't anything immediate.
16953
16954         * expression.cs (Is*Applicable): Do better checking on the parameter type
16955         of a ref/out parameter. The ones from the system assemblies are already 
16956         marked with the correct type so we don't need to do any correction.
16957
16958         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16959         the object type is standard too so include that.
16960
16961 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16962
16963         * ecore.cs (StandardConversionExists): Augment with missing code:
16964         deal with IntConstant, LongConstants and Enumerations.
16965
16966         * assign.cs: Report the error, instead of failing silently
16967
16968         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16969         typecontainer that they are declared, because the
16970         typecontainer/namespace will have the list of using clauses that
16971         need to be applied.
16972
16973         Assembly Attributes were escaping the normal registration
16974         mechanism. 
16975
16976         (EmitCode): Apply attributes within an EmitContext that represents
16977         the container they were declared on.
16978
16979         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16980
16981 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16982
16983         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16984         Revamp completely - make much cleaner as we now operate only
16985         on a set of Types.
16986
16987         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16988         to implement the logic detailed in the spec more correctly.
16989
16990         (UserDefinedConversion): Update accordingly.
16991
16992 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16993
16994         * statement.cs: Return flow analysis information up.
16995
16996         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16997         and the default.
16998
16999         (token): Do not consume an extra character before calling
17000         decimal_digits.
17001
17002 2002-05-06  Piers Haken <piersh@friskit.com>
17003
17004         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17005
17006 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17007
17008         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17009         EmitContext during the instance constructor initializer
17010         resolution, to stop access to instance variables.
17011
17012         This is mandated by the spec, last paragraph of the `constructor
17013         initializers' section. 
17014
17015 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17016
17017         * cs-parser.jay, class.cs (Accessor): new class used to represent
17018         an accessor (get or set).  In the past we used `null' to represent
17019         a missing accessor.  But this is ambiguous because there was no
17020         way to tell in abstract indexers/properties if one of them was
17021         specified.
17022
17023         Now there is a way of addressing that.
17024
17025         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17026         instead of FindMembers.
17027
17028         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17029         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17030
17031         * attribute.cs: Treat indexers and properties as the same in terms
17032         of applying attributes
17033
17034         * ecore.cs (FindMostEncompassedType): Use statically initialized
17035         EmptyExpressions()s like we do elsewhere to avoid creating useless
17036         objects (and we take this out of the tight loop).
17037
17038         (GetConversionOperators): Move the code to extract the actual
17039         operators to a separate routine to clean things up.
17040
17041 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17044         events are always registered FieldBuilders.
17045
17046         * class.cs (FieldBase): New class shared by Fields 
17047
17048         * delegate.cs: If we are a toplevel delegate, use our full name.
17049         If we are a nested delegate, then only use our tail name.
17050
17051 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17052
17053         * expression.cs (IsApplicable): Ensure that we add the "&" to
17054         ref/out types before comparing it with the type of the argument.
17055
17056         (IsParamsMethodApplicable): Ditto.
17057
17058         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17059         silly me ;-)
17060
17061         * delegate.cs : Handle the case when we have more than one applicable
17062         method. Flag an error only when we finish checking all.
17063
17064 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17065
17066         * expression.cs: Add support for boolean static initializers.
17067
17068 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17069
17070         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17071
17072         * parameter.cs (ComputeParameterTypes,
17073         ComputeAndDefineParameterTypes): Better error handling: now we
17074         clear the `types' cache if we fail during any of the type lookups.
17075         We also return the status code correctly to our caller
17076
17077         * delegate.cs: If we fail to define a delegate, abort the extra
17078         steps. 
17079
17080         * expression.cs (Binary.ResolveOperator): for
17081         operator==(object,object) and operator !=(object, object) we also
17082         have to verify that there is an implicit conversion from one to
17083         the other.
17084
17085         (ArrayAccess.DoResolve): Array Access can operate on
17086         non-variables. 
17087
17088 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17089
17090         * assign.cs (CompoundAssign): A new class used as a "flag" that
17091         the assignment actually is happening as part of a compound
17092         assignment operator.
17093
17094         During compound assignment, a few new rules exist to enable things
17095         like:
17096
17097         byte b |= 1 + 2
17098
17099         From the spec:
17100
17101         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17102         to the type of x) if y is implicitly convertible to the type of x,
17103         and the operator is a builtin operator and the return type of the
17104         operator is explicitly convertible to the type of x. 
17105
17106         * rootcontext.cs: Reset warning level to 2.  4 catches various
17107         "interesting" features in mcs, we must clean this up at some
17108         point, but currently am trying to kill other bugs ;-)
17109
17110         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17111         in container classes as well.  
17112
17113         * expression.cs (Binary.ResolveOperator): Handle string case
17114         before anything else (as operator overloading does emit an error
17115         before doing anything else).
17116
17117         This code could go away when we move to a table driven model, but
17118         i could not come up with a good plan last night.
17119
17120 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17121
17122         * typemanager.cs (CSharpName): reimplementation using regex.
17123         * class.cs: added null check for fields in Emit
17124         * rootcontext.cs: set warninglevel to 4
17125
17126 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * typemanager.cs (CSharpName): reimplemented with Lupus
17129         suggestion.
17130
17131 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17132
17133         * statement.cs (If): correclty implement Resolve, because we were
17134         not catching sem errors in there.  The same process is needed
17135         everywhere else. 
17136         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17137
17138
17139         (Statement.Warning_DeadCodeFound): Factorize code.
17140         (While): Report dead code here too.
17141
17142         (Statement): Added Resolve virtual method to allow
17143         for resolution split from the emit code.
17144
17145 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17146
17147         * statement.cs (EmitBoolExpression): No longer try to resolve the
17148         expression here.    
17149         (MakeBoolean): New utility function that resolve, implicitly
17150         converts to boolean and tags the expression. 
17151
17152
17153         (If, Do): Implement dead code elimination.
17154         (While): Implement loop inversion
17155
17156         (Do, While, For, If): Resolve the expression prior to calling our
17157         code generation.
17158
17159 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17160
17161         * class.cs:
17162           - added method Report28 (warning: program has more than one entry point)
17163           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17164           - modified method Method.Define, the part at the end of the method
17165
17166         * rootcontext.cs: added static public Location EntryPointLocation;
17167           
17168         * ../errors/cs0028.cs : Add test case for the above warning.              
17169
17170         * typemanager.cs:
17171           - modified method CSharpName to allow arrays of primitive type to
17172             be printed nicely (e.g. instead of System.Int32[][] it now prints
17173             int[][])
17174           - added method CSharpSignature: returns the signature of a method
17175             in string format to be used in reporting errors, warnings, etc.
17176
17177         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17178         with String.Empty.
17179
17180 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17181
17182         * delegate.cs (Define): Fix extremely silly bug where I was
17183         setting the type of the 'object' parameter of the BeginInvoke
17184         method to System.IAsyncResult instead of System.Object ;-)
17185
17186 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17187
17188         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17189         here. 
17190
17191         (Constructor.Emit): return if we fail to initialize the
17192         constructor.  Another door closed!  
17193
17194         * expression.cs (New.DoResolve): Improve error message (from -6 to
17195         1501).  Use DeclaredOnly lookup to find the exact constructor.
17196
17197         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17198         loop.  This is useful.
17199
17200         * cs-parser.jay: Adjust the default parameters so that destructors
17201         have the proper signature.
17202
17203 2002-04-26  Martin Baulig  <martin@gnome.org>
17204
17205         * driver.cs (LoadAssembly): If `assembly' contains any characters
17206         which are only valid in path names and not in assembly names
17207         (currently slash, backslash and point), use Assembly.LoadFrom ()
17208         instead of Assembly.Load () on the `assembly' (before iteration
17209         over the link_paths).
17210
17211 2002-04-26  Martin Baulig  <martin@gnome.org>
17212
17213         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17214
17215 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * class.cs (Property): use the new typemanager.MemberLookup
17218
17219         (TypeContainer.MemberLookup): Implement using the
17220         TypeManager.MemberLookup now. 
17221
17222         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17223         and return MemberInfos, so that these can be used without an
17224         EmitContext (what we had before).
17225
17226 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17227
17228         * expression.cs: Fix the case where the argument to params if the
17229         type of the params.  I omitted handling this before.   Fixed
17230
17231 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17232
17233         * driver.cs: Call BootCorlib_PopulateCoreType
17234
17235         * class.cs (Property.CheckBase): Check for properties only, not
17236         for all members. 
17237
17238         * interface.cs: Temporary hack: try/catch around the
17239         CustomAttributeBuilder, because I am getting an exception that I
17240         do not understand.
17241
17242         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17243         types whose definitions are required to be there (attributes are
17244         defined before standard types).
17245
17246         Compute definitions as we boot the various types, as they are used
17247         immediately (value_type class will need object_type, but if we do
17248         not initialize object_type, we will pass a null, which will let
17249         the runtime pick the System.Object from the existing corlib, which
17250         is not what we want).
17251
17252 2002-04-22  Patrik Torstensson <totte@labs2.com>
17253
17254         * cs-tokenizer.cs: fixed a number of trim() issues.
17255
17256 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17257
17258         * expression.cs (Argument.Type): Ensure that we return the correct
17259         type when we have out or ref parameters [in which case we 
17260         append a "&"].
17261
17262 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * class.cs (Property, Indexer): Allow extern modifier in there. 
17265
17266         * typemanager.cs (InitBaseTypes): Initializes object_type and
17267         value_type, since those will be used early on during the bootstrap
17268         process to compile corlib.
17269
17270         (InitCoreTypes): Move code from here to InitBaseTypes.
17271
17272 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17275         single-dimension arrays as using the ldlen opcode.  
17276
17277         Daniel Lewis discovered this optimization.  
17278
17279         * typemanager.cs: Add signature for System.Array::get_Length
17280
17281 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17282
17283         * statement.cs: report the error when the foreach does not apply to an
17284         array nor a collection.
17285
17286 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17287
17288         * expression.cs: Add implicit conversions to the operator ~.
17289
17290         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17291
17292         * typemanager.cs: Locate the decimal constructor.
17293
17294 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17295
17296         * attribute.cs: use the new property of TypeOf.
17297         * expression.cs: added 'get' property around typearg.
17298
17299         These changes fix a build breaker reported by NickD. Is this the
17300         correct way to fix?  If not, please, revert my changes and make it
17301         work :-).
17302
17303 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17304
17305         * attribute.cs: Add support for typeof in attribute invocations.
17306         I am not sure that this is right though.
17307
17308 2002-04-14  Duncan Mak  <duncan@ximian.com>
17309
17310         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17311         Binary.Operator.Division case.
17312
17313 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17314
17315         * class.cs (DefineType): Ensure that we do a proper check on
17316         attribute types and also register it with the TypeManager.
17317
17318         (TypeContainer.Targets): The default for attribute types is
17319         AttributeTargets.All.
17320
17321         * attribute.cs (ApplyAttributes): Registering the attribute type
17322         is done elsewhere, not when we discover we have a Usage attribute.
17323
17324 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17325
17326         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17327         and get rid of is_delegate parameter.
17328
17329         * everywhere : update.
17330
17331 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17332
17333         * cs-parser.jay (compilation_unit): Revamp completely to use
17334         some new ideas that I got from Rhys' grammar to solve the problems
17335         with assembly level attributes.
17336
17337         (outer_declaration): New grammar production.
17338
17339         (attribute_sections): Add.
17340
17341         (opt_attributes): Base on attribute_sections
17342
17343         (namespace_declaration): Allow opt_attributes to tackle the case
17344         when we have assembly level attributes - we are clever in this
17345         regard now ;-)
17346
17347         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17348         attributes in the non-global context.
17349
17350         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17351         instead of SetGlobalAttributes.
17352
17353         * class.cs, rootcontext.cs : Ensure we define and generate 
17354         attribute types before anything else.
17355
17356         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17357         and flag the new error -20 for the case when the attribute type
17358         does not have valid targets specified. csc does not catch this.
17359
17360         * ../errors/errors.txt : update for error # -20
17361
17362 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17363
17364         * support.cs (InternalParameters.ParameterModifier): Do some null
17365         checking and return sane values.
17366
17367         * class.cs (Method.Define): If we are a PInvoke method, ensure
17368         that we are static and extern. Report error # 601
17369
17370         * ../errors/cs0601.cs : Add test case for the above error.
17371
17372 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17373
17374         * rootcontext.cs (attribute_types): We need to keep type of
17375         all attribute types separately and emit code for them first.
17376
17377         (RegisterAttribute) : Implement.
17378
17379         * class.cs (DefineType): Check if the current Type is a custom
17380         attribute type and register it accordingly.
17381
17382         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17383         adding the first attribute twice and rename to
17384
17385         (SetGlobalAttributes): this.
17386
17387         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17388         lookups.
17389
17390         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17391         if we are processing global arguments. Hmm, I am unsure of this.
17392
17393 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17394
17395         * expression.cs: added static array of strings to avoid calling
17396         Enum.ToString () for Operator in Binary. Significant recover of
17397         performance.
17398
17399 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * class.cs (FindMembers): Allow the Builders of the various
17402         members to be null.  If they are skip them.  This only happens
17403         during the PInvoke declaration.
17404
17405 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17406
17407         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17408         failure, so we do not keep going afterwards.
17409
17410         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17411         wanted to pass `false' as the `is_delegate' argument.  If this is
17412         the case, why not use delegate_type == null to mean `is_delegate =
17413         false' and anything else as is_delegate = true.
17414
17415 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17416
17417         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17418         code for the section, not the beginning of the tests.
17419
17420 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17421
17422         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17423
17424         * expression.cs (Binary): same.  Warn about errors where we have
17425         Enum/Enum in operator + as well.
17426
17427 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17428
17429         * statement.cs:
17430                 - added support for switch(bool)
17431                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17432                 - add TableSwitchEmit() to handle table-based switch statements
17433
17434 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17435
17436         * expression.cs (Invocation.OverloadResolve): Factor out code which
17437         does parameter compatibility checking with arguments so that we can 
17438         re-use the code even from Delegate.VerifyApplicability
17439
17440         (VerifyArgumentsCompat): Move above code here.
17441
17442         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17443         and instead make a call to the above method.
17444
17445 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17446
17447         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17448         We use it to keep track of classes which are attribute types.
17449
17450 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * delegate.cs (Delegate.Define): Correctly define the types in the
17453         presence of fixed and array parameters.
17454
17455         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17456         doing FindMembers.
17457
17458         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17459         include NonPublic after the first iteration.
17460
17461         * class.cs (Indexer.CheckBase): Only check if both parents are
17462         non-null. 
17463
17464         * cs-parser.jay (accessor_body): If empty, set to null.
17465
17466         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17467         same code path here to resolve constants names that we did have in
17468         MemberAccess.DoResolve.  There is too much code duplicated here.
17469
17470 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17471
17472         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17473
17474         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17475         to MakeUnionSet.
17476
17477         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17478         tokens, numbers and strings.
17479
17480         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17481         parenthesis.
17482
17483         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17484         asyncronous parameters and the regular parameters.  
17485
17486         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17487         specify the target directory.
17488
17489         * expression.cs: (This.DoResolve): Simplify
17490         (As.Emit): Optimize, do not generate IsInst if the expression is
17491         always of the given type.
17492
17493         (Is.DoResolve): Bug fix, we were reporting both always/never for
17494         the is expression.
17495
17496         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17497         creating too many unnecessary arrays.
17498
17499 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17502         fields instead of rolling our own initializer.   Takes care of all
17503         implicit conversions, and drops unnecessary static checks/argument.
17504
17505 2002-03-31  Dick Porter  <dick@ximian.com>
17506
17507         * driver.cs: use the GetDirectories() return values properly, and
17508         use "/" as path separator.
17509
17510 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * expression.cs (Unary): Optimize - - expr into expr.
17513         (Binary): Optimize a + (-b) into a -b.
17514
17515         * codegen.cs (CodeGen): Made all methods static.
17516
17517 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17518
17519         * rootcontext.cs: 
17520
17521         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17522         TypeBuilder property.
17523
17524         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17525         instead. 
17526
17527         * tree.cs: Removed the various RecordXXXX, and replaced with a
17528         single RecordDecl.  Removed all the accessor methods, and just
17529         left a single access point Type 
17530
17531         * enum.cs: Rename DefineEnum to DefineType.
17532
17533         * decl.cs: New abstract method `DefineType' used to unify the
17534         Defines for Enumerations, Interfaces, TypeContainers and
17535         Delegates.
17536
17537         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17538         LookupBaseClasses method that used to live in class.cs and
17539         interface.cs here, and renamed to FindType.
17540
17541         * delegate.cs: Implement DefineType.  Take advantage of the
17542         refactored pattern for locating the parent builder without taking
17543         the parent_builder argument (which we know does not work if we are
17544         nested, and triggering a toplevel definition).
17545
17546 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17547
17548         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17549         accessibility of a member has changed during override and report
17550         an error if so.
17551
17552         * class.cs (Method.Define, Property.Define): Only complain on
17553         overrides if the method is private, any other accessibility is
17554         fine (and since we just checked the permission is the same, we are
17555         good to go).
17556
17557         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17558         and elif are processed always.  The other pre-processing
17559         directives are only processed if we are "taking" the path
17560
17561 2002-03-29  Martin Baulig  <martin@gnome.org>
17562
17563         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17564         current location is not Null.
17565
17566         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17567         a separate method so we can profile it.
17568
17569         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17570         `span.Seconds' are just seconds, but no minutes or hours.
17571         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17572
17573 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17574
17575         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17576         Remove the gratuitous set of Final:
17577
17578                                 // If an interface implementation, then we can set Final.
17579                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17580                                     implementing.DeclaringType.IsInterface)
17581                                         flags |= MethodAttributes.Final;
17582
17583         I do not know what I was smoking when I used that.
17584
17585
17586         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17587         step into fixing the name resolution issues for delegates and
17588         unifying the toplevel name resolution.
17589
17590 2002-03-28  Martin Baulig  <martin@gnome.org>
17591
17592         * class.cs (Method.Emit): If we have a symbol writer, call its
17593         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17594         tell it about the current method.
17595
17596         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17597         writer that we're going to emit the first byte of IL code for a new
17598         statement (a new source line).
17599         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17600         EmitContext.Mark() before emitting any code.
17601
17602         * location.cs (SymbolDocument): Return null when we're Null.
17603
17604         * statement.cs (Statement): Moved the `Location loc' variable here.
17605         (Statement.EmitBoolExpression): If we have a symbol writer, call
17606         ec.Mark() before emitting any code to tell it that we're at the
17607         beginning of a new statement.
17608         (StatementExpression): Added `Location' argument to the constructor.
17609         (Block): Added public readonly variable `StartLocation' and public
17610         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17611         (Block): Added constructor which takes a start and end location.
17612         (Block.SetEndLocation): New method. This sets the end location.
17613         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17614         local variables we create.
17615         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17616         each statement and do also mark the begin and end of the block.
17617
17618         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17619         tell it the current lexer.Location, use Location.Null for the end of the
17620         block.
17621         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17622         current block, set its end location using SetEndLocation().
17623         (statement_expression): StatementExpression constructor now takes the
17624         lexer.Location as additional argument.
17625         (for_statement, declare_local_variables): Likewise.
17626         (declare_local_variables): When creating a new implicit block, use the
17627         new Block constructor and pass it the lexer.Location.
17628
17629 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17632         members also on the parent interfaces recursively.
17633
17634 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17635
17636         * report.cs: Use new formats, since Gonzalo finished the missing
17637         bits. 
17638
17639         * expression.cs (Binary.ResolveOperator): added missing operator|
17640         operator& and operator^ for bool/bool.
17641
17642         * cs-parser.jay: CheckDef now takes a Location argument that is
17643         used to report errors more precisly (instead of reporting the end
17644         of a definition, we try to track something which is a lot closer
17645         to the source of the problem).
17646
17647         * cs-tokenizer.cs: Track global token use, so we can properly flag
17648         the use of #define/#undef after the first token has been seen.
17649
17650         Also, rename the reportXXXX to Error_DescriptiveName
17651
17652         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17653         TypeContainer, so that Enum and Interface can use this too.
17654
17655         * class.cs (TypeContainer.LookupInterfaceOrClass,
17656         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17657         `builder' argument.  Typically this was used to pass the parent
17658         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17659         the definition).  
17660
17661         The problem is that a nested class could trigger the definition of
17662         a toplevel class, and the builder would be obviously wrong in that
17663         case. 
17664
17665         So we drop this argument, and we compute dynamically the
17666         TypeBuilder/ModuleBuilder (the correct information was available
17667         to us anyways from DeclSpace.Parent)
17668
17669         * interface.cs (Interface.DefineInterface): Drop builder
17670         parameter cleanup like class.cs
17671
17672         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17673         like class.cs
17674
17675         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17676         values. 
17677
17678         (Try.Emit): Propagate the returns value from the statement.
17679
17680         (Return.Emit): Even if we are leavning 
17681
17682         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17683
17684         * modifiers.cs: Fix the computation of MethodAttributes flags.
17685
17686 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17687
17688         * driver.cs: allow compilation of files that start with '/'.
17689         Add a default case when checking the argument of --target.
17690
17691 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * interface.cs: Implement the same search algorithm for types in
17694         the interface code.
17695
17696         * delegate.cs: Do not allow multiple definition.
17697
17698         * Recovered ChangeLog that got accidentally amputated
17699
17700         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17701
17702         * rootcontext.cs: Load manually enum to allow core classes to
17703         contain enumerations.
17704
17705         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17706         Update to new static methods in TypeManager.
17707
17708         * typemanager.cs (GetMethod, GetConstructor): Use our
17709         implementation of FindMembers to find the members, since during
17710         corlib compilation, the types are TypeBuilders and GetMethod and
17711         GetConstructor do not work.
17712
17713         Make all methods in TypeManager static.
17714
17715         (InitCodeHelpers): Split the functionality from
17716         the InitCodeTypes function.
17717
17718         * driver.cs: Call InitCodeHelpers after we have populated the
17719         types. 
17720
17721         * cs-parser.jay (delegate_declaration): we did not used to compute
17722         the delegate name correctly for void delegates.
17723
17724 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * rootcontext.cs (RootContext): Init the interface_resolve_order
17727         and type_container_resolve_order always.
17728
17729         (ResolveCore, BootstrapCorlib_ResolveClass,
17730         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17731         compiler when compiling with --nostdlib
17732
17733         * class.cs (TypeContainer.DefineType): Check that our parent is
17734         not null.  This test is most important when we are bootstraping
17735         the core types.
17736
17737         * codegen.cs: Split out the symbol writing code.
17738
17739 2002-03-25  Martin Baulig  <martin@gnome.org>
17740
17741         * driver.cs (-g): Made -g an alias for --debug.
17742
17743 2002-03-24  Martin Baulig  <martin@gnome.org>
17744
17745         * codegen.cs (SymbolWriter): New public variable. Returns the
17746         current symbol writer.
17747         (CodeGen): Added `bool want_debugging_support' argument to the
17748          constructor. If true, tell the ModuleBuild that we want debugging
17749         support and ask it for the ISymbolWriter.
17750         (Save): If we have a symbol writer, call it's Close() method after
17751         saving the assembly.
17752
17753         * driver.c (--debug): New command line argument to create a
17754         debugger information file.
17755
17756         * location.cs (SymbolDocument): New public property. Returns an
17757         ISymbolDocumentWriter object for the current source file or null
17758         if we don't have a symbol writer.
17759
17760 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17761
17762         * driver.cs (LoadAssembly): Correctly return when all the paths
17763         have been tried and not before.
17764
17765         * statement.cs (Switch.Emit): return the actual coverage for this
17766         statement (returns/not-returns)
17767
17768         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17769         switch of the statement if we are the last switch section.  That
17770         kills two problems: try/catch problems (we used to emit an empty
17771         nop at the end) and switch statements where all branches would
17772         return. 
17773
17774 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17775
17776         * driver.cs: Add default assemblies (the equivalent to the
17777         Microsoft CSC.RSP file)
17778
17779         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17780         also update tokens_seen and set it to false.
17781
17782         * driver.cs: Implement --recurse for Mike.
17783
17784         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17785         correctly splitting out the paths.
17786
17787 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17788
17789         * interface.cs (Interface.PopulateProperty): Instead of using
17790         `parent' as the declaration space for the set parameters, use
17791         `this' 
17792
17793         * support.cs (InternalParameters): InternalParameters constructor
17794         takes a DeclSpace instead of a TypeContainer.
17795
17796         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17797         types are being initialized, load the address of it before calling
17798         the function.  
17799
17800         (New): Provide a mechanism to disable the generation of local
17801         value type temporaries when the caller will be providing us with
17802         an address to store it.
17803
17804         (ArrayCreation.EmitDynamicInitializers): Use it.
17805
17806 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * expression.cs (Invocation.EmitArguments): Only probe for array
17809         property if there is more than one argument.  Sorry about that.
17810
17811         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17812         empty param arrays.
17813
17814         * class.cs (Method.LabelParameters): Fix incorrect code path that
17815         prevented the `ParamArrayAttribute' from being applied to the
17816         params attribute.
17817
17818 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17819
17820         * support.cs (ReflectionParameters): Correctly compute whether the
17821         last argument is a params array.  Fixes the problem with
17822         string.Split ('a')
17823
17824         * typemanager.cs: Make the assemblies array always be non-null
17825         (empty, but non-null)
17826
17827         * tree.cs (RecordDecl): New function that abstracts the recording
17828         of names.  This reports error 101, and provides a pointer to the
17829         previous declaration.  Fixes a crash in the compiler.
17830
17831         * cs-parser.jay (constructor_declaration): Update to new grammar,
17832         and provide a constructor_body that can be empty.
17833
17834 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * driver.cs: Add support for --resources.
17837
17838         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17839         Make all types for the various array helper methods be integer.
17840
17841         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17842         CheckState to ConvCast.
17843
17844         (ConvCast): Now it takes a `checked' state argument, to avoid
17845         depending on the emit context for the conversion, and just using
17846         the resolve time setting.
17847
17848         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17849         instead of Invocation.EmitArguments.  We do not emit the original
17850         arguments, instead we emit those which have been converted to
17851         unsigned int expressions.
17852
17853         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17854
17855         * codegen.cs: ditto.
17856
17857         * expression.cs (LocalVariableReference): Drop the use of the
17858         Store function that depended on the variable index.
17859
17860         * statement.cs (VariableInfo): Drop the `Idx' property from this
17861         class, as this is not taking into account the indexes for
17862         temporaries tat we generate during the execution, getting the
17863         indexes wrong.
17864
17865         * class.cs: First emit class initializers, then call the parent
17866         constructor. 
17867
17868         * expression.cs (Binary): Fix opcode emision.
17869         (UnaryMutator.EmitCode): Support checked code generation
17870
17871         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17872         matches for events for both the Static and Instance scans,
17873         pointing to the same element.   Fix that.
17874
17875 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17876
17877         * rootcontext.cs (ResolveTree): Always set the
17878         interface_resolve_order, because nested interfaces will be calling
17879         into us.
17880
17881         * class.cs (GetInterfaceOrClass): Track the same resolution
17882         process used by TypeManager.LookupType.  This fixes the nested
17883         type lookups in class declarations (separate path from
17884         LookupType). 
17885
17886         (TypeContainer.DefineType): Also define nested interfaces.
17887         (TypeContainer.RegisterOrder): New public function used to
17888         register the order in which child interfaces need to be closed.
17889
17890         Nested interfaces need to be closed after their parents have been
17891         created. 
17892
17893         * interface.cs (InterfaceAttr): Put all the logic for computing
17894         the interface attribute here. 
17895
17896         (DefineInterface): Register our interface order with the
17897         RootContext or with the TypeContainer depending on the case.
17898
17899 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17900
17901         * cs-parser.jay: rework foreach statement to work with the new
17902         changes to the policy on SimpleNames.
17903
17904         * report.cs: support Stacktrace on warnings as well.
17905
17906         * makefile: drop --unsafe and /unsafe from the compile.
17907
17908 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17909
17910         * ecore.cs (StandardConversionExists): Modify to take an Expression
17911         as the first parameter. Ensure we do null -> reference type conversion
17912         checking.
17913
17914         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17915         temporary Expression objects.
17916
17917 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17918
17919         * interface.cs: workaround bug in method overloading resolution
17920         (there is already a bugzilla bug for it).
17921
17922 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17923
17924         We could also solve this problem by having a separate path for
17925         performing type lookups, instead of DoResolve, we could have a
17926         ResolveType entry point, and only participating pieces of the
17927         production (simplename, deref, array) would implement this. 
17928
17929         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17930         signal SimpleName to only resolve type names and not attempt to
17931         resolve anything else.
17932
17933         * expression.cs (Cast): Set the flag.
17934
17935         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17936
17937         * class.cs: Only report 108 if there is no `new' modifier.
17938
17939         * cs-parser.jay: rework foreach statement to work with the new
17940         changes to the policy on SimpleNames.
17941         
17942         * report.cs: support Stacktrace on warnings as well.
17943
17944         * makefile: drop --unsafe and /unsafe from the compile.
17945
17946 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17949         lookups here, instead of doing that at parse time.  This means
17950         that our grammar will not introduce `LocalVariableReferences' as
17951         expressions at this point.  That solves the problem of code like
17952         this:
17953
17954         class X {
17955            static void Main ()
17956            { int X = 1;
17957             { X x = null }}}
17958
17959         This is only half the fix.  The full fix requires parameters to
17960         also be handled in this way.
17961
17962         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17963         makes the use more obvious of the DeclSpace.  The
17964         ec.TypeContainer.TypeBuilder is now only used to pull the
17965         TypeBuilder for it.
17966
17967         My theory is that I can get rid of the TypeBuilder completely from
17968         the EmitContext, and have typecasts where it is used (from
17969         DeclSpace to where it matters).  
17970
17971         The only pending problem is that the code that implements Aliases
17972         is on TypeContainer, and probably should go in DeclSpace.
17973
17974         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17975         lookups here, instead of doing that at parse time.  This means
17976         that our grammar will not introduce `LocalVariableReferences' as
17977         expressions at this point.  That solves the problem of code like
17978         this:
17979
17980         class X {
17981            static void Main ()
17982            { int X = 1;
17983             { X x = null }}}
17984
17985         This is only half the fix.  The full fix requires parameters to
17986         also be handled in this way.
17987
17988         * class.cs (Property.DefineMethod): When implementing an interface
17989         method, set newslot, when implementing an abstract method, do not
17990         set the flag (before we tried never setting it, or always setting
17991         it, which is the difference).
17992         (Indexer.DefineMethod): same.
17993         (Method.DefineMethod): same.
17994
17995         * ecore.cs: Only set the status used flag if we get back a Field.
17996
17997         * attribute.cs: Temporary hack, so Paolo can keep working.
17998
17999 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18000
18001         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18002         the unmanaged type in the case we have a MarshalAs attribute.
18003
18004         (Resolve): Handle the case when we are parsing the special MarshalAs
18005         attribute [we need to store the unmanaged type to use later]
18006
18007         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18008         MarshalAs Attribute.
18009
18010         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18011         on parameters and accordingly set the marshalling info.
18012
18013 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * class.cs: Optimizing slightly by removing redundant code after
18016         we switched to the `NoTypes' return value.
18017         (Property.DefineMethod): use NoTypes here too.
18018
18019         This fixes the bug I introduced in my last batch of changes.
18020
18021 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18022
18023         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18024
18025         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18026         Enums since those are types too. 
18027
18028         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18029
18030         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18031         thanks to a call during the lookup process.
18032
18033 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18034
18035         * statement.cs (Foreach): Lots of work to accomodate a particular
18036         kind of foreach statement that I had not kept in mind.  It is
18037         possible to have foreachs on classes that provide a GetEnumerator
18038         method that return objects that implement the "pattern" for using
18039         a foreach, there is no need to support GetEnumerator
18040         specifically. 
18041
18042         This is needed to compile nant.
18043
18044         * decl.cs: Only report 114 if the member is not `Finalize' and if
18045         the warning level is at least 2.
18046
18047         * class.cs: Moved the compare function from Method to
18048         MethodSignature. 
18049
18050         (MethodSignature.InheritableMemberSignatureCompare): Add new
18051         filter function that is used to extract inheritable methods from a
18052         class. 
18053
18054         (Method.Define): Use the new `inheritable_method_signature_filter'
18055         delegate
18056
18057         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18058         command. 
18059
18060 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18061
18062         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18063
18064         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18065
18066         * expression.cs: Pass location information to
18067         ConvertImplicitStandard. 
18068
18069         * class.cs: Added debugging code to track return values from
18070         interfaces. 
18071
18072 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18073
18074         * expression.cs (Is.DoResolve): If either side of the `is' is an
18075         interface, do not flag the warning.
18076
18077         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18078         for interfaces
18079
18080         * report.cs: Allow for --fatal to be used with --probe.
18081
18082         * typemanager.cs (NoTypes): Move the definition for the empty Type
18083         array here. 
18084
18085         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18086         properties. 
18087         (TypeContainer.DefineProxy): New function used to proxy to parent
18088         implementations when implementing interfaces.
18089         (TypeContainer.ParentImplements): used to lookup if our parent
18090         implements a public function that is required by an interface.
18091         (TypeContainer.VerifyPendingMethods): Hook this up.
18092
18093         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18094         `modules' and `assemblies' arraylists into arrays.  We only grow
18095         these are the very early start up of the program, so this improves
18096         the speedof LookupType (nicely measured).
18097
18098         * expression.cs (MakeByteBlob): Replaced unsafe code with
18099         BitConverter, as suggested by Paolo.
18100
18101         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18102         folding of string concatenation, but if either side is a string,
18103         and the other is not, then return null, and let the runtime use
18104         the concatenation on the string plus the object (using
18105         `Object.ToString'). 
18106
18107 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18108
18109         Constant Folding has been implemented now.
18110
18111         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18112         the error instead on types that are not supported in one's
18113         complement. 
18114
18115         * constant.cs (Constant and all children): New set of functions to
18116         perform implict and explicit conversions.
18117
18118         * ecore.cs (EnumConstant): Implement the new functions to perform
18119         conversion by proxying to the child expression.
18120
18121         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18122         own separate setting that can not be turned off from the command
18123         line using --unchecked or --checked and is only controlled using
18124         the checked/unchecked statements and expressions.  This setting is
18125         used by the constant folder to flag errors.
18126
18127         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18128         ConstantCheckState as well.   
18129
18130         During Resolve, they also have to flag the state, because the
18131         constant folder runs completely in the Resolve phase.
18132
18133         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18134         well.
18135
18136 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * cfold.cs: New file, this file contains the constant folder.
18139
18140         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18141         argument to track whether we are using the resulting address to
18142         load or store a value and provide better error messages. 
18143
18144         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18145         new AddressOf arguments.
18146
18147         * statement.cs (Foreach.EmitCollectionForeach): Update
18148
18149         * expression.cs (Argument.Emit): Call AddressOf with proper
18150         arguments to track usage.
18151
18152         (New.DoEmit): Call AddressOf with new arguments.
18153
18154         (Unary.Emit): Adjust AddressOf call.
18155
18156 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18157
18158         * cs-parser.jay (member_access): Change the case for pre-defined types
18159         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18160         this suggestion.
18161
18162         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18163         a method body.
18164
18165         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18166         essentially like methods and apply attributes like MethodImplOptions to them too.
18167
18168         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18169         not being null.
18170
18171         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18172         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18173         is the DeclSpace.
18174
18175         * Update code everywhere accordingly.
18176
18177         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18178
18179         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18180
18181 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18182
18183         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18184         try performing lookups against those instead of jumping straight into using
18185         the 'using' clauses.
18186
18187         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18188
18189         (LookupType): Perform lookups in implicit parents too.
18190
18191         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18192         sequence as RootContext.LookupType. 
18193
18194         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18195         the various cases of namespace lookups into this method.
18196
18197 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18200         in positional arguments)
18201
18202         * class.cs (Operator): Update the AllowedModifiers to contain
18203         extern. 
18204
18205         * cs-parser.jay: Update operator declaration to allow for the
18206         operator body to be empty.
18207
18208         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18209         values. 
18210
18211 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18212
18213         * class.cs (Method.Emit): Label parameters.
18214
18215         * driver.cs: Return 1 or 0 as the program exit code.
18216
18217 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * expression.cs: Special case the `null' object when trying to
18220         auto-compute the type, as anything can be explicitly converted to
18221         that. 
18222
18223         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18224         spotting this Paolo.
18225
18226         (Expression.ImplicitNumericConversion): Perform comparissions of
18227         the type using the underlying type in the case of an enumeration
18228         rather than using the enumeration type for the compare.
18229
18230         Cope with the underlying == type case, which is not possible to
18231         catch before. 
18232
18233         (Expression.ConvertNumericExplicit): Perform comparissions of
18234         the type using the underlying type in the case of an enumeration
18235         rather than using the enumeration type for the compare.
18236
18237         * driver.cs: If the user does not supply an extension, assume .exe
18238
18239         * cs-parser.jay (if_statement): Rewrote so that we can track the
18240         location for the if statement.
18241
18242         * expression.cs (Binary.ConstantFold): Only concat strings when
18243         the operation is "+", not everything ;-)
18244
18245         * statement.cs (Statement.EmitBoolExpression): Take a location
18246         argument. 
18247         (If, While, Do): Track location.
18248
18249         * expression.cs (Binary.ResolveOperator): In the object + string
18250         case, I was missing a call to ConvertImplicit
18251
18252 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18253
18254         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18255         Location arguments. Ensure we use RootContext.LookupType to do our work
18256         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18257
18258         * interface.cs (PopulateMethod): Handle the type of the parameter being
18259         null gracefully.
18260
18261         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18262         have a params method with no fixed arguments and a call is made with no
18263         arguments.
18264
18265 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18268         the verbatim-string-literal
18269
18270         * support.cs (InternalParameters.ParameterModifier): handle null
18271         fixed parameters.
18272         (InternalParameters.ParameterType): ditto.
18273
18274         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18275         duplicating the name of the variable parameter.
18276         (GetParameterByName): Fix bug where we were not looking up array
18277         paramters if they were the only present (thanks Paolo!).
18278         (GetParameterInfo): We only have an empty set of types if both
18279         fixed and array are set to null.
18280         (GetParameterInfo-idx): Handle FixedParameter == null
18281
18282         * cs-parser.jay: Handle the case where there is no catch
18283         statements (missing null test).
18284
18285 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * driver.cs (MainDriver): Be conservative on our command line
18288         handling.
18289
18290         Catch DirectoryNotFoundException when calling GetFiles.
18291
18292         (SplitPathAndPattern): Used to split the input specification into
18293         a path and a pattern that we can feed to Directory.GetFiles.
18294
18295 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18296
18297         * statement.cs (Fixed): Implement the last case of the Fixed
18298         statement (string handling).
18299
18300         * expression.cs (StringPtr): New class used to return a char * to
18301         a string;  Used by the Fixed statement.
18302
18303         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18304
18305         * expression.cs (Binary.ResolveOperator): Remove redundant
18306         MemberLookup pn parent type.
18307         Optimize union call, we do not need a union if the types are the same.
18308         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18309         type.
18310
18311         Specialize the use of MemberLookup everywhere, instead of using
18312         the default settings. 
18313
18314         (StackAlloc): Implement stackalloc keyword.
18315
18316         * cs-parser.jay: Add rule to parse stackalloc.
18317
18318         * driver.cs: Handle /h, /help, /?
18319
18320         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18321         before we supported unsafe code.
18322
18323         * makefile: add --unsafe to the self compilation of mcs.
18324
18325 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18326
18327         * expression.cs (PointerArithmetic): New class that is used to
18328         perform pointer arithmetic.
18329         (Binary.Resolve): Handle pointer arithmetic
18330         Handle pointer comparission.
18331         (ArrayPtr): Utility expression class that is used to take the
18332         address of an array.
18333
18334         (ElementAccess): Implement array access for pointers
18335
18336         * statement.cs (Fixed): Implement fixed statement for arrays, we
18337         are missing one more case before we are done.
18338
18339         * expression.cs (Indirection): Implement EmitAssign and set the
18340         ExprClass to Variable.  This allows pointer dereferences to be
18341         treated as variables, and to have values assigned to them.
18342
18343         * ecore.cs (Expression.StoreFromPtr): New utility function to
18344         store values dereferencing.
18345
18346 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18347
18348         * expression.cs (Binary.ResolveOperator): Ensure that we are
18349         not trying to operate on a void type - this fixes the reported
18350         bug.
18351
18352         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18353         the parent implementation is sealed.
18354
18355         * ../errors/cs0239.cs : Add.
18356
18357         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18358
18359         * typemanager.cs (unverifiable_code_type): Corresponds to 
18360         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18361         which have unsafe code in them.
18362
18363         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18364         unsafe context.
18365
18366 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18367
18368         * cs-tokenizer.cs: Add support for @"litreal strings"
18369
18370         Make tokenizer accept pre-processor directives
18371         on any column (remove the old C-like limitation). 
18372
18373         * rootcontext.cs (EmitCode): Emit any global attributes.
18374         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18375
18376         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18377
18378         * cs-parser.jay: Add support for global attributes.  
18379
18380 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18381
18382         * expression.cs (Indirection): New helper class.  Unary will
18383         create Indirection classes to be able to implement the
18384         IMemoryLocation interface on it.
18385
18386 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18387
18388         * cs-parser.jay (fixed_statement): reference the right statement.
18389
18390         * statement.cs (Fixed.Emit): Finish implementing the fixed
18391         statement for the &x case.
18392
18393 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18394
18395         * class.cs (Property.Define, Method.Define): Remove newslot when
18396         `implementing'.  
18397
18398         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18399         wrong.  NewSlot should only be used if the `new' keyword is present.
18400
18401         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18402         locating our system dir.  Sorry about this.
18403
18404 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * driver.cs (GetSystemDir): Compute correctly the location of our
18407         system assemblies.  I was using the compiler directory instead of
18408         the library directory.
18409
18410 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18411
18412         * expression.cs (BetterFunction): Put back in what Miguel commented out
18413         since it is the correct fix. The problem is elsewhere ;-)
18414
18415         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18416         parameters of the parms method are themselves compatible or not !
18417
18418         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18419         to check that a class implements an interface before saying that an implicit
18420         conversion was allowed. Use ImplementsInterface to do the checking.
18421
18422 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18423
18424         * class.cs (Method.Define): Track whether we are an explicit
18425         implementation or not.  And only call DefineMethodOverride if we
18426         are an explicit implementation.
18427
18428         (Property.DefineMethod): Ditto.
18429
18430 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18431
18432         * expression.cs (BetterFunction): Catch hideous bug which was
18433          preventing us from detecting ambiguous calls due to implicit casts i.e
18434         cs0121.
18435
18436 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * support.cs (Pair): Remove un-needed method.  I figured why I was
18439         getting the error in cs-parser.jay, the variable in a foreach loop
18440         is readonly, and the compiler does not really treat this as a variable.
18441
18442         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18443         instead of EQUALS in grammar.  
18444
18445         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18446
18447         * expression.cs (Unary.DoResolve): Check whether the argument is
18448         managed or not.
18449
18450 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * support.cs: Api for Pair to set a value.  Despite the fact that
18453         the variables are public the MS C# compiler refuses to compile
18454         code that accesses the field if the variable is part of a foreach
18455         statement. 
18456
18457         * statement.cs (Fixed): Begin implementation of the fixed
18458         statement.
18459
18460         (Block.AddVariable): Return the VariableInfo on success and null
18461         on failure instead of true/false. 
18462
18463         * cs-parser.jay (foreach): Catch errors on variables already
18464         defined (we were ignoring this value before) and properly unwind
18465         the block hierarchy
18466
18467         (fixed_statement): grammar for the fixed statement.
18468
18469 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18470
18471         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18472         pointer types to be incretemented.
18473
18474         (SizeOf): Implement.
18475
18476         * cs-parser.jay (pointer_member_access): Implement
18477         expr->IDENTIFIER production.
18478
18479         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18480         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18481         on safe contexts.
18482
18483         (Unary): Implement indirection.
18484
18485         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18486         use in non-unsafe context).
18487
18488         (SimpleName.DoResolve): Check for pointers in field access on safe
18489         contexts. 
18490
18491         (Expression.LoadFromPtr): Factor the load-indirect code in this
18492         function.  This was duplicated in UnboxCast and ParameterReference
18493
18494 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18495
18496         * expression.cs (ComposedCast): report an error if a pointer cast
18497         is used in a safe region.
18498
18499         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18500         pointer type casts in unsafe context.
18501
18502         * codegen.cs (EmitContext): Set up IsUnsafe.
18503
18504         * cs-parser.jay (non_expression_type): Add productions for pointer
18505         casts. 
18506
18507         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18508         code.  We should not use force into static mode if the method is
18509         not virtual.  Fixes bug in MIS
18510
18511         * statement.cs (Do.Emit, While.Emit, For.Emit,
18512         Statement.EmitBoolExpression): Add support to Do and While to
18513         propagate infinite loop as `I do return' semantics.
18514
18515         Improve the For case to also test for boolean constants.
18516
18517         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18518         to the list of attributes we can add.
18519
18520         Remove `EmitContext' argument.
18521
18522         * class.cs (Method.Define): Apply parameter attributes.
18523         (Constructor.Define): Apply parameter attributes.
18524         (MethodCore.LabelParameters): Move here the core of labeling
18525         parameters. 
18526
18527         * support.cs (ReflectionParameters.ParameterModifier,
18528         InternalParameters.ParameterModifier): Use IsByRef on the type and
18529         only return the OUT bit for these parameters instead of in/out/ref
18530         flags.
18531
18532         This is because I miss-understood things.  The ParameterInfo.IsIn
18533         and IsOut represent whether the parameter has the [In] and [Out]
18534         attributes set.  
18535
18536 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * ecore.cs (FieldExpr.Emit): Release temporaries.
18539
18540         * assign.cs (LocalTemporary.Release): new function.
18541
18542         * codegen.cs (EmitContext.GetTemporaryStorage,
18543         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18544         temporary storage.  Now we can "put back" localbuilders when we
18545         are done with them
18546
18547 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18550         need to make a copy of the variable to generate verifiable code.
18551
18552 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * driver.cs: Compute dynamically the system directory.
18555
18556         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18557         Slower, but more generally useful.  Used by the abstract
18558         registering implementation. 
18559
18560         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18561         the rules for the special rule on Type/instances.  First check if
18562         we have the same name, and if so, try that special static path
18563         rather than the instance path.
18564
18565 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18568         for, while and if.
18569
18570         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18571         Enum, ValueType, Delegate or Array for non-corlib compiles.
18572
18573         * cs-tokenizer.cs: Catch long identifiers (645)
18574
18575         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18576         piece of code.
18577
18578         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18579         fix, we were returning too early, so we were not registering
18580         pending methods from abstract classes.
18581
18582         Do not register pending methods if the class is abstract.
18583
18584         * expression.cs (Conditional.DoResolve): Report circular implicit
18585         conversions when we neecd to compute it for conditional
18586         expressions. 
18587
18588         (Is.DoResolve): If the expression is always of the provided type,
18589         flag warning 183.  If the expression can not ever be of the
18590         provided type flag warning 184.
18591
18592         * class.cs: Catch 169 as well.
18593
18594         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18595         read. 
18596
18597 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18598
18599         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18600
18601 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * interface.cs: (PopulateMethod): Check for pointers being defined
18604         only if the unsafe context is active.
18605         (PopulateProperty): ditto.
18606         (PopulateIndexer): ditto.
18607
18608         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18609         specified.  If pointers are present, make sure that they are
18610         present in an unsafe context.
18611         (Constructor, Constructor.Define): ditto.
18612         (Field, Field.Define): ditto.
18613         (Property, Property.Define): ditto.
18614         (Event, Event.Define): ditto.
18615
18616         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18617         hashtable if there are classes or structs defined.
18618
18619         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18620         code, as the constant resolution moved.
18621
18622         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18623         the metadata, so we can flag error 133. 
18624
18625         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18626         pointer is being declared in an unsafe context.
18627
18628 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * modifiers.cs (Modifiers.Check): Require a Location argument.
18631         Report error 227 for Unsafe use.
18632
18633         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18634
18635         * statement.cs (For.Emit): If the test is null, then report that
18636         we do `return', as we wont reach anything afterwards.
18637
18638         (Switch.SwitchGoverningType): Track the expression that matched
18639         the conversion.
18640
18641         * driver.cs: Allow negative numbers as an error code to flag.
18642
18643         * cs-parser.jay: Handle 1551.
18644
18645         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18646
18647 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18648
18649         * cs-parser.jay: Report 1518 (type declaration can only contain
18650         class, struct, interface, enum or delegate)
18651
18652         (switch_label): Report 1523 (keywords `case' or `default' must
18653         preced code)
18654
18655         (opt_switch_sections): Report 1522 (empty switch)
18656
18657         * driver.cs: Report 1515 (response file specified multiple times)
18658         Report 1516 (Source file specified multiple times).
18659
18660         * expression.cs (Argument.Resolve): Signal 1510
18661
18662         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18663         access not allowed in static code)
18664
18665 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18666
18667         * typemanager.cs (IsPointerType): Utility method which we are going
18668         to need a lot.
18669
18670         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18671         the object type, so we take care of that.
18672
18673         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18674
18675         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18676         added to non-params parameters :-)
18677
18678         * typemanager.cs (CSharpName): Include 'void' type too. 
18679
18680         (void_ptr_type): Include in the set of core types.
18681
18682         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18683         duplicating code.
18684
18685         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18686         an unsafe context.
18687
18688         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18689         completely forgotten about it.
18690
18691 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18692
18693         * cs-parser.jay (pointer_type): Add. This begins our implementation
18694         of parsing rules for unsafe code.
18695
18696         (unsafe_statement): Implement.
18697
18698         (embedded_statement): Modify to include the above.
18699
18700         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18701
18702         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18703         if the current context is an unsafe one.
18704
18705         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18706         are handled differently, we need separate rules for them.
18707
18708         (local_variable_declaration): Update to use local_variable_pointer_type
18709         to allow variable declarations of unmanaged pointer types.
18710
18711         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18712         in unsafe contexts.
18713
18714         * ../errors/cs0214.cs : Add.
18715
18716 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18717
18718         * makefile: remove 'response' file when cleaning.
18719
18720 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18721
18722         * cs-parser.jay: Report 1524.
18723
18724 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * typemanager.cs (RegisterMethod): drop checking if we have
18727         registered this from here
18728
18729 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * class.cs (Method.EmitDestructor): Implement calling our base
18732         destructor. 
18733
18734         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18735         value of InFinally.
18736
18737         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18738         this routine and will wrap the call in a try/catch block.  Deal
18739         with the case.
18740
18741 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18742
18743         * ecore.cs (Expression.MemberLookup): instead of taking a
18744         parameter `same_type' that was used to tell whether we could
18745         access private members we compute our containing type from the
18746         EmitContext.
18747
18748         (FieldExpr): Added partial support for volatile fields.  This does
18749         not work for volatile fields exposed from assemblies, as I can not
18750         figure out how to extract the modreq from it.
18751
18752         Updated all the source files to use this.
18753
18754         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18755         because it is referenced by MemberLookup very often. 
18756
18757 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18758
18759         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18760         TypeBuilder.GetCustomAttributes to retrieve what we need.
18761
18762         Get rid of redundant default_member_attr_type as this is the same as
18763         default_member_type which already exists.
18764
18765         * interface.cs, attribute.cs : Update accordingly.
18766
18767 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18768
18769         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18770         work for TYpeBuilders though.  Ravi, can you please fix this?
18771
18772         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18773
18774         * expression.cs (Argument.Emit): Handle the case of ref objects
18775         being passed to ref functions;  
18776
18777         (ParameterReference.EmitLoad): Loads the content of the pointer
18778         without dereferencing.
18779
18780 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18781
18782         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18783
18784 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18785
18786         * class.cs (Indexer.DefineMethod): Incorporate the interface
18787         type in the name of the method if we are doing explicit interface
18788         implementation.
18789
18790         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18791
18792         (BetterConversion): Fix extremely trivial bug where we were referring to
18793         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18794         again !
18795
18796         * ../errors/bug16.cs : Add although we have fixed it.
18797
18798 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18799
18800         * expression.cs (BaseIndexer): Begin implementation.
18801
18802         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18803
18804         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18805         production directly to remove a shift/reduce, and implement
18806         explicit interface implementation.
18807
18808         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18809         after a floating point suffix.
18810
18811         * expression.cs (DoNumericPromotions): Improved the conversion for
18812         uint/uint.  If we have a constant, we avoid doing a typecast to a
18813         larger type.
18814
18815         * class.cs (Indexer): Implement explicit interface implementation
18816         for indexers.
18817
18818 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18819
18820         * class.cs: make the default instance constructor public and hidebysig.
18821
18822 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18823
18824         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18825         so we can call it from elsewhere.
18826
18827         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18828         we emit it internally if the class has a defined indexer; otherwise the user
18829         emits it by decorating the class definition with the DefaultMemberAttribute.
18830
18831         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18832         attribute is not used on a type which defines an indexer.
18833
18834         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18835         character when we skip whitespace.
18836
18837         * ../errors/cs0646.cs : Add.
18838
18839 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18842         again. 
18843
18844         * makefile: Add practical target `mcs3.exe' which builds the third
18845         generation compiler. 
18846
18847         * expression.cs (New): Fix structures constructor calling.
18848
18849         * class.cs (Property, Method, Indexer): Emit Final flag on the
18850         method if we are an interface implementation and we are not
18851         abstract. 
18852
18853         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18854         whether this property is referencing a `base' method.
18855
18856         * expression.cs (Invocation.EmitCall): take an extra argument:
18857         is_base, this is used to determine whether the `call' or
18858         `callvirt' opcode should be used.
18859
18860
18861         * delegate.cs: update EmitCall.
18862
18863         * class.cs (Method.Define): Set NewSlot for the cases where we are
18864         not implementing an interface method.
18865
18866         (Property.Define): ditto.
18867
18868 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18871         'r'.  Allows mcs to parse itself fully.
18872
18873 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18874
18875         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18876         of the number of initializers that require the InitializeArray method.
18877
18878         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18879         update the above field where necessary.
18880
18881         (MakeByteBlob): Update accordingly.
18882
18883         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18884         greater than 2.
18885
18886         (EmitDynamicInitializers): Update in accordance with the new optimization.
18887
18888         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18889         same OpCode applies.
18890
18891         * cs-parser.jay : Fix some glaring errors I introduced.
18892
18893 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18894
18895         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18896         so that we can check for name clashes there too.
18897
18898         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18899         for interface indexers.
18900
18901         * interfaces.cs (Define): Emit the default member attribute.
18902
18903         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18904         variable was being referred to while setting the value ;-)
18905
18906 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18909         byte-by-byte information when we know the data is zero.
18910
18911         Make the block always a multiple of 4, because
18912         DefineInitializedData has a bug.
18913
18914         * assign.cs: Fix, we should assign from the temporary, not from
18915         the source. 
18916
18917         * expression.cs (MakeByteBlob): Fix my incorrect code.
18918
18919 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * typemanager.cs (EnumToUnderlying): This function is used to get
18922         the underlying type from an enumeration, because it does not
18923         always work. 
18924
18925         * constant.cs: Use the I4_S form for values between -128 and 127.
18926
18927         * statement.cs (Block.LookupLabel): Looks up a label.
18928         (Block): Drop support for labeled blocks.
18929
18930         (LabeledStatement): New kind of statement that represents a label
18931         only.
18932
18933         (Goto): Finally implement this bad boy.
18934
18935         * cs-parser.jay: Update to reflect new mechanism to implement
18936         labels.
18937
18938 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18939
18940         * codegen.cs (EmitContext.This): a codegen property that keeps the
18941         a single instance of this instead of creating many different this
18942         instances. 
18943
18944         * delegate.cs (Delegate.DoResolve): Update to use the property;
18945
18946         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18947
18948         * expression.cs (BaseAccess.DoResolve): Ditto.
18949
18950 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18951
18952         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18953         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18954
18955         (InitCoreTypes): Update accordingly.
18956
18957         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18958         so we can quickly store the state.
18959
18960         (ApplyAttributes): Set the correct implementation flags
18961         for InternalCall methods.
18962
18963 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18964
18965         * expression.cs (EmitCall): if a method is not virtual, then do
18966         not use callvirt on it.
18967
18968         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18969         user defined stuff) requires the use of stobj, which takes an
18970         address on the stack instead of an array and an index.  So emit
18971         the Ldelema operation for it.
18972
18973         (EmitStoreOpcode): Use stobj for valuetypes.
18974
18975         (UnaryMutator.EmitCode): Use the right 1 value depending on
18976         whether we are dealing with int64/uint64, float or doubles.
18977
18978         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18979         constructors that I implemented last night.
18980
18981         (Constructor.IsDefault): Fix to work properly for static
18982         constructors.
18983
18984         * cs-parser.jay (CheckDef): report method signature errors.
18985         Update error number 103 to be 132.
18986
18987         * decl.cs: New AdditionResult enumeration value: MethodExists.
18988         Although we do this check for methods later on in the semantic
18989         analysis, catching repeated default constructors is so easy that
18990         we catch these here. 
18991
18992         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18993         promotions code.
18994
18995         (ParameterReference.EmitAssign, Emit): handle
18996         bools as bytes.
18997
18998         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18999         (ArrayAccess.EmitStoreOpcode): ditto.
19000
19001         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19002
19003         * expression.cs (MakeByteBlob): Complete all the missing types
19004         (uint, short, ushort, byte, sbyte)
19005
19006         * class.cs: Only init instance field initializers on instance
19007         constructors. 
19008
19009         Rename `constructors' to instance_constructors. 
19010
19011         (TypeContainer.AddConstructor): Only add constructors to the list
19012         if it is not static.
19013
19014         Make sure that we handle default_static_constructor independently
19015         everywhere where we handle instance_constructors
19016
19017 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19018
19019         * class.cs: Do not lookup or create a base initializer for a
19020         static constructor.
19021
19022         (ConstructorInitializer.Resolve): use the proper type to lookup
19023         for constructors.
19024
19025         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19026
19027         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19028         in DeclSpace. 
19029
19030         * decl.cs: CloseType is now an virtual method, the default
19031         implementation just closes this type.
19032
19033 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19034
19035         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19036         to PreserveSig by default. Also emit HideBySig on such methods.
19037
19038         Basically, set the defaults to standard values.
19039
19040         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19041         argument, if candidate is better, it can't be worse than the best !
19042
19043         (Invocation): Re-write bits to differentiate between methods being
19044         applicable in their expanded form and their normal form - for params
19045         methods of course.
19046
19047         Get rid of use_standard everywhere as only standard conversions are allowed
19048         in overload resolution. 
19049
19050         More spec conformance.
19051
19052 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * driver.cs: Add --timestamp, to see where the compiler spends
19055         most of its time.
19056
19057         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19058         `this' in static code.
19059
19060         (SimpleName.DoResolve): Implement in terms of a helper function
19061         that allows static-references to be passed upstream to
19062         MemberAccess.
19063
19064         (Expression.ResolveWithSimpleName): Resolve specially simple
19065         names when called by MemberAccess to implement the special
19066         semantics. 
19067
19068         (Expression.ImplicitReferenceConversion): Handle conversions from
19069         Null to reference types before others, as Null's type is
19070         System.Object. 
19071
19072         * expression.cs (Invocation.EmitCall): Handle the special case of
19073         calling methods declared on a reference type from a ValueType
19074         (Base classes System.Object and System.Enum)
19075
19076         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19077         the left hand side is a TypeExpr, not on every enumeration. 
19078
19079         (Binary.Resolve): If types are reference types, then do a cast to
19080         object on operators != and == of both arguments.
19081
19082         * typemanager.cs (FindMembers): Extract instance and static
19083         members if requested.
19084
19085         * interface.cs (PopulateProperty): Use void_type instead of null
19086         as the return type for the setter method.
19087
19088         (PopulateIndexer): ditto.
19089
19090 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19091
19092         * support.cs (ReflectionParameters): Fix minor bug where we
19093         were examining the wrong parameter for the ParamArray attribute.
19094
19095         Cope with requests for the type of the parameter at position
19096         greater than the params parameter's. We now return the element
19097         type of the params array as that makes more sense.
19098
19099         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19100         accordingly as we no longer have to extract the element type
19101         ourselves.
19102
19103         (Invocation.OverloadResolve): Update.
19104
19105 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19106
19107         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19108         against IEnumerator, test whether the return value is a descendant
19109         of the IEnumerator interface.
19110
19111         * class.cs (Indexer.Define): Use an auxiliary method to implement
19112         the other bits of the method definition.  Begin support for
19113         explicit interface implementation.
19114
19115         (Property.DefineMethod): Use TypeManager.void_type instead of null
19116         for an empty return value.
19117
19118 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19121         dealing with a FieldExpr which is composed of a FieldBuilder, in
19122         the code path we did extract the constant, but we should have
19123         obtained the underlying value to be able to cast it (otherwise we
19124         end up in an infinite loop, this is what Ravi was running into).
19125
19126         (ArrayCreation.UpdateIndices): Arrays might be empty.
19127
19128         (MemberAccess.ResolveMemberAccess): Add support for section
19129         14.5.4.1 that deals with the special case of E.I when E is a type
19130         and something else, that I can be a reference to a static member.
19131
19132         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19133         handle a particular array type to create byte blobs, it is just
19134         something we dont generate byteblobs for.
19135
19136         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19137         arguments. 
19138
19139         * location.cs (Push): remove the key from the hashtable that we
19140         are about to add.   This happens for empty files.
19141
19142         * driver.cs: Dispose files after we have parsed them.
19143
19144         (tokenize): new function that only runs the tokenizer on its
19145         input, for speed testing.
19146
19147 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19148
19149         * class.cs (Event.Define): Define the private field only if there
19150         are no accessors defined.
19151
19152         * expression.cs (ResolveMemberAccess): If there is no associated
19153         field with the event, that means we have an event defined with its
19154         own accessors and we should flag error cs0070 since transforming
19155         ourselves into a field is not valid in that case.
19156
19157         * ecore.cs (SimpleName.DoResolve): Same as above.
19158
19159         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19160         and charset to sane values.
19161
19162 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19163
19164         * assign.cs (DoResolve): Perform check on events only if they 
19165         are being accessed outside the declaring type.
19166
19167         * cs-parser.jay (event_declarations): Update rules to correctly
19168         set the type of the implicit parameter etc.
19169
19170         (add_accessor, remove_accessor): Set current local parameters.
19171
19172         * expression.cs (Binary): For delegate addition and subtraction,
19173         cast the return value from the method into the appropriate delegate
19174         type.
19175
19176 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19177
19178         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19179         of these as the workaround is unnecessary.
19180
19181         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19182         delegate data - none of that is needed at all.
19183
19184         Re-write bits to extract the instance expression and the delegate method
19185         correctly.
19186
19187         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19188         on delegates too.
19189
19190         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19191         of attaching attributes instead of duplicating code everywhere.
19192
19193         * everywhere : Update code to do attribute emission using the above method.
19194
19195 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19196
19197         * expression.cs (IsParamsMethodApplicable): if there are not
19198         parameters, return immediately.
19199
19200         * ecore.cs: The 0 literal can be implicity converted to an enum
19201         type. 
19202
19203         (SimpleName.DoResolve): First lookup the type, then lookup the
19204         members. 
19205
19206         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19207         want to get its address.  If the InstanceExpression is not
19208         addressable, store the result in a temporary variable, then get
19209         the address of it.
19210
19211         * codegen.cs: Only display 219 errors on warning level or above. 
19212
19213         * expression.cs (ArrayAccess): Make it implement the
19214         IMemoryLocation interface.
19215
19216         (Binary.DoResolve): handle the operator == (object a, object b)
19217         and operator != (object a, object b) without incurring into a
19218         BoxedCast (because 5 != o should never be performed).
19219
19220         Handle binary enumerator operators.
19221
19222         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19223         value type, otherwise use Ldelem_ref.
19224
19225         Use precomputed names;
19226
19227         (AddressOf): Implement address of
19228
19229         * cs-parser.jay (labeled_statement): Fix recursive block
19230         addition by reworking the production.
19231
19232         * expression.cs (New.DoEmit): New has a special case:
19233                 
19234                  If we are dealing with a ValueType, we have a few
19235                  situations to deal with:
19236                 
19237                     * The target of New is a ValueType variable, that is
19238                       easy, we just pass this as the variable reference
19239                 
19240                     * The target of New is being passed as an argument,
19241                       to a boxing operation or a function that takes a
19242                       ValueType.
19243                 
19244                       In this case, we need to create a temporary variable
19245                       that is the argument of New.
19246
19247
19248 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19249
19250         * rootcontext.cs (LookupType): Check that current_type is not null before
19251         going about looking at nested types.
19252
19253         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19254         not implement the IAssignMethod interface any more.
19255
19256         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19257         where we tranform them into FieldExprs if they are being resolved from within
19258         the declaring type.
19259
19260         * ecore.cs (SimpleName.DoResolve): Do the same here.
19261
19262         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19263
19264         * ../errors/bug10.cs : Add.
19265
19266         * ../errors/cs0070.cs : Add.
19267
19268         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19269
19270         * assign.cs : Get rid of EventIsLocal everywhere.
19271
19272 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19273
19274         * ecore.cs (ConvertIntLiteral): finished the implementation.
19275
19276         * statement.cs (SwitchLabel): Convert the value we are using as a
19277         key before looking up the table.
19278
19279 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * codegen.cs (EmitTopBlock): Require a Location argument now.
19282
19283         * cs-parser.jay (constructor_declarator): We need to setup
19284         current_local_parameters before we parse the
19285         opt_constructor_initializer, to allow the variables to be bound
19286         to the constructor arguments.
19287
19288         * rootcontext.cs (LookupType): First lookup nested classes in our
19289         class and our parents before we go looking outside our class.
19290
19291         * expression.cs (ConstantFold): Extract/debox the values at the
19292         beginnning. 
19293
19294         * rootcontext.cs (EmitCode): Resolve the constants first before we
19295         resolve the types.  This is not really needed, but it helps debugging.
19296
19297         * statement.cs: report location.
19298
19299         * cs-parser.jay: pass location to throw statement.
19300
19301         * driver.cs: Small bug fix.
19302
19303         * report.cs: Updated format to be 4-zero filled digits.
19304
19305 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19306
19307         * expression.cs (CheckIndices): Fix minor bug where the wrong
19308         variable was being referred to ;-)
19309
19310         (DoEmit): Do not call EmitStaticInitializers when the 
19311         underlying type is System.Object.
19312
19313 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19314
19315         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19316         and do the usual workaround for SRE.
19317
19318         * class.cs (MyEventBuilder.EventType): New member to get at the type
19319         of the event, quickly.
19320
19321         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19322
19323         * assign.cs (Assign.DoResolve): Handle the case when the target
19324         is an EventExpr and perform the necessary checks.
19325
19326         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19327         interface.
19328
19329         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19330
19331         (EventExpr): Set the type in the constructor itself since we 
19332         are meant to be born fully resolved.
19333
19334         (EventExpr.Define): Revert code I wrote earlier.
19335                 
19336         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19337         instance expression is null. The instance expression is a This in that case
19338         or a null, depending on whether it is a static method or not.
19339
19340         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19341         refers to more than one method.
19342
19343         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19344         and accordingly flag errors.
19345
19346 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19349
19350 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * location.cs (ToString): Provide useful rutine.
19353
19354 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19355
19356         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19357         objects, return the actual integral boxed.
19358
19359         * statement.cs (SwitchLabel): define an ILLabel for each
19360         SwitchLabel. 
19361
19362         (Switch.CheckSwitch): If the value is a Literal, extract
19363         the underlying literal.
19364
19365         Also in the unused hashtable we had, add the SwitchLabel so we can
19366         quickly look this value up.
19367
19368         * constant.cs: Implement a bunch of new constants.  Rewrite
19369         Literal based on this.  Made changes everywhere to adapt to this.
19370
19371         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19372         dereferencing array only once, and also copes with enumrations.
19373
19374         bytes are two bytes wide, not one.
19375
19376         (Cast): Perform constant conversions.
19377
19378         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19379         wrappers to the literals here.
19380
19381         * expression.cs (DoNumericPromotions): long literals can converted
19382         to ulong implicity (this is taken care of elsewhere, but I was
19383         missing this spot).
19384
19385         * ecore.cs (Expression.Literalize): Make the return type Literal,
19386         to improve type checking.
19387
19388         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19389
19390 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * literal.cs: Revert code from ravi that checked the bounds.  The
19393         bounds are sane by the definition of the type itself. 
19394
19395         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19396         need to actually look up in our parent hierarchy for interfaces
19397         implemented. 
19398
19399         * const.cs: Use the underlying type for enumerations
19400
19401         * delegate.cs: Compute the basename for the delegate creation,
19402         that should fix the delegate test case, and restore the correct
19403         Type Lookup semantics in rootcontext
19404
19405         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19406         referencing a nested type with the Reflection API is using the "+"
19407         sign. 
19408
19409         * cs-parser.jay: Do not require EOF token at the end.
19410
19411 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19412
19413         * rootcontext.cs (LookupType): Concatenate type names with
19414         a '.' instead of a '+' The test suite passes again.
19415
19416         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19417         field of the enumeration.
19418
19419         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19420         the case when the member is an EventExpr.
19421
19422         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19423         static has an associated instance expression.
19424
19425         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19426
19427         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19428
19429         * class.cs (Event.Define): Register event and perform appropriate checks
19430         for error #111.
19431
19432         We define the Add and Remove methods even if the use provides none because
19433         in that case, we provide default implementations ourselves.
19434
19435         Define a private field of the type of the event. This is done by the CSC compiler
19436         and we should be doing it too ;-)
19437
19438         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19439         More methods we use in code we generate.
19440
19441         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19442         is important.
19443
19444         (InitCoreTypes): Update accordingly for the above.
19445
19446         * class.cs (Event.Emit): Generate code for default accessors that we provide
19447
19448         (EmitDefaultMethod): Do the job in the above.
19449
19450         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19451         appropriate place.
19452
19453 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19454
19455         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19456         builders even if we were missing one.
19457
19458         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19459         pass the Basename as our class name instead of the Name.  The
19460         basename will be correctly composed for us.
19461
19462         * parameter.cs (Paramters): Now takes a Location argument.
19463
19464         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19465         make all the code call directly LookupType in RootContext and take
19466         this chance to pass the Location information everywhere.
19467
19468         * Everywhere: pass Location information.
19469
19470 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19471
19472         * class.cs (Constructor.Define): Updated way of detecting the
19473         length of the parameters.
19474
19475         (TypeContainer.DefineType): Use basename as the type name for
19476         nested types.
19477
19478         (TypeContainer.Define): Do not recursively define types here, as
19479         definition is taken care in order by the RootContext.
19480
19481         * tree.cs: Keep track of namespaces in a per-file basis.
19482
19483         * parameter.cs (Parameter.ComputeSignature): Update to use
19484         DeclSpace. 
19485
19486         (Parameters.GetSignature): ditto.
19487
19488         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19489         instead of a TypeContainer.
19490
19491         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19492         resolve names.  Because we need to be resolve in our context, not
19493         our parents.
19494
19495         * driver.cs: Implement response files.
19496
19497         * class.cs (TypeContainer.DefineType): If we are defined, do not
19498         redefine ourselves.
19499
19500         (Event.Emit): Emit the code for add/remove handlers.
19501         (Event.Define): Save the MethodBuilders for add/remove.
19502
19503         * typemanager.cs: Use pair here too.
19504
19505         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19506         DictionaryEntry requires the first argument to be non-null.  
19507
19508         (enum_declaration): Compute full name for registering the
19509         enumeration.
19510
19511         (delegate_declaration): Instead of using
19512         formal_parameter_list, use opt_formal_parameter_list as the list
19513         can be empty.
19514
19515         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19516         (EventParsing): New property that controls whether `add' and
19517         `remove' are returned as tokens or identifiers (for events);
19518
19519 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19520
19521         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19522         use MyEventBuilder only and let it wrap the real builder for us.
19523
19524         (MyEventBuilder): Revamp constructor etc.
19525
19526         Implement all operations that we perform on EventBuilder in precisely the same
19527         way here too.
19528
19529         (FindMembers): Update to use the EventBuilder member.
19530
19531         (Event.Emit): Update accordingly.
19532
19533 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19534
19535         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19536         by calling the appropriate methods.
19537
19538         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19539         useful.
19540
19541         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19542
19543 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19544
19545         * delegate.cs (Delegate.Populate): Check that the return type
19546         and various parameters types are indeed accessible.
19547
19548         * class.cs (Constructor.Define): Same here.
19549
19550         (Field.Define): Ditto.
19551
19552         (Event.Define): Ditto.
19553
19554         (Operator.Define): Check that the underlying Method defined itself
19555         correctly - so it's MethodBuilder should not be null.
19556
19557         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19558         expression happens to be null.
19559
19560         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19561         members but as of now we don't seem to be able to do anything really useful with it.
19562
19563         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19564         not the EventBuilder.
19565
19566 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19567
19568         * cs-tokenizer.cs: Add support for defines.
19569         Add support for #if, #elif, #else, #endif
19570
19571         (eval_var): evaluates a variable.
19572         (eval): stubbed for evaluating functions.
19573
19574         * cs-parser.jay: Pass the defines information
19575
19576         * driver.cs: Add --define command line option.
19577
19578         * decl.cs: Move MemberCore here.
19579
19580         Make it the base class for DeclSpace.  This allows us to catch and
19581         report 108 and 109 for everything now.
19582
19583         * class.cs (TypeContainer.Define): Extract all the members
19584         before populating and emit the warning 108 (new keyword required
19585         to override) instead of having each member implement this.
19586
19587         (MemberCore.Define): New abstract method, we will be using this in
19588         the warning reporting engine in Populate.
19589
19590         (Operator.Define): Adjust to new MemberCore protocol. 
19591
19592         * const.cs (Const): This does not derive from Expression, it is a
19593         temporary object we use to create fields, it is a MemberCore. 
19594
19595         * class.cs (Method.Define): Allow the entry point to be in a
19596         specific class.
19597
19598         * driver.cs: Rewrite the argument handler to clean it up a bit.
19599
19600         * rootcontext.cs: Made it just an auxiliary namespace feature by
19601         making everything static.
19602
19603         * driver.cs: Adapt code to use RootContext type name instead of
19604         instance variable.
19605
19606         * delegate.cs: Remove RootContext argument.
19607
19608         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19609         argument. 
19610
19611         * class.cs (Event.Define): The lookup can fail.
19612
19613         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19614
19615         * expression.cs: Resolve the this instance before invoking the code.
19616
19617 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * cs-parser.jay: Add a production in element_access that allows
19620         the thing to become a "type" reference.  This way we can parse
19621         things like "(string [])" as a type.
19622
19623         Note that this still does not handle the more complex rules of
19624         casts. 
19625
19626
19627         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19628
19629         * ecore.cs: (CopyNewMethods): new utility function used to
19630         assemble the list of methods from running FindMembers.
19631
19632         (MemberLookup): Rework FindMembers so that 
19633
19634 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * class.cs (TypeContainer): Remove Delegates who fail to be
19637         defined.
19638
19639         * delegate.cs (Populate): Verify that we dont get null return
19640         values.   TODO: Check for AsAccessible.
19641
19642         * cs-parser.jay: Use basename to emit error 574 (destructor should
19643         have the same name as container class), not the full name.
19644
19645         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19646         possible representation.  
19647
19648         Also implements integer type suffixes U and L.
19649
19650 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * expression.cs (ArrayCreation.DoResolve): We need to do the
19653         argument resolution *always*.
19654
19655         * decl.cs: Make this hold the namespace.  Hold the root context as
19656         well.
19657         (LookupType): Move here.
19658
19659         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19660
19661         * location.cs (Row, Name): Fixed the code, it was always returning
19662         references to the first file.
19663
19664         * interface.cs: Register properties defined through interfaces.
19665
19666         * driver.cs: Add support for globbing on the command line
19667
19668         * class.cs (Field): Make it derive from MemberCore as well.
19669         (Event): ditto.
19670
19671 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19672
19673         * class.cs (Event::Define): Check that the type of the event is a delegate
19674         type else flag error #66.
19675
19676         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19677         same.
19678
19679         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19680         values of EntryPoint, CharSet etc etc.
19681
19682         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19683
19684         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19685         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19686         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19687         which needs this to do its work.
19688
19689         * ../errors/cs0066.cs : Add.
19690
19691 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19692
19693         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19694         helper functions.
19695
19696         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19697         clears out the parameters field.
19698         (MemberSignatureCompare): Cleanup
19699
19700         (MemberCore): New base class used to share code between MethodCore
19701         and Property.
19702
19703         (RegisterRequiredImplementations) BindingFlags.Public requires
19704         either BindingFlags.Instace or Static.  Use instance here.
19705
19706         (Property): Refactored code to cope better with the full spec.
19707
19708         * parameter.cs (GetParameterInfo): Return an empty array instead
19709         of null on error.
19710
19711         * class.cs (Property): Abstract or extern properties have no bodies.
19712
19713         * parameter.cs (GetParameterInfo): return a zero-sized array.
19714
19715         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19716         method modifier validation to the typecontainer so we can reuse
19717         this on properties.
19718
19719         (MethodCore.ParameterTypes): return an empty sized array of types.
19720
19721         (Property.Define): Test property modifier validity.
19722
19723         Add tests for sealed/override too.
19724
19725         (Method.Emit): abstract or extern methods have no bodies.
19726
19727 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19728
19729         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19730         thing.
19731
19732         (Method::Define, ::Emit): Modify accordingly.
19733
19734         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19735
19736         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19737
19738         * makefile: Pass in /unsafe.
19739
19740 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19741
19742         * class.cs (MakeKey): Kill routine.
19743
19744         * class.cs (TypeContainer.Define): Correctly define explicit
19745         method implementations (they require the full interface name plus
19746         the method name).
19747
19748         * typemanager.cs: Deply the PtrHashtable here and stop using the
19749         lame keys.  Things work so much better.
19750
19751         This of course broke everyone who depended on `RegisterMethod' to
19752         do the `test for existance' test.  This has to be done elsewhere.
19753
19754         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19755         the object stupid Equals method (because, that like fails all over
19756         the place).  We still do not use it.
19757
19758         * class.cs (TypeContainer.SetRequiredInterface,
19759         TypeContainer.RequireMethods): Killed these two routines and moved
19760         all the functionality to RegisterRequiredImplementations.
19761
19762         (TypeContainer.RegisterRequiredImplementations): This routine now
19763         registers all the implementations required in an array for the
19764         interfaces and abstract methods.  We use an array of structures
19765         which can be computed ahead of time to reduce memory usage and we
19766         also assume that lookups are cheap as most classes will not
19767         implement too many interfaces.
19768
19769         We also avoid creating too many MethodSignatures.
19770
19771         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19772         clear the "pending" bit if we find that there are problems with
19773         the declaration.
19774
19775         (TypeContainer.VerifyPendingMethods): Update to report errors of
19776         methods that look like implementations but are not.
19777
19778         (TypeContainer.Define): Add support for explicit interface method
19779         implementation. 
19780
19781 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19782
19783         * typemanager.cs: Keep track of the parameters here instead of
19784         being a feature of the TypeContainer.
19785
19786         * class.cs: Drop the registration of parameters here, as
19787         InterfaceMethods are also interface declarations.
19788
19789         * delegate.cs: Register methods with the TypeManager not only with
19790         the TypeContainer.  This code was buggy.
19791
19792         * interface.cs: Full registation here.
19793
19794 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19795
19796         * expression.cs: Remove reducer for binary expressions, it can not
19797         be done this way.
19798
19799         * const.cs: Put here the code that used to go into constant.cs
19800
19801         * constant.cs: Put here the code for constants, this is a new base
19802         class for Literals.
19803
19804         * literal.cs: Make Literal derive from Constant.
19805
19806 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * statement.cs (Return.Emit): Report error 157 if the user
19809         attempts to return from a finally block.
19810
19811         (Return.Emit): Instead of emitting a return, jump to the end of
19812         the function.
19813
19814         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19815         LocalBuilder to store the result of the function.  ReturnLabel is
19816         the target where we jump.
19817
19818
19819 2001-12-09  Radek Doulik  <rodo@ximian.com>
19820
19821         * cs-parser.jay: remember alias in current namespace
19822
19823         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19824         namespaces
19825
19826         * class.cs (LookupAlias): lookup alias in my_namespace
19827
19828         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19829         aliases hashtable
19830         (LookupAlias): lookup alias in this and if needed in parent
19831         namespaces
19832
19833 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19834
19835         * support.cs: 
19836
19837         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19838         making things static.  I need this to avoid passing the
19839         TypeContainer when calling ParameterType.
19840
19841         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19842         that did string manipulation to compute the type and then call
19843         GetType.  Use Parameter.ParameterType instead.
19844
19845         * cs-tokenizer.cs: Consume the suffix for floating values.
19846
19847         * expression.cs (ParameterReference): figure out whether this is a
19848         reference parameter or not.  Kill an extra variable by computing
19849         the arg_idx during emission.
19850
19851         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19852         function that returns whether a parameter is an out/ref value or not.
19853
19854         (Parameter.ParameterType): The type of the parameter (base,
19855         without ref/out applied).
19856
19857         (Parameter.Resolve): Perform resolution here.
19858         (Parameter.ExternalType): The full type (with ref/out applied).
19859
19860         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19861         support for expressions on the using statement.
19862
19863 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * statement.cs (Using.EmitLocalVariableDecls): Split the
19866         localvariable handling of the using statement.
19867
19868         (Block.EmitMeta): Keep track of variable count across blocks.  We
19869         were reusing slots on separate branches of blocks.
19870
19871         (Try.Emit): Emit the general code block, we were not emitting it. 
19872
19873         Check the type of the declaration to be an IDisposable or
19874         something that can be implicity converted to it. 
19875
19876         Emit conversions if required.
19877
19878         * ecore.cs (EmptyExpression): New utility class.
19879         (Expression.ImplicitConversionExists): New utility function.
19880
19881 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * statement.cs (Using): Implement.
19884
19885         * expression.cs (LocalVariableReference): Support read only variables.
19886
19887         * statement.cs: Remove the explicit emit for the Leave opcode.
19888         (VariableInfo): Add a readonly field.
19889
19890 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19891
19892         * ecore.cs (ConvCast): new class used to encapsulate the various
19893         explicit integer conversions that works in both checked and
19894         unchecked contexts.
19895
19896         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19897         properly generate the overflow opcodes.
19898
19899 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19900
19901         * statement.cs: The correct type for the EmptyExpression is the
19902         element_type, not the variable type.  Ravi pointed this out.
19903
19904 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19905
19906         * class.cs (Method::Define): Handle PInvoke methods specially
19907         by using DefinePInvokeMethod instead of the usual one.
19908
19909         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19910         above to do the task of extracting information and defining the method.
19911
19912 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19913
19914         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19915         of the condition for string type.
19916
19917         (Emit): Move that here. 
19918
19919         (ArrayCreation::CheckIndices): Keep string literals in their expression
19920         form.
19921
19922         (EmitDynamicInitializers): Handle strings appropriately.
19923
19924 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * codegen.cs (EmitContext): Replace multiple variables with a
19927         single pointer to the current Switch statement.
19928
19929         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19930         EmitContext.
19931
19932 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19933
19934         * statement.cs 
19935
19936         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19937         default'.
19938
19939         (Foreach.Emit): Foreach on arrays was not setting
19940         up the loop variables (for break/continue).
19941
19942         (GotoCase): Semi-implented.
19943
19944 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19945
19946         * attribute.cs (CheckAttribute): Handle system attributes by using
19947         Attribute.GetAttributes to examine information we need.
19948
19949         (GetValidPlaces): Same here.
19950
19951         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19952
19953         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19954
19955         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19956
19957         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19958
19959         (Method::Emit): Handle the case when we are a PInvoke method.
19960
19961 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * expression.cs: Use ResolveWithSimpleName on compound names.
19964
19965 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19966
19967         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19968         before trying to reduce it.
19969
19970         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19971
19972         * constant.cs (LookupConstantValue): Implement.
19973
19974         (EmitConstant): Use the above in emitting the constant.
19975
19976         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19977         that are user-defined by doing a LookupConstantValue on them.
19978
19979         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19980         too, like above.
19981
19982 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19985
19986         (BaseAccess.DoResolve): Implement.
19987
19988         (MemberAccess.DoResolve): Split this routine into a
19989         ResolveMemberAccess routine that can be used independently
19990
19991 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19992
19993         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19994         As that share bits of the implementation.  Is returns a boolean,
19995         while As returns the Type that is being probed.
19996
19997 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19998
19999         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20000         instead of a Literal - much easier.
20001
20002         (EnumInTransit): Remove - utterly useless :-)
20003
20004         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20005
20006         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20007
20008         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20009         chain when we have no associated expression.
20010
20011 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20012
20013         * constant.cs (Define): Use Location while reporting the errror.
20014
20015         Also emit a warning when 'new' is used and there is no inherited
20016         member to hide.
20017
20018         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20019         populated.
20020
20021         (LookupEnumValue): Implement to lookup an enum member's value and define it
20022         if necessary.
20023
20024         (Populate): Re-write accordingly to use the above routine.
20025
20026 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20027
20028         * expression.cs (This): Fix prototype for DoResolveLValue to
20029         override the base class DoResolveLValue.
20030
20031         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20032         declarations) 
20033
20034         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20035         (we need to load the address of the field here).  This fixes
20036         test-22. 
20037
20038         (FieldExpr.DoResolveLValue): Call the DoResolve
20039         function to initialize the Instance expression.
20040
20041         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20042         correctly the GetEnumerator operation on a value type.
20043
20044         * cs-parser.jay: Add more simple parsing error catches.
20045
20046         * statement.cs (Switch): Add support for string switches.
20047         Handle null specially.
20048
20049         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20050
20051 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20052
20053         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20054
20055         (declare_local_constant): New helper function.
20056
20057         * statement.cs (AddConstant): Keep a separate record of constants
20058
20059         (IsConstant): Implement to determine if a variable is a constant.
20060
20061         (GetConstantExpression): Implement.
20062
20063         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20064
20065         * statement.cs (IsVariableDefined): Re-write.
20066
20067 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20068
20069         * class.cs (TypeContainer::FindMembers): Look for constants
20070         in the case when we are looking for MemberTypes.Field
20071
20072         * expression.cs (MemberAccess::DoResolve): Check that in the
20073         case we are a FieldExpr and a Literal, we are not being accessed
20074         by an instance reference.
20075
20076         * cs-parser.jay (local_constant_declaration): Implement.
20077
20078         (declaration_statement): Implement for constant declarations.
20079
20080 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * statement.cs (Switch): Catch double defaults.
20083
20084         (Switch): More work on the switch() statement
20085         implementation.  It works for integral values now, need to finish
20086         string support.
20087
20088
20089 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20090
20091         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20092         integer literals into other integer literals.  To be used by
20093         switch. 
20094
20095 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20096
20097         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20098         some memory.
20099
20100         (EmitDynamicInitializers): Cope with the above since we extract data
20101         directly from ArrayData now.
20102
20103         (ExpectInitializers): Keep track of whether initializers are mandatory
20104         or not.
20105
20106         (Bounds): Make it a hashtable to prevent the same dimension being 
20107         recorded for every element in that dimension.
20108
20109         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20110         from being found.
20111
20112         Also fix bug which was causing the indices to be emitted in the reverse
20113         order.
20114
20115 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20118         unfinished.  They do not work, because the underlying code is
20119         sloppy.
20120
20121 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20122
20123         * cs-parser.jay: Remove bogus fixme.
20124
20125         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20126         on Switch statement.
20127
20128 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20129
20130         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20131         the same. 
20132
20133         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20134         parameter. Apparently, any expression is allowed. 
20135
20136         (ValidateInitializers): Update accordingly.
20137
20138         (CheckIndices): Fix some tricky bugs thanks to recursion.
20139
20140         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20141         I was being completely brain-dead.
20142
20143         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20144         and re-write acordingly.
20145
20146         (DelegateInvocation): Re-write accordingly.
20147
20148         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20149
20150         (MakeByteBlob): Handle types more correctly.
20151
20152         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20153         initialization from expressions but it is incomplete because I am a complete
20154         Dodo :-|
20155
20156 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20157
20158         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20159         on If.  Basically, we have to return `true' (ie, we do return to
20160         our caller) only if both branches of the if return.
20161
20162         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20163         short-circuit operators, handle them as short circuit operators. 
20164
20165         (Cast.DoResolve): Resolve type.
20166         (Cast.Cast): Take an expression as the target type.
20167
20168         * cs-parser.jay (cast_expression): Remove old hack that only
20169         allowed a limited set of types to be handled.  Now we take a
20170         unary_expression and we resolve to a type during semantic
20171         analysis.
20172
20173         Use the grammar productions from Rhys to handle casts (this is
20174         not complete like Rhys syntax yet, we fail to handle that corner
20175         case that C# has regarding (-x), but we will get there.
20176
20177 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20178
20179         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20180         field which is an array type.
20181
20182         * cs-parser.jay (declare_local_variables): Support array initialization too.
20183
20184         * typemanager.cs (MakeKey): Implement.
20185
20186         (everywhere): Use the above appropriately.
20187
20188         * cs-parser.jay (for_statement): Update for array initialization while
20189         declaring variables.
20190
20191         * ecore.cs : The error message was correct, it's the variable's names that
20192         were misleading ;-) Make the code more readable.
20193
20194         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20195         the correct type etc.
20196
20197         (ConvertExplicit): Handle Enum types by examining the underlying type.
20198
20199 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20200
20201         * parameter.cs (GetCallingConvention): Always return
20202         CallingConventions.Standard for now.
20203
20204 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20207         and `r' after calling DoNumericPromotions.
20208
20209         * ecore.cs: Fix error message (the types were in the wrong order).
20210
20211         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20212         BindingFlags.Instance as well 
20213
20214         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20215         implicit int literal conversion in an empty cast so that we
20216         propagate the right type upstream.
20217
20218         (UnboxCast): new class used to unbox value types.
20219         (Expression.ConvertExplicit): Add explicit type conversions done
20220         by unboxing.
20221
20222         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20223         the target type before applying the implicit LongLiterals to ULong
20224         literal cast.
20225
20226 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * cs-parser.jay (for_statement): Reworked the way For works: now
20229         we declare manually any variables that are introduced in
20230         for_initializer to solve the problem of having out-of-band code
20231         emition (that is what got for broken).
20232
20233         (declaration_statement): Perform the actual variable declaration
20234         that used to be done in local_variable_declaration here.
20235
20236         (local_variable_declaration): Do not declare anything, just pass
20237         the information on a DictionaryEntry
20238
20239 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20240
20241         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20242         re-write of the logic to now make it recursive.
20243
20244         (UpdateIndices): Re-write accordingly.
20245
20246         Store element data in a separate ArrayData list in the above methods.
20247
20248         (MakeByteBlob): Implement to dump the array data into a byte array.
20249
20250 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20251
20252         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20253         into CheckIndices.
20254
20255         * constant.cs (Define): Implement.
20256
20257         (EmitConstant): Re-write fully.
20258
20259         Pass in location info.
20260
20261         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20262         respectively.
20263
20264         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20265         DictionaryEntry since we need location info too.
20266
20267         (constant_declaration): Update accordingly.
20268
20269         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20270         code into another method : UpdateIndices.
20271
20272 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20273
20274         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20275         some type checking etc.
20276
20277 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20278
20279         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20280         bits to provide dimension info if the user skips doing that.
20281
20282         Update second constructor to store the rank correctly.
20283
20284 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20285
20286         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20287         and try to implement.
20288
20289         * ../errors/cs0150.cs : Add.
20290
20291         * ../errors/cs0178.cs : Add.
20292
20293 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * statement.cs: Implement foreach on multi-dimensional arrays. 
20296
20297         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20298         name of the params argument.
20299
20300         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20301         initializing the array.
20302
20303         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20304         we can use this elsewhere.
20305
20306         * statement.cs: Finish implementation of foreach for single
20307         dimension arrays.
20308
20309         * cs-parser.jay: Use an out-of-band stack to pass information
20310         around, I wonder why I need this.
20311
20312         foreach_block: Make the new foreach_block the current_block.
20313
20314         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20315         function used to return a static Parameters structure.  Used for
20316         empty parameters, as those are created very frequently.
20317
20318         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20319
20320 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20321
20322         * interface.cs : Default modifier is private, not public. The
20323         make verify test passes again.
20324
20325 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20326
20327         * support.cs (ReflectionParameters): Fix logic to determine
20328         whether the last parameter is a params one. Test 9 passes again.
20329
20330         * delegate.cs (Populate): Register the builders we define with
20331         RegisterParameterForBuilder. Test 19 passes again.
20332
20333         * cs-parser.jay (property_declaration): Reference $6 instead
20334         of $$ to get at the location.
20335
20336         (indexer_declaration): Similar stuff.
20337
20338         (attribute): Ditto.
20339
20340         * class.cs (Property): Register parameters for the Get and Set methods
20341         if they exist. Test 23 passes again.
20342
20343         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20344         call to EmitArguments as we are sure there aren't any params arguments. 
20345         Test 32 passes again.
20346
20347         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20348         IndexOutOfRangeException. 
20349
20350         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20351         Test 33 now passes again.
20352
20353 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20354
20355         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20356         broke a bunch of things.  Will have to come up with a better way
20357         of tracking locations.
20358
20359         * statement.cs: Implemented foreach for single dimension arrays.
20360
20361 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20362
20363         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20364         an error.  This removes the lookup from the critical path.
20365
20366         * cs-parser.jay: Removed use of temporary_loc, which is completely
20367         broken. 
20368
20369 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20370
20371         * support.cs (ReflectionParameters.ParameterModifier): Report
20372         whether the argument is a PARAMS argument or not.
20373
20374         * class.cs: Set the attribute `ParamArrayAttribute' on the
20375         parameter argument.
20376
20377         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20378         and cons_param_array_attribute (ConstructorInfo for
20379         ParamArrayAttribute)., 
20380
20381         * codegen.cs: Emit the return using the `Return' statement, that
20382         way we can report the error correctly for missing return values. 
20383
20384         * class.cs (Method.Emit): Clean up.
20385
20386         * expression.cs (Argument.Resolve): Take another argument: the
20387         location where this argument is used.  Notice that this is not
20388         part of the "Argument" class as to reduce the size of the
20389         structure (we know the approximate location anyways).
20390
20391         Test if the argument is a variable-reference, if not, then
20392         complain with a 206.
20393
20394         (Argument.Emit): Emit addresses of variables.
20395
20396         (Argument.FullDesc): Simplify.
20397
20398         (Invocation.DoResolve): Update for Argument.Resolve.
20399
20400         (ElementAccess.DoResolve): ditto.
20401
20402         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20403         method should be virtual, as this method is always virtual.
20404
20405         (NewDelegate.DoResolve): Update for Argument.Resolve.
20406
20407         * class.cs (ConstructorInitializer.DoResolve): ditto.
20408
20409         * attribute.cs (Attribute.Resolve): ditto.
20410
20411 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20414
20415         * expression.cs (ParameterReference): Drop IStackStorage and implement
20416         IAssignMethod instead. 
20417
20418         (LocalVariableReference): ditto.
20419
20420         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20421         IAssignMethod instead. 
20422
20423 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20424
20425         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20426         enumerations that are used in heavily used structures derive from
20427         byte in a laughable and pathetic attempt to reduce memory usage.
20428         This is the kind of pre-optimzations that you should not do at
20429         home without adult supervision.
20430
20431         * expression.cs (UnaryMutator): New class, used to handle ++ and
20432         -- separatedly from the other unary operators.  Cleans up the
20433         code, and kills the ExpressionStatement dependency in Unary.
20434
20435         (Unary): Removed `method' and `Arguments' from this class, making
20436         it smaller, and moving it all to SimpleCall, so I can reuse this
20437         code in other locations and avoid creating a lot of transient data
20438         strucutres when not required.
20439
20440         * cs-parser.jay: Adjust for new changes.
20441
20442 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * enum.cs (Enum.Populate): If there is a failure during
20445         definition, return
20446
20447         * cs-parser.jay (opt_enum_base): we used to catch type errors
20448         here, but this is really incorrect.  The type error should be
20449         catched during semantic analysis.
20450
20451 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20452
20453         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20454         current_local_parameters as expected since I, in my stupidity, had forgotten
20455         to do this :-)
20456
20457         * attribute.cs (GetValidPlaces): Fix stupid bug.
20458
20459         * class.cs (Method::Emit): Perform check on applicability of attributes.
20460
20461         (Constructor::Emit): Ditto.
20462
20463         (Field::Emit): Ditto.
20464
20465         (Field.Location): Store location information.
20466
20467         (Property, Event, Indexer, Operator): Ditto.
20468
20469         * cs-parser.jay (field_declaration): Pass in location for each field.
20470
20471         * ../errors/cs0592.cs : Add.
20472
20473 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20474
20475         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20476
20477         (InitCoreTypes): Update accordingly.
20478
20479         (RegisterAttrType, LookupAttr): Implement.
20480
20481         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20482         info about the same.
20483
20484         (Resolve): Update to populate the above as necessary.
20485
20486         (Error592): Helper.
20487
20488         (GetValidPlaces): Helper to the above.
20489
20490         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20491
20492         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20493
20494 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20495
20496         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20497
20498         * ../errors/cs0617.cs : Add.
20499
20500 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20501
20502         * enum.cs (Emit): Rename to Populate to be more consistent with what
20503         we expect it to do and when exactly it is called.
20504
20505         * class.cs, rootcontext.cs : Update accordingly.
20506
20507         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20508         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20509
20510         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20511
20512         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20513         of a fieldinfo using the above, when dealing with a FieldBuilder.
20514
20515 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20516
20517         * ../errors/cs0031.cs : Add.
20518
20519         * ../errors/cs1008.cs : Add.
20520
20521         * ../errrors/cs0543.cs : Add.
20522
20523         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20524         enum type.
20525
20526         (FindMembers): Implement.
20527
20528         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20529         enums and delegates too.
20530
20531         (enum_types): Rename to builder_to_enum.
20532
20533         (delegate_types): Rename to builder_to_delegate.
20534
20535         * delegate.cs (FindMembers): Implement.
20536
20537 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20538
20539         * typemanager.cs (IsEnumType): Implement.
20540
20541         * enum.cs (Emit): Re-write parts to account for the underlying type
20542         better and perform checking etc.
20543
20544         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20545         of the underlying type.
20546
20547         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20548         value
20549
20550         * enum.cs (error31): Helper to report error #31.
20551
20552         * cs-parser.jay (enum_declaration): Store location of each member too.
20553
20554         * enum.cs (member_to_location): New hashtable. 
20555
20556         (AddEnumMember): Update location hashtable.
20557
20558         (Emit): Use the location of each member while reporting errors.
20559
20560 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * cs-parser.jay: A for_initializer if is a
20563         local_variable_declaration really ammount to have an implicit
20564         block with the variable declaration and no initializer for for.
20565
20566         * statement.cs (For.Emit): Cope with null initializers.
20567
20568         This fixes the infinite loop on for initializers.
20569
20570 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * enum.cs: More cleanup.
20573
20574         * ecore.cs: Remove dead code.
20575
20576         * class.cs (Property.Emit): More simplification.
20577         (Event.Emit): ditto.
20578
20579         Reworked to have less levels of indentation.
20580
20581 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20582
20583         * class.cs (Property): Emit attributes.
20584
20585         (Field): Ditto.
20586
20587         (Event): Ditto.
20588
20589         (Indexer): Ditto.
20590
20591         (Operator): Ditto.
20592
20593         * enum.cs (Emit): Ditto.
20594
20595         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20596         Enums too.
20597
20598         * class.cs (Field, Event, etc.): Move attribute generation into the
20599         Emit method everywhere.
20600
20601         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20602         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20603         as we had no way of defining nested enums !
20604
20605         * rootcontext.cs : Adjust code accordingly.
20606
20607         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20608
20609 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20610
20611         * expression.cs (EvalConstantExpression): Move into ecore.cs
20612
20613         * enum.cs (Enum): Rename some members and make them public and readonly
20614         according to our convention.
20615
20616         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20617         nothing else.
20618
20619         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20620
20621         (Enum::Emit): Write a simple version for now which doesn't try to compute
20622         expressions. I shall modify this to be more robust in just a while.
20623
20624         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20625
20626         (TypeContainer::CloseType): Create the Enum types too.
20627
20628         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20629
20630         * expression.cs (EvalConstantExpression): Get rid of completely.
20631
20632         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20633         user-defined values and other cases.
20634
20635         (IsValidEnumLiteral): Helper function.
20636
20637         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20638         out there in the case we had a literal FieldExpr.
20639
20640         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20641
20642         (Literalize): Revamp a bit to take two arguments.
20643
20644         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20645
20646 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20647
20648         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20649
20650         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20651
20652         (Resolve): Use the above to ensure we have proper initializers.
20653
20654 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20655
20656         * expression.cs (Expression::EvalConstantExpression): New method to 
20657         evaluate constant expressions.
20658
20659         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20660
20661 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20662
20663         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20664         in an array.
20665
20666         (Binary.ResolveOperator): Handle operator != (object a, object b)
20667         and operator == (object a, object b);
20668
20669         (Binary.DoNumericPromotions): Indicate whether the numeric
20670         promotion was possible.
20671
20672         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20673         Implement.  
20674
20675         Made the ArrayAccess implement interface IAssignMethod instead of
20676         IStackStore as the order in which arguments are passed reflects
20677         this.
20678
20679         * assign.cs: Instead of using expr.ExprClass to select the way of
20680         assinging, probe for the IStackStore/IAssignMethod interfaces.
20681
20682         * typemanager.cs: Load InitializeArray definition.
20683
20684         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20685         static data that can be used to initialize arrays. 
20686
20687 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20688
20689         * expression.cs: Handle operator== and operator!= for booleans.
20690
20691         (Conditioal.Reduce): Implement reducer for the ?: operator.
20692
20693         (Conditional.Resolve): Implement dead code elimination.
20694
20695         (Binary.Resolve): Catch string literals and return a new
20696         concatenated string.
20697
20698         (Unary.Reduce): Implement reduction of unary expressions.
20699
20700         * ecore.cs: Split out the expression core handling here.
20701
20702         (Expression.Reduce): New method used to perform constant folding
20703         and CSE.  This is needed to support constant-expressions. 
20704
20705         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20706         targets, and optimize for !x.
20707
20708 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20709
20710         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20711         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20712         set custom atttributes.
20713
20714         * literal.cs (Literal::GetValue): New abstract method to return the actual
20715         value of the literal, cast as an object.
20716
20717         (*Literal): Implement GetValue method.
20718
20719         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20720         expressions to the arraylist but objects of type Argument.
20721
20722         * class.cs (TypeContainer::Emit): Emit our attributes too.
20723
20724         (Method::Emit, Constructor::Emit): Ditto.
20725
20726         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20727         to be ignoring earlier.
20728
20729 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20730
20731         * attribute.cs (AttributeSection::Define): Implement to do the business
20732         of constructing a CustomAttributeBuilder.
20733
20734         (Attribute): New trivial class. Increases readability of code.  
20735
20736         * cs-parser.jay : Update accordingly.
20737
20738         (positional_argument_list, named_argument_list, named_argument): New rules
20739
20740         (attribute_arguments): Use the above so that we are more correct.
20741
20742 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20743
20744         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20745         to perform all checks for a method with a params parameter.
20746
20747         (Invocation::OverloadResolve): Update to use the above method and therefore
20748         cope correctly with params method invocations.
20749
20750         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20751         params too.
20752
20753         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20754         constructors in our parent too because we can't afford to miss out on 
20755         protected ones ;-)
20756
20757         * attribute.cs (AttributeSection): New name for the class Attribute
20758
20759         Other trivial changes to improve readability.
20760
20761         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20762         use the new class names.
20763
20764 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20765
20766         * class.cs (Method::Define): Complete definition for params types too
20767
20768         (Indexer::Define): Ditto.
20769
20770         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20771         Cope everywhere with a request for info about the array parameter.
20772
20773 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20774
20775         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20776
20777         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20778         local_variable_type to extract the string corresponding to the type.
20779
20780         (local_variable_type): Fixup the action to use the new helper method.
20781
20782         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20783         go.
20784
20785         * expression.cs : Clean out code which uses the above.
20786
20787 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20788
20789         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20790         and bale out if necessary by returning a false.
20791
20792         (RegisterProperty): Ditto.
20793
20794         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20795         and print out appropriate error messages.
20796
20797         * interface.cs (everywhere): Ditto.
20798
20799         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20800         location to constructor.
20801
20802         * class.cs (Property, Event, Indexer): Update accordingly.
20803
20804         * ../errors/cs111.cs : Added.
20805
20806         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20807         of a method, as laid down by the spec.
20808
20809         (Invocation::OverloadResolve): Use the above method.
20810
20811 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20812
20813         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20814         now take a TypeContainer and a Parameters object.
20815
20816         (ParameterData): Modify return type of ParameterModifier method to be 
20817         Parameter.Modifier and not a string.
20818
20819         (ReflectionParameters, InternalParameters): Update accordingly.
20820
20821         * expression.cs (Argument::GetParameterModifier): Same here.
20822
20823         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20824         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20825         symbol in it at all so maybe this is only for now.
20826
20827 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20828
20829         * support.cs (InternalParameters): Constructor now takes an extra argument 
20830         which is the actual Parameters class.
20831
20832         (ParameterDesc): Update to provide info on ref/out modifiers.
20833
20834         * class.cs (everywhere): Update call to InternalParameters to pass in
20835         the second argument too.
20836
20837         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20838         to return the modifier info [ref/out etc]
20839
20840         (InternalParameters, ReflectionParameters): Implement the above.
20841
20842         * expression.cs (Argument::ParameterModifier): Similar function to return
20843         info about the argument's modifiers.
20844
20845         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20846         too.
20847
20848         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20849         a new SetFormalParameters object which we pass to InternalParameters.
20850
20851 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20852
20853         * expression.cs (NewArray): Merge into the ArrayCreation class.
20854
20855 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20856
20857         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20858         NewUserdefinedArray into one as there wasn't much of a use in having
20859         two separate ones.
20860
20861         * expression.cs (Argument): Change field's name to ArgType from Type.
20862
20863         (Type): New readonly property which returns the proper type, taking into 
20864         account ref/out modifiers.
20865
20866         (everywhere): Adjust code accordingly for the above.
20867
20868         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20869         whether we are emitting for a ref or out parameter.
20870
20871         * expression.cs (Argument::Emit): Use the above field to set the state.
20872
20873         (LocalVariableReference::Emit): Update to honour the flag and emit the
20874         right stuff.
20875
20876         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20877
20878         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20879
20880         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20881
20882         (ReflectionParameters, InternalParameters): Implement the above method.
20883
20884         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20885         reporting errors.
20886
20887         (Invocation::FullMethodDesc): Ditto. 
20888
20889 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20890
20891         * cs-parser.jay: Add extra production for the second form of array
20892         creation. 
20893
20894         * expression.cs (ArrayCreation): Update to reflect the above
20895         change. 
20896
20897         * Small changes to prepare for Array initialization.
20898
20899 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20900
20901         * typemanager.cs (ImplementsInterface): interface might be null;
20902         Deal with this problem;
20903
20904         Also, we do store negative hits on the cache (null values), so use
20905         this instead of calling t.GetInterfaces on the type everytime.
20906
20907 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20908
20909         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20910
20911         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20912         split functionality out into different classes.
20913
20914         (New::FormArrayType): Move into NewBuiltinArray.
20915
20916         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20917         quite useless.
20918
20919         (NewBuiltinArray): New class to handle creation of built-in arrays.
20920
20921         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20922         account creation of one-dimensional arrays.
20923
20924         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20925
20926         (NewUserdefinedArray::DoResolve): Implement.
20927
20928         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20929
20930         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20931         we maintain inside the TypeManager. This is necessary to perform lookups on the
20932         module builder.
20933
20934         (LookupType): Update to perform GetType on the module builders too.     
20935
20936         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20937
20938         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20939
20940 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20941
20942         * expression.cs (New::DoResolve): Implement guts of array creation.
20943
20944         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20945
20946 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20947
20948         * expression.cs: Fix bug I introduced lsat night that broke
20949         Delegates. 
20950
20951         (Expression.Resolve): Report a 246 error (can not resolve name)
20952         if we find a SimpleName in the stream.
20953
20954         (Expression.ResolveLValue): Ditto.
20955
20956         (Expression.ResolveWithSimpleName): This function is a variant of
20957         ResolveName, this one allows SimpleNames to be returned without a
20958         warning.  The only consumer of SimpleNames is MemberAccess
20959
20960 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20961
20962         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20963         might arrive here.  I have my doubts that this is correct.
20964
20965         * statement.cs (Lock): Implement lock statement.
20966
20967         * cs-parser.jay: Small fixes to support `lock' and `using'
20968
20969         * cs-tokenizer.cs: Remove extra space
20970
20971         * driver.cs: New flag --checked, allows to turn on integer math
20972         checking. 
20973
20974         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20975         Threading.Monitor.Exit 
20976
20977 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20978
20979         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20980         Expression Class to be IndexerAccess.
20981
20982         Notice that Indexer::DoResolve sets the eclass to Value.
20983
20984 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20985
20986         * class.cs (TypeContainer::Emit): Emit code for indexers.
20987
20988         * assign.cs (IAssignMethod): New interface implemented by Indexers
20989         and Properties for handling assignment.
20990
20991         (Assign::Emit): Simplify and reuse code. 
20992
20993         * expression.cs (IndexerAccess, PropertyExpr): Implement
20994         IAssignMethod, clean up old code. 
20995
20996 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20997
20998         * typemanager.cs (ImplementsInterface): New method to determine if a type
20999         implements a given interface. Provides a nice cache too.
21000
21001         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21002         method.
21003
21004         (ConvertReferenceExplicit): Ditto.
21005
21006         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21007         various methods, with correct names etc.
21008
21009         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21010         Operator.UnaryNegation.
21011
21012         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21013         we have a unary plus or minus operator.
21014
21015         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21016         UnaryMinus.
21017
21018         * everywhere : update accordingly.
21019
21020         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21021         respectively.
21022
21023         * class.cs (Method::Define): For the case where we are implementing a method
21024         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21025         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21026
21027 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21028
21029         * interface.cs (FindMembers): Implement to work around S.R.E
21030         lameness.
21031
21032         * typemanager.cs (IsInterfaceType): Implement.
21033
21034         (FindMembers): Update to handle interface types too.
21035
21036         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21037         use IsAssignableFrom as that is not correct - it doesn't work.
21038
21039         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21040         and accordingly override EmitStatement.
21041
21042         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21043         using the correct logic :-)
21044
21045 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21046
21047         * ../errors/cs-11.cs : Add to demonstrate error -11 
21048
21049 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21052         then pass this as a hint to ResolveLValue.
21053
21054         * expression.cs (FieldExpr): Add Location information
21055
21056         (FieldExpr::LValueResolve): Report assignment to readonly
21057         variable. 
21058
21059         (Expression::ExprClassFromMemberInfo): Pass location information.
21060
21061         (Expression::ResolveLValue): Add new method that resolves an
21062         LValue. 
21063
21064         (Expression::DoResolveLValue): Default invocation calls
21065         DoResolve. 
21066
21067         (Indexers): New class used to keep track of indexers in a given
21068         Type. 
21069
21070         (IStackStore): Renamed from LValue, as it did not really describe
21071         what this did.  Also ResolveLValue is gone from this interface and
21072         now is part of Expression.
21073
21074         (ElementAccess): Depending on the element access type
21075
21076         * typemanager.cs: Add `indexer_name_type' as a Core type
21077         (System.Runtime.CompilerServices.IndexerNameAttribute)
21078
21079         * statement.cs (Goto): Take a location.
21080
21081 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21082
21083         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21084         if two delegates are compatible.
21085
21086         (NewDelegate::DoResolve): Update to take care of the case when
21087         we instantiate a delegate from another delegate.
21088
21089         * typemanager.cs (FindMembers): Don't even try to look up members
21090         of Delegate types for now.
21091
21092 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21093
21094         * delegate.cs (NewDelegate): New class to take care of delegate
21095         instantiation.
21096
21097         * expression.cs (New): Split the delegate related code out into 
21098         the NewDelegate class.
21099
21100         * delegate.cs (DelegateInvocation): New class to handle delegate 
21101         invocation.
21102
21103         * expression.cs (Invocation): Split out delegate related code into
21104         the DelegateInvocation class.
21105
21106 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21107
21108         * expression.cs (New::DoResolve): Implement delegate creation fully
21109         and according to the spec.
21110
21111         (New::DoEmit): Update to handle delegates differently.
21112
21113         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21114         because of which we were printing out arguments in reverse order !
21115
21116         * delegate.cs (VerifyMethod): Implement to check if the given method
21117         matches the delegate.
21118
21119         (FullDelegateDesc): Implement.
21120
21121         (VerifyApplicability): Implement.
21122
21123         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21124         delegate invocations too.
21125
21126         (Invocation::Emit): Ditto.
21127
21128         * ../errors/cs1593.cs : Added.
21129
21130         * ../errors/cs1594.cs : Added.
21131
21132         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21133
21134 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21135
21136         * typemanager.cs (intptr_type): Core type for System.IntPtr
21137
21138         (InitCoreTypes): Update for the same.
21139
21140         (iasyncresult_type, asynccallback_type): Ditto.
21141
21142         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21143         correct.
21144
21145         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21146         too.
21147
21148         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21149         the builders for the 4 members of a delegate type :-)
21150
21151         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21152         type.
21153
21154         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21155
21156         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21157
21158 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * statement.cs (Break::Emit): Implement.   
21161         (Continue::Emit): Implement.
21162
21163         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21164         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21165         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21166         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21167         end loop
21168
21169         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21170         properties that track the label for the current loop (begin of the
21171         loop and end of the loop).
21172
21173 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21174
21175         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21176         use of emitting anything at all.
21177
21178         * class.cs, rootcontext.cs : Get rid of calls to the same.
21179
21180         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21181
21182         (Populate): Define the constructor correctly and set the implementation
21183         attributes.
21184
21185         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21186         have been defined.
21187
21188         (AddDelegateType): Implement.
21189
21190         (IsDelegateType): Implement helper method.
21191
21192         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21193
21194         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21195         and accordingly handle it.
21196
21197         * delegate.cs (Populate): Take TypeContainer argument.
21198         Implement bits to define the Invoke method. However, I still haven't figured out
21199         how to take care of the native int bit :-(
21200
21201         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21202         Qualify the name of the delegate, not its return type !
21203
21204         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21205         conversion.
21206
21207         (StandardConversionExists): Checking for array types turns out to be recursive.
21208
21209         (ConvertReferenceExplicit): Implement array conversion.
21210
21211         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21212
21213 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21214
21215         * cs-parser.jay (delegate_declaration): Store the fully qualified
21216         name as it is a type declaration.
21217
21218         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21219         readonly.
21220
21221         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21222         as TypeContainer::DefineType.
21223
21224         (Populate): Method in which all the definition of the various methods (Invoke)
21225         etc is done.
21226
21227         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21228         see.
21229
21230         (CloseDelegate): Finally creates the delegate.
21231
21232         * class.cs (TypeContainer::DefineType): Update to define delegates.
21233         (Populate, Emit and CloseType): Do the same thing here too.
21234
21235         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21236         delegates in all these operations.
21237
21238 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21239
21240         * expression.cs: LocalTemporary: a new expression used to
21241         reference a temporary that has been created.
21242
21243         * assign.cs: Handle PropertyAccess back here, so that we can
21244         provide the proper semantic access to properties.
21245
21246         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21247         a few more explicit conversions. 
21248
21249         * modifiers.cs: `NEW' modifier maps to HideBySig.
21250
21251         * expression.cs (PropertyExpr): Make this into an
21252         ExpressionStatement, and support the EmitStatement code path. 
21253
21254         Perform get/set error checking, clean up the interface.
21255
21256         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21257         them into toplevel access objects.
21258
21259 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21262         SRE.
21263
21264         * typemanager.cs: Keep track here of our PropertyBuilders again to
21265         work around lameness in SRE.
21266
21267 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * expression.cs (LValue::LValueResolve): New method in the
21270         interface, used to perform a second resolution pass for LValues. 
21271
21272         (This::DoResolve): Catch the use of this in static methods.
21273
21274         (This::LValueResolve): Implement.
21275
21276         (This::Store): Remove warning, assigning to `this' in structures
21277         is 
21278
21279         (Invocation::Emit): Deal with invocation of
21280         methods on value types.  We need to pass the address to structure
21281         methods rather than the object itself.  (The equivalent code to
21282         emit "this" for structures leaves the entire structure on the
21283         stack instead of a pointer to it). 
21284
21285         (ParameterReference::DoResolve): Compute the real index for the
21286         argument based on whether the method takes or not a `this' pointer
21287         (ie, the method is static).
21288
21289         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21290         value types returned from functions when we need to invoke a
21291         method on the sturcture.
21292
21293
21294 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21295
21296         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21297         defining the type in the Modulebuilder or Typebuilder. This is to take
21298         care of nested types which need to be defined on the TypeBuilder using
21299         DefineNestedMethod.
21300
21301         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21302         methods in RootContext, only ported to be part of TypeContainer.
21303
21304         (TypeContainer::GetInterfaceOrClass): Ditto.
21305
21306         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21307
21308         * interface.cs (Interface::DefineInterface): New method. Does exactly
21309         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21310         too.
21311
21312         (Interface::GetInterfaces): Move from RootContext here and port.
21313
21314         (Interface::GetInterfaceByName): Same here.
21315
21316         * rootcontext.cs (ResolveTree): Re-write.
21317
21318         (PopulateTypes): Re-write.
21319
21320         * class.cs (TypeContainer::Populate): Populate nested types too.
21321         (TypeContainer::Emit): Emit nested members too.
21322
21323         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21324         instead just use the name argument passed in as it is already fully
21325         qualified.
21326
21327         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21328         to TypeContainer mapping to see if a type is user-defined.
21329
21330         * class.cs (TypeContainer::CloseType): Implement. 
21331
21332         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21333         the default constructor.
21334
21335         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21336         twice.
21337
21338         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21339
21340         * interface.cs (CloseType): Create the type here.
21341
21342         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21343         the hierarchy.
21344
21345         Remove all the methods which are now in TypeContainer.
21346
21347 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21348
21349         * delegate.cs (Define): Re-write bits to define the delegate
21350         correctly.
21351
21352 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21355
21356         * expression.cs (ImplicitReferenceConversion): handle null as well
21357         as a source to convert to any reference type.
21358
21359         * statement.cs (Return): Perform any implicit conversions to
21360         expected return type.  
21361
21362         Validate use of return statement.  
21363
21364         * codegen.cs (EmitContext): Pass the expected return type here.
21365
21366         * class.cs (Method, Constructor, Property): Pass expected return
21367         type to EmitContext.
21368
21369 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * expression.cs: Make DoResolve take an EmitContext instead of a
21372         TypeContainer.
21373
21374         Replaced `l' and `location' for `loc', for consistency.
21375
21376         (Error, Warning): Remove unneeded Tc argument.
21377
21378         * assign.cs, literal.cs, constant.cs: Update to new calling
21379         convention. 
21380
21381         * codegen.cs: EmitContext now contains a flag indicating whether
21382         code is being generated in a static method or not.
21383
21384         * cs-parser.jay: DecomposeQI, new function that replaces the old
21385         QualifiedIdentifier.  Now we always decompose the assembled
21386         strings from qualified_identifier productions into a group of
21387         memberaccesses.
21388
21389 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21390
21391         * rootcontext.cs: Deal with field-less struct types correctly now
21392         by passing the size option to Define Type.
21393
21394         * class.cs: Removed hack that created one static field. 
21395
21396 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21397
21398         * statement.cs: Moved most of the code generation here. 
21399
21400 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21401
21402         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21403         seem very right.
21404
21405         (ElementAccess): Remove useless bits for now - keep checks as the spec
21406         says.
21407
21408 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21409
21410         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21411         and start performing checks according to the spec.
21412
21413 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21414
21415         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21416         rank_specifiers instead.
21417
21418         (rank_specifiers): Change the order in which the rank specifiers are stored
21419
21420         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21421
21422         * expression.cs (ElementAccess): Implement the LValue interface too.
21423
21424 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21425
21426         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21427         except that user defined conversions are not included.
21428
21429         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21430         perform the conversion of the return type, if necessary.
21431
21432         (New::DoResolve): Check whether we are creating an array or an object
21433         and accordingly do the needful.
21434
21435         (New::Emit): Same here.
21436
21437         (New::DoResolve): Implement guts of array creation.
21438
21439         (New::FormLookupType): Helper function.
21440
21441 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21442
21443         * codegen.cs: Removed most of the code generation here, and move the
21444         corresponding code generation bits to the statement classes. 
21445
21446         Added support for try/catch/finalize and throw.
21447
21448         * cs-parser.jay: Added support for try/catch/finalize.
21449
21450         * class.cs: Catch static methods having the flags override,
21451         virtual or abstract.
21452
21453         * expression.cs (UserCast): This user cast was not really doing
21454         what it was supposed to do.  Which is to be born in fully resolved
21455         state.  Parts of the resolution were being performed at Emit time! 
21456
21457         Fixed this code.
21458
21459 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21460
21461         * expression.cs: Implicity convert the result from UserCast.
21462
21463 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21464
21465         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21466         prevented it from working correctly. 
21467
21468         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21469         merely ConvertImplicit.
21470
21471 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21472
21473         * typemanager.cs: Make the LookupTypeContainer function static,
21474         and not per-instance.  
21475
21476         * class.cs: Make static FindMembers (the one that takes a Type
21477         argument). 
21478
21479         * codegen.cs: Add EmitForeach here.
21480
21481         * cs-parser.jay: Make foreach a toplevel object instead of the
21482         inline expansion, as we need to perform semantic analysis on it. 
21483
21484 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21485
21486         * expression.cs (Expression::ImplicitUserConversion): Rename to
21487         UserDefinedConversion.
21488
21489         (Expression::UserDefinedConversion): Take an extra argument specifying 
21490         whether we look for explicit user conversions too.
21491
21492         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21493
21494         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21495
21496         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21497         with the appropriate arguments.
21498
21499         * cs-parser.jay (cast_expression): Record location too.
21500
21501         * expression.cs (Cast): Record location info.
21502
21503         (Expression::ConvertExplicit): Take location argument.
21504
21505         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21506         to determine if we are doing explicit conversions.
21507
21508         (UserCast::Emit): Update accordingly.
21509
21510         (Expression::ConvertExplicit): Report an error if everything fails.
21511
21512         * ../errors/cs0030.cs : Add.
21513
21514 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21515
21516         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21517         virtual and newslot bits. 
21518
21519         * class.cs (TypeContainer::RegisterRequiredImplementations):
21520         Record methods we need.
21521
21522         (TypeContainer::MakeKey): Helper function to make keys for
21523         MethodBases, since the Methodbase key is useless.
21524
21525         (TypeContainer::Populate): Call RegisterRequiredImplementations
21526         before defining the methods.   
21527
21528         Create a mapping for method_builders_to_methods ahead of time
21529         instead of inside a tight loop.
21530
21531         (::RequireMethods):  Accept an object as the data to set into the
21532         hashtable so we can report interface vs abstract method mismatch.
21533
21534 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21535
21536         * report.cs: Make all of it static.
21537
21538         * rootcontext.cs: Drop object_type and value_type computations, as
21539         we have those in the TypeManager anyways.
21540
21541         Drop report instance variable too, now it is a global.
21542
21543         * driver.cs: Use try/catch on command line handling.
21544
21545         Add --probe option to debug the error reporting system with a test
21546         suite. 
21547
21548         * report.cs: Add support for exiting program when a probe
21549         condition is reached.
21550
21551 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21552
21553         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21554         we do a forcible conversion regardless of type, to check if 
21555         ForceConversion returns a null.
21556
21557         (Binary::error19): Use location to report error.
21558
21559         (Unary::error23): Use location here too.
21560
21561         * ../errors/cs0019.cs : Check in.
21562
21563         * ../errors/cs0023.cs : Check in.
21564
21565         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21566         case of a non-null MethodInfo object with a length of 0 !
21567
21568         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21569         an applicable member - according to the spec :-)
21570         Also fix logic to find members in base types.
21571
21572         (Unary::ResolveOperator): Same here.
21573
21574         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21575         as I was getting thoroughly confused between this and error19 :-)
21576
21577         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21578         (::FindMostEncompassedType): Implement.
21579         (::FindMostEncompassingType): Implement.
21580         (::StandardConversionExists): Implement.
21581
21582         (UserImplicitCast): Re-vamp. We now need info about most specific
21583         source and target types so that we can do the necessary conversions.
21584
21585         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21586         mathematical union with no duplicates.
21587
21588 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21589
21590         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21591         in order from base classes to child classes, so that we can in
21592         child classes look up in our parent for method names and
21593         attributes (required for handling abstract, virtual, new, override
21594         constructs: we need to instrospect our base class, and if we dont
21595         populate the classes in order, the introspection might be
21596         incorrect.  For example, a method could query its parent before
21597         the parent has any methods and would determine that the parent has
21598         no abstract methods (while it could have had them)).
21599
21600         (RootContext::CreateType): Record the order in which we define the
21601         classes.
21602
21603 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * class.cs (TypeContainer::Populate): Also method definitions can
21606         fail now, keep track of this.
21607
21608         (TypeContainer::FindMembers): Implement support for
21609         DeclaredOnly/noDeclaredOnly flag.
21610
21611         (Constructor::Emit) Return the ConstructorBuilder.
21612
21613         (Method::Emit) Return the MethodBuilder. 
21614         Check for abstract or virtual methods to be public.
21615
21616         * rootcontext.cs (RootContext::CreateType): Register all the
21617         abstract methods required for the class to be complete and the
21618         interface methods that must be implemented. 
21619
21620         * cs-parser.jay: Report error 501 (method requires body if it is
21621         not marked abstract or extern).
21622
21623         * expression.cs (TypeOf::Emit): Implement.
21624
21625         * typemanager.cs: runtime_handle_type, new global type.
21626
21627         * class.cs (Property::Emit): Generate code for properties.
21628
21629 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21630
21631         * expression.cs (Unary::ResolveOperator): Find operators on base type
21632         too - we now conform exactly to the spec.
21633
21634         (Binary::ResolveOperator): Same here.
21635
21636         * class.cs (Operator::Define): Fix minor quirk in the tests.
21637
21638         * ../errors/cs0215.cs : Added.
21639
21640         * ../errors/cs0556.cs : Added.
21641
21642         * ../errors/cs0555.cs : Added.
21643
21644 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21645
21646         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21647         single integer which is really efficient
21648
21649 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21650
21651         *  expression.cs (Expression::ImplicitUserConversion): Use location
21652         even in the case when we are examining True operators.
21653  
21654         * class.cs (Operator::Define): Perform extensive checks to conform
21655         with the rules for operator overloading in the spec.
21656
21657         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21658         some of the other conversions mentioned in the spec.
21659
21660         * typemanager.cs (array_type): New static member for the System.Array built-in
21661         type.
21662
21663         (cloneable_interface): For System.ICloneable interface.
21664
21665         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21666         we start resolving the tree and populating types.
21667
21668         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21669  
21670 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21671
21672         * expression.cs (Expression::ExprClassFromMemberInfo,
21673         Expression::Literalize): Create literal expressions from
21674         FieldInfos which are literals.
21675
21676         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21677         type casts, because they were wrong.  The test suite in tests
21678         caught these ones.
21679
21680         (ImplicitNumericConversion): ushort to ulong requires a widening
21681         cast. 
21682
21683         Int32 constant to long requires widening cast as well.
21684
21685         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21686         for integers because the type on the stack is not i4.
21687
21688 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * expression.cs (report118): require location argument. 
21691
21692         * parameter.cs: Do not dereference potential null value.
21693
21694         * class.cs: Catch methods that lack the `new' keyword when
21695         overriding a name.  Report warnings when `new' is used without
21696         anything being there to override.
21697
21698         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21699
21700         * class.cs: Only add constructor to hashtable if it is non-null
21701         (as now constructors can fail on define).
21702
21703         (TypeManager, Class, Struct): Take location arguments.
21704
21705         Catch field instance initialization in structs as errors.
21706
21707         accepting_filter: a new filter for FindMembers that is static so
21708         that we dont create an instance per invocation.
21709
21710         (Constructor::Define): Catch errors where a struct constructor is
21711         parameterless 
21712
21713         * cs-parser.jay: Pass location information for various new
21714         constructs. 
21715
21716         * delegate.cs (Delegate): take a location argument.
21717
21718         * driver.cs: Do not call EmitCode if there were problesm in the
21719         Definition of the types, as many Builders wont be there. 
21720
21721         * decl.cs (Decl::Decl): Require a location argument.
21722
21723         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21724         into integers, and find the most appropiate integer for it.
21725
21726         * literal.cs: Implement ULongLiteral.
21727
21728         * rootcontext.cs: Provide better information about the location of
21729         failure when CreateType fails.
21730
21731 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21734         as well.
21735
21736         * expression.cs (Binary::CheckShiftArguments): Add missing type
21737         computation.
21738         (Binary::ResolveOperator): Add type to the logical and and logical
21739         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21740         before.
21741
21742         (Binary::DoNumericPromotions): In the case where either argument
21743         is ulong (and most signed types combined with ulong cause an
21744         error) perform implicit integer constant conversions as well.
21745
21746 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21747
21748         * expression.cs (UserImplicitCast): Method should always be
21749         non-null. 
21750         (Invocation::BetterConversion): Simplified test for IntLiteral.
21751
21752         (Expression::ImplicitNumericConversion): Split this routine out.
21753         Put the code that performs implicit constant integer conversions
21754         here. 
21755
21756         (Expression::Resolve): Become a wrapper around DoResolve so we can
21757         check eclass and type being set after resolve.
21758
21759         (Invocation::Badness): Remove this dead function
21760
21761         (Binary::ResolveOperator): Do not compute the expensive argumnets
21762         unless we have a union for it.
21763
21764         (Probe::Emit): Is needs to do an isinst and then
21765         compare against null.
21766
21767         (::CanConvert): Added Location argument.  If the Location argument
21768         is null (Location.Null), then we do not report errors.  This is
21769         used by the `probe' mechanism of the Explicit conversion.  We do
21770         not want to generate an error for something that the user
21771         explicitly requested to be casted.  But the pipeline for an
21772         explicit cast first tests for potential implicit casts.
21773
21774         So for now, if the Location is null, it means `Probe only' to
21775         avoid adding another argument.   Might have to revise this
21776         strategy later.
21777
21778         (ClassCast): New class used to type cast objects into arbitrary
21779         classes (used in Explicit Reference Conversions).
21780
21781         Implement `as' as well.
21782
21783         Reverted all the patches from Ravi below: they were broken:
21784
21785                 * The use of `level' as a mechanism to stop recursive
21786                   invocations is wrong.  That was there just to catch the
21787                   bug with a strack trace but not as a way of addressing
21788                   the problem.
21789
21790                   To fix the problem we have to *understand* what is going
21791                   on and the interactions and come up with a plan, not
21792                   just get things going.
21793
21794                 * The use of the type conversion cache that I proposed
21795                   last night had an open topic: How does this work across
21796                   protection domains.  A user defined conversion might not
21797                   be public in the location where we are applying the
21798                   conversion, a different conversion might be selected
21799                   (ie, private A->B (better) but public B->A (worse),
21800                   inside A, A->B applies, but outside it, B->A will
21801                   apply).
21802
21803                 * On top of that (ie, even if the above is solved),
21804                   conversions in a cache need to be abstract.  Ie, `To
21805                   convert from an Int to a Short use an OpcodeCast', not
21806                   `To convert from an Int to a Short use the OpcodeCast on
21807                   the variable 5' (which is what this patch was doing).
21808
21809 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21810
21811         * expression.cs (Invocation::ConversionExists): Re-write to use
21812         the conversion cache
21813
21814         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21815         cache all conversions done, not just user-defined ones.
21816
21817         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21818         to determine if a conversion exists instead of acutually trying to 
21819         perform the conversion. It's faster too.
21820
21821         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21822         and only then attempt the implicit conversion.
21823
21824 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21825
21826         * expression.cs (ConvertImplicit): Use a cache for conversions
21827         already found. Check level of recursion and bail out if necessary.
21828
21829 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21830
21831         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21832         Export standard methods that we expect for string operations.
21833
21834         * statement.cs (Block::UsageWarning): Track usage of variables and
21835         report the errors for not used variables.
21836
21837         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21838         operator. 
21839
21840 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21841
21842         * codegen.cs: remove unnneded code 
21843
21844         * expression.cs: Removed BuiltinTypeAccess class
21845
21846         Fix the order in which implicit conversions are
21847         done.  
21848
21849         The previous fixed dropped support for boxed conversions (adding a
21850         test to the test suite now)
21851
21852         (UserImplicitCast::CanConvert): Remove test for source being null,
21853         that code is broken.  We should not feed a null to begin with, if
21854         we do, then we should track the bug where the problem originates
21855         and not try to cover it up here.
21856
21857         Return a resolved expression of type UserImplicitCast on success
21858         rather than true/false.  Ravi: this is what I was talking about,
21859         the pattern is to use a static method as a "constructor" for
21860         objects. 
21861
21862         Also, do not create arguments until the very last minute,
21863         otherwise we always create the arguments even for lookups that
21864         will never be performed. 
21865
21866         (UserImplicitCast::Resolve): Eliminate, objects of type
21867         UserImplicitCast are born in a fully resolved state. 
21868
21869         * typemanager.cs (InitCoreTypes): Init also value_type
21870         (System.ValueType). 
21871
21872         * expression.cs (Cast::Resolve): First resolve the child expression.
21873
21874         (LValue): Add new method AddressOf to be used by
21875         the `&' operator.  
21876
21877         Change the argument of Store to take an EmitContext instead of an
21878         ILGenerator, because things like FieldExpr need to be able to call
21879         their children expression to generate the instance code. 
21880
21881         (Expression::Error, Expression::Warning): Sugar functions for
21882         reporting errors.
21883
21884         (Expression::MemberLookup): Accept a TypeContainer instead of a
21885         Report as the first argument.
21886
21887         (Expression::ResolvePrimary): Killed.  I still want to improve
21888         this as currently the code is just not right.
21889
21890         (Expression::ResolveMemberAccess): Simplify, but it is still
21891         wrong. 
21892
21893         (Unary::Resolve): Catch errors in AddressOf operators.
21894
21895         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21896         index to a byte for the short-version, or the compiler will choose
21897         the wrong Emit call, which generates the wrong data.
21898
21899         (ParameterReference::Emit, ::Store): same.
21900
21901         (FieldExpr::AddressOf): Implement.
21902
21903         * typemanager.cs: TypeManager: made public variable instead of
21904         property.
21905
21906         * driver.cs: document --fatal.
21907
21908         * report.cs (ErrorMessage, WarningMessage): new names for the old
21909         Error and Warning classes.
21910
21911         * cs-parser.jay (member_access): Turn built-in access to types
21912         into a normal simplename
21913
21914 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21915
21916         * expression.cs (Invocation::BetterConversion): Fix to cope
21917         with q being null, since this was introducing a bug.
21918
21919         * expression.cs (ConvertImplicit): Do built-in conversions first.
21920
21921 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21922
21923         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21924
21925 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21926
21927         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21928         I had introduced long ago (what's new ?).
21929
21930         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21931         the work of all the checking. 
21932         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21933         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21934
21935         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21936         that is the right way. 
21937
21938         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21939         overloading resolution. Use everywhere instead of cutting and pasting code.
21940
21941         (Binary::ResolveOperator): Use MakeUnionSet.
21942
21943         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21944         we have to convert to bool types. Not complete yet.
21945
21946 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21947
21948         * typemanager.cs (TypeManager::CSharpName): support ushort.
21949
21950         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21951         to provide an expression that performsn an implicit constant int
21952         conversion (section 6.1.6).
21953         (Expression::ConvertImplicitRequired): Reworked to include
21954         implicit constant expression conversions.
21955
21956         (Expression::ConvertNumericExplicit): Finished.
21957
21958         (Invocation::Emit): If InstanceExpression is null, then it means
21959         that we perform a call on this.
21960
21961 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21962
21963         * expression.cs (Unary::Emit): Remove some dead code.
21964         (Probe): Implement Resolve and Emit for `is'.
21965         (Expression::ConvertImplicitRequired): Attempt to do constant
21966         expression conversions here.  Maybe should be moved to
21967         ConvertImplicit, but I am not sure.
21968         (Expression::ImplicitLongConstantConversionPossible,
21969         Expression::ImplicitIntConstantConversionPossible): New functions
21970         that tell whether is it possible to apply an implicit constant
21971         expression conversion.
21972
21973         (ConvertNumericExplicit): Started work on explicit numeric
21974         conversions.
21975
21976         * cs-parser.jay: Update operator constants.
21977
21978         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21979         (Parameters::GetSignature): Hook up VerifyArgs here.
21980         (Parameters::VerifyArgs): Verifies that no two arguments have the
21981         same name. 
21982
21983         * class.cs (Operator): Update the operator names to reflect the
21984         ones that the spec expects (as we are just stringizing the
21985         operator names).
21986
21987         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21988         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21989         previous usage did only work for our methods.
21990         (Expression::ConvertImplicit): Handle decimal implicit numeric
21991         conversions as well.
21992         (Expression::InternalTypeConstructor): Used to invoke constructors
21993         on internal types for default promotions.
21994
21995         (Unary::Emit): Implement special handling for the pre/post
21996         increment/decrement for overloaded operators, as they need to have
21997         the same semantics as the other operators.
21998
21999         (Binary::ResolveOperator): ditto.
22000         (Invocation::ConversionExists): ditto.
22001         (UserImplicitCast::Resolve): ditto.
22002
22003 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22004
22005         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22006         operator, return after emitting body. Regression tests pass again !
22007
22008         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22009         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22010         (Invocation::OverloadResolve): Ditto.
22011         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22012
22013         * everywhere : update calls to the above methods accordingly.
22014
22015 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22016
22017         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22018
22019         * expression.cs (ExpressionStatement): New base class used for
22020         expressions that can appear in statements, so that we can provide
22021         an alternate path to generate expression that do not leave a value
22022         on the stack.
22023
22024         (Expression::Emit, and all the derivatives): We no longer return
22025         whether a value is left on the stack or not.  Every expression
22026         after being emitted leaves a single value on the stack.
22027
22028         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22029         facilties of ExpressionStatement if possible.
22030
22031         * cs-parser.jay: Update statement_expression.
22032
22033 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22034
22035         * driver.cs: Change the wording of message
22036
22037 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22038
22039         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22040         the type of the expression to the return type of the method if
22041         we have an overloaded operator match ! The regression tests pass again !
22042         (Unary::ResolveOperator): Ditto.
22043
22044         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22045         to find "op_Implicit", not "implicit" ;-)
22046         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22047         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22048
22049         * everywhere : Correct calls to the above accordingly.
22050
22051         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22052         (ConvertImplicit): Do user-defined conversion if it exists.
22053
22054 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22055
22056         * assign.cs: track location.
22057         (Resolve): Use implicit conversions on assignment.
22058
22059         * literal.cs: Oops.  Not good, Emit of short access values should
22060         pass (Bytes) or the wrong argument will be selected.
22061
22062         * expression.cs (Unary::Emit): Emit code for -expr.
22063
22064         (Unary::ResolveOperator): Handle `Substract' for non-constants
22065         (substract from zero from the non-constants).
22066         Deal with Doubles as well. 
22067
22068         (Expression::ConvertImplicitRequired): New routine that reports an
22069         error if no implicit conversion exists. 
22070
22071         (Invocation::OverloadResolve): Store the converted implicit
22072         expressions if we make them
22073
22074 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22075
22076         * class.cs (ConstructorInitializer): Take a Location argument.
22077         (ConstructorBaseInitializer): Same here.
22078         (ConstructorThisInitializer): Same here.
22079
22080         * cs-parser.jay : Update all calls accordingly.
22081
22082         * expression.cs (Unary, Binary, New): Take location argument.
22083         Update accordingly everywhere.
22084
22085         * cs-parser.jay : Update all calls to the above to take a location
22086         argument.
22087
22088         * class.cs : Ditto.
22089
22090 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22091
22092         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22093         (Invocation::BetterConversion): Same here
22094         (Invocation::ConversionExists): Ditto.
22095
22096         (Invocation::ConversionExists): Implement.
22097
22098 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22099
22100         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22101         Also take an additional TypeContainer argument.
22102
22103         * All over : Pass in TypeContainer as argument to OverloadResolve.
22104
22105         * typemanager.cs (CSharpName): Update to check for the string type and return
22106         that too.
22107
22108         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22109         a given method.
22110
22111 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22112
22113         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22114         (Invocation::BetterFunction): Implement.
22115         (Invocation::BetterConversion): Implement.
22116         (Invocation::ConversionExists): Skeleton, no implementation yet.
22117
22118         Okay, things work fine !
22119
22120 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22121
22122         * typemanager.cs: declare and load enum_type, delegate_type and
22123         void_type. 
22124
22125         * expression.cs (Expression::Emit): Now emit returns a value that
22126         tells whether a value is left on the stack or not.  This strategy
22127         might be reveted tomorrow with a mechanism that would address
22128         multiple assignments.
22129         (Expression::report118): Utility routine to report mismatches on
22130         the ExprClass.
22131
22132         (Unary::Report23): Report impossible type/operator combination
22133         utility function.
22134
22135         (Unary::IsIncrementableNumber): Whether the type can be
22136         incremented or decremented with add.
22137         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22138         complemented. 
22139         (Unary::ResolveOperator): Implement ++, !, ~,
22140
22141         (Invocation::Emit): Deal with new Emit convetion.
22142
22143         * All Expression derivatives: Updated their Emit method to return
22144         whether they leave values on the stack or not.
22145
22146         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22147         stack for expressions that are statements. 
22148
22149 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22150
22151         * expression.cs (LValue): New interface.  Must be implemented by
22152         LValue objects.
22153         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22154         LValue interface.
22155
22156         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22157         interface for generating code, simplifies the code.
22158
22159 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22160
22161         * expression.cs (everywhere): Comment out return statements in ::Resolve
22162         methods to avoid the warnings.
22163
22164 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22165
22166         * driver.cs (parse): Report error 2001 if we can not open the
22167         source file.
22168
22169         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22170         not resolve it.
22171
22172         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22173         object. 
22174
22175         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22176         otherwise nested blocks end up with the same index.
22177
22178         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22179
22180         * expression.cs:  Instead of having FIXMEs in the Resolve
22181         functions, throw exceptions so it is obvious that we are facing a
22182         bug. 
22183
22184         * cs-parser.jay (invocation_expression): Pass Location information.
22185
22186         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22187         Use a basename for those routines because .NET does not like paths
22188         on them. 
22189
22190         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22191         already defined.
22192
22193 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22194
22195         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22196         are loading the correct data types (throws an exception if not).
22197         (TypeManager::InitCoreTypes): Use CoreLookupType
22198
22199         * expression.cs (Unary::ResolveOperator): return the child
22200         expression for expressions which are just +expr.
22201         (Unary::ResolveOperator): Return negative literals for -LITERAL
22202         expressions (otherwise they are Unary {Literal}).
22203         (Invocation::Badness): Take into account `Implicit constant
22204         expression conversions'.
22205
22206         * literal.cs (LongLiteral): Implement long literal class.
22207         (IntLiteral): export the `Value' of the intliteral. 
22208
22209 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22210
22211         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22212
22213         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22214         instead of 'Operator'
22215
22216         * expression.cs (Binary::ResolveOperator): Update accordingly.
22217         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22218         and 'Minus'
22219
22220         * cs-parser.jay (unary_expression): Update to use the new names.
22221
22222         * gen-treedump.cs (GetUnary): Same here.
22223
22224         * expression.cs (Unary::Resolve): Implement.
22225         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22226         operators are found instead of making noise ;-)
22227         (Unary::ResolveOperator): New method to do precisely the same thing which
22228         Binary::ResolveOperator does for Binary expressions.
22229         (Unary.method, .Arguments): Add.
22230         (Unary::OperName): Implement.   
22231         (Unary::ForceConversion): Copy and Paste !
22232
22233         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22234         a unary operator.
22235
22236         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22237         for the inbuilt operators. Only overloading works for now ;-)
22238
22239 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22240
22241         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22242         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22243
22244         * expression.cs (This::Emit): Implement. 
22245         (This::Resolve): Implement.
22246         (TypeOf:Resolve): Implement.
22247         (Expression::ResolveSimpleName): Add an implicit this to instance
22248         field references. 
22249         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22250         Bind instance variable to Field expressions.
22251         (FieldExpr::Instance): New field used to track the expression that
22252         represents the object instance.
22253         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22254         binding 
22255         (FieldExpr::Emit): Implement.
22256
22257         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22258         the last instruction contains a return opcode to avoid generating
22259         the last `ret' instruction (this generates correct code, and it is
22260         nice to pass the peverify output).
22261
22262         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22263         initializer for static and instance variables.
22264         (Constructor::Emit): Allow initializer to be null in the case of
22265         static constructors.  Only emit initializer for instance
22266         constructors. 
22267
22268         (TypeContainer::FindMembers): Return a null array if there are no
22269         matches.
22270
22271         Also fix the code for the MemberTypes.Method branch, as it was not
22272         scanning that for operators (or tried to access null variables before).
22273
22274         * assign.cs (Assign::Emit): Handle instance and static fields. 
22275
22276         * TODO: Updated.
22277
22278         * driver.cs: Stop compilation if there are parse errors.
22279
22280         * cs-parser.jay (constructor_declaration): Provide default base
22281         initializer for non-static constructors.
22282         (constructor_declarator): Do not provide a default base
22283         initializers if none was specified.
22284         Catch the fact that constructors should not have parameters.
22285
22286         * class.cs: Do not emit parent class initializers for static
22287         constructors, that should be flagged as an error.
22288
22289 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22290
22291         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22292         Move back code into TypeContainer::Populate.
22293
22294 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22295
22296         * class.cs (TypeContainer::AddConstructor): Fix the check to
22297         compare against Name, not Basename. 
22298         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22299
22300         * cs-parser.jay : Update accordingly.
22301
22302         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22303         for methods, don't forget to look into the operators too.
22304         (RegisterMethodBuilder): Helper method to take care of this for
22305         methods, constructors and operators.
22306         (Operator::Define): Completely revamp.
22307         (Operator.OperatorMethod, MethodName): New fields.
22308         (TypeContainer::Populate): Move the registering of builders into
22309         RegisterMethodBuilder.
22310         (Operator::Emit): Re-write.
22311
22312         * expression.cs (Binary::Emit): Comment out code path to emit method
22313         invocation stuff for the case when we have a user defined operator. I am
22314         just not able to get it right !
22315
22316 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22317
22318         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22319         argument. 
22320
22321         (Expression::MemberLookup): Provide a version that allows to
22322         specify the MemberTypes and BindingFlags. 
22323
22324         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22325         so it was not fetching variable information from outer blocks.
22326
22327         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22328         Beforefieldinit as it was buggy.
22329
22330         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22331         that Ravi put here.  
22332
22333         * class.cs (Constructor::Emit): Only emit if block is not null.
22334         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22335         deal with this by semantically definining it as if the user had
22336         done it.
22337
22338         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22339         constructors as we now "emit" them at a higher level.
22340
22341         (TypeContainer::DefineDefaultConstructor): Used to define the
22342         default constructors if none was provided.
22343
22344         (ConstructorInitializer): Add methods Resolve and Emit. 
22345
22346         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22347
22348 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22349
22350         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22351         the default constructor builder with our hashtable for methodbuilders
22352         to methodcores.
22353
22354         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22355         and argument_count is 0 in which case we have a match.
22356         (Binary::ResolveOperator): More null checking and miscellaneous coding
22357         style cleanup.
22358
22359 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22360
22361         * rootcontext.cs (IsNameSpace): Compare against null.
22362
22363         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22364
22365         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22366         and Unary::Operator.
22367
22368         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22369         accordingly.
22370
22371         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22372         we have overloaded operators.
22373         (Binary::ResolveOperator): Implement the part which does the operator overload
22374         resolution.
22375
22376         * class.cs (Operator::Emit): Implement.
22377         (TypeContainer::Emit): Emit the operators we have too.
22378
22379         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22380         the case when we have a user-defined operator.
22381
22382 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22383
22384         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22385
22386 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22387
22388         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22389         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22390         (Constructor::Emit): Implement.
22391         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22392         if we have no work to do. 
22393         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22394         Emit method.
22395
22396         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22397         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22398
22399         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22400         of parent.parent.
22401
22402 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22403
22404         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22405         in the source.
22406         (Tree::RecordNamespace): Method to do what the name says ;-)
22407         (Tree::Namespaces): Property to get at the namespaces hashtable.
22408
22409         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22410         keep track.
22411
22412         * rootcontext.cs (IsNamespace): Fixed it :-)
22413
22414 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22415
22416         * class.cs (TypeContainer::FindMembers): Add support for
22417         constructors. 
22418         (MethodCore): New class that encapsulates both the shared aspects
22419         of a Constructor and a Method.  
22420         (Method, Constructor): Factored pieces into MethodCore.
22421
22422         * driver.cs: Added --fatal which makes errors throw exceptions.
22423         Load System assembly as well as part of the standard library.
22424
22425         * report.cs: Allow throwing exceptions on errors for debugging.
22426
22427         * modifiers.cs: Do not use `parent', instead use the real type
22428         container to evaluate permission settings.
22429
22430         * class.cs: Put Ravi's patch back in.  He is right, and we will
22431         have to cope with the
22432
22433 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22434
22435         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22436         FamORAssem, not FamANDAssem.
22437
22438 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22439
22440         * driver.cs: Added --parse option that only parses its input files
22441         and terminates.
22442
22443         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22444         incorrect.  IsTopLevel is not used to tell whether an object is
22445         root_types or not (that can be achieved by testing this ==
22446         root_types).  But to see if this is a top-level *class* (not
22447         necessarly our "toplevel" container). 
22448
22449 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22450
22451         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22452         parent instead of a direct call to GetType.
22453
22454 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22455
22456         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22457         Modifiers.TypeAttr. This should just be a call to that method.
22458
22459         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22460         object so that we can determine if we are top-level or not.
22461
22462         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22463         TypeContainer too.
22464
22465         * enum.cs (Enum::Define): Ditto.
22466
22467         * modifiers.cs (FieldAttr): Re-write.
22468
22469         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22470         (TypeContainer::HaveStaticConstructor): New property to provide access
22471         to precisely that info.
22472
22473         * modifiers.cs (MethodAttr): Re-write.
22474         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22475
22476         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22477         of top-level types as claimed.
22478
22479 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22480
22481         * expression.cs (MemberLookup): Fruitless attempt to lookup
22482         constructors.  Maybe I need to emit default constructors?  That
22483         might be it (currently .NET emits this for me automatically).
22484         (Invocation::OverloadResolve): Cope with Arguments == null.
22485         (Invocation::EmitArguments): new function, shared by the new
22486         constructor and us.
22487         (Invocation::Emit): Handle static and instance methods.  Emit
22488         proper call instruction for virtual or non-virtual invocations.
22489         (New::Emit): Implement.
22490         (New::Resolve): Implement.
22491         (MemberAccess:Resolve): Implement.
22492         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22493         to track instances.
22494         (FieldExpr::Resolve): Set type.
22495
22496         * support.cs: Handle empty arguments.
22497                 
22498         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22499         SimpleLookup): Auxiliary routines to help parse a qualifier
22500         identifier.  
22501
22502         Update qualifier_identifier rule.
22503
22504         * codegen.cs: Removed debugging messages.
22505
22506         * class.cs: Make this a global thing, this acts just as a "key" to
22507         objects that we might have around.
22508
22509         (Populate): Only initialize method_builders_to_methods once.
22510
22511         * expression.cs (PropertyExpr): Initialize type from the
22512         PropertyType. 
22513
22514         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22515         Resolve pattern.  Attempt to implicitly convert value to boolean.
22516         Emit code.
22517
22518         * expression.cs: Set the type for the int32/int32 argument case.
22519         (Binary::ResolveOperator): Set the return type to boolean for
22520         comparission operators
22521
22522         * typemanager.cs: Remove debugging print code.
22523
22524         (Invocation::Resolve): resolve type.
22525
22526         * class.cs: Allocate a MemberInfo of the correct size, as the code
22527         elsewhere depends on the test to reflect the correct contents.
22528
22529         (Method::) Keep track of parameters, due to System.Reflection holes
22530
22531         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22532         mapping here.
22533
22534         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22535         of the exact size and return that.
22536
22537         (Class::LookupMethodByBuilder): New function that maps
22538         MethodBuilders to its methods.  Required to locate the information
22539         on methods because System.Reflection bit us again.
22540
22541         * support.cs: New file, contains an interface ParameterData and
22542         two implementations: ReflectionParameters and InternalParameters
22543         used to access Parameter information.  We will need to grow this
22544         as required.
22545
22546         * expression.cs (Invocation::GetParameterData): implement a cache
22547         and a wrapper around the ParameterData creation for methods. 
22548         (Invocation::OverloadResolve): Use new code.
22549
22550 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22551
22552         * class.cs (TypeContainer::EmitField): Remove and move into 
22553         (Field::Define): here and modify accordingly.
22554         (Field.FieldBuilder): New member.
22555         (TypeContainer::Populate): Update accordingly.
22556         (TypeContainer::FindMembers): Implement.
22557
22558 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22559
22560         * statement.cs: (VariableInfo::VariableType): New field to be
22561         initialized with the full type once it is resolved. 
22562
22563 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22564
22565         * parameter.cs (GetParameterInfo): Use a type cache to compute
22566         things only once, and to reuse this information
22567
22568         * expression.cs (LocalVariableReference::Emit): Implement.
22569         (OpcodeCast::Emit): fix.
22570
22571         (ParameterReference::Resolve): Implement.
22572         (ParameterReference::Emit): Implement.
22573
22574         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22575         that are expressions need to stay as Expressions.
22576
22577         * typemanager.cs (CSharpName): Returns the C# name of a type if
22578         possible. 
22579
22580         * expression.cs (Expression::ConvertImplicit): New function that
22581         implements implicit type conversions.
22582
22583         (Expression::ImplicitReferenceConversion): Implements implicit
22584         reference conversions.
22585
22586         (EmptyCast): New type for transparent casts.
22587
22588         (OpcodeCast): New type for casts of types that are performed with
22589         a sequence of bytecodes.
22590
22591         (BoxedCast): New type used for casting value types into reference
22592         types.  Emits a box opcode.
22593
22594         (Binary::DoNumericPromotions): Implements numeric promotions of
22595         and computation of the Binary::Type.
22596
22597         (Binary::EmitBranchable): Optimization.
22598
22599         (Binary::Emit): Implement code emission for expressions.
22600
22601         * typemanager.cs (TypeManager): Added two new core types: sbyte
22602         and byte.
22603
22604 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22605
22606         * class.cs (TypeContainer::FindMembers): Method which does exactly
22607         what Type.FindMembers does, only we don't have to use reflection. No
22608         implementation yet.
22609
22610         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22611         typecontainer objects as we need to get at them.
22612         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22613
22614         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22615         typecontainer object.
22616
22617         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22618         of just a Report object.
22619
22620 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22621
22622         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22623         "remove_"
22624         (TypeContainer::Populate): Now define the delegates of the type too.
22625         (TypeContainer.Delegates): Property to access the list of delegates defined
22626         in the type.
22627
22628         * delegates.cs (Delegate::Define): Implement partially.
22629
22630         * modifiers.cs (TypeAttr): Handle more flags.
22631
22632 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22633
22634         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22635         and not <=
22636         (Operator::Define): Re-write logic to get types by using the LookupType method
22637         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22638         (Indexer::Define): Ditto.
22639         (Event::Define): Ditto.
22640         (Property::Define): Ditto.
22641
22642 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22643
22644         * class.cs (TypeContainer::Populate): Now define operators too. 
22645         (TypeContainer.Operators): New property to access the list of operators
22646         in a type.
22647         (Operator.OperatorMethodBuilder): New member to hold the method builder
22648         for the operator we are defining.
22649         (Operator::Define): Implement.
22650
22651 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22652
22653         * class.cs (Event::Define): Make the prefixes of the accessor methods
22654         addOn_ and removeOn_ 
22655
22656         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22657         of the location being passed in too. Ideally, this should go later since all
22658         error reporting should be done through the Report object.
22659
22660         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22661         (Populate): Iterate thru the indexers we have and define them too.
22662         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22663         for the get and set accessors.
22664         (Indexer::Define): Implement.
22665
22666 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22667
22668         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22669         my previous implementation, did not work.
22670
22671         * typemanager.cs: Add a couple of missing types (the longs).
22672
22673         * literal.cs: Use TypeManager.bool_type instead of getting it.
22674
22675         * expression.cs (EventExpr): New kind of expressions.
22676         (Expressio::ExprClassFromMemberInfo): finish
22677
22678 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22679
22680         * assign.cs: Emit stores to static fields differently.
22681
22682 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22683
22684         * Merge in changes and adjust code to tackle conflicts. Backed out my
22685         code in Assign::Resolve ;-) 
22686
22687 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22688
22689         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22690         instead Report.Error and also pass in the location.
22691         (CSharpParser::Lexer): New readonly property to return the reference
22692         to the Tokenizer object.
22693         (declare_local_variables): Use Report.Error with location instead of plain 
22694         old error.
22695         (CheckDef): Ditto.
22696
22697         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22698         (Operator.CheckBinaryOperator): Ditto.
22699
22700         * cs-parser.jay (operator_declarator): Update accordingly.
22701
22702         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22703         (CheckBinaryOperator): Same here.
22704
22705         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22706         on the name without any prefixes of namespace names etc. This is because we
22707         already might have something already fully qualified like 
22708         'System.Console.WriteLine'
22709
22710         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22711
22712 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22713
22714         * cs-tokenizer.cs (location): Return a string which also contains
22715         the file name.
22716
22717         * expression.cs (ElementAccess): New class for expressions of the
22718         type 'element access.'
22719         (BaseAccess): New class for expressions of the type 'base access.'
22720         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22721         respectively.
22722
22723         * cs-parser.jay (element_access): Implement action.
22724         (base_access): Implement actions.
22725         (checked_expression, unchecked_expression): Implement.
22726
22727         * cs-parser.jay (local_variable_type): Correct and implement.
22728         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22729
22730         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22731
22732         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22733         name and the specifiers.
22734
22735         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22736
22737         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22738         making them all public ;-)
22739
22740         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22741         class anyways.
22742
22743 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22744
22745         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22746         PropertyExprs.
22747         (FieldExpr, PropertyExprs): New resolved expressions.
22748         (SimpleName::MemberStaticCheck): Perform static checks for access
22749         to non-static fields on static methods. Maybe this should be
22750         generalized for MemberAccesses. 
22751         (SimpleName::ResolveSimpleName): More work on simple name
22752         resolution. 
22753
22754         * cs-parser.jay (primary_expression/qualified_identifier): track
22755         the parameter index.
22756
22757         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22758         (EmitContext::EmitBoolExpression): Chain to expression generation
22759         instead of temporary hack.
22760         (::EmitStatementExpression): Put generic expression code generation.
22761
22762         * assign.cs (Assign::Emit): Implement variable assignments to
22763         local variables, parameters and fields.
22764
22765 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22766
22767         * statement.cs (Block::GetVariableInfo): New method, returns the
22768         VariableInfo for a variable name in a block.
22769         (Block::GetVariableType): Implement in terms of GetVariableInfo
22770
22771         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22772         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22773
22774 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22775
22776         * cs-parser.jay (operator_declaration): Continue on my quest : update
22777         to take attributes argument.
22778         (event_declaration): Ditto.
22779         (enum_declaration): Ditto.
22780         (indexer_declaration): Ditto.
22781
22782         * class.cs (Operator::Operator): Update constructor accordingly.
22783         (Event::Event): Ditto.
22784
22785         * delegate.cs (Delegate::Delegate): Same here.
22786
22787         * enum.cs (Enum::Enum): Same here.
22788
22789 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22790
22791         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22792
22793         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22794
22795         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22796         being passed around as an arraylist.
22797         (Attributes::AddAttribute): Method to add attribute sections.
22798
22799         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22800         (struct_declaration): Update accordingly.
22801         (constant_declaration): Update.
22802         (field_declaration): Update.
22803         (method_header): Update.
22804         (fixed_parameter): Update.
22805         (parameter_array): Ditto.
22806         (property_declaration): Ditto.
22807         (destructor_declaration): Ditto.
22808
22809         * class.cs (Struct::Struct): Update constructors accordingly.
22810         (Class::Class): Ditto.
22811         (Field::Field): Ditto.
22812         (Method::Method): Ditto.
22813         (Property::Property): Ditto.
22814         (TypeContainer::OptAttribute): update property's return type.
22815
22816         * interface.cs (Interface.opt_attributes): New member.
22817         (Interface::Interface): Update to take the extra Attributes argument.
22818
22819         * parameter.cs (Parameter::Parameter): Ditto.
22820
22821         * constant.cs (Constant::Constant): Ditto.
22822
22823         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22824         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22825         the attributes as a parameter.
22826         (InterfaceProperty): Update constructor call.
22827         (InterfaceEvent): Ditto.
22828         (InterfaceMethod): Ditto.
22829         (InterfaceIndexer): Ditto.
22830
22831         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22832         pass the attributes too.
22833         (interface_event_declaration): Ditto.
22834         (interface_property_declaration): Ditto.
22835         (interface_method_declaration): Ditto.
22836         (interface_declaration): Ditto.
22837
22838 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * class.cs (Method::Define): Track the "static Main" definition to
22841         create an entry point. 
22842
22843         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22844         EntryPoint if we find it. 
22845
22846         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22847         (EmitContext::ig): Make this variable public.
22848
22849         * driver.cs: Make the default output file be the first file name
22850         with the .exe extension.  
22851
22852         Detect empty compilations
22853
22854         Handle various kinds of output targets.  Handle --target and
22855         rename -t to --dumper.
22856
22857         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22858         methods inherited from Expression return now an Expression.  This
22859         will is used during the tree rewriting as we resolve them during
22860         semantic analysis.
22861
22862         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22863         the spec.  Missing entirely is the information about
22864         accessability of elements of it.
22865
22866         (Expression::ExprClassFromMemberInfo): New constructor for
22867         Expressions that creates a fully initialized Expression based on
22868         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22869         a Type.
22870
22871         (Invocation::Resolve): Begin implementing resolution of invocations.
22872
22873         * literal.cs (StringLiteral):  Implement Emit.
22874
22875 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22876
22877         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22878         member.
22879
22880 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22881
22882         * cs-parser.jay (attribute_arguments): Implement actions.
22883         (attribute): Fix bug in production. Implement action.
22884         (attribute_list): Implement.
22885         (attribute_target): Implement.
22886         (attribute_target_specifier, opt_target_specifier): Implement
22887         (CheckAttributeTarget): New method to check if the attribute target
22888         is valid.
22889         (attribute_section): Implement.
22890         (opt_attributes): Implement.
22891
22892         * attribute.cs : New file to handle attributes.
22893         (Attribute): Class to hold attribute info.
22894
22895         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22896         (attribute_section): Modify production to use 2 different rules to 
22897         achieve the same thing. 1 s/r conflict down !
22898         Clean out commented, useless, non-reducing dimension_separator rules.
22899
22900         * class.cs (TypeContainer.attributes): New member to hold list
22901         of attributes for a type.
22902         (Struct::Struct): Modify to take one more argument, the attribute list.
22903         (Class::Class): Ditto.
22904         (Field::Field): Ditto.
22905         (Method::Method): Ditto.
22906         (Property::Property): Ditto.
22907
22908         * cs-parser.jay (struct_declaration): Update constructor call to
22909         pass in the attributes too.
22910         (class_declaration): Ditto.
22911         (constant_declaration): Ditto.
22912         (field_declaration): Ditto.
22913         (method_header): Ditto.
22914         (fixed_parameter): Ditto.
22915         (parameter_array): Ditto.
22916         (property_declaration): Ditto.
22917
22918         * constant.cs (Constant::Constant): Update constructor similarly.
22919         Use System.Collections.
22920
22921         * parameter.cs (Parameter::Parameter): Update as above.
22922
22923 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22924
22925         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22926         (TypeContainer.delegates): New member to hold list of delegates.
22927
22928         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22929         this time as I seem to be on crack ;-)
22930
22931 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22932
22933         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22934         tell whether an identifier represents a namespace.
22935
22936         * expression.cs (NamespaceExpr): A namespace expression, used only
22937         temporarly during expression resolution.
22938         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22939         utility functions to resolve names on expressions.
22940
22941 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22942
22943         * codegen.cs: Add hook for StatementExpressions. 
22944
22945         * class.cs: Fix inverted test for static flag in methods.
22946
22947 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22948
22949         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22950         to make it coincide with MS' number.
22951         (Operator::CheckBinaryOperator): Ditto.
22952
22953         * ../errors/errors.txt : Remove error numbers added earlier.
22954
22955         * ../errors/cs1019.cs : Test case for error # 1019
22956
22957         * ../errros/cs1020.cs : Test case for error # 1020
22958
22959         * cs-parser.jay : Clean out commented cruft.
22960         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22961         used anywhere - non-reducing rule.
22962         (namespace_declarations): Non-reducing rule - comment out.
22963
22964         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22965         with TypeContainer::AddEnum.
22966
22967         * delegate.cs : New file for delegate handling classes.
22968         (Delegate): Class for declaring delegates.
22969
22970         * makefile : Update.
22971
22972         * cs-parser.jay (delegate_declaration): Implement.
22973
22974 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22975
22976         * class.cs (Event::Define): Implement.
22977         (Event.EventBuilder): New member.
22978
22979         * class.cs (TypeContainer::Populate): Update to define all enums and events
22980         we have.
22981         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22982         readonly fields for all these cases ?
22983
22984 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22985
22986         * class.cs (Property): Revamp to use the convention of making fields readonly.
22987         Accordingly modify code elsewhere.
22988
22989         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22990         the Define method of the Property class.
22991
22992         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22993         trivial bug.
22994         (TypeContainer::Populate): Update to define all the properties we have. Also
22995         define all enumerations.
22996
22997         * enum.cs (Define): Implement.
22998
22999 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23000
23001         * cs-parser.jay (overloadable_operator): The semantic value is an
23002         enum of the Operator class.
23003         (operator_declarator): Implement actions.
23004         (operator_declaration): Implement.
23005
23006         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23007         validity of definitions.
23008         (Operator::CheckBinaryOperator): Static method to check for binary operators
23009         (TypeContainer::AddOperator): New method to add an operator to a type.
23010
23011         * cs-parser.jay (indexer_declaration): Added line to actually call the
23012         AddIndexer method so it gets added ;-)
23013
23014         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23015         already taken care of by the MS compiler ?  
23016
23017 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23018
23019         * class.cs (Operator): New class for operator declarations.
23020         (Operator::OpType): Enum for the various operators.
23021
23022 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23023
23024         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23025         ostensibly handle this in semantic analysis.
23026
23027         * cs-parser.jay (general_catch_clause): Comment out
23028         (specific_catch_clauses, specific_catch_clause): Ditto.
23029         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23030         (catch_args, opt_catch_args): New productions.
23031         (catch_clause): Rewrite to use the new productions above
23032         (catch_clauses): Modify accordingly.
23033         (opt_catch_clauses): New production to use in try_statement
23034         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23035         and re-write the code in the actions to extract the specific and
23036         general catch clauses by being a little smart ;-)
23037
23038         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23039         Hooray, try and catch statements parse fine !
23040
23041 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23042
23043         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23044         string from the hashtable of variables.
23045
23046         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23047         I end up making that mistake ;-)
23048         (catch_clauses): Fixed gross error which made Key and Value of the 
23049         DictionaryEntry the same : $1 !!
23050
23051 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23052
23053         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23054
23055         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23056         when the add and remove accessors are specified. 
23057
23058 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23059
23060         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23061         information about indexer_declarator.
23062         (indexer_declarator): Implement actions.
23063         (parsing_indexer): New local boolean used to keep track of whether
23064         we are parsing indexers or properties. This is necessary because 
23065         implicit_parameters come into picture even for the get accessor in the 
23066         case of an indexer.
23067         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23068
23069         * class.cs (Indexer): New class for indexer declarations.
23070         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23071         (TypeContainer::indexers): New member to hold list of indexers for the
23072         type.
23073
23074 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23075
23076         * cs-parser.jay (add_accessor_declaration): Implement action.
23077         (remove_accessor_declaration): Implement action.
23078         (event_accessors_declaration): Implement
23079         (variable_declarators): swap statements for first rule - trivial.
23080
23081         * class.cs (Event): New class to hold information about event
23082         declarations.
23083         (TypeContainer::AddEvent): New method to add an event to a type
23084         (TypeContainer::events): New member to hold list of events.
23085
23086         * cs-parser.jay (event_declaration): Implement actions.
23087
23088 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23089
23090         * cs-parser.jay (dim_separators): Implement. Make it a string
23091         concatenating all the commas together, just as they appear.
23092         (opt_dim_separators): Modify accordingly
23093         (rank_specifiers): Update accordingly. Basically do the same
23094         thing - instead, collect the brackets here.
23095         (opt_rank_sepcifiers): Modify accordingly.
23096         (array_type): Modify to actually return the complete type string
23097         instead of ignoring the rank_specifiers.
23098         (expression_list): Implement to collect the expressions
23099         (variable_initializer): Implement. We make it a list of expressions
23100         essentially so that we can handle the array_initializer case neatly too.
23101         (variable_initializer_list): Implement.
23102         (array_initializer): Make it a list of variable_initializers
23103         (opt_array_initializer): Modify accordingly.
23104
23105         * expression.cs (New::NType): Add enumeration to help us
23106         keep track of whether we have an object/delegate creation
23107         or an array creation.
23108         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23109         members to hold data about array creation.
23110         (New:New): Modify to update NewType
23111         (New:New): New Overloaded contructor for the array creation
23112         case.
23113
23114         * cs-parser.jay (array_creation_expression): Implement to call
23115         the overloaded New constructor.
23116
23117 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23118
23119         * class.cs (TypeContainer::Constructors): Return member
23120         constructors instead of returning null.
23121
23122 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23123
23124         * typemanager.cs (InitCoreTypes): Initialize the various core
23125         types after we have populated the type manager with the user
23126         defined types (this distinction will be important later while
23127         compiling corlib.dll)
23128
23129         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23130         on Expression Classification.  Now all expressions have a method
23131         `Resolve' and a method `Emit'.
23132
23133         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23134         generation from working.     Also add some temporary debugging
23135         code. 
23136
23137 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23138
23139         * codegen.cs: Lots of code generation pieces.  This is only the
23140         beginning, will continue tomorrow with more touches of polish.  We
23141         handle the fundamentals of if, while, do, for, return.  Others are
23142         trickier and I need to start working on invocations soon.
23143
23144         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23145         s.InitStatement. 
23146
23147         * codegen.cs (EmitContext): New struct, used during code
23148         emission to keep a context.   Most of the code generation will be
23149         here. 
23150
23151         * cs-parser.jay: Add embedded blocks to the list of statements of
23152         this block.  So code generation proceeds in a top down fashion.
23153
23154 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23155
23156         * statement.cs: Add support for multiple child blocks.
23157
23158 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23159
23160         * codegen.cs (EmitCode): New function, will emit the code for a
23161         Block of code given a TypeContainer and its ILGenerator. 
23162
23163         * statement.cs (Block): Standard public readonly optimization.
23164         (Block::Block constructors): Link children. 
23165         (Block::Child): Child Linker.
23166         (Block::EmitVariables): Emits IL variable declarations.
23167
23168         * class.cs: Drop support for MethodGroups here, delay until
23169         Semantic Analysis.
23170         (Method::): Applied the same simplification that I did before, and
23171         move from Properties to public readonly fields.
23172         (Method::ParameterTypes): Returns the parameter types for the
23173         function, and implements a cache that will be useful later when I
23174         do error checking and the semantic analysis on the methods is
23175         performed.
23176         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23177         and made a method, optional argument tells whether this is a class
23178         or a structure to apply the `has-this' bit.
23179         (Method::GetCallingConvention): Implement, returns the calling
23180         convention. 
23181         (Method::Define): Defines the type, a second pass is performed
23182         later to populate the methods.
23183
23184         (Constructor::ParameterTypes): implement a cache similar to the
23185         one on Method::ParameterTypes, useful later when we do semantic
23186         analysis. 
23187
23188         (TypeContainer::EmitMethod):  New method.  Emits methods.
23189
23190         * expression.cs: Removed MethodGroup class from here.
23191
23192         * parameter.cs (Parameters::GetCallingConvention): new method.
23193
23194 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23195
23196         * class.cs (TypeContainer::Populate): Drop RootContext from the
23197         argument. 
23198
23199         (Constructor::CallingConvention): Returns the calling convention.
23200         (Constructor::ParameterTypes): Returns the constructor parameter
23201         types. 
23202
23203         (TypeContainer::AddConstructor): Keep track of default constructor
23204         and the default static constructor.
23205
23206         (Constructor::) Another class that starts using `public readonly'
23207         instead of properties. 
23208
23209         (Constructor::IsDefault): Whether this is a default constructor. 
23210
23211         (Field::) use readonly public fields instead of properties also.
23212
23213         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23214         track of static constructors;  If none is used, turn on
23215         BeforeFieldInit in the TypeAttributes. 
23216
23217         * cs-parser.jay (opt_argument_list): now the return can be null
23218         for the cases where there are no arguments. 
23219
23220         (constructor_declarator): If there is no implicit `base' or
23221         `this', then invoke the default parent constructor. 
23222
23223         * modifiers.cs (MethodAttr): New static function maps a set of
23224         modifiers flags into a MethodAttributes enum
23225         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23226         MethodAttr, TypeAttr to represent the various mappings where the
23227         modifiers are used.
23228         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23229
23230 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23231
23232         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23233         method arguments.
23234
23235         * interface.cs (PopulateIndexer): Implemented the code generator
23236         for interface indexers.
23237
23238 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23239
23240         * interface.cs (InterfaceMemberBase): Now we track the new status
23241         here.  
23242
23243         (PopulateProperty): Implement property population.  Woohoo!  Got
23244         Methods and Properties going today. 
23245
23246         Removed all the properties for interfaces, and replaced them with
23247         `public readonly' fields. 
23248
23249 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23250
23251         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23252         initialize their hashtables/arraylists only when they are needed
23253         instead of doing this always.
23254
23255         * parameter.cs: Handle refs and out parameters.
23256
23257         * cs-parser.jay: Use an ArrayList to construct the arguments
23258         instead of the ParameterCollection, and then cast that to a
23259         Parameter[] array.
23260
23261         * parameter.cs: Drop the use of ParameterCollection and use
23262         instead arrays of Parameters.
23263
23264         (GetParameterInfo): Use the Type, not the Name when resolving
23265         types. 
23266
23267 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23268
23269         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23270         and instead use public readonly fields.
23271
23272         * class.cs: Put back walking code for type containers.
23273
23274 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23275
23276         * class.cs (MakeConstant): Code to define constants.
23277
23278         * rootcontext.cs (LookupType): New function.  Used to locate types 
23279
23280
23281 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23282
23283         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23284         this System.Reflection code is.  Kudos to Microsoft
23285
23286         * typemanager.cs: Implement a type cache and avoid loading all
23287         types at boot time.  Wrap in LookupType the internals.  This made
23288         the compiler so much faster.  Wow.  I rule!
23289
23290         * driver.cs: Make sure we always load mscorlib first (for
23291         debugging purposes, nothing really important).
23292
23293         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23294         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23295
23296         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23297         on namespaces that have been imported using the `using' keyword.
23298
23299         * class.cs (TypeContainer::TypeAttr): Virtualize.
23300         (Class::TypeAttr): Return attributes suitable for this bad boy.
23301         (Struct::TypeAttr): ditto.
23302         Handle nested classes.
23303         (TypeContainer::) Remove all the type visiting code, it is now
23304         replaced with the rootcontext.cs code
23305
23306         * rootcontext.cs (GetClassBases): Added support for structs. 
23307
23308 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23309
23310         * interface.cs, statement.cs, class.cs, parameter.cs,
23311         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23312         Drop use of TypeRefs, and use strings instead.
23313
23314 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23315
23316         * rootcontext.cs: 
23317
23318         * class.cs (Struct::Struct): set the SEALED flags after
23319         checking the modifiers.
23320         (TypeContainer::TypeAttr): new property, returns the
23321         TypeAttributes for a class.  
23322
23323         * cs-parser.jay (type_list): Oops, list production was creating a
23324         new list of base types.
23325
23326         * rootcontext.cs (StdLib): New property.
23327         (GetInterfaceTypeByName): returns an interface by type name, and
23328         encapsulates error handling here.
23329         (GetInterfaces): simplified.
23330         (ResolveTree): Encapsulated all the tree resolution here.
23331         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23332         types. 
23333
23334         * driver.cs: Add support for --nostdlib, to avoid loading the
23335         default assemblies.
23336         (Main): Do not put tree resolution here. 
23337
23338         * rootcontext.cs: Beginning of the class resolution.
23339
23340 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23341
23342         * rootcontext.cs: Provide better error reporting. 
23343
23344         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23345
23346         * rootcontext.cs (CreateInterface): Handle the case where there
23347         are no parent interfaces.
23348
23349         (CloseTypes): Routine to flush types at the end.
23350         (CreateInterface): Track types.
23351         (GetInterfaces): Returns an array of Types from the list of
23352         defined interfaces.
23353
23354         * typemanager.c (AddUserType): Mechanism to track user types (puts
23355         the type on the global type hash, and allows us to close it at the
23356         end). 
23357
23358 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23359
23360         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23361         RecordInterface instead.
23362
23363         * cs-parser.jay: Updated to reflect changes above.
23364
23365         * decl.cs (Definition): Keep track of the TypeBuilder type that
23366         represents this type here.  Not sure we will use it in the long
23367         run, but wont hurt for now.
23368
23369         * driver.cs: Smaller changes to accomodate the new code.
23370
23371         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23372         when done. 
23373
23374         * rootcontext.cs (CreateInterface):  New method, used to create
23375         the System.TypeBuilder type for interfaces.
23376         (ResolveInterfaces): new entry point to resolve the interface
23377         hierarchy. 
23378         (CodeGen): Property, used to keep track of the code generator.
23379
23380 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23381
23382         * cs-parser.jay: Add a second production for delegate_declaration
23383         with `VOID'.
23384
23385         (enum_body): Put an opt_comma here instead of putting it on
23386         enum_body or enum_member_declarations so we can handle trailing
23387         commas on enumeration members.  Gets rid of a shift/reduce.
23388
23389         (type_list): Need a COMMA in the middle.
23390
23391         (indexer_declaration): Tell tokenizer to recognize get/set
23392
23393         * Remove old targets.
23394
23395         * Re-add the parser target.
23396
23397 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23398
23399         * cs-parser.jay: Add precendence rules for a number of operators
23400         ot reduce the number of shift/reduce conflicts in the grammar.
23401
23402 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23403
23404         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23405         and put it here.
23406
23407         Get rid of old crufty code.
23408
23409         * rootcontext.cs: Use this to keep track of the parsed
23410         representation and the defined types available to the program. 
23411
23412         * gen-treedump.cs: adjust for new convention.
23413
23414         * type.cs: Split out the type manager, and the assembly builder
23415         from here. 
23416
23417         * typemanager.cs: the type manager will live here now.
23418
23419         * cil-codegen.cs: And the code generator here. 
23420
23421 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23422
23423         * makefile: Fixed up for easy making.
23424
23425 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23426
23427         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23428         the 
23429
23430         (unary_expression): Expand pre_increment_expression and
23431         post_decrement_expression to reduce a shift/reduce.
23432
23433 2001-07-11  Simon Cozens
23434
23435         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23436
23437         Improve allow_keyword_as_indent name.
23438
23439 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23440
23441         * Adjustments for Beta2. 
23442
23443 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23444
23445         * decl.cs: Added `Define' abstract method.
23446         (InTransit): new property, used to catch recursive definitions. 
23447
23448         * interface.cs: Implement `Define'. 
23449
23450         * modifiers.cs: Map Modifiers.constants to
23451         System.Reflection.TypeAttribute flags.
23452
23453         * class.cs: Keep track of types and user-defined types.
23454         (BuilderInit): New method for creating an assembly
23455         (ResolveType): New function to launch the resolution process, only
23456         used by interfaces for now.
23457
23458         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23459         that are inserted into the name space. 
23460
23461 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23462
23463         * ARGH.  I have screwed up my tree so many times due to the use of
23464         rsync rather than using CVS.  Going to fix this at once. 
23465
23466         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23467         load types.
23468
23469 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23470
23471         * Experiment successful: Use System.Type rather that our own
23472         version of Type.  
23473
23474 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * cs-parser.jay: Removed nsAliases from here.
23477
23478         Use new namespaces, handle `using XXX;' 
23479
23480         * namespace.cs: Reimplemented namespace handling, use a recursive
23481         definition of the class.  Now we can keep track of using clauses
23482         and catch invalid using clauses.
23483
23484 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23485
23486         * gen-treedump.cs: Adapted for all the renaming.
23487
23488         * expression.cs (Expression): this class now has a Type property
23489         which returns an expression Type.
23490
23491         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23492         `Type', as this has a different meaning now in the base
23493
23494 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23495
23496         * interface.cs, class.cs: Removed from all the sources the
23497         references to signature computation, as we can not do method
23498         signature computation during the parsing time, as we are not
23499         trying to solve at that point distinguishing:
23500
23501         class X {
23502                 void a (Blah x) {}
23503                 void a (NS.Blah x) {}
23504         }
23505
23506         Which depending on the context might be valid or not, as we do not
23507         know if Blah is the same thing as NS.Blah at that point.
23508
23509         * Redid everything so the code uses TypeRefs now instead of
23510         Types.  TypeRefs are just temporary type placeholders, that need
23511         to be resolved.  They initially have a pointer to a string and the
23512         current scope in which they are used.  This is used later by the
23513         compiler to resolve the reference to an actual Type. 
23514
23515         * DeclSpace is no longer a CIR.Type, and neither are
23516         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23517         are all DeclSpaces, but no Types. 
23518
23519         * type.cs (TypeRefManager): This implements the TypeRef manager,
23520         which keeps track of all the types that need to be resolved after
23521         the parsing has finished. 
23522
23523 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23524
23525         * ARGH.  We are going to have to store `foreach' as a class rather
23526         than resolving it, as we need to verify error 1579 after name
23527         resolution.   *OR* we could keep a flag that says `This request to
23528         IEnumerator comes from a foreach statement' which we can then use
23529         to generate the error.
23530
23531 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23532
23533         * class.cs (TypeContainer.AddMethod): we now add methods to the
23534         MethodGroup instead of the method hashtable.  
23535
23536         * expression.cs: Add MethodGroup abstraction, which gets us one
23537         step closer to the specification in the way we handle method
23538         declarations.  
23539
23540         * cs-parser.jay (primary_expression): qualified_identifier now
23541         tried to match up an identifier to a local variable reference or
23542         to a parameter reference.
23543
23544         current_local_parameters is now a parser global variable that
23545         points to the current parameters for the block, used during name
23546         lookup.
23547
23548         (property_declaration): Now creates an implicit `value' argument to
23549         the set accessor.
23550
23551 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23552
23553         * parameter.cs: Do not use `param' arguments as part of the
23554         signature, per the spec.
23555
23556 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23557
23558         * decl.cs: Base class for classes, structs and interfaces.  This
23559         is the "Declaration Space" 
23560
23561         * cs-parser.jay: Use CheckDef for checking declaration errors
23562         instead of having one on each function.
23563
23564         * class.cs: Factor out some code for handling error handling in
23565         accordance to the "Declarations" section in the "Basic Concepts"
23566         chapter in the ECMA C# spec.
23567
23568         * interface.cs: Make all interface member classes derive from
23569         InterfaceMemberBase.
23570
23571 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23572
23573         * Many things: all interfaces are parsed and generated in
23574         gen-treedump.  Support for member variables, constructors,
23575         destructors, properties, constants is there.
23576
23577         Beginning of the IL backend, but very little done, just there for
23578         testing purposes. 
23579
23580 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23581
23582         * cs-parser.jay: Fix labeled statement.
23583
23584         * cs-tokenizer.cs (escape): Escape " and ' always.
23585         ref_line, ref_name: keep track of the line/filename as instructed
23586         by #line by the compiler.
23587         Parse #line.
23588
23589 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23590
23591         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23592         to match the values in System.CodeDOM.
23593
23594         Divid renamed to Divide.
23595
23596         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23597         statements. 
23598         (Statements.set): remove.
23599
23600         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23601         statements. 
23602
23603         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23604         falseStatements always have valid values. 
23605
23606         * cs-parser.jay: Use System.CodeDOM now.
23607