6860177a83749041d165de3da280e8d5b7c756e1
[mono.git] / mcs / gmcs / ChangeLog
1 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2
3         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4
5 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6
7         * cs-parser.jay, expression.cs : CS0214 was missing error location
8           for constants. Fixed bug #76404.
9
10 2005-10-10  Raja R Harinath  <rharinath@novell.com>
11
12         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
13         InstanceExpression.
14         (PropertyExpr.EmitCall): Likewise.
15         * expression.cs (Invocation.EmitArguments): Handle case where
16         arguments == null.
17         (Invocation.EmitCall): Avoid allocating temporary variable if
18         there are no arguments.
19
20 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
21
22         Fix #76370.
23         * convert.cs (ExplicitConversionCore): Fixed object->enum
24         conversion.
25
26 2005-10-07  Raja R Harinath  <rharinath@novell.com>
27
28         Fix #76323.
29         * convert.cs (ImplicitConversionStandard): Move conversion of
30         void* to arbitrary pointer types ...
31         (ExplicitConversionStandard): .. here.
32         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
33         error to always print typenames.
34
35 2005-10-07  Raja R Harinath  <rharinath@novell.com>
36
37         * convert.cs (GetConversionOperator): Rename from
38         GetConversionOperators.  Move operator selection code from ...
39         (UserDefinedConversion): ... here.
40
41 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
42
43         * convert.cs (ExplicitConversionCore): Removed duplicate enum
44         conversion.
45
46 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
47
48         * assign.cs (Assign.DoResolve): Error method changed.
49
50         * cfold.cs (DoConstantNumericPromotions): Error method changed.
51         
52         * const.cs (ResolveValue): Reset in_transit immediately.
53         
54         * constant.cs: Error method changed.
55         
56         * convert.cs: Removed useless location parameter.
57         (ExplicitNumericConversion): Don't do double enum check.
58         (ExplicitConversionCore): Renamed from ExplicitConversion.
59         (ExplicitUnsafe): Extracted from ExplicitConversion.
60         (ExplicitConversion): Uses for error reporting.
61         
62         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
63         error messages.
64         (ResolveBoolean): Uses common error method.
65         (CastToDecimal): Get rid of ec.
66         (CastFromDecimal): Optimized.
67         (ConvCast): Get rid of ec.
68         
69         * enum.cs (ResolveValue): Reset in_transit immediately.
70         (Emit): Return after first error.
71         
72         * expression.cs: Convert changes.
73         
74         * literal.cs: Error method changed.
75         
76         * statement.cs: Error method changed.
77
78 2005-10-06  Raja R Harinath  <rharinath@novell.com>
79
80         Fix gtest-131.cs and gtest-211.cs.
81         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
82         Only emit code for a label if it is used.  Unreachable code can
83         violate ECMA evaluation stack invariants.
84
85 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
86
87         * anonymous.cs: Implemented ExprClassName.
88         
89         * assign.cs (Assign.DoResolve): Don't chrash when type is not
90         delegate.
91         
92         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
93         check.
94         
95         * class.cs (StaticClass.DefineContainerMembers): Report protected
96         members as error.
97         
98         * codegen.cs: if(ed) PRODUCTION.
99         
100         * convert.cs (Error_CannotImplicitConversion): Better error
101         distinction.
102         
103         * cs-parser.jay: More error checks.
104         
105         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
106         
107         * driver.cs (CSCParseOption): Enabled wrong option check.
108         
109         * ecore.cs (Expression.ExprClassName): Turned to property.
110         (MemberExpr.CheckIntermediateModification): For checking boxed
111         value types     modification.
112         
113         * statement.cs (Fixed.Resolve): Expression type must be
114         convertible to fixed type.
115         (CollectionForeach.GetEnumeratorFilter,TryType):
116         Small refactoring for easier error checking.
117
118 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
119
120         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
121         attributes.
122         
123         * class.cs (GeneratedBaseInitializer): New class for customization
124         compiler generated initializers.
125         (MemberBase.DoDefine): Check Obsolete attribute here.
126         (FieldMember.DoDefine): Ditto.
127         
128         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
129         constants.
130         
131         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
132         (MemberCore.GetObsoleteAttribute): Removed argument.
133         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
134         (MemberCore.CheckObsoleteType): New helper.
135         
136         * delegate.cs,
137         * enum.cs,
138         * statement.cs: Updates after MemberCore changes.
139         
140         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
141         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
142         
143         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
144         obsolete attribute for compiler construct.
145         (As.DoResolve): Cache result.
146         
147         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
148
149 2005-10-01  Miguel de Icaza  <miguel@novell.com>
150
151         * expression.cs (Probe): instead of having a "Type probe_type"
152         keep the extra information as a TypeExpr probe_type_expr since the
153         "As" operator needs to perform some type checks.
154
155         * (As.DoResolve): If the type is a type parameter, ensure that it
156         is constrained by a class.
157
158 2005-09-22  Miguel de Icaza  <miguel@novell.com>
159
160         * statement.cs (Lock): Use the TemporaryVariable class instead of
161         manually using local variables as those do not work when variables
162         are captured.
163
164         * ecore.cs: Moved the TemporaryVariable class from being a nested
165         class inside Foreach to be a public class that can be employed in
166         other places. 
167
168 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
169
170         * cs-parser.jay: interface_accessors replaced by
171         accessor_declarations.
172
173         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
174         location.
175         
176         * statement.cs (GotoCase.Resolve): Convert null constant to
177         null case.
178         (SwitchLabel.ResolveAndReduce): Ditto.
179         (SwitchLabel.NullStringCase): Custom null stamp.
180         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
181         
182         typemanager.cs (CSharpSignature): Don't skip first argument
183         for full names.
184
185 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
186
187         * cfold.cs, constant.cs, convert.cs, ecore.cs,
188         expression.cs, iterators.cs, literal.cs: Store constants and
189         literals location.
190         
191         * class.cs (MemberBase.ShortName): Pass location.
192         
193         * cs-parser.jay: Some location fixes.
194         
195         * ecore.cs (Expression.Location): Made virtual.
196
197 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
198
199         Fix #72930.
200         * const.cs (Const.ResolveValue): Check for assigning non-null
201         value to reference type.
202
203 2005-09-26  Raja R Harinath  <rharinath@novell.com>
204
205         Fix #76133.
206         * expression.cs (This.VerifyFixed): In a value type T, the type of
207         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
208         value type R, 'this' is treated as a value parameter.
209
210 2005-09-05  Miguel de Icaza  <miguel@novell.com>
211
212         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
213         if the underlying types are the same, otherwise we need to produce
214         code that will do the proper cast.
215
216         This was exposed by Marek's constant rewrite which produced
217         invalid code for the call site:
218
219         enum X : long { a }
220         void Method (X v) {}
221
222         Method ((X) 5)
223
224         This fixes test-49.cs
225
226 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
227
228         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
229           Type/Object should be allowed as well. Fixed bug #75968.
230
231 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
232
233         * expression.cs : (Binary.DoResolve): when one is enum constant and
234           another is constant 0, then return enum one *as enum type*.
235           Fixed bug 74846.
236
237 2005-10-04  Martin Baulig  <martin@ximian.com>
238
239         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
240         `SetMemberIsUsed()' work for generics, too.
241
242 2005-10-04  Martin Baulig  <martin@ximian.com>
243
244         * expression.cs (DelegateInvocation.EmitStatement): Make this work
245         for corlib.  Fixes #75691.
246
247 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
248
249         Fix #76255.
250         * driver.cs: Fix compilation files with full root path.
251
252 2005-09-25  Miguel de Icaza  <miguel@novell.com>
253
254         * report.cs (SymbolRelatedToPreviousError): Format the output so
255         it does not use an open parenthesis that is never closed. 
256
257         * driver.cs: Follow coding guidelines
258
259 2005-09-18  Miguel de Icaza  <miguel@novell.com>
260
261         * driver.cs: Set InEmacs based on the environment variable EMACS. 
262
263         * location.cs (InEmacs): in this mode, do not report column
264         location as it confuses Emacs.
265
266 2005-10-03  Raja R Harinath  <rharinath@novell.com>
267
268         * support.cs (SeekableStreamReader.Position): Don't error out when
269         the requested position is just beyond the end of the current
270         buffered data.
271
272 2005-09-28  Raja R Harinath  <rharinath@novell.com>
273
274         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
275         try to keep in sync with the byte count of the underlying Stream.
276         However, this limits us to a window size of 2048 characters: i.e.,
277         the maximum lookahead of our lexer/parser can be 2048 characters.
278
279 2005-09-22  Martin Baulig  <martin@ximian.com>
280
281         * driver.cs: Removed a debugging FIXME.
282
283 2005-09-21  Raja R Harinath  <rharinath@novell.com>
284
285         * cs-parser.jay (type_arguments): Add CS1644 check.
286         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
287
288 2005-09-15  Raja R Harinath  <rharinath@novell.com>
289
290         * Makefile (PROGRAM): Make profile specific.
291         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
292         the current directory.
293
294         Fix test-455.cs.
295         * expression.cs (Invocation.EmitCall): Remove optimization on
296         this_call since it doesn't handle 'this' being a value type.
297
298 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
299
300         * driver.cs: Ensure file handles are closed after parsing
301
302 2005-09-05  Miguel de Icaza  <miguel@novell.com>
303
304         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
305         if the underlying types are the same, otherwise we need to produce
306         code that will do the proper cast.
307
308         This was exposed by Marek's constant rewrite which produced
309         invalid code for the call site:
310
311         enum X : long { a }
312         void Method (X v) {}
313
314         Method ((X) 5)
315
316         This fixes test-49.cs
317
318 2005-09-05  Martin Baulig  <martin@ximian.com>
319
320         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
321         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
322
323         * cs-parser.jay (delegate_declaration): Small fix for #75852.
324
325 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
326
327         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
328           to be a pointer type due to the spec 25.2, so check if declaring
329           type is generic type definition. Fixed bug #75772.
330
331 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
332
333         Fixed bug #75957.
334         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
335           both types are not defined by methods.
336         * expression.cs : (Invocation.IsApplicable): it should work when
337           the argument type is equal to the parameter type, not only when
338           ImplicitConversionExists() returns true.
339
340 2005-09-02  Raja R Harinath  <rharinath@novell.com>
341
342         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
343         internal.
344
345         Fix #75941.
346         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
347         flow-branching for LocalVariableReferences in case we were invoked
348         from a MemberAccess.
349         * expression.cs (LocalVariableReference.VerifyAssigned): New.
350         Carved out of ...
351         (LocalVariableReference.DoResolveBase): ... this.
352         (MemberAccess.Resolve): Do the check that was disabled during
353         SimpleNameResolve.
354
355 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
356
357         * class.cs :
358           (PartialContainer.Create): check abstract/sealed/static strictly
359           but abstract/sealed can exist only at one side. Fixed bug #75883.
360
361 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
362
363         Fix #75945.
364         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
365         specified, don't default to UnmanagedType.I4.
366
367 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
368
369         * expression.cs : conditional operator should check possibly
370           incorrect assign expression. Fixed bug #75946.
371
372 2005-08-30  Raja R Harinath  <rharinath@novell.com>
373
374         Fix #75934.
375         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
376         (ScopeInfo.EmitScopeType): Use it to construct field names from
377         names of captured locals.
378
379         Fix #75929.
380         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
381         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
382         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
383         (ExplicitConversion): Remove enum cases already handled by
384         implicit conversion.  Move implicit conversion check to the beginning.
385         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
386         * expression.cs (ArrayCreation.EmitDynamicInitializers):
387         Don't treat System.Enum as a struct.
388
389 2005-08-30  Jb Evain  <jbevain@gmail.com>
390
391         * attribute.cs: handles as expression in parameters.
392
393 2005-08-30  Raja R Harinath  <rharinath@novell.com>
394
395         Fix #75802.
396         * class.cs (TypeContainer.VerifyClsName): Don't use a
397         PartialContainer when verifying CLS compliance.
398         (AbstractPropertyEventMethod): Set Parent here, ...
399         (PropertyMethod): ... not here.
400
401 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
402
403         * attribute.cs : escaped attribute name should not be allowed to be
404           resolved (e.g. @class as classAttribute). Fixed bug #75930.
405
406 2005-08-29  Raja R Harinath  <rharinath@novell.com>
407
408         Fix #75927.
409         * convert.cs (ImplicitStandardConversionExists): Allow zero also
410         when converting a long constant to unsigned long.
411         * expression.cs (Invocation.OverloadResolve): Add sanity check to
412         detect where IsApplicable and VerifyArgumentsCompat disagree.
413
414 2005-08-29  Raja R Harinath  <rharinath@novell.com>
415         and Carlos Alberto Cortez  <carlos@unixmexico.org>
416
417         Fix #75848.
418         * class.cs (TypeContainer.CanElideInitializer): New helper.
419         (TypeContainer.EmitFieldInitializers): Use it to determine if we
420         can safely emitting the initializer of a field.
421
422 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
423
424         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
425           allowed inside a switch (without loop). Fixed bug #75433.
426
427 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
428
429         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
430         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
431
432 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
433
434         * driver.cs : kinda reverting the default encoding changes (not exact 
435           revert since I noticed that "codepage:reset" might not work fine).
436
437 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
438
439         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
440           Location. Now getter and setter store location correctly.
441           (errors/cs0111-12.cs now reports the expected location.)
442
443 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
444
445         * driver.cs : Use default encoding on the environment.
446           Removed (now that) extra parameter for SeekableStreamReader.
447         * support.cs : (SeekableStreamReader) third .ctor() argument for
448           StreamReader is not required (always true). preamble size could
449           be acquired in simpler and safe way.
450
451 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
452
453         * cs-parser.jay: report CS0642 at warning level 3
454           and report CS0642 for an if else statement also
455           fixes bug #74745. Patch by John Luke (and a bit
456           modified by me).
457           Removed extra CS0642 warning check for "while",
458           "for" and "fixed".
459         * statement.cs: In Block.Resolve(), CS0642 check
460           is reimplemented to check a sequence of an empty
461           statement and a block.
462
463           Both fix bug #66777.
464
465 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
466
467         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
468         detection until I fix it.
469         
470         * cs-tokenizer.cs: Changed error message.
471         
472         * cs-parser.jay: Fixed 2 error locations.
473         
474         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
475         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
476         properties.
477         
478         * enum.cs (GetSignatureForError): Fixed.
479         
480         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
481         method detection.
482         
483         * class.cs,
484         * typemanager.cs (RegisterProperty): Removed.
485         
486         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
487
488 2005-08-24  Raja R Harinath  <rharinath@novell.com>
489
490         Fix #75874.
491         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
492         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
493
494 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
495
496         * expression.cs : tiny fix is required for not warning positive ulong.
497           See test-441.cs.
498
499 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
500
501         * expression.cs : add CS0652 check for constant and integral
502           expression. Fixed bug #53974.
503
504 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
505
506         * expression.cs : in DoNumericPromotions(), check if there is implicit
507           conversion overload for string (to check CS0034). Fixed bug #52492.
508
509 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
510
511         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
512
513 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
514
515         * ecore.cs : report location when it is *not* Null.
516
517 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
518
519         * codegen.cs,
520           ecore.cs,
521           flowanalysis.cs,
522           expression.cs:
523           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
524           correctly. Fixed bug #75721.
525
526 2005-08-23  Raja R Harinath  <rharinath@novell.com>
527
528         * support.cs (SeekableStreamReader.Position): Avoid an expensive
529         loop that performs 'min (pos, char_count)'.
530
531         Fix #75862.
532         * expression.cs (Unary.ResolveOperator): Don't discard implicit
533         converted value in Operator.OnesComplement.
534
535 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
536
537         * anonymous.cs: If the anon method is pulled into a helper class,
538         it needs to be `internal' not `private'. Fixes runtime behavior on
539         msft. bug #75704
540
541 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
542
543         Fix #75803
544         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
545         is a partial class.
546
547 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
548
549         The big constants rewrite
550         Fix #75746, #75685 and more
551         As a side effect saved 1MB for MWF ;-)
552         
553         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
554         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
555         enum based for corlib compilation.
556         
557         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
558         subtractions.
559         
560         * class.cs (FixedField.Define): Use ResolveAsConstant.
561         
562         * const.cs (IConstant): Interface constants and enums.
563         (Const.ResolveValue): New method for constant resolvning.
564         (ExternalConstant): Constants from imported assemblies.
565         
566         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
567         conversion; like enums.
568         (Constant.ToType): Converts this constant to different type.
569         (Constant.Increment): Adds 1.
570         
571         * convert.cs (ImplicitConversionRequired): Simplified.
572         
573         * cs-parser.jay: Create EnumMember directly.
574         
575         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
576         
577         * doc.cs (GenerateEnumDocComment): Removed.
578         
579         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
580         (ConvertIntLiteral): Removed.
581         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
582         
583         * enum.cs (EnumMember): Implement IConstant.
584         (Enum.IsValidEnumConstant): Removed.
585         (Enum.GetNextDefaultValue): Removed.
586         (Enum.FindMembers): Updated.
587         (Enum.GenerateDocComment): Iterate enum members.
588         
589         * expression.cs (Cast.TryReduce): Handle enums correctly.
590         (New.Constantify): Made public.
591         (MemberAccess.DoResolve): Removed contant specific if(s).
592         
593         * literal.cs (NullLiteral): Implement new abstract methods.
594         
595         * statement.cs (GotoCase.Resolve): Use new constant methods.
596         (SwitchLabel.ResolveAndReduce): Use new constant methods.
597         
598         * typemanager.cs (LookupEnum): Removed.
599         (IsEnumType): Fixed to work with corlib.
600         (RegisterConstant): Removed.
601         (LookupConstant): Removed.
602         (GetConstant): Changed to work with IConstant.
603
604 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
605
606         * location.cs : Fixed overflown (>255) column number.
607
608 2005-08-03  Raja R Harinath  <rharinath@novell.com>
609
610         First cut of the qualified-alias-member feature.
611         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
612         token.
613         * cs-parser.jay (DOUBLE_COLON): New token.
614         (namespace_or_type_name): Add rule for recognizing
615         qualified-alias-members.
616         (primary_expression): Likewise.
617         (element_access): Allow QualifiedAliasMember as a possible
618         type-bearing expression.
619         (local_variable_type, local_variable_pointer_type): Likewise.
620         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
621         aliases in the current and enclosing namespace declarations.
622         (NamespaceEntry.UsingAlias): Add CS0440 warning.
623         * decl.cs (MemberName.is_double_colon): New.
624         (MemberName.MemberName): Add new constructor for alias-member.
625         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
626         * expression.cs (QualifiedAliasMember): New expression type.
627
628 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
629
630         * location.cs : it borked when no argument was specified.
631
632 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
633
634         * location.cs : tiny ToString() format fix.
635
636 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
637
638         * statement.cs : oops, it was missing.
639
640 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
641
642         A set of fixes for precise line/column location.
643
644         * location.cs :
645           "token" field now holds a file/line "delta", a line number offset 
646           from the segment, and a column number. See also:
647           http://lists.ximian.com/pipermail/mono-devel-list/2004-
648           December/009508.html
649           Removed static IsNull. Use instance IsNull property instead.
650         * cs-tokenizer.cs :
651           For some tokens it stores Location. For Identifier it stores
652           LocatedToken which is a pair of string name and location.
653           Column numbers are adjusted only at getChar().
654         * report.cs :
655           Use Location.ToString() for reporting (it now contains column).
656         * cs-parser.jay :
657           Largely modified to use LocatedToken instead of
658           string (IDENTIFIER), and to acquire Location from some tokens.
659         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
660           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
661           codegen.cs :
662           Now MemberName holds Location. DeclSpace.ctor() receives Location
663           as a parameter. Removed extra parameters to all derived classes.
664           Replaced Location.IsNull() with instance property.
665         * assign.cs, expression.cs :
666           Added .ctor() overload that omits Location.
667         * attribute.cs :
668           Added "nameEscaped" flag that indicates the identifier was escaped
669           in the source file. This fixes bug #57047.
670
671 2005-09-02  Martin Baulig  <martin@ximian.com>
672
673         * class.cs: Make CS3005 a warning, not an error.
674
675 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
676
677         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
678         New method, looking for lo-case imported cls type.
679
680         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
681         here.
682
683         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
684
685         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
686
687         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
688         all_imported_types.
689         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
690
691         Optimized to save 3.5 MB for SWF compilation.
692
693 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
694
695         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
696         (PartialContainer.Create): Moved logic AddToContainer.
697         (PartialContainer.MarkForDuplicationCheck): Shares name.
698         
699         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
700         place.
701         
702         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
703         initialization.
704         (Namespace.GetSignatureForError): New method.
705         
706         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
707         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
708
709 2005-08-01  Raja R Harinath  <rharinath@novell.com>
710
711         Fix #75669.
712         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
713         member lookup rather than qualifier_type, since qualifier_type can
714         be null.
715
716 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
717
718         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
719         enum member.
720
721 2005-07-31  Miguel de Icaza  <miguel@novell.com>
722
723         * statement.cs: Copy the local exception into the exception
724         captured local.  Fixes 75674
725
726 2005-07-31  Raja R Harinath  <harinath@gmail.com>
727
728         Fix #75658.
729         * expression.cs (Invocation.OverloadResolve): Don't report error
730         CS1501 if error CS1502 has been reported.
731         (New.DoResolve): Delegate CS1501 reporting to
732         Invocation.OverloadResolve.
733
734         Fix #75656.
735         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
736         invariant-meaning-in-block property in an enclosing block if
737         necessary.
738
739 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
740
741         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
742         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
743         (Switch.CheckSwitch): Just save 50kb for SWF.
744
745 2005-07-27  Martin Baulig  <martin@ximian.com>
746
747         * anonymous.cs (CaptureContext.AddField): Added
748         `AnonymousContainer am' argument; compute its toplevel scope if
749         it's not already computed.  Fixes #75649.
750
751 2005-07-26  Raja R Harinath  <rharinath@novell.com>
752
753         Fix #75628.
754         * class.cs (Constructor.Emit): Reset block to null if the block
755         resolve fails.
756
757 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
758
759         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
760
761 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
762
763         * class.cs (MethodData.Define): Check whether accessor implementing
764         interface is public.
765
766         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
767
768 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
769
770         Fix #57245
771         * namespace.cs (LookupType): Moved same type check to...
772         
773         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
774         with the same name.
775
776 2005-07-21  Raja R Harinath  <rharinath@novell.com>
777
778         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
779         already found a typebuilder.
780         * class.cs (MethodCore.IsDuplicateImplementation): Compare
781         MemberNames, not strings.
782
783         * const.cs (Error_ExpressionMustBeConst): 
784         Rename from Error_EpressionMustBeConst.
785         * const.cs, class.cs, statement.cd: Update.
786
787 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
788
789         Fix #65573
790
791         * const.cs (Const.LookupConstantValue): Report missing contant expression
792         everytime.
793         (Error_EpressionMustBeConstant): Only one error method.
794
795         * class.cs, statement.c: Updated.
796
797 2005-07-20  Raja R Harinath  <rharinath@novell.com>
798
799         * statement.cs (Block.Flags): Add back HasVarargs.
800         (Block.flags): Make protected.
801         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
802
803         * typemanager.cs (types, typecontainers, user_types): Remove.
804         (UserTypes, TypeContainers): Likewise.
805         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
806         (CleanUp, Reset): Update.
807         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
808         (GetNestedType): Use Type.GetNestedType.
809         (CoreLookupType): Take two arguments, the namespace and the
810         basename of the type.  Update to use the Namespace.Lookup
811         mechanism.
812         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
813         (RealMemberLookup): Use IsNestedChildOf instead of playing with
814         string concatenation and substring matches.
815         * class.cs, enum.cs, delegate.cs: Update to changes.
816
817 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
818
819         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
820         Expression and made virtual.
821
822         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
823         (ImplicitStandardConversionExists): Fixed `byte' typo ?
824
825         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
826
827         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
828         error message.
829
830         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
831         change.
832
833 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
834
835         Fix #57707
836         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
837         AssemblyCultureAttribute is not used on executable.
838
839         * rootcontext.cs,
840         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
841
842 2005-07-16  Raja R Harinath  <rharinath@novell.com>
843
844         Fix #60638.
845         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
846         New.  Reports CS0252/CS0253.
847         Mostly taken from preliminary patch by Duncak Mak.
848         (Binary.DoResolveOperator): Store results of operator lookup.
849         Use them to detect if we need to warn about unintended reference
850         comparisons.
851
852 2005-07-15  Raja R Harinath  <rharinath@novell.com>
853
854         Fix #72969.
855         * namespace.cs (Namespace.Lookup): Add back location parameter.
856         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
857         * delegate.cs, ecore.cs, expression.cs: Update to changes.
858
859         * codegen.cs (EmitContext.DeclSpace): Make readonly.
860         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
861         (Namespace.LookupType): ... this.
862         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
863         of namespaces.
864         * typemanager.cs (LookupTypeReflection): Remove buggy code that
865         purported to handle pointers.
866         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
867         CoreLookupType.
868
869 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
870
871         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
872         type as namespace.
873
874 2005-07-15  Raja R Harinath  <rharinath@novell.com>
875
876         * namespace.cs (Namespace.Lookup): Drop location parameter.
877         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
878         (NamespaceEntry.Lookup): ... this.
879         (NamespaceEntry.Error_AmbiguousTypeReference):
880         Move here from DeclSpace.
881         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
882         names ...
883         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
884         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
885         Move to NamespaceEntry.
886         * delegate.cs, expression.cs: Update to changes.
887
888 2005-08-31  Martin Baulig  <martin@ximian.com>
889
890         Committing a patch from Atsushi Enomoto for #75850.
891
892         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
893         Prefer a generic enumerator over a non-generic one.
894
895 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
896
897         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
898         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
899
900 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
901
902         * driver.cs : reverting default encoding change as well as mcs.
903
904 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
905
906         * driver.cs, support.cs : merged r48826.
907           Marek Safer wrote:
908           > could you integrate your mcs changes to gmcs otherwise
909           > gmcs cannot compile some files.
910
911 2005-08-20  Martin Baulig  <martin@ximian.com>
912
913         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
914         scope if we don't already have it.
915
916         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
917         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
918         fixes #75867.
919
920 2005-07-31  Miguel de Icaza  <miguel@novell.com>
921
922         * statement.cs: Copy the local exception into the exception
923         captured local.  Fixes 75674
924
925 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
926
927         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
928         type as namespace.
929
930 2005-08-12  Martin Baulig  <martin@ximian.com>
931
932         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
933         for nested types here to avoid hitting the cache too early.
934
935 2005-08-09  Miguel de Icaza  <miguel@novell.com>
936
937         * enum.cs: On the new compiler CLS error 3005 is now a warning not
938         an error. 
939
940 2005-08-03  Martin Baulig  <martin@ximian.com>
941
942         Make iterators in generic methods work; see gtest-191.cs.
943
944         * generic.cs
945         (Constraints.Resolve): Protect against being called twice.
946
947         * class.cs
948         (TypeContainer.GetClassBases): Make this `protected virtual'.
949
950         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
951         (Iterator.GetClassBases): Override this and compute the base
952         classes here.
953         (Iterator.DefineNestedTypes): If we're a generic method, all our
954         method type parameters become class type parameters on the proxy
955         class.
956
957         * statement.cs
958         (ToplevelBlock.Parameters): Make this a property, not a field.
959         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
960
961 2005-08-03  Martin Baulig  <martin@ximian.com>
962
963         * typemanager.cs (TypeManager.IsSubclassOf): Use
964         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
965         (TypeManager.GetFullName_recursed): Improved.
966
967 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
968
969         Fix #75417
970         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
971         Private accessor case, using TypeManager.IsPrivateAccessible instead of
972         invocation_type == mi.DeclaringType, since the first one also checks
973         other condition used by generic instances.
974         
975 2005-07-27  Martin Baulig  <martin@ximian.com>
976
977         * anonymous.cs (CaptureContext.AddField): Added
978         `AnonymousContainer am' argument; compute its toplevel scope if
979         it's not already computed.  Fixes #75649.
980
981 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
982
983         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
984         CheckAttributeType and refactored.
985         (Attribute.ResolvePossibleAttributeType): Changed to reuse
986         ResolveAsTypeTerminal error handling.
987         (ResolveAsTypeTerminal): Introduced because of global attributes extra
988         handling.
989         (GetSignatureForError): Print errors in same way.
990
991         * class.cs,
992         * codegen.cs: Reflect attribute GetSignatureForError change.
993
994         * ecore.cs,
995         * expression.cs: Add silent parameter to ResolveAsTypeStep.
996
997         * namespace.cs (UsingEntry): Refactored to make fields private.
998
999         * assign.cs,
1000         statement.cs: Error_UnexpectedKind has extra parameter.
1001
1002 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1003
1004         * ecore.cs (IAlias): Remove.
1005         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1006         that implement the interface.
1007         * namespace.cs (Namespace): Likewise.
1008         (Namespace.declspaces): Renamed from 'defined_names'.
1009         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1010         DeclSpace instead of an IAlias.
1011         * tree.cs (Tree.AddDecl): Update.
1012
1013 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1014
1015         * statement.cs (Block.Flags); Remove HasVarargs.
1016         (Block.HasVarargs): Move to ToplevelBlock.
1017         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1018         (Block.Variables): Make protected.  Initialize variable hashtable
1019         if necessary.
1020         (Block.AddVariable): Update.
1021         (Block.Resolve): Update to changes.
1022         (ToplevelBlock.HasVarargs): New boolean.
1023         (ToplevelBlock.ThisVariable): Move here from Block.
1024         (ToplevelBlock.AddThisVariable): Likewise.
1025         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1026         * expression.cs (This.ResolveBase): Update to changes.
1027         (ArglistAccess.DoResolve): Likewise.
1028
1029 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1030
1031         Fix #75321
1032         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1033
1034         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1035         not used and not used & assigned.
1036         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1037
1038 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1039
1040         Fix #75053
1041         * expression.cs (Is.DoResolve): null is never provided type.
1042
1043 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1044
1045         Fix #52496
1046         * cs-parser.jay: Less strict event error rule to catch more errors.
1047
1048 2005-07-11  Martin Baulig  <martin@ximian.com>
1049
1050         * generic.cs (ConstructedType.CheckConstraints): Improve the check
1051         for the constructor constraint: we do not only have to check
1052         whether the class has a public constructor, but also ensure that
1053         it's parameterless.  Fixes #75492.
1054
1055 2005-07-11  Martin Baulig  <martin@ximian.com>
1056
1057         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1058         between type parameters if they either have the reference type
1059         constraint or the class constraint.
1060
1061 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
1062
1063         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1064
1065 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1066
1067         Fix #74975
1068         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1069         (ExtractSecurityPermissionSet): Cope with self referencing security
1070         attributes properly.
1071
1072         * driver.cs (SetOutputFile): Made public property OutputFile.
1073
1074 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1075
1076         Fix #75486.
1077         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1078         has_nonstatic_fields.  Make into a FieldBase pointer.
1079         (TypeContainer.AddField): Add CS0282 check.
1080         (TypeContainer.EmitType): Update.
1081
1082 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1083
1084         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1085         compare if they start with __.
1086
1087 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1088
1089         * statement.cs (Switch.SwitchGoverningType): Only look at
1090         UserCasts that don't need implicit standard conversions to one of
1091         the allowed switch types (Fixes test-322.cs).
1092         (LocalInfo.Resolve): Re-enable sanity-test.
1093
1094 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1095
1096         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1097         
1098         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1099         
1100         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1101
1102 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1103
1104         Fix #75472.
1105         * ecore.cs (SimpleName.GetSignatureForError): Add.
1106         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1107         (MemberAccess.GetSignatureForError): Add.
1108
1109 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1110  
1111         The big error and warning messages review.
1112         
1113         * anonymous.cs,
1114         * assign.cs,
1115         * attribute.cs,
1116         * class.cs,
1117         * codegen.cs,
1118         * convert.cs,
1119         * cs-parser.jay,
1120         * cs-tokenizer.cs,
1121         * decl.cs,
1122         * delegate.cs,
1123         * doc.cs,
1124         * driver.cs,
1125         * ecore.cs,
1126         * enum.cs,
1127         * expression.cs,
1128         * flowanalysis.cs,
1129         * iterators.cs,
1130         * literal.cs,
1131         * location.cs,
1132         * modifiers.cs,
1133         * namespace.cs,
1134         * parameter.cs,
1135         * pending.cs,
1136         * report.cs,
1137         * rootcontext.cs,
1138         * statement.cs,
1139         * support.cs,
1140         * tree.cs,
1141         * typemanager.cs: Updated.
1142         
1143         * class.cs: (MethodCore.SetYields): Moved here to share.
1144         (PropertyMethod.Define): Moved iterator setup here.
1145         
1146         * iterators.cs: Add orig_method to have full access to parent
1147         container.
1148
1149 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1150
1151         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1152         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1153         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1154         variable of struct type.
1155         * expression.cs (Unary.ResolveOperator): Update to change.
1156         (Indirection.VerifyFixed): Likewise.
1157         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1158         (ParameterReference.VerifyFixed): Value parameters are fixed.
1159         (This.VerifyFixed): Treat 'this' as a value parameter.
1160         * statement.cs (LocalInfo.IsFixed): Remove.
1161
1162 2005-07-01  Martin Baulig  <martin@ximian.com>
1163
1164         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1165         `ec.EmitThis ()' to get the correct scope.
1166
1167 2005-07-01  Martin Baulig  <martin@ximian.com>
1168
1169         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1170         instance is a ParameterReference; fixes #75299.
1171
1172 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1173
1174         Fix #75412.
1175         * expression.cs (Indexers.map): Remove.
1176         (Indexers.Append): Filter out inaccessible setters and getters.
1177         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1178
1179         Fix #75283.
1180         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1181         Refactored from ...
1182         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1183         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1184         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1185         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1186
1187 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1188
1189         Fix #75322
1190         * class.cs (FieldBase.GetInitializerExpression): One more field
1191         for backup.
1192
1193 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1194
1195         * pending.cs: Do not define a proxy if the base method is virtual,
1196         it will be picked up by the runtime (bug 75270).
1197
1198 2005-07-08  Martin Baulig  <martin@ximian.com>
1199
1200         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1201         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1202
1203 2005-07-07  Martin Baulig  <martin@ximian.com>
1204
1205         * generic.cs (ConstructedType.CheckConstraint): Use
1206         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1207         called recursively; fixes #75329.
1208
1209 2005-07-06  Martin Baulig  <martin@ximian.com>
1210
1211         * generic.cs (TypeManager.InferTypeArguments): Added support for
1212         anonymous methods; fixes #75461.
1213
1214 2005-07-01  Martin Baulig  <martin@ximian.com>
1215
1216         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1217         `ec.EmitThis ()' to get the correct scope.
1218
1219 2005-07-01  Martin Baulig  <martin@ximian.com>
1220
1221         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1222         instance is `This'; fixes #75299.
1223
1224 2005-06-30  Martin Baulig  <martin@ximian.com>
1225
1226         * class.cs (Indexer): Implement IIteratorContainer; added support
1227         for iterators in indexers.
1228
1229         * codegen.cs
1230         (EmitContext.CurrentIterator): Make this a property, not a field.
1231
1232         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1233
1234 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1235
1236         * pending.cs: Do not define a proxy if the base method is virtual,
1237         it will be picked up by the runtime (bug 75270).
1238
1239 2005-06-28  Martin Baulig  <martin@ximian.com>
1240
1241         * cs-parser.jay (interface_method_declaration): Avoid a
1242         reduce/reduce conflict by moving some of the code into a separate
1243         `interface_method_declaration_body' rule; fixes #75368.
1244
1245 2005-06-28  Martin Baulig  <martin@ximian.com>
1246
1247         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1248         array check after the check for TypeBuilder's.
1249
1250 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1251
1252         * convert.cs (FindMostEncompassedType): Add two trivial special
1253         cases (number_of_types == 0 || number_of_types == 1).
1254         (FindMostEncompasingType): Likewise.
1255
1256 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1257
1258         Some cleanups preparing for the fix of #75283.
1259         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1260         error testing.
1261         (EventExpr.InstanceResolve): Likewise.
1262         (EventExpr.DoResolve): Remove redundant checks.
1263
1264 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1265
1266         * class.cs: Small fix.
1267
1268 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1269
1270         Fix #75160.
1271         * class.cs (GetPartialBases): Fix return value check of
1272         part.GetClassBases.
1273
1274 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1275
1276         Ensure that partial classes are registered in their enclosing
1277         namespace.  Initial part of fix of #75160.
1278         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1279         Register declspace with namespace here, not in
1280         DeclSpace.RecordDecl.
1281         * cs-parser.jay: Pass namespace to RecordDecl.
1282         * class.cs (PartialContainer.Create): Likewise.
1283         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1284         called.
1285         * decl.cs (Declspace.RecordDecl): Remove.
1286         * namespace.cs (NamespaceEntry.DefineName): Remove.
1287
1288 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1289
1290         * rootcontext.cs: Reset TargetExt as well.
1291
1292 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1293
1294         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1295         -langversion:ISO-1.
1296
1297 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1298
1299         Fix #75080, cs0119.cs.
1300         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1301         of ...
1302         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1303         allowing ExprClass.Type and ExprClass.Namespace for
1304         ResolveFlags.VariableOrValue.
1305         (Expression.Resolve) [1-argument variant]: Change default resolve
1306         flags based on language version.
1307         (Expression.Error_UnexpectedKind): Use a simple string array
1308         rather than an ArrayList.
1309         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1310         not ExprClass.Type.
1311         (TypeOfVoid.DoResolve): Likewise.
1312         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1313         flags argument -- it always has the same value.
1314
1315 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1316
1317         Fix #75081.
1318         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1319         Use it in the error message.
1320         * assign.cs, expression.cs, statement.cs: Update.
1321
1322 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1323
1324         Fix #75088.
1325         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1326         the "almostMatchedMember" case too.
1327         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1328         that failed the accessibility checks to 'almost_match'.
1329
1330 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1331
1332         * attribute.cs: Use internal MethodBuilder methods to set
1333         ExactSpelling and SetLastError on PInvoke methods, instead
1334         of passing them via charset.  Fixes #75060.
1335
1336 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1337
1338         * parameter.cs (Parameter): Remove TODO comment.
1339         (Parameter.DefineParameter): Remove Location parameter.
1340         (Parameters.LabelParameters): Likewise.
1341         * class.cs (Constructor.Emit): Update to change.
1342         (MethodData.Emit): Likewise.
1343         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1344         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1345
1346 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1347
1348         * parameter.cs,
1349           Removed Parameters.Location and added Parameter.Location instead.
1350           Removed Location parameter from Emit() and GetSignature().
1351         * anonymous.cs,
1352           class.cs,
1353           cs-parser.jay,
1354           delegate.cs,
1355           iterators.cs,
1356           statement.cs :
1357           Modified all related calls.
1358
1359 2005-06-21  Martin Baulig  <martin@ximian.com>
1360
1361         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1362         left-hand side is not a nullable type; fixes #75328.
1363
1364 2005-06-21  Martin Baulig  <martin@ximian.com>
1365
1366         * typemanager.cs
1367         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1368         (TypeManager.GetFullNameSignature): Likewise.
1369
1370         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1371         `source.FullName' and `target.FullName' to check whether there are
1372         two conflicting definitions.
1373
1374 2005-06-21  Martin Baulig  <martin@ximian.com>
1375
1376         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1377         a BoxedCast - also for reference types - to be compatible with csc.
1378
1379 2005-06-21  Martin Baulig  <martin@ximian.com>
1380
1381         * expression.cs (MemberAccess.DoResolve): Add support for nested
1382         types in a generic instance; fixes #75320.
1383
1384 2005-06-20  Martin Baulig  <martin@ximian.com>
1385
1386         * generic.cs (TypeManager.InferType): Also walk the class
1387         hierarchy for generic instances; fixes #75261.
1388
1389 2005-06-17  Martin Baulig  <martin@ximian.com>
1390
1391         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1392         to make things work for corlib.
1393
1394 2005-06-15  Martin Baulig  <martin@ximian.com>
1395
1396         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1397         obsolete `SecurityAction' values.
1398
1399 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1400
1401         * rootcontext.cs: Reset TargetExt as well.
1402         
1403 2005-06-09  Martin Baulig  <martin@ximian.com>
1404
1405         * delegate.cs (Delegate.VerifyMethod): Added
1406         `MethodGroupExpr old_mg' argument; inherit its
1407         `HasTypeParameters'; fix #75085.
1408
1409 2005-06-09  Martin Baulig  <martin@ximian.com>
1410
1411         * expression.cs (Invocation.OverloadResolve): Correctly handle
1412         generic methods for the SetMemberIsUsed(); fix #75064.
1413
1414 2005-06-09  Martin Baulig  <martin@ximian.com>
1415
1416         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1417         fixes #75062.
1418
1419 2005-06-08  Martin Baulig  <martin@ximian.com>
1420
1421         * cs-parser.jay (nullable_type_or_conditional): If we put the
1422         nullable back and our `type' is a `ComposedCast', remove the
1423         nullable from it.  Fixes #75156.
1424
1425         * expression.cs (ComposedCast.RemoveNullable): New public method.
1426
1427 2005-06-08  Martin Baulig  <martin@ximian.com>
1428
1429         The big Iterators rewrite :-)
1430
1431         * iterators.cs: Rewrite this to use the anonymous methods framework.
1432
1433         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1434         before the TypeContainers; see 2test-21.cs.
1435
1436         * class.cs
1437         (TypeContainer.DefineType): Don't create a new EmitContext if we
1438         already have one (this only happens if we're an Iterator).
1439         (TypeContainer.Define): Also call Define() on all our iterators.
1440         (Method.CreateEmitContext): Added support for iterators.
1441
1442         * anonymous.cs
1443         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1444         (AnonymousContainer.CreateMethodHost): Moved here from
1445         AnonymousMethod and made abstract.
1446         (AnonymousContainer.CreateScopeType): New abstract method.
1447         (AnonymousContainer.IsIterator): New public property.
1448         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1449         get the ScopeTypeBuilder rather than manually defining it here. 
1450         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1451         iterators here.
1452
1453         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1454         before RootContext.DefineTypes().
1455
1456         * codegen.cs (EmitContext.RemapToProxy): Removed.
1457         (EmitContext.CurrentAnonymousMethod): Changed type from
1458         AnonymousMethod -> AnonymousContainer.
1459         (EmitContext.ResolveTopBlock): Protect from being called twice.
1460         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1461         (EmitContext.EmitThis): Removed the iterators hacks; use the
1462         anonymous methods framework for that.
1463
1464         * statement.cs
1465         (ToplevelBlock.Container): Make this a property, not a field.
1466         (ToplevelBlock.ReParent): New public method; move the
1467         ToplevelBlock into a new container.
1468         (Foreach.TemporaryVariable): Simplify.
1469
1470 2005-06-05  Martin Baulig  <martin@ximian.com>
1471
1472         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1473         (Block.AddTemporaryVariable): New public method; creates a new
1474         `LocalInfo' for a temporary variable.
1475         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1476         variables here.
1477         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1478         non-iterator variables.
1479
1480 2005-06-05  Martin Baulig  <martin@ximian.com>
1481
1482         * statement.cs (Foreach.TemporaryVariable): Create the
1483         LocalBuilder in the Emit phase and not in Resolve since in some
1484         situations, we don't have an ILGenerator during Resolve; see
1485         2test-19.cs for an example.
1486
1487 2005-06-04  Martin Baulig  <martin@ximian.com>
1488
1489         The big Foreach rewrite - Part II.
1490
1491         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1492         with `PropertyInfo ienumerator_getcurrent'.
1493
1494         * codegen.cs (VariableStorage): Removed.
1495
1496         * statement.cs
1497         (Foreach): Derive from Statement, not ExceptionStatement.
1498         (Foreach.CollectionForeach): New nested class.  Moved all the code
1499         dealing with collection foreach here.
1500         (Foreach.ForeachHelperMethods): Removed.
1501         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1502
1503 2005-05-23  Martin Baulig  <martin@ximian.com>
1504
1505         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1506         don't need to.  Fix #75014.
1507
1508 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1509
1510         Improve user-defined conversion handling.
1511         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1512         applicable operators.
1513         (AddConversionOperators): New.  Helper for GetConversionOperators.
1514         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1515         there is only one most encompassed/encompassing type.
1516         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1517         "applicable operator" handling.
1518         (UserConversion): Move cache here from GetConversionOperators.
1519         Directly cache the chosen operator, rather than the whole
1520         MethodGroup.
1521         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1522         case.  Allow conversion of decimal to sbyte and byte too.
1523         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1524         New static methods.  Used to avoid allocating EmptyExpressions in
1525         convert.cs.
1526
1527 2005-05-24  Duncan Mak  <duncan@novell.com>
1528
1529         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1530         another class, used in Convert.ExplicitNumericConversion.
1531         (CastToDecimal): New class, similar to above, but casts to
1532         System.Decimal, used in Convert.ImplicitNumericConversion and also
1533         in explicit convesion from double/float to decimal.
1534
1535         * convert.cs (ImplicitNumericConversion): Handle implicit
1536         conversions to System.Decimal.
1537         (ExplicitNumericConversion): handle explicit conversions to
1538         System.Decimal.
1539
1540         This fixes #68711.
1541         
1542 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1543
1544         * typemanager.cs: Do not throw an exception in the TypeBuilder
1545         case, we take care of it on the TypeCode.
1546
1547 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1548         
1549         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1550         is back.
1551         
1552         * cs-parser.jay: Catch more lexical errors.
1553         
1554         * report.cs: Add one more Error method.
1555         
1556         * rootcontext.cs,
1557         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1558
1559 2005-05-20  Martin Baulig  <martin@ximian.com>
1560
1561         * class.cs (TypeContainer.CircularDepException): Removed.
1562         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1563         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1564         (CS0146) and interface (CS0529) dependencies here.
1565
1566 2005-05-20  Martin Baulig  <martin@ximian.com>
1567
1568         * expression.cs (New.DoResolve): Move the CS0712 check above the
1569         CS0144 check; otherwise it can never be reached.
1570
1571 2005-05-20  Martin Baulig  <martin@ximian.com>
1572
1573         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1574
1575 2005-05-20  Martin Baulig  <martin@ximian.com>
1576
1577         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1578
1579         * typemanager.cs (TypeManager.IsAttributeType): New public method.
1580
1581 2005-05-19  Martin Baulig  <martin@ximian.com>
1582
1583         * delegate.cs
1584         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1585         to disable error reporting.
1586
1587         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1588         here since we don't want to report an error; see the new test-336.cs.
1589
1590 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1591
1592         * statement.cs (ToplevelBlock.GetParameterReference)
1593         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1594         Move here from class Block.
1595         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1596         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1597
1598 2005-05-18  Martin Baulig  <martin@ximian.com>
1599
1600         Fix #74978.
1601
1602         * flowanalysis.cs
1603         (FlowBranching.Reachability): Add non-static public And() and Or()
1604         methods.
1605         (FlowBranchingSwitch): New class; do the `break_origins' thing
1606         like in FlowBranchingLoop.
1607         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1608         reachability, not just locals and parameters.
1609         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1610         switch; MergeBreakOrigins() now takes care of that.
1611
1612 2005-05-18  Martin Baulig  <martin@ximian.com>
1613
1614         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1615         a loop and may leave it, reset the barrier; fixes #74974.
1616
1617 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1618
1619         Fix test-382.cs.  Emit values of decimal constants.
1620         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1621         Carved out of ...
1622         (TypeContainer.AddField): ... this.
1623         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1624         with initializers to include 'Const's.
1625         (ClassPart.RegisterFieldForInitialization): Forward to
1626         PartialContainer.
1627         * const.cs (Const.Const): Pass initializer to base class.
1628         (Const.Define): In case of decimal constants, register them for
1629         initialization in a static constructor.
1630
1631 2005-05-14  Martin Baulig  <martin@ximian.com>
1632
1633         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1634         do not call ResolveUnreachable() on unreachable statements in
1635         here, see the comment in the source code.
1636
1637 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1638
1639         Fix #74934.
1640         * expression.cs (BinaryResolveOperator): If one of the operands of
1641         an equality comparison is 'null' and the other is a pointer type,
1642         convert the null to a NullPointer.
1643         * convert.cs (ImplicitReferenceConversion): If the expression is a
1644         NullLiteral and the target type is a pointer type, return a
1645         NullPointer instead.
1646         (ImplicitConversionStandard): Likewise.
1647
1648 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1649         
1650         * cs-parser.jay: Set readonly context based on special constructs.
1651         
1652         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1653         readonly variable error handling.
1654         
1655         * rootcontext.cs (EmitCode): Don't verify members when error
1656         occurred.
1657         
1658         * statement.cs (LocalInfo): Add reaodnly context information.
1659         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1660
1661 2005-05-17  Martin Baulig  <martin@ximian.com>
1662
1663         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1664         #70970. 
1665
1666 2005-05-13  Martin Baulig  <martin@ximian.com>
1667
1668         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1669         handle unreachable blocks.
1670
1671 2005-05-13  Martin Baulig  <martin@ximian.com>
1672
1673         * class.cs
1674         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1675         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1676         #74905. 
1677
1678 2005-05-13  Martin Baulig  <martin@ximian.com>
1679
1680         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1681         instance variable, not a local.  Fix #74873.
1682         (Block.ResolveUnreachable): Set it to true here.
1683
1684 2005-05-12  Martin Baulig  <martin@ximian.com>
1685
1686         * cs-parser.jay (property_declaration): Pass the `current_class',
1687         not the `current_container' to Property's .ctor.  Fixes #74912.
1688
1689 2005-05-11  Martin Baulig  <martin@ximian.com>
1690
1691         * typemanager.cs (Closure): Copy this from MCS and merge all the
1692         GMCS-specific changes into it.
1693
1694 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1695
1696         Fix #74920.
1697         * typemanager.cs (unmanaged_enclosing_types): New.
1698         (IsUnmanagedType): Avoid infloops by using
1699         'unmanaged_enclosing_types' to talk with recursive invocations.
1700
1701 2005-05-11  Duncan Mak  <duncan@novell.com>
1702
1703         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1704         continuing to process for 'arg'.
1705         (handle_preprocessing_directive): Check the argument of the #endif
1706         directive and report error CS1025 if there are any trailing
1707         characters.
1708
1709         According to the C# spec, having even whitespace after the #endif
1710         directive is illegal; however, because we call arg.TrimEnd ()
1711         beforehand, we have the same behavior as csc, allowing whitespace
1712         after the directive.
1713
1714         Fixes #74892.
1715
1716 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1717
1718         Fix #74863.
1719         
1720         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1721         (Constructor.GetObsoleteAttribute): Implemented correctly.
1722
1723 2005-05-10  Martin Baulig  <martin@ximian.com>
1724
1725         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1726         resolve the type; fixes #74864.
1727         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1728         in DoResolve(); fixes #74862.
1729
1730 2005-05-10  Martin Baulig  <martin@ximian.com>
1731
1732         * support.cs (ReflectionParameters.ParameterModifier): Use
1733         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1734         and `ParameterAttributes.In'.  Fixes #74884.
1735
1736 2005-05-10  Martin Baulig  <martin@ximian.com>
1737
1738         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1739         the cache if we're just looking for `MemberTypes.NestedType' in a
1740         generic instance.
1741
1742         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1743         constraints if we're still resolving the type tree.
1744         (Expression.MemberLookup): If we're resolving the type tree, only
1745         look for `MemberTypes.NestedType' since we're only interested in
1746         getting types.
1747
1748         * class.cs (TypeContainer.DefineType): Don't resolve the type
1749         parameters here; do this later in ResolveType() after the type
1750         tree has been resolved.
1751         (TypeContainer.ResolveType): New public method; this is called
1752         after the type tree is resolved and before the types are being
1753         populated.  We resolve the generic constraints here.
1754         (TypeContainer.DoDefineMember): Check the constraints on our base
1755         class and interfaces.
1756
1757         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1758         set the `ResolvingTypeTree' flag on the EmitContext.
1759
1760         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1761
1762 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1763
1764         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1765         
1766         * expression.cs (Argument.GetParameterModifier): Turned to property.
1767         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1768         
1769         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1770         its C# equivalent.
1771         
1772 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1773
1774         Fix #74852.
1775         * decl.cs (MemberCache.AddMethods): Register override methods,
1776         rather than non-override methods.
1777         * typemanager.cs (RegisterOverride): New.
1778         (IsOverride): Update.
1779
1780 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1781
1782         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1783
1784 2005-05-06  Martin Baulig  <martin@ximian.com>
1785
1786         * attribute.cs
1787         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1788         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1789
1790 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1791
1792         Fix #73105.
1793         
1794         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1795         recursive declaration.
1796         
1797         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1798         
1799 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1800
1801         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1802         
1803         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1804
1805 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1806
1807         Fix #74797.
1808         * decl.cs (DeclSpace.FamilyAccessible): 
1809         Use TypeManager.IsNestedFamilyAccessible.
1810
1811         Fix reopened #64812.
1812         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1813         internal'.
1814
1815 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1816             Abin Thomas  <projectmonokochi@rediffmail.com>
1817             Anoob V E  <projectmonokochi@rediffmail.com>
1818             Harilal P R  <projectmonokochi@rediffmail.com>
1819
1820         Fix #64812.
1821         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1822         allow access to all static members.
1823
1824 2005-05-04  Martin Baulig  <martin@ximian.com>
1825
1826         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1827
1828 2005-05-04  Martin Baulig  <martin@ximian.com>
1829
1830         Fix #74655.
1831
1832         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1833         section at the end; make things work if `default' is not the last
1834         section.        
1835
1836 2005-05-04  Martin Baulig  <martin@ximian.com>
1837
1838         Fix #70400.
1839
1840         * statement.cs (Switch): Replaced the `got_default' field with a
1841         `default_section' one.
1842         (Switch.CheckSwitch): Set `default_section' here.
1843         (Switch.Resolve): If we're a constant switch and the constant is
1844         not found, use the default section.
1845
1846 2005-05-03  Martin Baulig  <martin@ximian.com>
1847
1848         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1849
1850         * statement.cs (Foreach.ArrayForeach): New nested class.
1851         (Foreach.TemporaryVariable): New nested class.
1852         (Foreach.EmitArrayForeach): Removed; this is now in the new
1853         ArrayForeach class.
1854
1855 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1856
1857         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1858         more conservative.
1859         (VerifyPendingMethods): Revert change below.
1860
1861         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1862         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1863         that used to trigger warning -28.  Remove warning -28.
1864         * expression.cs (Invocation.OverloadResolve): Use
1865         TypeManager.IsOverride to distinguish override methods.
1866
1867         Fix #74773.
1868         * pending.cs (VerifyPendingMethods): If a base type implements the
1869         requested interface, don't bother checking individual methods of
1870         the base type.  As a side-effect, this prevents the creation of
1871         unnecessary proxies.
1872
1873 2005-05-02  Martin Baulig  <martin@ximian.com>
1874
1875         Fix #70182.
1876
1877         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1878         Also `And' the locals if the old vector is null.
1879         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1880         null; in this case we basically reset all the variables.        
1881
1882 2005-05-02  Martin Baulig  <martin@ximian.com>
1883
1884         Fix #74529.
1885
1886         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1887         Added `FlowBranching branching' argument; always `and' the
1888         variables instead of `or'ing them unless we're an infinite loop.
1889
1890         * statement.cs (While.Resolve): Create a new sibling unless we're
1891         infinite.       
1892
1893 2005-05-02  Martin Baulig  <martin@ximian.com>
1894
1895         Fix #70140.
1896
1897         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1898         arguments; use it instead of creating a new TopLevelBlock.
1899         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1900         our ConstructorInitializer.
1901
1902         * statement.cs
1903         (TopLevelBlock.TopLevelBranching): New public property.
1904         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1905         and create our `TopLevelBranching'.
1906
1907         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1908         anonymous method host, use `block.TopLevelBranching' rather than
1909         creating a new branching.
1910
1911 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1912
1913         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1914         a ScopeInfo, if any of the current children is a child of the new
1915         entry, move those children there.
1916
1917 2005-04-30  Martin Baulig  <martin@ximian.com>
1918
1919         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1920         at the beginning of a SwitchSection.  Fix #73335.
1921
1922 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1923
1924         Fix #74378
1925         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1926         
1927         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1928         (FieldExpr.DoResolve): Obsolete members are ignored for field
1929         initializers.
1930         
1931 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1932
1933         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1934         of arrays detection.
1935
1936         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1937         verification.
1938         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1939
1940         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1941         arrays report.
1942
1943 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1944
1945         * cs-parser.jay: Use the prefered version of -unsafe in error
1946         message.
1947
1948 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1949
1950         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1951         circumstances.
1952
1953 2005-04-20  John Luke  <john.luke@gmail.com>
1954
1955         * driver.cs: fix typo in error message, --outout to --output
1956
1957 2005-04-30  Martin Baulig  <martin@ximian.com>
1958
1959         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1960         handle the .NET 2.x security attributes.
1961
1962 2005-04-30  Martin Baulig  <martin@ximian.com>
1963
1964         * typemanager.cs
1965         (TypeManager.ExpandInterfaces): Don't add things twice.
1966
1967         * class.cs
1968         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1969
1970 2005-04-29  Martin Baulig  <martin@ximian.com>
1971
1972         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1973
1974         * anonymous.cs: Added support for anonymous generic methods.
1975
1976 2005-04-29  Martin Baulig  <martin@ximian.com>
1977
1978         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1979         generic instances.
1980
1981 2005-04-29  Martin Baulig  <martin@ximian.com>
1982
1983         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1984
1985         * expression.cs (New.DoResolve): Fix the CS0304 check.
1986
1987 2005-04-29  Martin Baulig  <martin@ximian.com>
1988
1989         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1990         naming schema.
1991
1992         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1993         explicit interface implementation, compare the interface types.
1994         (MethodData.Define): Use the new naming scheme from the latest
1995         .NET 2.x beta2.
1996         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1997
1998         * decl.cs (MemberName.GetMemberName): Removed.
1999         (MemberName.MethodName, FullName): New properties.
2000
2001 2005-04-25  Raja R Harinath  <rharinath@novell.com>
2002
2003         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2004
2005 2005-04-22  Martin Baulig  <martin@ximian.com>
2006
2007         * generic.cs (GenericMethod): Create the EmitContext in the
2008         `Define()'; in `Define(MethodBuilder)', create the type parameters
2009         before calling `Define()'.  Fixes #73933.
2010
2011 2005-04-22  Martin Baulig  <martin@ximian.com>
2012
2013         * generic.cs
2014         (Constraints.Resolve): Make things work wrt. the new type lookup system.
2015         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2016
2017         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2018         ConstructedType, check its constraints.
2019
2020 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2021
2022         * codegen.cs (InRefOutArgumentResolving): New field.
2023         
2024         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2025         fields outside contructor.
2026         
2027         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2028         
2029 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2030
2031         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2032         parameter code was not completed ever, so it was not as up-to-date
2033         as local variables.  Must finish it.
2034
2035         The bug fix was to compare the Toplevel of the block, not the
2036         current block.  Thanks for Ben for pointing this out. 
2037
2038 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2039
2040         * decl.cs (AddMethods): Use the declaring type of the problem
2041         method to determine if we want to squash a warning.
2042
2043 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2044
2045         * attribute.cs: Removed debug output.
2046
2047         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2048         
2049         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2050         Report.Stderr.
2051         
2052 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2053
2054         Fix #74481.
2055         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2056         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2057         all null comparisons against reference types.
2058
2059 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2060
2061         Fix# 74565
2062         * class.cs (TypeContainer.CircularDepException) New nested
2063         exception class.
2064         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2065         (TypeContainer.DefineType): Removed error, reset InTransit before
2066         exit.
2067         (Class.DefineType): Throw exception when is in Transit.
2068         Catch exception and report error.
2069         (Struct.DefineType): Throw exception when is in Transit.
2070         Catch exception and report error.
2071         (Interface.DefineType): Throw exception when is in Transit.
2072         Catch exception and report error.
2073
2074         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2075         handle nested exception handlers.
2076
2077         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2078         a catch.
2079
2080         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2081         InFinally and InCatch storage.
2082
2083         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2084         (Catch.Resolve): Set and Restore ec.InCatch.
2085         (Try.Resolve): Set and Restore ec.InFinally.
2086         (Try.HasCatch): True when try has catch.
2087
2088 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2089
2090         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2091           for the same event member, so exclude such cases from warning 419.
2092           Fixed bug #74633.
2093
2094 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2095
2096         * expression.cs (Binary.ResolveOperator): Apply patch from John
2097         Luke to fix bug 59864: operators &, | and ^ on enumerations
2098         require that the same enum type on both sides.
2099
2100         * driver.cs: Add warnings to old flag usage, this is to assist
2101         people who produce Makefiles and hope that the Makefiles will be
2102         used on Windows.
2103
2104         * class.cs (TypeContainer.EmitType): Moved the definition of the
2105         special $PRIVATE$ field from the resolve phase to the Emit phase.
2106         During resolve we do not know if we are a struct with
2107         HasExplicitLayout, we know this only after the attributes for the
2108         type are emitted.
2109
2110         Set the FieldOffset to zero on the dummy field that we create for
2111         the class.   Fixes 74590.
2112
2113 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2114
2115         Fix #73834.
2116         * ecore.cs (PropertyExpr.resolved): New.
2117         (DoResolve): Use it to handle a case of double resolution here.
2118         Handle a case of identical-name-and-type-name.
2119         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2120         resolution by storing the results of expression resolution back
2121         into the "probes" array.
2122
2123 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2124
2125         Fix cs0208-7.cs and cs0208-8.cs.
2126         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2127         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2128         error reporting to point out the reason a struct is not unmanaged.
2129
2130 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2131
2132         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2133           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2134
2135 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2136
2137         Fix #74528.
2138         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2139         IdenticalNameAndTypeName here.
2140         (EventExpr.InstanceResolve): Likewise.
2141
2142 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2143
2144         C# 2.0 DefaultCharSetAttribute implementation
2145         
2146         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2147         which allows us to set GlobalNamespace for every resolve.
2148         (Attribute.ResolveArguments): Cut from Resolve.
2149         (Attribute.GetCharSetValue): Returns CharSet named argument.
2150         (Attribute.DefinePInvokeMethod): Gets default charset from
2151         module settings.
2152         (GlobalAttribute.ResolveAsTypeStep): Override.
2153         (GlobalAttribute.ResolveArguments): Override.
2154         
2155         * class.cs (TypeAttr): Is protected.
2156         
2157         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2158         (ModuleClass.DefaultCharSetType): New memeber.
2159         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2160         
2161         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2162         charset from module.
2163         
2164         * delegate.cs (TypeAttr): Override.
2165         (Delegate.DefineType): Use this TypeAttr.
2166         
2167         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2168         at very early stage (before types are defined) to resolve model
2169         module attributes. It will probably not work with corlib but it
2170         should be ok.
2171         
2172         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2173         charset from module.
2174         
2175         * typemanager.cs (default_charset_type): New type.
2176
2177 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2178
2179         * decl.cs (MemberCache.AddMethods): Don't warn if
2180         System.Object.Finalize has buggy MethodAttributes.
2181
2182         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2183         removed below.
2184
2185 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2186
2187         * doc.cs : detect ambiguous reference to overloaded members.
2188           Fixed bug #71603. MS 1.1 csc does not detect it.
2189
2190 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2191
2192         * doc.cs : delegates must not be referenced with parameters.
2193           Fixed bug #71605.
2194
2195 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2196
2197         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2198
2199 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2200
2201         * driver.cs (MainDriver): Stop processing if the CLS stage found
2202         errors. 
2203
2204         (CompilerCallableEntryPoint.InvokeCompiler): Always
2205         reset after execution;   Take a TextWriter argument for the
2206         output.
2207
2208         * report.cs: Use the error stream instead of hardcoding stderr. 
2209
2210 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2211
2212         * class.cs: Reduce code paths to test, too small of an
2213         optimization to make it worth the extra testing.  Always perform
2214         it. 
2215
2216 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2217
2218         Fix #74510.
2219         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2220         operators that had errors reported on them.
2221
2222 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2223
2224         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2225         argument types.
2226         (Attribute.Resolve): Add named argument type checking.
2227         
2228         * class.cs (FixedField.Define): Use IsPrimitiveType
2229         
2230         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2231         
2232         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2233         unsafe parameter types.
2234         
2235         * statement.cs (Using.ResolveExpression): Add better error description.
2236         
2237         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2238         
2239 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2240
2241         Fix #74484.
2242         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2243         AttributeUsageAttribute in the emitcontext of the attribute class,
2244         not in the emitcontext of the attributable entity it was attached to.
2245         * cs-parser.jay: Use 'current_class', not 'current_container',
2246         when creating a GlobalAttribute.
2247
2248 2005-04-08  Alp Toker  <alp@atoker.com>
2249
2250         * pending.cs: The fix to #58413 failed to compile methods implementing
2251         interfaces with/without params modifiers and vice versa, even though
2252         params modifiers aren't part of the signature. Make the modifier check
2253         less strict as in csc.
2254
2255 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2256             Anoob V E  <projectmonokochi@rediffmail.com>
2257             Harilal P R  <projectmonokochi@rediffmail.com>
2258
2259         Fix #58413.
2260         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2261         modifiers of pending methods.
2262         (PendingImplementation.PendingImplementation): Initialize it.
2263         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2264         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2265         with ParameterData.  Add check for modifiers.
2266         * class.cs (MethodData.Define): Update to changes.
2267
2268 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2269
2270         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2271
2272 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2273
2274         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2275         property.
2276         
2277         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2278         
2279         * rootcontext.cs,
2280         * typemanager.cs: Registered RequiredAttributeAttribute.
2281         
2282 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2283
2284         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2285         Warning CS0169 is back at level 3.
2286         (IMethodData.SetMemberIsUsed): New method.
2287         
2288         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2289         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2290         
2291         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2292
2293         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2294         contants.
2295         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2296         is used.
2297         
2298         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2299         is used.
2300         
2301         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2302         to avoid the problems with nested types.
2303
2304 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2305             Anoob V.E  <projectmonokochi@rediffmail.com>
2306             Harilal P.R  <projectmonokochi@rediffmail.com>
2307             Raja R Harinath  <rharinath@novell.com>
2308
2309         Fix #73820.
2310         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2311         attribute.
2312         * typemanager (GetConstructor): Make public.
2313
2314 2005-04-05  John Luke  <john.luke@gmail.com>
2315             Raja R Harinath  <rharinath@novell.com>
2316
2317         Fix #62232.
2318         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2319         struct too.  Return false quicker in a few cases.
2320         (VerifyUnManaged): Use it.
2321
2322 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2323
2324         Fix #74041.
2325         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2326         not 'unreachable_seen'.
2327
2328 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2329
2330         * attribute.cs (Attribute.GetValue): Removed unused.
2331         
2332         * codegen.cs (CodeGen.TrimExt): Removed unused.
2333         
2334         * cs-parser.jay (output): Removed unused.
2335         
2336         * cs-tokenizer.cs (hex_digits): Removed unused.
2337         
2338         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2339         
2340         * expression.cs (Indirection.LoadExprValue): Removed unused.
2341         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2342         
2343         * iterators.cs (Iterator.param_types): Removed unused.
2344         
2345         * statement.cs (Goto.block): Removed unused.
2346         (ToplevelBlock.did): Removed unused.
2347         (Switch.ResolveConstantSwitch): Removed unused.
2348
2349 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2350
2351         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2352         resetting thingy.
2353
2354 2005-04-19  Martin Baulig  <martin@ximian.com>
2355
2356         Merged r42462 from MCS and made it work for GMCS.
2357
2358         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2359
2360         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2361
2362 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2363
2364         Fix #74232 and cs0208-3.cs.
2365         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2366         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2367         unmanaged type.  Don't use FieldBuilders when 't' is a
2368         TypeBuilder.  Use ModFlags and MemberType fields.
2369         * class.cs (MemberBase.member_type): Rename from MemberType.
2370         (MemberBase.MemberType): New property.  Determines member_type on
2371         demand.
2372         (MemberBase.DoDefine): Don't initialize MemberType here.
2373         (FieldMember.Define): Likewise.
2374
2375 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2376
2377         Fix #74241
2378         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2379         Attributes are emitted there.
2380         
2381 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2382
2383         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2384         keyword in 'partial enum' too.
2385         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2386         is not allowed).
2387         Report from Kamil Skalski <nazgul@omega.pl>.
2388
2389         Fix #74309.
2390         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2391         have partial containers too.
2392
2393         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2394         in block' checks to Block.CheckInvariantMeaningInBlock.
2395         * statement.cs (Block.GetKnownVariableInfo): Make private.
2396         (Block.IsVariableUsedInChildBlock): Remove.
2397         (Block.IsVariableUsedInBlock): Likewise.
2398         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2399         conflicting declaration.
2400         (Block.AddVariable): Make error messages less long-winded and more
2401         specific.  Show location of conflicting declaration.
2402         * parameter.cs (Parameters.Location): New readonly property.
2403
2404 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2405
2406         Clean up semantics of invoking ResolveMemberAccess.
2407         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2408         can have an instance, ensure that we pass in a non-TypeExpression
2409         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2410         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2411         argument.  Update to changes and simplify.
2412         (FieldExpr.Emitinstance): Remove CS0120 check.
2413         (PropertyExpr.EmitInstance): Likewise.
2414         * expression.cs (Argument.Resolve): Likewise.
2415         (Invocation.DoResolve): Update to changes in semantics of
2416         InstanceExpression.
2417
2418 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2419
2420         Fix #74241
2421         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2422         customization.
2423         
2424         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2425
2426 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2427
2428         Fix difference in behaviour with commandline invocation.
2429         * driver.cs (Driver.Reset): New.
2430         (CompilerCallableEntryPoint): Call it.
2431
2432         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2433         variable" warnings if the boolean expression failed to resolve.
2434
2435 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2436
2437         * attribute.cs: Fix the union of several permissions when some of them
2438         are unrestricted (so the result isn't an unrestricted permission set).
2439         Fix #74036.
2440
2441 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2442
2443         * ecore.cs (MemberExpr): New class.  Convert from interface
2444         IMemberExpr.
2445         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2446         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2447         error checks.
2448         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2449         (MethodGroupExpr.IsExplicitImpl): Remove.
2450         (Expression.GetFieldFromEvent): Remove.
2451         (SimpleName.MemberStaticCheck): Remove.
2452         (SimpleName.DoSimpleNameResolve): Update to changes.
2453         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2454         (MemberAccess.IdenticalNameAndTypeName): Remove.
2455         (MemberAccess.error176): Move to MemberExpr.
2456         (MemberAccess.DoResolve): Update to changes.
2457         (BaseAccess.DoResolve): Likewise.
2458
2459 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2460
2461         C# 2.0 Conditional attribute class implementation
2462         
2463         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2464         Analyzes class whether it has attribute which has ConditionalAttribute
2465         and its condition is not defined.
2466         
2467         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2468         (Class.IsExcluded): New method. Search for at least one defined
2469         condition in ConditionalAttribute of attribute class.
2470
2471 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2472
2473         * ecore.cs (PropertyExpr): Derive from Expression, not
2474         ExpressionStatement.
2475         (PropertyExpr.EmitStatement): Remove.
2476
2477 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2478
2479         Fix #74060.
2480         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2481         internal field "value__" of an enum be private.  The examples for
2482         "value__" that I found on MSDN all used FieldAttributes.Private.
2483
2484         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2485         Don't mention IL method attribute names.
2486
2487         Fix #47991.  Remove a TODO.
2488         * statement.cs (Block.Toplevel): Make into a field.
2489         (Block.Parameters): Move into ToplevelBlock.
2490         (Block.known_variables): Rename from child_variable_names.
2491         (Block.Block): Remove variants that take Parameters.  Initialize
2492         'Toplevel' with the immediately surrounding toplevel block.
2493         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2494         LocalInfo parameter.
2495         (Block.GetKnownVariableInfo): New.
2496         (Block.IsVariableNameUsedInChildBlock): Update.
2497         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2498         the block, even though it may not be in scope.
2499         (Block.AddVariable): Remove Parameters parameter.  Use
2500         Toplevel.Parameters instead.
2501         (Block.AddConstant): Remove Parameters parameter.
2502         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2503         (Block.IsParamaterReference): Likewise.
2504         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2505         (ToplevelBlock.Parameters): New.  Moved from Block.
2506         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2507         initialize Parameters to a non-null value.
2508         * cs-parser.jay: Update to changes.
2509         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2510         simple names that mean different things in the same block.  Use
2511         Block.IsVariableNameUsedInBlock.
2512
2513 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2514
2515         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2516
2517 2005-03-26  Raja R Harinath  <harinath@acm.org>
2518
2519         Fix #73038.
2520         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2521         fails to resolve, ensure that the LHS is still resolved as an
2522         lvalue.
2523
2524 2005-03-25  Raja R Harinath  <harinath@acm.org>
2525
2526         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2527         ec.ContainerType.
2528         (Enum.current_ec): Remove.
2529         (Enum.LookupEnumValue): Remove EmitContext argument.
2530         Just uses the one created during DefineType.
2531         (Enum.FindMembers): Update.
2532         * expression.cs (MemberAccess.DoResolve): Update.
2533
2534 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2535
2536         * assign.cs (Assign.DoResolve): Check for CS1717 when
2537         source and target are same (uses Equals).
2538
2539         * expression.cs (LocalVariableReference, ParameterReference,
2540         This): Implemented Equals, GetHashCode.
2541
2542         * statement.cs (Block.GetParameterReference): Removed useless
2543         local variable.
2544
2545 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2546
2547         Fix cs0128.cs
2548         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2549         blocks before deciding whether the error is cs0136 or cs0128.
2550
2551         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2552         (using_alias_directive, using_namespace_directive): Pass
2553         MemberName, not an expression to Namespace.UsingAlias and
2554         Namespace.Using.
2555         (MakeName): Use the MemberName of the namespace.
2556         * namespace.cs (Namespace.MemberName): New.
2557         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2558         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2559         Likewise.
2560         * decl.cs (MemberName.Name): Make readonly.
2561         (MemberName.FromDotted): New "constructor".
2562         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2563         (MemberCore.Name): Compute from MemberName on demand.
2564         (MemberCore.SetMemberName): Provide a way to change the
2565         MemberName.
2566         (MemberCore.AddToContainer): Don't take a fullname parameter.
2567         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2568         fully qualified name of the container to the member name.
2569         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2570         only if the type is a member of the root container.
2571         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2572         MemberName.Left rather than searching for an embedded ".".
2573         (PartialContainer.CreatePart): Update to changes in RootContext.
2574         (MemberBase.ShortName): Turn into a property.  Use
2575         MemberCore.SetMemberName.
2576         (MemberBase.ExplicitInterfaceName): Remove.
2577         (MemberBase.UpdateMemberName): Remove.
2578         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2579         (PropertyBase.SetMemberName): New override.
2580         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2581         (Tree.GetDecl): New.
2582         (Tree.AllDecls): Rename from Decls.
2583         * attribute.cs, enum.cs, report.cs: Update to changes.
2584         * driver.cs (MainDriver): Use MemberName.FromDotted on
2585         RootContext.MainClass.
2586
2587 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2588
2589         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2590         checks.
2591
2592         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2593
2594 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2595
2596         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2597         property accessor modifiers.
2598
2599         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2600         fixed buffer attribute (CS1716).
2601         (PropertyMethod.HasCustomAccessModifier): When property accessor
2602         has custom modifier.
2603
2604         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2605         modifiers.
2606         (PropertyExpr.DoResolveLValue): Add CS0272.
2607
2608 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2609
2610         * convert.cs: When converting to a pointer, use the proper Conv.U
2611         or Conv.I depending on the source data type.
2612
2613         * cs-tokenizer.cs: Make the size for large decimal constants,
2614         fixes #72957.
2615
2616 2005-03-17  Martin Baulig  <martin@ximian.com>
2617
2618         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2619         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2620
2621 2005-03-17  Martin Baulig  <martin@ximian.com>
2622
2623         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2624         to bool so we can return an error condition.
2625         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2626         returned an error.
2627
2628 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2629
2630         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2631         attributes.
2632
2633 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2634
2635         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2636         Refactor to avoid traversing the list of assemblies, and to avoid
2637         string concatenation.
2638         * typemanager.cs (guid_attr_type): Remove.
2639         (negative_hits, pointers, references): Remove hashes.
2640         (type_hash): New.
2641         (GetConstructedType): New.  Uses type_hash to handle constructed
2642         types (arrays, references, pointers).
2643         (GetReferenceType, GetPointerType): Use it.
2644         (GetNestedType): New.  Uses type_hash to handle nested types of
2645         reflected types.
2646         (LookupType, LookupTypeDirect): Remove.
2647         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2648         'types' hash and LookupTypeReflection directly.
2649         (params_string, params_object): Use GetConstructedType.
2650         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2651         top-level types.
2652         (Namespace.Lookup): Use cached_types.
2653         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2654         provided by old TypeManager.LookupType.
2655         * rootcontext.cs (MakeFQN): Remove.
2656         * decl.cs (DeclSpace.MakeFQN): Likewise.
2657         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2658         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2659         TypeManager.GetConstructedType.
2660         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2661
2662 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
2663
2664         * cs-parser.jay: Fix build.
2665
2666 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2667
2668         * class.cs (TypeContainer.CircularDepException) New nested
2669         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2670
2671         * cs-parser.jay: Reports CS1527 for any namespace element.
2672
2673         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2674         Added CS0407.
2675
2676         * expression.cs (ParameterReference.IsAssigned): Changed error to
2677         CS0269.
2678         (Error_WrongNumArguments): Moved CS0245 detection here.
2679
2680         * statement.cs (Return.Resolve): Add CS1622 report.
2681
2682 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2683
2684         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2685
2686 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2687
2688         * attribute.cs expression.cs: Get rid of some allocations.
2689
2690 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2691
2692         * doc.cs : just eliminate the latest change.
2693
2694 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2695
2696         * doc.cs : commented out the latest change. It breaks xml-030.cs
2697
2698 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2699
2700         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2701           fail. So invoke CreateType() in FindDocumentedType().
2702
2703 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2704
2705         * cs-tokenizer.cs : added IsKeyword().
2706         * doc.cs : Detect keyword incorrectly used as identifier.
2707           Allow identifiers prefixed by @.
2708
2709 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2710
2711         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2712         It caused exception in namespace resolving (again!).
2713         
2714         * class.cs (Class.ctor): Removed exit.
2715         (PropertyMethod.ctor): ditto.
2716         
2717         * codegen.cs (Codegen.Reset): Reset static data.
2718         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2719         
2720         * cs-tokenizer.cs (Cleanup): Removed.
2721         
2722         * driver.cs (GetSystemDir): Rewrote to one line command.
2723         It caused problem with unloaded dynamic modules.
2724         (UnixParseOption): Removed Exit.
2725         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2726         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2727         Now can be mcs used as library.
2728         
2729         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2730         empty location.
2731         
2732         * location.cs (Reset): Reset static data.
2733         
2734         * namespace.cs (Reset): Reset static data.
2735         
2736         * report.cs (Report.Reset): Reset static data.
2737         
2738         * rootcontext.cs (RootContext.Reset): Reset static data.
2739         
2740         * tree.cs (RootTypes.ctor): Use Location.Null
2741         
2742         * typemanager.cs (TypeManager.Reset): Reset static data.
2743         (CoreLookupType): Removed Exit.
2744         (TypeHandle.Reset): Reset static data.
2745         
2746 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2747
2748         Fix #73516.
2749         * typemanager.cs (ComputeNamespaces): Import namespaces from
2750         referenced modules too.
2751
2752 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2753
2754         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2755         than '.'.
2756
2757 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2758
2759         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2760         enclosing DeclSpace.  This ensures that a name-lookup populates
2761         more caches and there are fewer 'TypeExpression's.  Carve out
2762         nested type lookup into ...
2763         (LookupNestedTypeInHierarchy): ... this.
2764
2765 2005-04-15  Martin Baulig  <martin@ximian.com>
2766
2767         Merged r41590 from MCS and make it work in the generics land.
2768
2769         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2770         `check' argument.
2771
2772         * class.cs (PartialContainer.UpdateConstraints): Removed.
2773         (PartialContainer.CheckConstraints): Removed.
2774         (PartialContainer.SetParameterInfo): Store the constraints here.
2775         (PartialContainer.DefineTypeParameters): New public method;
2776         resolve the type parameter's constraints here.  Note that the
2777         PartialContainer doesn't have an EmitContext anymore, so we must
2778         do this in the ClassPart.
2779
2780 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2781
2782         Clean up a few partial-class semantics.  
2783         Fixes test-357.cs and cs1618-2.cs.
2784         * cs-parser.jay (struct_declaration): Use 'current_class' as
2785         parent of newly-created struct.  Remove call to Register ().
2786         Use 'pop_current_class' to complete handing the current struct.
2787         (interface_declaration): Likewise.
2788         (class_declaration): Likewise.
2789         (enum_declaration): Use 'current_class' as parent of newly created
2790         enum.
2791         (delegate_declaration): Likewise.
2792         (pop_current_class): New function.  This is used to handle closing
2793         up the 'current_class' and 'current_container', and pointing them
2794         to the enclosing class/container.
2795         (CSharpParser): Initialize 'current_class' too.
2796         * decl.cs (MemberCore): Add check for invariant: a partial
2797         container is not a parsed entity, and thus does not enclose any
2798         parsed members.
2799         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2800         (DeclSpace.BaseTypeExpr): Use it.
2801         (DeclSpace.LookupType): Add check for invariant.
2802         * class.cs (TypeContainer): Add check for invariant: a nested
2803         class should have the same NamespaceEntry as its enclosing class.
2804         (TypeContainer.EmitFieldInitializers): Make virtual.
2805         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2806         MemberCore.
2807         (TypeContainer.Register): Remove.
2808         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2809         null.  Use TypeResolveEmitContext for resolving base types and
2810         interfaces.  Move initialization of Parts.TypeBuilder here from
2811         ...
2812         (TypeContainer.DefineNestedTypes): ... here.
2813         (PartialContainer): Take a Namespace not a NamespaceEntry.
2814         (PartialContainer.Create): Don't use Register.  Call the
2815         appropriate Add... function directly.
2816         (ClassPart): Take both the PartialContainer and the enclosing
2817         class as constructor arguments.
2818         (ClassPart.EmitFieldInitializers): Override.
2819         (ClassPart.PartFindNestedTypes): Remove.
2820         (FieldBase.GetInitializerExpression): Resolve the initializer
2821         expression in the emit context of the enclosing class.
2822         * tree.cs (RootTypes): Remove Register ().
2823         
2824 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2825
2826         * cs-parser.jay: Removed CS0134.
2827         
2828         * driver.cs: Removed CS1901.
2829         
2830         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2831         for predefined types.
2832
2833 2005-03-07  Duncan Mak  <duncan@novell.com>
2834
2835         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2836         well. Fixes bug #73454.
2837
2838 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2839
2840         * cs-tokenizer.cs (xtoken): Add CS1035.
2841         
2842         * class.cs (MethodData.Define): Add CS0683.
2843         (FieldMember.ctor): Add CS0681.
2844
2845 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2846
2847         * ecore.cs (SimpleName.DoResolve): Rename from
2848         SimpleName.DoResolveAllowStatic.
2849         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2850         Pass 'intermediate' flag to MemberStaticCheck.
2851         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2852         of "intermediate" lookups via MemberAccess.
2853         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2854         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2855
2856 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2857
2858         Fix #73394.
2859         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2860         slipped in because of variable names that are identical to a
2861         builtin type's BCL equivalent ('string String;', 'int Int32;').
2862         (PropertyExpr.EmitInstance): Likewise.
2863
2864 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2865
2866         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2867         
2868         * report.cs (warning_ignore_table): Made public.
2869
2870 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #73282.
2873         * class.cs (MethodData.Emit): Pass 'container' to
2874         container.GetObsoleteAttribute instead of 'container.Parent'.
2875
2876 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2877
2878         * cs-parser.jay: Add 1534 error test.
2879
2880         * iterators.cs (Yield.CheckContext): Add error 1629.
2881         (Iterator.ctor): Save unsafe modifier.
2882         (MoveNextMethod.DoEmit): Restore unsafe context.
2883
2884         * namespace.cs (UsingAlias): Better error message.
2885
2886 2005-03-03  Dan Winship  <danw@novell.com>
2887
2888         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2889         the warning message [#73219]
2890
2891 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2892
2893         Fix compile with MCS 1.0.0.0.
2894         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2895         w_restore to not depend on string constant folding.
2896
2897 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2898
2899         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2900         CS0246 check to users who passed 'silent = false'.
2901         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2902         check.
2903         (SimpleName.SimpleNameResolve): Update.
2904         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2905         (MemberAccess.IdenticalNameAndTypeName): Update.
2906         * doc.cs (FindDocumentedTypeNonArray): Update.
2907
2908 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2909
2910         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2911         * parameters.cs (ComputeAndDefineParameters): Remove.
2912         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2913         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2914         Use GetParameterInfo.
2915
2916 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2917
2918         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2919
2920 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2921
2922         Unify DeclSpace.LookupType and DeclSpace.FindType.
2923         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2924         is in charge of defining nested types on demand.
2925         (DeclSpace.LookupType): Use it when the current_type is a
2926         TypeBuilder.  Use LookupTypeDirect for reflected types.
2927         (DeclSpace.FindType): Remove.
2928         (DeclSpace.LookupInterfaceOrClass): Likewise.
2929         (DeclSpace.DefineTypeAndParents): Likewise.
2930         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2931         DeclSpace.LookupType.
2932         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2933         * typemanager.cs (LookupType): Simplify.
2934         (AddUserType): Remove type from negative_hits.
2935         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2936         * class.cs (TypeContainer.FindMembers): Move handling of nested
2937         types ...
2938         (TypeContainer.FindMembers_NestedTypes): ... here.
2939         (TypeContainer.FindNestedType): Implement override.
2940         (ClassPart.FindNestedType): Delegate to PartialContainer.
2941         (ClassPart.PartFindNestedType): Looks up the nested types of the
2942         part alone.
2943
2944 2005-04-14  Martin Baulig  <martin@ximian.com>
2945
2946         * generic.cs (ConstructedType): Moved all the type lookup and
2947         nested class logic into SimpleName.
2948         (ConstructedType.ResolveConstructedType): Our underlying type is
2949         already fully resolved; all the type lookup stuff is in
2950         SimpleName.
2951
2952         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2953         constructed types here instead of in ConstructedType.
2954
2955         * decl.cs (MemberName.GetTypeExpression): Always create a
2956         SimpleName, not a ConstructedType.
2957         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2958
2959 2005-03-02  Martin Baulig  <martin@ximian.com>
2960
2961         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2962         static constructor in static classes.
2963
2964 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2965
2966         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2967         sizeParamIndex is not specified.
2968
2969 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2970
2971         Fix #73117
2972         * report.cs (WarningMessage.IsEnabled): Missing null check.
2973
2974 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2975
2976         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2977         in the fields and not in the properties.
2978
2979 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2980
2981         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2982         fields as well.
2983
2984 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2985
2986         * attribute.cs: Small refactoring (improved robustness).
2987         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2988         (ValidateGuid): Removed.
2989         (Resolve): Removed referenced to above mentioned.
2990         (GetAttributeUsage): Made private and changed to work without
2991         class assistance.
2992         (GetIndexerAttributeValue): Don't crash.
2993         (GetConditionalAttributeValue): Ditto.
2994         (GetClsCompliantAttributeValue): Ditto.
2995         (ExtractSecurityPermissionSet): All attributes exceptions are
2996         error 648.
2997         (GetPropertyValue): New helper.
2998         (GetMethodImplOptions): New method.
2999         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3000         some missing properties.
3001         
3002         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3003         (Method.ApplyAttributeBuilder): Updated.
3004         
3005         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3006         exception.
3007
3008 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3009
3010         Fix #73052.
3011         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3012         non-simple types (array, pointer, reference).
3013
3014 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3015
3016         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3017
3018         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3019         for operators.
3020         (Method.CheckBase): Catch wrong destructor here.
3021         (MethodData.Define): Add errors 550, 668.
3022
3023         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3024
3025         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3026
3027         * pending.cs (VerifyPendingMethods): Add error 551.
3028
3029         * typemanager.cs (CSharpName): Next error report helper.
3030
3031 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3032
3033         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3034         attributes. Removed useless attribute double check.
3035         It saves almost 2MBs for corlib.
3036
3037 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3038
3039         Fix #72924.
3040         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3041         called twice in case of error.
3042
3043 2005-02-23  Chris Toshok  <toshok@ximian.com>
3044
3045         Fix compiler portions of #72827.
3046         * statement.cs (Block.Emit): call Begin/EndScope on the
3047         EmitContext instead of the ILGenerator.
3048
3049         * codegen.cs (EmitContext.BeginScope): new method, call
3050         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3051         we have one.)
3052         (EmitContext.BeginScope): same, but EndScope and CloseScope
3053
3054         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3055         offset and call the superclass's OpenScope(int) with it.
3056         (SymbolWriter.CloseScope): get the current il
3057         offset and call superclass's CloseScope(int) with it.
3058
3059 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3060
3061         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3062         CS1677 for out and ref as well.
3063
3064         * class.cs (Method.Define): Add error CS1599 detection.
3065         
3066         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3067         
3068         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3069         
3070         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3071         
3072         * support.cs.cs (ModifierDesc): New helper method.
3073
3074 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3075             Abin Thomas  <projectmonokochi@rediffmail.com>
3076             Anoob V E  <projectmonokochi@rediffmail.com>
3077             Harilal P R  <projectmonokochi@rediffmail.com>
3078
3079         Fix #57851, #72718.
3080         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3081         MemberLookup (used for error reporting) actually returns a result.
3082         Fix error report number (122, not 112).
3083
3084 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3085             Anoob V E  <projectmonokochi@rediffmail.com>
3086             Harilal P R  <projectmonokochi@rediffmail.com>
3087
3088         Fix #71134.
3089         * pending.cs (PendingImplementation.GetAbstractMethods):
3090         Find NonPublic members too.
3091
3092 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3093
3094         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3095         Fixed error 217.
3096         
3097         * class.cs (MethodCore.CheckMethodAgainstBase):
3098         Add error 239 report.
3099
3100 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3101
3102         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3103         
3104         * class.cs (Operator.Define): Add error 217 report.
3105         
3106 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3107
3108         Fix #68955.
3109         * expression.cs (Invocation.IsApplicable): Make public.
3110         (Invocation.IsParamsMethodApplicable): Likewise.
3111         * delegate.cs (Delegate.VerifyApplicability): Don't use
3112         Invocation.VerifyArgumentCompat for parameter applicability
3113         testing.  Use Invocation.IsApplicable and
3114         Invocation.IsParamsMethodApplicable.
3115
3116 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3117
3118         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3119         
3120         * class.cs (Operator.Define): Add error 217 report.
3121         
3122 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3123
3124         * namespace.cs (UsingEntry.Resolve): Undo change below.
3125
3126 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3127
3128         Fix #72756.
3129         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3130         disable the error message when the extended MemberLookup also
3131         fails.
3132         (Expression.MemberLookupFinal): Update.
3133         (SimpleName.DoSimpleNameResolve): Update.
3134         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3135         Don't use MemberLookupFinal.
3136         (New.DoResolve): Update.
3137         (BaseAccess.CommonResolve): Update.
3138
3139 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix #72732.
3142         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3143         occured previously, don't resolve again.
3144
3145 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3146
3147         Fix #69949
3148         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3149         argument. Call ResolveAttributeUsage for unresolved.
3150         when types doesn't match ctor arguments.
3151         
3152         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3153         for nested attribute classes.
3154         (Class.attribute_usage): Removed.
3155         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3156         for attribute class.
3157         
3158         * ecore.cs (IsAttribute): Removed.
3159         
3160         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3161         
3162         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3163         now normal types.
3164         (attribute_types): Removed.
3165         (EmitCode): Global attributes are emited as the latest.
3166
3167 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3168
3169         * class.cs (EmitFieldInitializers): Don't emit field initializer
3170         for default values when optimilization is on.
3171         
3172         * constant.cs (Constant.IsDefaultValue): New property.
3173         
3174         * driver.cs: Add /optimize handling.
3175         
3176         * constant.cs,
3177         * ecore.cs,
3178         * literal.cs: Implement new IsDefaultValue property.
3179         
3180         * rootcontext.cs (Optimize): New field, holds /optimize option.
3181
3182 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3183
3184         Fix crasher in re-opened #72347.
3185         * namespace.cs (Namespace.Lookup): Return null if
3186         DeclSpace.DefineType returns null.
3187
3188         Fix #72678.
3189         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3190
3191 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3192
3193         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3194         now returns null if it cannot resolve to an lvalue.
3195         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3196         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3197         returned null.  Remove check for SimpleName.
3198         (EventExpr.DoResolveLValue): New.
3199         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3200         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3201         error from ...
3202         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3203         avoid CS0131 error.
3204         (Unary.ResolveOperator): Move CS0211 check ...
3205         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3206         CS0131 error.
3207         (Unary.DoResolveLValue): Simplify.
3208         (AddressOf.DoResolveLValue): New.
3209         (ArrayAccess.DoResolveLValue): New.
3210
3211 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3212
3213         * attribute.cs (Attribute.Resolve): Add arguments casting for
3214         when types doesn't match ctor arguments.
3215
3216 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3217
3218         Fix parts of #63202.
3219         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3220         lookup of operator in base type.  Ensure that all checks happen
3221         when the operator resolves to an "op_..." method.
3222
3223 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3224
3225         Fix #71992.
3226         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3227         'ignore_cs0104' parameter.  Pass it to ...
3228         (NamespaceEntry.Lookup): ... this.
3229         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3230         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3231         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3232         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3233         Update.  Request that cs0104 errors be ignored.
3234         (ComposedCast.ResolveAsTypeStep): Update.
3235
3236 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3237
3238         Fix #59209.
3239         * expression.cs (Invocation.BetterFunction): Remove support for
3240         comparing virtual functions and their overrides.
3241         (Invocation.IsOverride): New.
3242         (Invocation.OverloadResolve): Don't consider 'override' functions
3243         during candidate selection.  Store them in a lookaside list.
3244         If the selected method is a 'virtual' function, use the list to
3245         find any overrides that are closer to the LHS type.
3246
3247 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3248
3249         * expression.cs (New.DoResolve): Add complex core type reduction.
3250         (New.Constantify): Converts complex core type syntax like 'new int ()'
3251         to simple constant.
3252         
3253 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3254
3255         * decl.cs (EntryType.EntryType): New constructor to create an
3256         updated copy of a cache entry.
3257         (MemberCache.AddMethods): Use it.
3258         (MemberCache.ClearDeclaredOnly): Remove.
3259         (MemberCache.MemberCache): Update.
3260
3261 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3262
3263         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3264         variable.  This one is represents the actual low-level declaration
3265         of the method, as opposed to the semantic level `IsStatic'.   
3266
3267         An anonymous method which is hosted into a static method might be
3268         actually an instance method.  IsStatic would reflect the
3269         container, while MethodIsStatic represents the actual code
3270         generated.
3271
3272         * expression.cs (ParameterReference): Use the new MethodIsStatic
3273         instead of IsStatic.
3274
3275         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3276         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3277         set on the current EmitContext. 
3278
3279         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3280         resolve our casted expression as an LValue.  This triggers the
3281         proper LValue processing that is later required by Assign.
3282
3283         This fixes 72347.
3284
3285         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3286
3287 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3288
3289         C# 2.0 Fixed buffer implementation
3290
3291         * anonymous.cs: Update after RegisterHelperClass renaming.
3292
3293         * attribute.cs (AttributeTester.fixed_buffer_cache):
3294         Cache of external fixed buffers.
3295         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3296         implementation if field is fixed buffer else null.
3297
3298         * class.cs
3299         (TypeContainer.AddField): Accept FieldMember instead of Field.
3300         (FieldBase.IsFieldClsCompliant): Extracted code from
3301         VerifyClsCompliance descendant customization.
3302         (FixedField): New class handles fixed buffer fields.
3303         (FixedFieldExternal): Keeps information about imported fixed
3304         buffer.
3305         (IFixedField): Make access to internal or external fixed buffer
3306         same.
3307
3308         * cs-parser.jay: Add fixed buffer parsing.
3309
3310         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3311         buffer.
3312
3313         * expression.cs (Indirection): Extended implementation to accept
3314         fixed buffer field.
3315         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3316         (ElementAccess.MakePointerAccess): Get type as parameter.
3317         (DoResolve): Add fixed buffer field expression conversion.
3318         (DoResolveLValue): Ditto.
3319         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3320         (ArrayPtr): Derives from FixedBufferPtr.
3321         (ArrayPtr.Emit): Add extra emit for array elements.
3322
3323         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3324
3325         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3326         for compiler generated types.
3327         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3328
3329         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3330         and consume less memory.
3331         (Fixed.Resolve): Add fixed buffer case.
3332
3333         * typemanager.cs (compiler_generated_attr_ctor,
3334         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3335         (HasElementType): Add our own implementation to work on every
3336         runtime.
3337
3338 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3339
3340         * anonymous.cs (CaptureContext): Track whether `this' has been
3341         referenced.   
3342
3343         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3344         only captured `this' if it was implicitly done (instance
3345         methods/variables were used). 
3346
3347         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3348         `this' must be captured.
3349
3350 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3351  
3352         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3353         is null it means that there has been no need to capture anything,
3354         so we just create a sibling.
3355
3356         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3357
3358         Just a partial fix.  The other half is fairly elusive.
3359         
3360 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3361
3362         Fix #52586, cs0121-4.cs.
3363         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3364         and return a hashtable.
3365         (MemberCache.ClearDeclaredOnly): New.
3366         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3367         the method_hash of a base type too.
3368         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3369         type methods.  Overwrite entries with the same MethodHandle so
3370         that the ReflectedType is correct.  The process leaves in base
3371         virtual functions and their overrides as distinct entries.
3372         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3373         matters since it was boxed in a ArrayList before.
3374         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3375         modifier.
3376         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3377         case of a virtual function and its override (choose the overload
3378         as better).
3379         (Invocation.OverloadResolve): Avoid 'override' members during
3380         'applicable_type' calculation.
3381
3382 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3383
3384         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3385         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3386         GetTypeHandle.  It is possible for a reflected type to derive from
3387         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3388         System.Array during mscorlib compilation).
3389         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3390         contain a method_hash, don't create one either.  Don't create a
3391         deep copy of the base cache's method_hash.
3392         (MemberCache.SetupCache): Rename back from DeepCopy.
3393         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3394         already initialized.  If we see an override function, add its
3395         underlying base virtual function to the member_hash too.
3396
3397 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3398
3399         Combine two near-redundant caches.
3400         * typemanager.cs (method_params): Rename from method_internal_params.
3401         (TypeManager.GetParameterData): New.  Replace
3402         Invocation.GetParameterData.
3403         (TypeManager.LookupParametersByBuilder): Remove.
3404         * expression.cs (Invocation.method_parameter_cache): Remove.
3405         (Invocation.GetParameterData): Remove.
3406         Update to changes.
3407         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3408         Update to changes.
3409
3410 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3411
3412         Fix #72015.
3413         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3414         TypeManager.multicast_delegate_type is null, resolve it by looking
3415         up "System.MulticastDelegate".
3416         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3417
3418 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3419             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3420             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3421
3422         Fix cs0164.cs.
3423         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3424         (LabeledStatement.AddReference): New.  Set 'referenced'.
3425         (Goto.Resolve): Use it.
3426
3427 2005-02-05  John Luke  <john.luke@gmail.com>
3428
3429         * driver.cs: remove duplicate -doc line in Usage ()
3430
3431 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3432
3433         * location.cs (Location.AddFile): Fix CS2002 error report.
3434
3435 2005-02-02  Martin Baulig  <martin@ximian.com>
3436
3437         * delegate.cs (Delegate.DefineType): Report an internal error if
3438         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3439         details.        
3440
3441 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3442
3443         Fix a crasher in a variant of #31984.
3444         * const.cs (Constant.CheckBase): New override that defers the
3445         new-or-override check in case the base type hasn't been populated
3446         yet.
3447         (Constant.Define): Ensure the new-or-override check is performed.
3448
3449 2005-02-01  Duncan Mak  <duncan@ximian.com>
3450
3451         * const.cs (LookupConstantValue): Check that `ce' is not null
3452         before calling GetValue ().
3453
3454 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3455
3456         Fix test-334.cs (#69519).
3457         * cs-parser.jay (using_alias_directive): Pass in an expression to
3458         NamespaceEntry.UsingAlias.
3459         (using_namespace_directive): Pass in an expression to
3460         NamespaceEntry.Using.
3461         (namespace_name): Don't flatten to a string.
3462         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3463         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3464         ResolveAsTypeStep.
3465         (NamespaceEntry.UsingEntry): Likewise.
3466         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3467         changes.
3468         (NamespaceEntry.LookupForUsing): Remove.
3469         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3470         names.
3471         (NamespaceEntry.Lookup): Remove support for dotted names.
3472
3473 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3474
3475         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3476         split into two.
3477         (NamespaceEntry.ImplicitParent): Compute on demand.
3478         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3479         parallels the current.
3480         (NamespaceEntry.LookupForUsing): Use it.
3481         (NamespaceEntry.Lookup): If the current namespace-entry is
3482         implicit, don't search aliases and using tables.
3483
3484 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3485
3486         Fix #31984.
3487         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3488         BaseCache here.
3489         (TypeContainer.BaseCache): Compute on demand.
3490         (TypeContainer.FindMembers): Define constants and types if they're
3491         not already created.
3492         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3493         check.
3494         * const.cs (Constant.Define): Make idempotent.
3495
3496 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3497
3498         * pending.cs: Produce better code (no nops produced by using Ldarg
3499         + value).
3500         
3501         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3502         i - 1' it should be arg + 1.
3503
3504         Fixes bug #71819.
3505
3506 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3507
3508         * attribute.cs (Attribute.CheckAttributeType): Make private
3509         non-virtual.
3510         (Attribute.ResolveType): Make virtual.
3511         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3512         handling of RootContext.Tree.Types.
3513
3514 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3515
3516         Update attribute-handling to use the SimpleName/MemberAccess
3517         mechanisms.
3518         * cs-parser.jay (attribute): Pass in an expression to the
3519         constructors of Attribute and GlobalAttribute.
3520         * attribute.cs (Attribute): Take an expression for the name.
3521         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3522         passed in attribute name expression.
3523         (Attribute.CheckAttributeType): Use it.
3524         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3525         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3526         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3527         argument to prevent error messages if the lookup fails.
3528
3529 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3530
3531         * expression.cs (Indirection): Implemented IVariable interface
3532         to support indirection in AddressOf operator.
3533         (PointerArithmetic.Emit): Add optimalization for case where
3534         result can be precomputed.
3535
3536 2005-01-26  Martin Baulig  <martin@ximian.com>
3537
3538         * class.cs (TypeContainer.AttributeTargets): Return the correct
3539         AttributeTargets depending on our `Kind' instead of throwing an
3540         exception; fixes #71632.
3541
3542 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3543
3544         Fix #71257
3545         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3546         constant members.
3547
3548 2005-03-17  Martin Baulig  <martin@ximian.com>
3549
3550         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3551         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3552
3553 2005-03-17  Martin Baulig  <martin@ximian.com>
3554
3555         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3556         to bool so we can return an error condition.
3557         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3558         returned an error.
3559
3560 2005-03-17  Martin Baulig  <martin@ximian.com>
3561
3562         * generic.cs (TypeMananager.IsIEnumerable): New public method.
3563
3564         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3565         converting from an array-type of T to `IEnumerable<T>'.
3566
3567 2005-03-16  Martin Baulig  <martin@ximian.com>
3568
3569         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3570         (Nullable.LiftedUnaryMutator): New public class.
3571
3572         * expression.cs (UnaryMutator.DoResolve): Added support for
3573         Nullable Types.
3574
3575 2005-03-14  Martin Baulig  <martin@ximian.com>
3576
3577         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3578
3579 2005-03-14  Martin Baulig  <martin@ximian.com>
3580
3581         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3582         the comparision operators `<', `>', `<=' and `>='.
3583
3584 2005-03-13  Martin Baulig  <martin@ximian.com>
3585
3586         * generic.cs
3587         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3588         avoid confusion with the `NullLiteral'.
3589         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3590
3591 2005-03-13  Martin Baulig  <martin@ximian.com>
3592
3593         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3594         comparing arbitrary types with the null literal.
3595
3596 2005-03-13  Martin Baulig  <martin@ximian.com>
3597
3598         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3599         boolean operators '&&', '||', '&' and '|'.
3600         (Nullable.OperatorTrueOrFalse): New public class.
3601
3602         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3603         instead of a `StaticCallExpr'; added support for nullables.
3604
3605 2005-03-10  Martin Baulig  <martin@ximian.com>
3606
3607         * expression.cs
3608         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3609         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
3610
3611 2005-03-07  Martin Baulig  <martin@ximian.com>
3612
3613         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3614         it work if `expr' is not an IMemoryLocation.
3615         (Nullable.Lifted): Implement IMemoryLocation.
3616         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3617         target type.
3618
3619 2005-03-05  Martin Baulig  <martin@ximian.com>
3620
3621         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3622         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3623         (Nullable): Added support for lifted unary and binary operators.
3624
3625         * expression.cs (Unary.DoResolve): Added support for nullable types.
3626         (Binary.DoResolve): Likewise.
3627         (Conditional.DoResolve): Likewise.
3628
3629 2005-03-02  Martin Baulig  <martin@ximian.com>
3630
3631         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3632
3633         * class.cs (ClassPart.SetParameterInfo): Override this.
3634         (PartialContainer.SetParameterInfo): Override this.
3635         (TypeContainer.CheckConstraints): New protected method.
3636         (PartialContainer.CheckConstraints): Override this and check
3637         whether the same contraints were specified in all parts of a
3638         partial generic type definition.
3639         (PartialContainer.UpdateConstraints): New public method.
3640
3641         * generic.cs (TypeParameter.UpdateConstraints): New public method.
3642
3643 2005-03-02  Martin Baulig  <martin@ximian.com>
3644
3645         Committing a patch from Carlos Alberto Cortez to fix #72887.
3646
3647         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3648         casts from `T []' to `int []'.
3649
3650 2005-03-02  Martin Baulig  <martin@ximian.com>
3651
3652         * generic.cs (TypeManager.IsEqual): Make this symmetric.
3653
3654         * expression.cs (Binary.ResolveOperator): When resolving a
3655         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3656         `=='.  Fixes #71866.  See gen-127.cs.
3657
3658 2005-03-02  Martin Baulig  <martin@ximian.com>
3659
3660         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3661         static constructor in static classes.
3662
3663 2005-03-02  Martin Baulig  <martin@ximian.com>
3664
3665         * generic.cs
3666         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3667         (Nullable.LiftedConversion): Added support for user-defined
3668         conversions.
3669
3670         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3671
3672         * cs-parser.jay: Use ComposedCast everywhere instead of
3673         NullableType, so we don't need to check for NullableType
3674         everywhere.
3675         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3676         case where we'll be resolved into a `parenthesized_expression_0'
3677         afterwards.
3678
3679         * convert.cs
3680         (Convert.UserDefinedConversion): Added nullable conversions.
3681
3682 2005-02-28  Martin Baulig  <martin@ximian.com>
3683
3684         * generic.cs (TypeManager.IsNullableType): New static method.
3685         (Nullable): New abstract class.
3686         (Nullable.NullLiteral): New public class.
3687         (Nullable.LiftedConversion): New public class.
3688
3689         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3690         `builtin_types opt_nullable'.
3691
3692         * convert.cs
3693         (Convert.ImplicitConversionStandard): Added nullable conversions.
3694         (Convert.ExplicitConversionStandard): Likewise.
3695         (Convert.ExplicitConversion): Likewise.
3696
3697 2005-02-26  Martin Baulig  <martin@ximian.com>
3698
3699         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3700         begin with a "?", for instance "?[]".  Don't do a type lookup if
3701         `dim' is empty.
3702
3703 2005-02-25  Martin Baulig  <martin@ximian.com>
3704
3705         The first part of Nullable Types :-)
3706
3707         * generic.cs (NullableType): New public class.
3708         (NullCoalescingOperator): New public class.
3709         (TypeArguments.Resolve): Add a CS0306 check.
3710
3711         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3712         (opt_nullable): New rule.
3713         (type): Added `opt_nullable' to `namespace_or_type_name',
3714         `builtin_types' and `pointer_type'.
3715         (array_type): Added `opt_nullable'.
3716         (opt_rank_specifier_or_nullable): New rule; this is the
3717         combination of `opt_rank_specifier' and `opt_nullable'.
3718         (opt_error): New rule; catch errors here.
3719         (nullable_type_or_conditional): New rule; we use this to check for
3720         nullable and still detect the conditional operator.
3721         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3722         instead `opt_rank_specifier'.
3723
3724         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3725         for nullables.
3726
3727 2005-02-24  Martin Baulig  <martin@ximian.com>
3728
3729         * README, README.Changes: Removed; they're old and obsolete.
3730
3731 2005-02-22  Martin Baulig  <martin@ximian.com>
3732
3733         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3734         returned an error, set `constraints' to null to avoid a crash
3735         later on.
3736         (TypeParameter.ResolveType): Likewise.
3737
3738 2005-02-22  Martin Baulig  <martin@ximian.com>
3739
3740         * generic.cs
3741         (Constraints.ResolveTypes): Protect against being called twice.
3742         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3743         (TypeParameter.ResolveType): New public method; calls
3744         constraints.ResolveTypes().
3745         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3746         into the new ResolveType().
3747         (GenericMethod.Define): Call ResolveType() on all our
3748         TypeParameter's.        
3749
3750 2005-02-21  Martin Baulig  <martin@ximian.com>
3751
3752         * generic.cs
3753         (TypeManager.generic_nullable_type): New static public field.
3754         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3755
3756         * rootcontext.cs
3757         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3758
3759 2005-02-15  Martin Baulig  <martin@ximian.com>
3760
3761         * generic.cs (ConstructedType.Constraints): Correctly check
3762         constraints if the argument type is a type parameter; fixes
3763         #72326. 
3764
3765 2005-02-02  Martin Baulig  <martin@ximian.com>
3766
3767         * delegate.cs (Delegate.DefineType): Report an internal error if
3768         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3769         details.        
3770
3771 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3772
3773         * pending.cs: Produce better code (no nops produced by using Ldarg
3774         + value).
3775         
3776         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3777         i - 1' it should be arg + 1.
3778
3779         Fixes bug #71819.
3780         
3781 2005-01-26  Martin Baulig  <martin@ximian.com>
3782
3783         * cs-parser.jay (indexer_declarator): Don't report an error if we
3784         have type parameters since we can be an explicit interface
3785         implementation; fixes #71449.
3786
3787 2005-01-26  Martin Baulig  <martin@ximian.com>
3788
3789         * class.cs (TypeContainer.AttributeTargets): Return the correct
3790         AttributeTargets depending on our `Kind' instead of throwing an
3791         exception; fixes #71632.
3792
3793 2005-01-26  Martin Baulig  <martin@ximian.com>
3794
3795         * delegate.cs (Delegate.DefineType): Correctly define our type
3796         parameters.  Fixes #71483.
3797
3798 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3799
3800         Fix #71602.
3801         * expression.cs (MemberAccess.DoResolve): Don't complain with
3802         cs0572 when the LHS of a member access has identical name and type
3803         name.
3804
3805 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3806
3807         Fix #71651, #71675
3808         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3809         CreatePermission.
3810         Create custom PermissionSet only for PermissionSetAttribute.
3811
3812 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3813
3814         Fix #71649
3815         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3816         delegates in static class.
3817
3818 2005-01-24  Martin Baulig  <martin@ximian.com>
3819
3820         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3821         merging an implicit block, just use its reachability.
3822
3823         * statement.cs (Block.Resolve): Make the unreachable code check
3824         work wrt. implicit blocks; see test-337 from #63842.
3825
3826 2005-01-21  Alp Toker  <alp@atoker.com>
3827  
3828         * cs-parser.jay: destructor_declaration's container is PartialContainer
3829         not Class when partial types are used, so use Kind prop instead of
3830         'is'.
3831         
3832 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3833
3834         * cs-parser.jay: Improve error reporting when an interface
3835         declares new types.
3836
3837 2005-01-20  Dick Porter  <dick@ximian.com>
3838
3839         * support.cs: SeekableStreamReader fix from Sandor Dobos
3840         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3841         chars are read.  Fixes bug 70369.
3842
3843 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3844
3845         * cs-parser.jay (catch_clause): Simplify current_block handling
3846         somewhat.
3847
3848 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3849
3850         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3851         code with ImplicitStandardConversion to handle the implicit
3852         conversion of method groups into valid delegate invocations. 
3853
3854         The problem is that in parameter handling we were using this code
3855         path.  Fixes bug #64698
3856
3857 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3858
3859         * cs-parser.jay: Fix several infelicities.
3860         - Avoid assigning to the parser value stack.  Code like 
3861           '$3 = null' is unclean.  Synthesize a value for the code block
3862           instead. 
3863         - Avoid using oob_stack for storing location information.  Use ...
3864         (_mark_): ... this.  New (empty) rule.  Saves the current location
3865         in $$.
3866         (foreach_statement): Avoid using oob_stack for current_block
3867         handling.  Use technique used in for_statement and
3868         using_statement.  Synthesize a value for the code block to store
3869         additional intermediate information.
3870
3871 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3872
3873         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3874         of a different type is only allowed to private fields of a
3875         containing type, not on fields of a base class.
3876
3877         See test-174.cs and error cs0122-9.cs
3878
3879 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3880
3881         Fix test-335.cs (bug #58126).
3882         * cs-parser.jay (argument): Split out non-expression parts of the
3883         rule into 'non_simple_argument'.
3884         (invocation_expression): Support parenthesized invocations with
3885         multiple arguments, and with single non-simple arguments.
3886
3887 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3888
3889         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3890         places.
3891
3892 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3893
3894         Fix cs0038-1.cs, cs1640-6.cs.
3895         * ecore.cs (Expression.Resolve): Remove special-case for
3896         SimpleName in error-handling.
3897         (Expression.almostMatchedMembers): Relax access permission to
3898         protected.
3899         (Expression.MemberLookupFailed): Handle duplicates in
3900         almostMatchedMembers list.
3901         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3902         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3903         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3904         overload if the passed in MemberInfo is a MethodBase.
3905
3906 2005-01-25  Martin Baulig  <martin@ximian.com>
3907
3908         * doc.cs
3909         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3910
3911 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3912
3913         Fix #70749
3914         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3915         for non-CAS & merge permission sets properly.
3916
3917 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3918
3919         Improve standard-compliance of simple name and member access 
3920         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3921         * ecore.cs (FullNamedExpression): New abstract base class 
3922         for Namespaces and TypeExpressions.
3923         (ResolveFlags.SimpleName): Remove.
3924         (SimpleName): Remove support for dotted names.
3925         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3926         DeclSpace.FindType and DeclSpace.LookupType.
3927         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3928         (Expression.ExprClassName): Make member function.
3929         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3930         a namespace.  Remove creation of dotted "SimpleName"s.
3931         (MemberAccess.DoResolve): Likewise.
3932         * decl.cs (DeclSpace.Cache): Make private.
3933         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3934         (DeclSpace.FindType): Update.
3935         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3936         FullNamedExpression.
3937         * namespace.cs (Namespace): Derive from FullNamedExpression
3938         so that it can be part of expression resolution.
3939         (Namespace.Lookup): Return an FullNamedExpression.
3940         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3941         namespace.
3942         * rootcontext.cs (NamespaceLookup): Remove.
3943         (LookupType): Move to DeclSpace.
3944         * attribute.cs (CheckAttributeType): Update.
3945         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3946         (FindDocumentedTypeNonArray): Likewise.
3947
3948 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3949
3950         Fix cs0509.cs, cs1632.cs.
3951         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3952         is the same as IsInterface.
3953         (TypeContainer.GetClassBases): Likewise.
3954         * statement.cs (LabeledStatement.ig): New field.
3955         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3956         label.
3957         (LabeledStatement.DoEmit): Check that the label was created with
3958         the same ILGenerator.
3959
3960 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3961
3962         Fix #71058
3963         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3964         accessors to its properties.
3965
3966         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3967         from accessors to property.
3968         
3969 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3970
3971         Fix #70722
3972         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3973         only for overrides.
3974         
3975 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3976
3977         * attribute.cs: Check for null and empty strings.  
3978
3979         I have lost another battle to Paolo.
3980
3981 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3982
3983         Fix #70942
3984         * class.cs (PropertyMethod): Set Parent field in ctors.
3985         (SetMethod.InternalParameters): Add unsafe switch hack.
3986         Override MarkForDuplicationCheck where it is appropriate.
3987
3988         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3989         It says whether container allows members with the same name.
3990         Base default is no.
3991         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3992         Removed is_method parameter.
3993
3994 2005-01-06  Duncan Mak  <duncan@ximian.com>
3995
3996         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3997         because the previous change led to incorrect reporting of CS1032
3998         ("Cannot define/undefine preprocessor symbols after first token in
3999         file"). Instead of using `tokens_seen' as the only flag that
4000         triggers CS1040, introduce `comments_seen'. This new flag is used
4001         to signify having seen comments on the current line, so it is
4002         unset after a newline.
4003
4004 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4005
4006         * doc.cs : When searching for a type, find nested type too.
4007           This fixes bug #71040.
4008
4009 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4010
4011         * doc.cs :
4012           - Warn missing member comment on those classes which also does not
4013             have doc comments. Fixed bug #71041.
4014           - Don't warn missing doc comment on default constructor.
4015             Fixed bug #71042.
4016
4017 2005-01-06  Duncan Mak  <duncan@ximian.com>
4018
4019         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4020         comments, set `tokens_seen' to true. This allows us to detect
4021         misplaced preprocessor directives (i.e. not at the beginning of
4022         the a line, nor after whitespaces). In that case, report error
4023         CS1040. This fixes bug #56460.
4024
4025         * cs-parser.jay (interface_member_declaration): Add checks for
4026         IsExplicitImpl, and report CS0541 error if an interface member is
4027         defined as an explicit interface declaration.
4028
4029 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4030
4031         Fix #70817
4032         * class.cs (PropertyMethod): Set Parent field in ctors.
4033         (SetMethod.InternalParameters): Add unsafe switch hack.
4034         
4035         * decl.cs (MemberCore.Parent): Cannot be readonly.
4036
4037 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4038
4039         * decl.cs (DeclSpace.ResolveType): Remove.
4040         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4041         Merge in code from ...
4042         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4043         * class.cs, enum.cs: Update to changes.
4044
4045 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4046
4047         * anonymous.cs: Ensure that we init the scope of our parent if it
4048         has not been initialized yet.
4049
4050 2004-12-30  Duncan Mak  <duncan@ximian.com>
4051
4052         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4053         if field.FieldBuilder is null. Fixes #70758.
4054
4055         * convert.cs: Fixed some typos and updated some of the comments.
4056         (ImplicitStandardConversionExists):
4057         (TryImplicitIntConversion): If `target_type' is an interface and
4058         the type of `ic' implements this interface, return true or a new
4059         BoxedCast instead of null. This fixes #70468.
4060
4061 2004-12-29  Duncan Mak  <duncan@ximian.com>
4062
4063         * expression.cs (Argument.Emit): Check that Expr is
4064         IMemoryLocation before casting to it, and report CS1510 otherwise.
4065
4066         This fixes #70402.
4067
4068 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4069
4070         * statement.cs (Block.ThisVariable): remove the recursion here, to
4071         make the --profile more sane.
4072
4073 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4074
4075         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4076         assembly, by JB Evain.
4077
4078 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4079
4080         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4081           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4082         "parent" refers to enclosing type/class.  "base" refers to superclass.
4083
4084 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4085
4086         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4087         Ensure that we only have GlobalAttributes.
4088         * attribute.cs (Attribute.Emit): Make non-virtual.
4089         (GlobalAttribute.Emit): Remove.
4090         (Attribute.Resolve): Make virtual.
4091         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4092         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4093         the argument. Don't create one.
4094         (Attribute.GetObsoleteAttribute): Likewise.
4095         (Attribute.GetClsCompliantAttributeValue): Likewise.
4096         * class.cs, decl.cs: Update to changes.
4097
4098 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4099
4100         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4101         
4102         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4103         
4104         * statement.cs (Foreach.Resolve): Add error 186 report.
4105
4106 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4107
4108         * expression.cs (Conditional.DoResolve): Add warning 429.
4109         
4110         * statement.cs (If.Resolve): Add warning 665.
4111
4112 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4113
4114         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4115         except when in the parser, and in GlobalAttribute.
4116         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4117         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4118         RootContext.Tree.Types.NamespaceEntry once work is done.
4119         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4120         and resets RootContext.Tree.Types.NamespaceEntry.
4121
4122 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4123
4124         * cs-parser.jay: Don't create a block for every variable.
4125
4126 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4127
4128         * location.cs: Provide extra information.
4129
4130         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4131         variables from the captured environment, it is the ldarg_0.
4132
4133 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4134
4135         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4136         find a conclusion.
4137         
4138         * class.cs: Changed warning level for 169 to avoid developer
4139         displeasure from warning flooding. It will be changed back when they
4140         fix most of current BCL warnings.
4141         
4142         * RootContext.cs: Pushed default WarningLevel to 3.
4143         
4144         * statement.cs: Removed unused variable.
4145
4146 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4147
4148         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4149         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4150         Add error 502 report.
4151         (StaticClass.DefineType): Add error 441 report.
4152         (Class.AllowedModifiersProp): New virtual property as temporary
4153         extension to AllowedModifiers.
4154         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4155         to share implementation with StaticClass and don't call virtual
4156         methods from ctor.
4157         
4158         * driver.cs (MainDriver): Add error 1558 test.
4159
4160         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4161         report. Moved error 36 test here.
4162
4163         * statement.cs (Throw.Resolve): Add error 724 report.
4164
4165         * typemanager.cs: Add out_attribute_type core type.
4166         
4167 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4168
4169         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4170         3018 report.
4171         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4172
4173         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4174         3017 report.
4175         
4176         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4177
4178         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4179         Add error 3023 report.
4180         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4181
4182         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4183         implementation.
4184
4185 2004-12-12  John Luke  <john.luke@gmail.com>
4186
4187         * driver.cs (AddArgs): take -- into account when
4188         adding arguments, fixes bug 65710 
4189
4190 2004-12-12  Martin Baulig  <martin@ximian.com>
4191
4192         * expression.cs (Unary.TryReduceNegative): Added support for
4193         SByteConstant and ByteConstant.
4194         (Unary.Reduce): Check error values from TryReduceNegative().
4195
4196 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4197
4198         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4199         and report exception as error 182.
4200
4201 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4202
4203         * driver.cs (Main): Fix message when there are warnings.
4204
4205 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4206
4207         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4208
4209 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4210
4211         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4212         Reduced number of warnings.
4213         
4214         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4215
4216 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4217
4218         * driver.cs: Removed message.
4219
4220         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4221
4222 2004-12-08    <vargaz@freemail.hu>
4223
4224         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4225
4226 2004-12-08  Martin Baulig  <martin@ximian.com>
4227
4228         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4229         instead of a CS3002 for properties and indexer.
4230
4231 2004-12-08  Martin Baulig  <martin@ximian.com>
4232
4233         * decl.cs (MemberName.ToString): Make this work again.
4234
4235 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4236
4237         * attribute.cs (Resolve): Add error 591 detection.
4238
4239         * class.cs (FieldMember.Define): Add error 1547 detection.
4240         (Indexer.Define): Add error 620 detection.
4241         (Operator.Define): Add error 590 detection.
4242
4243         * ecore.cs: Missing argument for error 79.
4244
4245         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4246         detection.
4247
4248 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4249
4250         Fix #70106
4251         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4252         only.
4253
4254 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4255
4256         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4257           Some operator comments were suppressed.
4258         * doc.cs : Implicit/explicit operator name in doc comments are like
4259           "op_Explicit(type)~returnType", so added suffix handling.
4260
4261 2005-01-21  Alp Toker  <alp@atoker.com>
4262
4263         * cs-parser.jay: destructor_declaration's container is PartialContainer
4264         not Class when partial types are used, so use Kind prop instead of 'is'.
4265
4266 2004-12-12  Martin Baulig  <martin@ximian.com>
4267
4268         * expression.cs (Unary.TryReduceNegative): Added support for
4269         SByteConstant and ByteConstant.
4270         (Unary.Reduce): Check error values from TryReduceNegative().
4271
4272 2004-12-11  Martin Baulig  <martin@ximian.com>
4273
4274         * support.cs (ReflectionParameters.ParameterName): If we have a
4275         `gpd', call `ParameterName' on it.
4276
4277         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4278
4279         * pending.cs (PendingImplementation.DefineProxy): Call
4280         DefineParameter() for all of the MethodBuilder's arguments.
4281
4282 2004-12-09  Martin Baulig  <martin@ximian.com>
4283
4284         * doc.cs (DocUtil): Make this a static class.
4285
4286 2004-12-09  Martin Baulig  <martin@ximian.com>
4287
4288         * expression.cs (Invocation.InferType): Moved the type inference
4289         implementation into TypeManager.
4290
4291         * generics.cs (TypeManager): Moved the type inference
4292         implementation here.
4293
4294 2004-12-09  Martin Baulig  <martin@ximian.com>
4295
4296         * typemanager.cs (TypeManager): Make this a partial class.
4297
4298         * generics.cs
4299         (TypeManager): Move the generics part of `TypeManager' here.
4300
4301 2004-12-08  Martin Baulig  <martin@ximian.com>
4302
4303         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4304         instead of a CS3002 for properties and indexer.  Added CS3024
4305         check for generic interfaces.
4306
4307         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4308         instances are not CLS-compliant.
4309
4310 2004-12-08  Martin Baulig  <martin@ximian.com>
4311
4312         * cs-parser.jay
4313         (void_pointer_expression): New rule for `void*', `void**' etc.
4314         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4315
4316 2004-12-08  Martin Baulig  <martin@ximian.com>
4317
4318         * expression.cs (Invocation.InferType): Removed the hack for
4319         MethodCore.MayUnify().  
4320
4321         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4322         this actually work.
4323
4324         * class.cs (MethodCore.MayUnify): Use
4325         TypeManager.MayBecomeEqualGenericTypes().       
4326
4327 2004-12-08  Martin Baulig  <martin@ximian.com>
4328
4329         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4330         parameter, box it.  Fixes #69233.
4331
4332 2004-12-08  Martin Baulig  <martin@ximian.com>
4333
4334         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4335         have the ctor constraint.  Fixes #68326.
4336
4337 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4338
4339         * cs-parser.jay : interface comment was not consumed because of
4340           extra opt_semicolon before doc handling.
4341
4342 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4343
4344         Fix test-327.cs, test-328.cs, and put in early infrastructure
4345         for eventually fixing #52697.
4346         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4347         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4348         from other methods.
4349         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4350         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4351         (VerifyUsing, error246): Update.
4352         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4353         'NamespaceEntry.LookupNamespaceOrType'.
4354
4355 2004-12-07  Martin Baulig  <martin@ximian.com>
4356
4357         * driver.cs: Call it "BETA SOFTWARE" :-)
4358
4359 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4360
4361         Fix crash on cs0657-17.cs.
4362         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4363         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4364         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4365         the case where the NamespaceEntry gets overwritten.
4366
4367 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4368
4369         Fixed #69195, #56821
4370         * ecore.cs (ResolveBoolean): Tiny refactoring.
4371
4372         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4373         of right expression resolving when left is false constant and
4374         operator is LogicalAnd OR true constant and operator is LogicalOr.
4375
4376         * statement.cs (ResolveUnreachable): Always reports warning.
4377
4378 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4379
4380         * class.cs: Distinguish between 1721 and 1722 (just a little help
4381         for the programmer).
4382
4383 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4384
4385         * delegate.cs: Only allow this on new versions of the language. 
4386
4387 2004-12-02  Duncan Mak  <duncan@ximian.com>
4388
4389         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4390         Expression class.
4391         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4392         here as a static method. Take an additional bool out parameter
4393         `must_do_cs1540_check' for signaling to InstanceResolve.
4394         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4395         member field from PropertyExpr class and made it an argument of
4396         the method instead.
4397         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4398         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4399         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4400         and `remove_accessor' as well as InstanceResolve: report CS0122
4401         where applicable.
4402
4403         Fixes #70129.
4404
4405 2004-12-07  Martin Baulig  <martin@ximian.com>
4406
4407         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4408         and CS0692 where appropriate.
4409
4410 2004-12-06  Martin Baulig  <martin@ximian.com>
4411
4412         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4413         IsDuplicateImplementation() and improved it.
4414
4415         * expression.cs (Invocation.InferTypeArguments): Added
4416         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4417         and removed the "ref" modifier from `infered_types'.
4418
4419         * decl.cs (MemberName.ToString): Removed the exception.
4420
4421 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4422
4423         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4424           comments are allowed.
4425
4426 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4427
4428         * delegate.cs: Add checks for subtypes in paramaters and return values
4429         in VerifyMethod () to add support for Covariance/Contravariance
4430         in delegates.
4431         
4432 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4433
4434         * report.cs: Remove extra closing parenthesis.
4435
4436         * convert.cs (Error_CannotImplicitConversion): If the name of the
4437         types are the same, provide some extra information.
4438
4439 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4440
4441         Fix bug #70102
4442         * attribute.cs (Resolve): Improved implementation of params
4443         attribute arguments.
4444
4445         * support.cs (ParameterData): Add HasParams to be faster.
4446
4447 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4448
4449         all things are for /doc support:
4450
4451         * doc.cs: new file that supports XML documentation generation.
4452         * mcs.exe.sources: added doc.cs.
4453         * driver.cs:
4454           Handle /doc command line option.
4455           Report error 2006 instead of 5 for missing file name for /doc.
4456           Generate XML documentation when required, after type resolution.
4457         * cs-tokenizer.cs:
4458           Added support for picking up documentation (/// and /** ... */),
4459           including a new XmlCommentState enumeration.
4460         * cs-parser.jay:
4461           Added lines to fill Documentation element for field, constant,
4462           property, indexer, method, constructor, destructor, operator, event
4463           and class, struct, interface, delegate, enum.
4464           Added lines to warn incorrect comment.
4465         * rootcontext.cs :
4466           Added Documentation field (passed only when /doc was specified).
4467         * decl.cs:
4468           Added DocComment, DocCommentHeader, GenerateDocComment() and
4469           OnGenerateDocComment() and some supporting private members for
4470           /doc feature to MemberCore.
4471         * class.cs:
4472           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4473         * delegate.cs:
4474           Added overriden DocCommentHeader.
4475         * enum.cs:
4476           Added overriden DocCommentHeader and GenerateDocComment().
4477
4478 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4479
4480         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4481         unwrapping the enumeration values, chain to
4482         DoConstantNumericPromotions again, so we can promote things to the
4483         fundamental types (takes care of enums that are bytes, sbytes).
4484
4485         Fixes bug #62054.
4486
4487 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4488
4489         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4490         Fix long-standing bug in type-lookup.  Use FindType instead of
4491         LookupType when ec.ResolvingTypeTree.
4492         (Attribute.ResolveType, Attribute.Resolve)
4493         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4494         Update to changes.
4495         (Attributes.Search): Remove internal version.  Update.
4496         (Attributes.SearchMulti): Update.
4497         (Attributes.GetClsCompliantAttribute): Remove.
4498         (Attributes.GetIndexerNameAttribute): Remove.
4499         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4500         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4501         * class.cs (Indexer.Define): Likewise.
4502
4503 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4504
4505         Fix bug #68790
4506         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4507         MarshallByReference members access.
4508
4509         * expression.cs: Use CheckMarshallByRefAccess;
4510         Better error CS0197 message.
4511
4512         * report.cs: Print whole related error message.
4513
4514 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4515
4516         * class (GetClassBases): Better error 60 report.
4517         (EventProperty): Disabled warning 67 detection.
4518
4519 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4520
4521         Fix bug #60324
4522         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4523
4524         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4525         precise values.
4526
4527 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4528
4529         Fix bug #49488
4530         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4531
4532         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4533
4534 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4535
4536         * attribute.cs (Attribute.Resolve): Refine error reporting and
4537         report a cs0117 if the identifier does not exist, to distinguish
4538         from 0617 which is a miss-use of the actual identifier.
4539
4540         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4541         between cs0070 and cs0079.
4542
4543         * class.cs (MemberBase.DoDefine): When reporting a wrong
4544         accessibility level, we use MethodCore to compare instead of
4545         Method (this was a regression in some refactoring effort).
4546
4547         So now we correctly report cs0056 again.
4548
4549         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4550         testing the target_type (which was known to be object_type) and
4551         not the source type (which is anonymous_method).
4552
4553         Fixed reporting of error cs1660.
4554
4555         * expression.cs (UserCast.Source): Expose the underlying cast.
4556
4557         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4558         allowed types to find a match to int32 first (most common).
4559
4560         In addition, it ignores any ImplicitUserConversions that did an
4561         internal implicit conversion (as the switch statement allows only
4562         one integral conversion to exist).
4563
4564         * class.cs (PartialContainer.Create): rename `name' to
4565         `member_name' for clarity.  Then replace the string calls with a
4566         call to MemberName.GetPartialName, as now using
4567         MemberName.ToString is an error (this is due to the side effects
4568         it had, that were fixed in the past).
4569
4570         This will restore the error reporting on a number of partial class
4571         errors that were missusing this (and getting an exception as a
4572         results, which is now just a plain textual warning, because
4573         yyparse debug output would crash otherwise).
4574
4575 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4576
4577         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4578
4579 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4580
4581         * rootcontext.cs (LookupType): Make sure to cache lookups that
4582         don't give us a negative result. This saves about 5% of corlib
4583         compilation time.
4584
4585 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4586
4587         * report.cs (AbstractMessage.Print): messages are sent to stderr
4588
4589         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4590         non-interface in the list of interfaces (at this point, either
4591         parent was properly set, or a base class is being listed in the
4592         interfaces section).
4593
4594         This flags error 1722, and resolves the crash from bug 69259.
4595
4596 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4597
4598         * statement.cs (Using.EmitExpressionFinally): make this work right
4599         for valuetypes. Fixes 69926.
4600
4601 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4602
4603         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4604         converted to an enum" here, before we try to change the underlying
4605         type.  This code exists, but it is a different code path than the
4606         one used while encoding constants.
4607
4608         (ImplicitReferenceConversionExists): In addition, resynchronized
4609         the code here, so it matches the same code in
4610         ImplicitReferenceConversionExists for the `from any class-type S
4611         to any interface-type T'.       
4612
4613 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4614
4615         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4616
4617 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4618
4619         * cs-parser.jay: Use verbosity accordingly. 
4620
4621 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4622
4623         * expression.cs (Unary.ResolveOperator): Do not report warning;
4624         AddressOf reads from variable.
4625         
4626         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4627
4628 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4629
4630         Fix bug #69462
4631
4632         * attribute.cs (Attributable): Removed CheckTargets.
4633         (Attributes.Emit): Explicit attribute targets are tested here.
4634
4635         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4636         not enabled for interfaces.
4637
4638         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4639         (GetAssemblyName): Ouch next bug there.
4640
4641 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4642
4643         * expression.cs: Error 275 added.
4644         
4645 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4646
4647         Fix bug #69177 (Implemented decimal constant support)
4648
4649         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4650         (BinaryFold): Add DecimalConstant.
4651
4652         * const.cs (Define): Decimal constant 
4653         (is not constant.
4654         (ChangeType): Add decimal type handling.
4655         (LookupConstantValue): Don't set value for decimal type but
4656         emit DecimalConstantAttribute. Needed for constant optimization.
4657
4658         * constant.cs (ToDecimal): New method.
4659         (ConvertToDecimal): New method.
4660         (IntConstant): Implemented ConvertToDecimal.
4661         (DecimalConstant.Emit): Emit optimized version for decimals in
4662         int range.
4663
4664         * expression.cs (ResolveOperator): Changed order of constant
4665         reduction to work correctly with native types which have
4666         overloaded operators.
4667         (ResolveMemberAccess): Extract constant value from attribute
4668         for decimal type.
4669
4670         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4671
4672         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4673         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4674         (ChangeType): Decimal is special.
4675         (TypeToCoreType): Add decimal type.
4676
4677 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4678
4679         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4680         decimal types.
4681
4682 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4683
4684         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4685         test cs1667-5.cs.
4686
4687 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4688
4689         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4690
4691         * pending.cs (PendingImplementation): Grab only interfaces.
4692
4693 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4694
4695         * statement.cs (ForeachHelperMethods): Add location member and
4696         error 202 detection.
4697
4698 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4699
4700         * expression.cs (DoResolveBase): Fixed wrong warning for out
4701         variables.
4702
4703 2004-12-04  Martin Baulig  <martin@ximian.com>
4704
4705         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4706         to check whether the conversion is ok.
4707
4708         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4709         `Type.EmptyTypes' if we're not a generic TypeContainer.
4710
4711 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4712
4713         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4714         old bug: when converting from the null literal to a pointer,
4715         return an EmptyCast, not the NullLiteral.
4716
4717         This fixes #69921, the recent null_type changes probably made this
4718         bug more prominent.
4719
4720 2004-12-03  Martin Baulig  <martin@ximian.com>
4721
4722         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4723         method as our child, call AnonymousMethod.Compatible() on it.
4724
4725 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4726
4727         * class.cs (FieldBase): Use an unused bit field from the field to
4728         encode the `has_offset' property from the FieldMember.  This saves
4729         a couple of Ks on bootstrap compilation.
4730
4731         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4732         method as our child, return the AnonymousMethod resolved
4733         expression.
4734
4735         * expression.cs (New.DoResolve): Allow return values from
4736         NewDelegate to also include AnonymousMethods.
4737
4738         Fixes #70150.
4739
4740 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4741
4742         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4743         cs1648 report.
4744         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4745         System.Runtime.InteropServices._Exception, since it's a base
4746         interface of the core type System.Exception in the net_2_0 profile.
4747
4748 2004-11-27  Martin Baulig  <martin@ximian.com>
4749
4750         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4751
4752 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4753
4754         * Makefile: Convert to use executable.make.
4755         * gmcs.exe.sources: New.
4756
4757 2004-11-25  Martin Baulig  <martin@ximian.com>
4758
4759         * expression.cs (Invocation.InferType): Added support for byref types.
4760
4761 2004-11-25  Martin Baulig  <martin@ximian.com>
4762
4763         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4764         in TypeManager.TypeToCoreType().
4765
4766 2004-11-25  Martin Baulig  <martin@ximian.com>
4767
4768         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4769         "Dispose" method from the `current_type'.
4770         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4771         DoDefineMembers() instead of using the MethodBuilder; this is
4772         required for generic iterators.
4773
4774         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4775
4776 2004-11-24  Martin Baulig  <martin@ximian.com>
4777
4778         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4779
4780 2004-11-20  Martin Baulig  <martin@ximian.com>
4781
4782         * expression.cs (Invocation.InferType): Correctly infer generic
4783         instances; see gen-103.cs.
4784         (Invocation.InferTypeArguments): If a generic method doesn't have
4785         any unbound type parameters, we don't need to infer anything.
4786
4787 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4788
4789         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4790
4791 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4792
4793         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4794         (TypeHandle.GetMemberCache): New.
4795         (TypeHandle.TypeHandle): Update.
4796         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4797         (TypeManager.LookupParentInterfacesCache):
4798         Rename from LookupInterfaceCache.  Optimize slightly.
4799         (TypeManager.MemberLookup_FindMembers): Update.
4800         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4801         multi-type variant.
4802         (AddCacheContents): Rename from AddHashtable.
4803         * class.cs (TypeContainer.parent_container): Remove.
4804         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4805         (TypeContainer.DoDefineMembers): Don't initialize it.
4806         Update to name changes.
4807         
4808 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4809
4810         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4811         that factors the code to check access modifiers on override.  
4812
4813         (PropertyBase): Use the code here.
4814
4815         Patch from Lluis S'anchez, fixes bug #69361.
4816
4817 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4818
4819         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4820         routine that is used to report the use of a captured variable
4821         whose address has been taken.
4822
4823         There are two checks: one when variables are being captured and
4824         the other check is when the address of a variable is taken. 
4825         
4826         (because an anonymous methods might be resolved before *or* after
4827         the address has been taken) and 
4828
4829         * expression.cs (Conditional.DoResolve): Remove the special
4830         casing that Martin added to trueExpr and falseExpr being both
4831         NullLiteral.  We get the right behavior now just by introducing
4832         the null_type into the compiler. 
4833
4834         * convert.cs (ExplicitConversion): Change the code to use
4835         null_type instead of testing `expr is NullLiteral'.
4836         (ImplicitConversionStandard): use null_type too.
4837         (ImplicitReferenceConversionExists): use null_type too.
4838         (ImplicitReferenceConversion): use null_type too.
4839
4840         * literal.cs: The type of `NullLiteral' is now null_type instead
4841         of object_type. 
4842         (Resolve): Set the type here.
4843
4844         * typemanager.cs: Introduce null_type.
4845
4846 2004-11-18  Martin Baulig  <martin@ximian.com>
4847
4848         * rootcontext.cs
4849         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4850
4851 2004-11-18  Martin Baulig  <martin@ximian.com>
4852
4853         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4854
4855 2004-11-18  Martin Baulig  <martin@ximian.com>
4856
4857         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4858         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4859         call ResolveConstructedType() on it to resolve it without checking
4860         constraints.
4861         (Constraints.ResolveTypes): Check them here.
4862         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4863         but don't check constraints.
4864         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4865         check constraints here.
4866         (ConstructedType.ResolveConstructedType): New public method.  This
4867         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4868         resolve ourselves without checking constraints.
4869
4870         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4871
4872 2004-11-18  Martin Baulig  <martin@ximian.com>
4873
4874         * decl.cs
4875         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4876
4877         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4878
4879 2004-11-18  Martin Baulig  <martin@ximian.com>
4880
4881         * ecore.cs (TypeExpr.ResolveType): Removed.
4882         (Expression.ResolveAsTypeTerminal): We always return a fully
4883         resolved `TypeExpr', so we can just access its `Type'.
4884
4885         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4886
4887 2004-11-17  Martin Baulig  <martin@ximian.com>
4888
4889         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4890         sure we don't return any unresolved TypeExpr's.
4891         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4892         a `TypeExpr'.
4893         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4894
4895         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4896         unresolved `ConstructedType's.
4897
4898 2004-11-17  Martin Baulig  <martin@ximian.com>
4899
4900         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4901
4902 2004-11-17  Martin Baulig  <martin@ximian.com>
4903
4904         * ecore.cs
4905         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4906
4907         * decl.cs (DeclSpace.ResolveType): Removed.
4908         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4909
4910 2004-11-17  Martin Baulig  <martin@ximian.com>
4911
4912         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4913         direction, like FindMembers() does.  Fixes #69546, testcase is in
4914         test-315.cs.    
4915
4916 2004-11-16  Martin Baulig  <martin@ximian.com>
4917
4918         This is based on a patch from Marek Safar, see bug #69082.
4919         Fixes bugs #63705 and #67130.
4920
4921         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4922         method; create a MemberCache for an interface type and cache the
4923         result.
4924
4925         * decl.cs (IMemberContainer.ParentContainer): Removed.
4926         (IMemberContainer.ParentCache): New property.
4927         (MemberCache.SetupCacheForInterface): Removed.
4928         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4929         to create a cache for an interface's "parent".
4930
4931         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4932         interfaces too.
4933
4934 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4935
4936         * statement.cs: Avoid adding bools to a hashtable.
4937
4938 2004-11-15  Martin Baulig  <martin@ximian.com>
4939
4940         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4941
4942 2004-11-11  Martin Baulig  <martin@ximian.com>
4943
4944         * typemanager.cs (TypeManager.GetMethodName): New method.
4945
4946         * class.cs (MethodData.Define): Include the generic arity in the
4947         name of an explicit interface; also add it to the method name.
4948
4949         * pending.cs (PendingImplementation.InterfaceMethod): The method
4950         name now includes the generic arity.
4951
4952 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4953
4954         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4955         calling an unsafe method from a safe location.
4956
4957 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4958
4959         Fix #69167
4960         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4961
4962 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4963
4964         * namespace.cs (VerifyUsing): use GetPartialName instead of
4965         ToString. 
4966
4967 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4968
4969         * statement.cs (Return.Resolve): Fix regression in typo: if
4970         `in_exc', we have to request a NeedReturnLabel, this was a typo
4971         introduced in the anonymous method check-in.  Fixes #69131.
4972
4973         * Indexers were using the ShortName when defining themselves,
4974         causing a regression in the compiler bootstrap when applying the
4975         patch from 2004-11-02 (first part), now they use their full name
4976         and the bug is gone.
4977
4978 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4979
4980         * driver.cs: Strip the path from the names of embedded resources. Fixes
4981         #68519.
4982
4983 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4984
4985         Fix error message regression: cs0104-2.cs.
4986         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4987         (AliasEntry.Resolve): Update.
4988         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4989         'silent' flag.
4990         (RootContext.LookupType): Update.
4991
4992 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4993
4994         * cs-parser.jay: Add support for handling accessor modifiers
4995         * class: Add support port accessor modifiers and error checking,
4996         define PropertyMethod.Define as virtual (not abstract anymore)
4997         * ecore.cs: Add checking for proeprties access with access modifiers
4998         * iterators.cs: Modify Accessor constructor call based in the modified
4999         constructor
5000 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5001
5002         * expression.cs (StringConcat): Handle being called twice,
5003         as when we have a concat in a field init with more than two
5004         ctors in the class
5005
5006 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5007
5008         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5009         special case explicit implementations, we should always produce
5010         the .property or .event declaration.
5011         
5012         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5013         since it will not return correct data if people use this
5014         unresolved in the presence of using statements (see test-313).
5015
5016         * class.cs (MethodData.Define): If we are an explicit interface
5017         implementation, set the method name to the full name of the
5018         interface plus the name of the method.  
5019
5020         Notice that using the method.MethodName.GetFullName() does not
5021         work, as it will only contain the name as declared on the source
5022         file (it can be a shorthand in the presence of using statements)
5023         and not the fully qualifed type name, for example:
5024
5025         using System;
5026
5027         class D : ICloneable {
5028                 object ICloneable.Clone ()  {
5029                 }
5030         }
5031
5032         Would produce a method called `ICloneable.Clone' instead of
5033         `System.ICloneable.Clone'.
5034
5035         * namespace.cs (Alias.Resolve): Use GetPartialName.
5036         
5037 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * cs-parser.jay: Add error 1055 report.
5040
5041 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5042
5043         * assign.cs (Assign.DoResolve): Only do the transform of
5044         assignment into a New if the types are compatible, if not, fall
5045         through and let the implicit code deal with the errors and with
5046         the necessary conversions. 
5047
5048 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5049
5050         * cs-parser.jay: Add error 1031 report.
5051
5052         * cs-tokenizer.cs: Add location for error 1038.
5053
5054 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * cs-parser.jay: Add error 1016 report.
5057
5058 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5059
5060         * cs-parser.jay: Add errors 1575,1611 report.
5061
5062 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * cs-parser.jay: Add error 1001 report.
5065
5066 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5067
5068         Fix #68850
5069         * attribute.cs (GetMarshal): Add method argument for
5070         caller identification.
5071
5072         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5073         agument for GetMarshal and RuntimeMissingSupport.
5074
5075 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * attribute.cs (ExtractSecurityPermissionSet): Removed
5078         TypeManager.code_access_permission_type.
5079
5080         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5081
5082 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5083
5084         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5085         for obsolete use of a variable here.   Fixes regression on errors
5086         cs0619-25 and cs0619-26.
5087
5088 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5089
5090         Fix #62358, implemented security attribute encoding.
5091
5092         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5093         Tests permitted SecurityAction for assembly or other types.
5094         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5095         data from SecurityPermissionAttribute to PermisionSet class.
5096
5097         * class.cs (ApplyAttributeBuilder): Added special handling
5098         for System.Security.Permissions.SecurityAttribute based types.
5099
5100         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5101         special handling for System.Security.Permissions.SecurityAttribute
5102         based types.
5103
5104         * enum.cs (ApplyAttributeBuilder): Added special handling
5105         for System.Security.Permissions.SecurityAttribute based types.
5106
5107         * parameter.cs (ApplyAttributeBuilder): Added special handling
5108         for System.Security.Permissions.SecurityAttribute based types.
5109
5110         * rootcontext.cs: Next 2 core types.
5111
5112         * typemanager.cs (TypeManager.security_permission_attr_type):
5113         Built in type for the SecurityPermission Attribute.
5114         (code_access_permission_type): Build in type.
5115
5116 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5117
5118         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5119         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5120         all of this information into
5121         EmitContext.EmitCapturedVariableInstance.
5122         
5123         * codegen.cs (EmitCapturedVariableInstance): move here the
5124         funcionality of emitting an ldarg.0 in the presence of a
5125         remapping.   This centralizes the instance emit code.
5126
5127         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5128         then emit a load of this: it means that we have reached the
5129         topmost ScopeInfo: the one that contains the pointer to the
5130         instance of the class hosting the anonymous method.
5131
5132         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5133         captures to the topmost CaptureContext.
5134
5135 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5136
5137         * expression.cs (LocalVariableReference): Move the knowledge about
5138         the iterators into codegen's EmitCapturedVariableInstance.
5139
5140 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5141
5142         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5143         all code paths return a value from an anonymous method (it is the
5144         same as the 161 error, but for anonymous methods).
5145
5146 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5147
5148         The introduction of anonymous methods in the compiler changed
5149         various ways of doing things in the compiler.  The most
5150         significant one is the hard split between the resolution phase
5151         and the emission phases of the compiler.
5152
5153         For instance, routines that referenced local variables no
5154         longer can safely create temporary variables during the
5155         resolution phase: they must do so from the emission phase,
5156         since the variable might have been "captured", hence access to
5157         it can not be done with the local-variable operations from the runtime.
5158         
5159         * statement.cs 
5160
5161         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5162         is a toplevel block.
5163
5164         (ToplevelBlock): A new kind of Block, these are the blocks that
5165         are created by the parser for all toplevel method bodies.  These
5166         include methods, accessors and anonymous methods.
5167
5168         These contain some extra information not found in regular blocks:
5169         A pointer to an optional CaptureContext (for tracking captured
5170         local variables and parameters).  A pointer to the parent
5171         ToplevelBlock.
5172         
5173         (Return.Resolve): Catch missmatches when returning a value from an
5174         anonymous method (error 1662).
5175         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5176         phase.
5177
5178         (Break.Resolve): ditto.
5179
5180         (SwitchLabel): instead of defining the labels during the
5181         resolution phase, we now turned the public ILLabel and ILLabelCode
5182         labels into methods called GetILLabelCode() and GetILLabel() that
5183         only define the label during the Emit phase.
5184
5185         (GotoCase): Track the SwitchLabel instead of the computed label
5186         (its contained therein).  Emit the code by using
5187         SwitchLabel.GetILLabelCode ().
5188
5189         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5190         whether the Local has been captured or not.
5191
5192         (LocalInfo.IsCaptured): New property, used to tell whether the
5193         local has been captured.
5194         
5195         * anonymous.cs: Vastly updated to contain the anonymous method
5196         support.
5197
5198         The main classes here are: CaptureContext which tracks any
5199         captured information for a toplevel block and ScopeInfo used to
5200         track the activation frames for various local variables.   
5201
5202         Each toplevel block has an optional capture context associated
5203         with it.  When a method contains an anonymous method both the
5204         toplevel method and the anonymous method will create a capture
5205         context.   When variables or parameters are captured, they are
5206         recorded on the CaptureContext that owns them, for example:
5207
5208         void Demo () {
5209              int a;
5210              MyDelegate d = delegate {
5211                  a = 1;
5212              }
5213         }
5214
5215         Here `a' will be recorded as captured on the toplevel
5216         CapturedContext, the inner captured context will not have anything
5217         (it will only have data if local variables or parameters from it
5218         are captured in a nested anonymous method.
5219
5220         The ScopeInfo is used to track the activation frames for local
5221         variables, for example:
5222
5223         for (int i = 0; i < 10; i++)
5224                 for (int j = 0; j < 10; j++){
5225                    MyDelegate d = delegate {
5226                         call (i, j);
5227                    }
5228                 }
5229
5230         At runtime this captures a single captured variable `i', but it
5231         captures 10 different versions of the variable `j'.  The variable
5232         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5233         recorded on a child.  
5234
5235         The toplevel ScopeInfo will also track information like the `this'
5236         pointer if instance variables were referenced (this is necessary
5237         as the anonymous method lives inside a nested class in the host
5238         type of the method). 
5239
5240         (AnonymousMethod): Expanded to track the Toplevel, implement
5241         `AnonymousMethod.Compatible' to tell whether an anonymous method
5242         can be converted to a target delegate type. 
5243
5244         The routine now also produces the anonymous method content
5245
5246         (AnonymousDelegate): A helper class that derives from
5247         DelegateCreation, this is used to generate the code necessary to
5248         produce the delegate for the anonymous method that was created. 
5249
5250         * assign.cs: API adjustments for new changes in
5251         Convert.ImplicitStandardConversionExists.
5252
5253         * class.cs: Adjustments to cope with the fact that now toplevel
5254         blocks are of type `ToplevelBlock'. 
5255
5256         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5257         insteda of standard blocks.
5258
5259         Flag errors if params arguments are passed to anonymous methods.
5260
5261         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5262         `CurrentAnonymousMethod' which points to the current Anonymous
5263         Method.  The variable points to the AnonymousMethod class that
5264         holds the code being compiled.  It is set in the new EmitContext
5265         created for the anonymous method.
5266
5267         (EmitContext.Phase): Introduce a variable and an enumeration to
5268         assist in enforcing some rules about when and where we are allowed
5269         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5270         only one that enfonces this right now).
5271
5272         (EmitContext.HaveCaptureInfo): new helper method that returns
5273         whether we have a CapturedContext initialized.
5274
5275         (EmitContext.CaptureVariable): New method used to register that a
5276         LocalInfo must be flagged for capturing. 
5277
5278         (EmitContext.CapturedParameter): New method used to register that a
5279         parameters must be flagged for capturing. 
5280         
5281         (EmitContext.CapturedField): New method used to register that a
5282         field must be flagged for capturing. 
5283
5284         (EmitContext.HaveCapturedVariables,
5285         EmitContext.HaveCapturedFields): Return whether there are captured
5286         variables or fields. 
5287
5288         (EmitContext.EmitMethodHostInstance): This is used to emit the
5289         instance for the anonymous method.  The instance might be null
5290         (static methods), this (for anonymous methods that capture nothing
5291         and happen to live side-by-side with the current method body) or a
5292         more complicated expression if the method has a CaptureContext.
5293
5294         (EmitContext.EmitTopBlock): Routine that drives the emission of
5295         code: it will first resolve the top block, then emit any metadata
5296         and then emit the code.  The split is done so that we can extract
5297         any anonymous methods and flag any captured variables/parameters.
5298         
5299         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5300         during this phase, the ILGenerator should not be used as labels
5301         and local variables declared here might not be accessible to any
5302         code that is part of an anonymous method.  
5303
5304         Exceptions to this include the temporary variables that are
5305         created by some statements internally for holding temporary
5306         variables. 
5307         
5308         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5309         metadata for a cb
5310
5311         (EmitContext.TemporaryReturn): This method is typically called
5312         from the Emit phase, and its the only place where we allow the
5313         ReturnLabel to be defined other than the EmitMeta.  The reason is
5314         that otherwise we would have to duplicate a lot of logic in the
5315         Resolve phases of various methods that today is on the Emit
5316         phase. 
5317
5318         (EmitContext.NeedReturnLabel): This no longer creates the label,
5319         as the ILGenerator is not valid during the resolve phase.
5320
5321         (EmitContext.EmitThis): Extended the knowledge in this class to
5322         work in anonymous methods in addition to iterators. 
5323
5324         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5325         code is necessary on the stack to access the instance to a local
5326         variable (the variable will be accessed as a field).
5327
5328         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5329         EmitContext.EmitAddressOfParameter): Routines to support
5330         parameters (not completed at this point). 
5331         
5332         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5333         will also remove the parameters.
5334
5335         * convert.cs (Convert): Define a `ConstantEC' which points to a
5336         null.  This is just to prefity some code that uses
5337         ImplicitStandardConversion code and do not have an EmitContext
5338         handy.
5339
5340         The idea is to flag explicitly that at that point in time, it is
5341         known that the conversion will not trigger the delegate checking
5342         code in implicit conversions (which requires a valid
5343         EmitContext). 
5344
5345         Everywhere: pass new EmitContext parameter since
5346         ImplicitStandardConversionExists now requires it to check for
5347         anonymous method conversions. 
5348
5349         (Convert.ImplicitStandardConversionExists): If the type of an
5350         expression is the anonymous_method_type, and the type is a
5351         delegate, we invoke the AnonymousMethod.Compatible method to check
5352         whether an implicit conversion is possible. 
5353
5354         (Convert.ImplicitConversionStandard): Only do implicit method
5355         group conversions if the language level is not ISO_1.
5356
5357         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5358         MethodInfo for the Invoke method.  used by Delegate and
5359         AnonymousDelegate.
5360
5361         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5362         method conversions if the target type is a delegate.
5363
5364         Removed extra debugging nops.
5365
5366         (LocalVariableReference): Turn the `local_info' into a public
5367         field. 
5368
5369         Add `prepared' field, the same hack used for FieldExprs to cope
5370         with composed assignments, as Local variables do not necessarily
5371         operate purely on the stack as they used to: they can be captured
5372         fields. 
5373
5374         Add `temp' for a temporary result, like fields.
5375
5376         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5377
5378         It now copes with Local variables that are captured and emits the
5379         proper instance variable to load it from a field in the captured
5380         case. 
5381
5382         (ParameterReference.DoResolveBase): During the resolve phase,
5383         capture parameters if we are in an anonymous method.
5384
5385         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5386         anonymous method, use the EmitContext helper routines to emit the
5387         parameter reference.
5388
5389         * iterators.cs: Set RemapToProxy to true/false during the
5390         EmitDispose class.
5391
5392         * parameters.cs (GetParameterByName): New helper method. 
5393
5394         * typemanager.cs (anonymous_method_type) a new type that
5395         represents an anonyous method.  This is always an internal type,
5396         used as a fencepost to test against the anonymous-methodness of an
5397         expression. 
5398         
5399 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5400
5401         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5402         561 report.
5403         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5404
5405 2004-11-10  Martin Baulig  <martin@ximian.com>
5406
5407         * expression.cs (Invocation.BetterFunction): If two methods have
5408         equal parameter types, but only one of them is generic, the
5409         non-generic one wins.
5410         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5411         instance; just use `Type.IsValueType' to determine whether
5412         something is a struct or not.
5413         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5414         so we can be called multiple times.
5415
5416 2004-11-10  Martin Baulig  <martin@ximian.com>
5417
5418         * generic.cs (TypeParameter.DefineConstraints): New public method.
5419         (TypeParameter.CheckAccessLevel): Override this and return true.
5420         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5421         override ResolveType() anymore.
5422         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5423
5424 2004-11-10  Martin Baulig  <martin@ximian.com>
5425
5426         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5427         call DeclSpace.ResolveNestedType() on it.
5428
5429 2004-11-10  Martin Baulig  <martin@ximian.com>
5430
5431         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5432         non-null, call ParameterModifier() on it.
5433
5434 2004-11-10  Martin Baulig  <martin@ximian.com>
5435
5436         * iterators.cs
5437         (Iterators): Added `current_type' and `this_type' fields.
5438         (Iterators.DefineIterator): Create a new EmitContext and store it
5439         in `ec'; compute `this_type'.
5440
5441 2004-11-10  Martin Baulig  <martin@ximian.com>
5442
5443         * typemanager.cs
5444         (TypeManager.IsPrivateAccessible): New public method.
5445         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5446
5447 2004-11-10  Martin Baulig  <martin@ximian.com>
5448
5449         * class.cs (TypeContainer.DefineType): Call
5450         TypeBuilder.DefineGenericParameters() before resolving the type
5451         parameters.
5452         (MethodData.parent_method): New protected field.
5453         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5454         (MethodData.Define): Compute `parent_method'.
5455
5456         * decl.cs
5457         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5458         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5459         (DeclSpace.ec): New protected field; store the EmitContext here.
5460         (DeclSpace.EmitContext): New public property.
5461         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5462         (DeclSpace.ResolveNestedType): New public method.
5463         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5464         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5465         (DeclSpace.FamilyAccessible): Likewise.
5466         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5467         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5468         EmitContext.
5469
5470         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5471         field.
5472
5473         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5474         (Enum.Emit): Don't create a new EmitContext.
5475
5476 2004-10-18  Martin Baulig  <martin@ximian.com>
5477
5478         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5479         `Type' directly, but call ResolveType() on it.
5480         (Catch.Resolve): Likewise.
5481         (Foreach.Resolve): Likewise.
5482
5483 2004-10-18  Martin Baulig  <martin@ximian.com>
5484
5485         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5486         `Type' directly, but call ResolveType() on it.
5487         (Probe.DoResolve): Likewise.
5488         (ArrayCreation.LookupType): Likewise.
5489         (TypeOf.DoResolve): Likewise.
5490         (SizeOf.DoResolve): Likewise.
5491
5492 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5493
5494         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5495         the ResolveType.
5496
5497 2004-10-17  John Luke  <john.luke@gmail.com>
5498
5499         * class.cs (Operator.GetSignatureForError): use CSharpName
5500
5501         * parameter.cs (Parameter.GetSignatureForError): Returns
5502         correct name even if was not defined.
5503
5504 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5505
5506         Fix #65816.
5507         * class.cs (TypeContainer.EmitContext): New property.
5508         (DefineNestedTypes): Create an emitcontext for each part.
5509         (MethodCore.DoDefineParameters): Use container's emitcontext.
5510         Pass type array to InternalParameters.
5511         (MemberBase.DoDefine): Use container's emitcontext.
5512         (FieldMember.Define): Likewise.
5513         (Event.Define): Likewise.
5514         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5515         Pass type array to InternalParameters.
5516         (SetIndexerMethod.GetParameterInfo): Likewise.
5517         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5518         * delegate.cs (Define): Pass emitcontext to
5519         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5520         array to InternalParameters.
5521         * expression.cs (ParameterReference.DoResolveBase): Pass
5522         emitcontext to GetParameterInfo.
5523         (ComposedCast.DoResolveAsTypeStep): Remove check on
5524         ec.ResolvingTypeTree.
5525         * parameter.cs (Parameter.Resolve): Change argument to
5526         EmitContext.  Use ResolveAsTypeTerminal.
5527         (Parameter.GetSignature): Change argument to EmitContext.
5528         (Parameters.ComputeSignature): Likewise.
5529         (Parameters.ComputeParameterTypes): Likewise.
5530         (Parameters.GetParameterInfo): Likewise.
5531         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5532         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5533         * support.cs (InternalParameters..ctor): Remove variant that takes
5534         a DeclSpace.
5535         * typemanager.cs (system_intptr_expr): New.
5536         (InitExpressionTypes): Initialize it.
5537
5538 2004-10-12  Chris Toshok  <toshok@ximian.com>
5539
5540         * cs-parser.jay: fix location for try_statement and catch_clause.
5541
5542 2004-10-18  Martin Baulig  <martin@ximian.com>
5543
5544         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5545         `Type' directly, but call ResolveType() on it.
5546         (MemberBase.DoDefine): Likewise.
5547
5548         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5549         `Type' directly, but call ResolveType() on it.
5550         (ComposedCast.DoResolveAsTypeStep): Likewise.
5551
5552         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5553         `Type' directly, but call ResolveType() on it.
5554
5555 2004-10-17  John Luke  <john.luke@gmail.com>
5556
5557         * class.cs (Operator.GetSignatureForError): use CSharpName
5558
5559         * parameter.cs (Parameter.GetSignatureForError): Returns
5560         correct name even if was not defined.
5561
5562 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5563
5564         Fix #65816.
5565         * class.cs (TypeContainer.EmitContext): New property.
5566         (DefineNestedTypes): Create an emitcontext for each part.
5567         (MethodCore.DoDefineParameters): Use container's emitcontext.
5568         Pass type array to InternalParameters.
5569         (MemberBase.DoDefine): Use container's emitcontext.
5570         (FieldMember.Define): Likewise.
5571         (Event.Define): Likewise.
5572         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5573         Pass type array to InternalParameters.
5574         (SetIndexerMethod.GetParameterInfo): Likewise.
5575         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5576         * delegate.cs (Define): Pass emitcontext to
5577         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5578         array to InternalParameters.
5579         * expression.cs (ParameterReference.DoResolveBase): Pass
5580         emitcontext to GetParameterInfo.
5581         (ComposedCast.DoResolveAsTypeStep): Remove check on
5582         ec.ResolvingTypeTree.
5583         * parameter.cs (Parameter.Resolve): Change argument to
5584         EmitContext.  Use ResolveAsTypeTerminal.
5585         (Parameter.GetSignature): Change argument to EmitContext.
5586         (Parameters.ComputeSignature): Likewise.
5587         (Parameters.ComputeParameterTypes): Likewise.
5588         (Parameters.GetParameterInfo): Likewise.
5589         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5590         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5591         * support.cs (InternalParameters..ctor): Remove variant that takes
5592         a DeclSpace.
5593         * typemanager.cs (system_intptr_expr): New.
5594         (InitExpressionTypes): Initialize it.
5595
5596 2004-10-12  Chris Toshok  <toshok@ximian.com>
5597
5598         * cs-parser.jay: fix location for try_statement and catch_clause.
5599
5600 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5601
5602         More DeclSpace.ResolveType avoidance.
5603         * decl.cs (MemberCore.InUnsafe): New property.
5604         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5605         with newly created EmitContext.
5606         (FieldMember.Define): Likewise.
5607         * delegate.cs (Delegate.Define): Likewise.
5608         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5609         only if normal name-lookup fails.
5610         (TypeExpr.DoResolve): Enable error-checking.
5611         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5612         (SizeOf.DoResolve): Likewise.
5613         (ComposedCast.DoResolveAsTypeStep): Likewise.
5614         (StackAlloc.DoResolve): Likewise.
5615         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5616         (Block.Unsafe): New property.
5617         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5618         (Unsafe): Set 'unsafe' flag of contained block.
5619         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5620         (Fixed.Resolve): Likewise.
5621         (Catch.Resolve): Likewise.
5622         (Using.ResolveLocalVariableDecls): Likewise.
5623         (Foreach.Resolve): Likewise.
5624
5625 2004-10-05  John Luke <john.luke@gmail.com>
5626
5627         * cs-parser.jay: add location to error CS0175
5628
5629 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5630
5631         * ecore.cs (Expression.Constantity): Add support for turning null
5632         into a constant.
5633
5634         * const.cs (Const.Define): Allow constants to be reference types
5635         as long as the value is Null.
5636
5637 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5638
5639         * namespace.cs (NamespaceEntry.Using): No matter which warning
5640         level is set, check if this namespace name has already been added.
5641
5642 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5643
5644         * expression.cs: reftype [!=]= null should always use br[true,false].
5645         # 67410
5646
5647 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5648
5649         Fix #67108
5650         * attribute.cs: Enum conversion moved to 
5651         GetAttributeArgumentExpression to be applied to the all
5652         expressions.
5653
5654 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5655
5656         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5657         * class.c (TypeContainer.DefineType): Flag error if
5658         base types aren't accessible due to access permissions.
5659         * decl.cs (DeclSpace.ResolveType): Move logic to
5660         Expression.ResolveAsTypeTerminal.
5661         (DeclSpace.ResolveTypeExpr): Thin layer over
5662         Expression.ResolveAsTypeTerminal.
5663         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5664         Refactor code into NestedAccess.  Use it.
5665         (DeclSpace.NestedAccess): New.
5666         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5667         argument to silence errors.  Check access permissions.
5668         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5669         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5670         (Cast.DoResolve): Likewise.
5671         (New.DoResolve): Likewise.
5672         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5673         (TypeOf.DoResolve): Likewise.
5674
5675         * expression.cs (Invocation.BetterConversion): Return the Type of
5676         the better conversion.  Implement section 14.4.2.3 more faithfully.
5677         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5678         section 14.4.2.2 explicit.
5679         (Invocation.OverloadResolve): Update.
5680         (Invocation): Remove is_base field.
5681         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5682         (Invocation.Emit): Likewise.
5683
5684 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5685
5686         * cs-parser.jay: Reverted 642 warning fix.
5687
5688 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5689
5690         Fix bug #66615
5691         * decl.cs (FindMemberWithSameName): Indexer can have more than
5692         1 argument.
5693
5694 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5695
5696         * expression.cs (LocalVariableReference.DoResolveLValue):
5697         Do not report warning 219 for out values.
5698         (EmptyExpression.Null): New member to avoid extra allocations.
5699
5700 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5701
5702         * cs-parser.jay: Fix wrong warning 642 report.
5703
5704         * cs-tokenizer.cs (CheckNextToken): New helper;
5705         Inspect next character if is same as expected.
5706
5707 2004-09-23  Martin Baulig  <martin@ximian.com>
5708
5709         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5710         (Convert.ImplicitReferenceConversionExists): Likewise.
5711
5712 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5713
5714         * Makefile (DISTFILES): Comment out a few missing files.
5715
5716 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5717
5718         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5719         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5720         (gmcs.exe): Invoke bootstrap-libs.
5721         (clean-local): Clean the net_2_0_bootstrap profile too.
5722         (PROGRAM_INSTALL_DIR): New.
5723         (install-local): Use it.
5724
5725 2004-10-13  Martin Baulig  <martin@ximian.com>
5726
5727         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5728         (TypeParameter.DefineType): If we're a method type parameter and
5729         that method is overriding something, "inflate" its constraints.
5730
5731 2004-10-12  Martin Baulig  <martin@ximian.com>
5732
5733         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5734         and have type arguments, create and resolve a ConstructedType.
5735
5736 2004-10-12  Martin Baulig  <martin@ximian.com>
5737
5738         * decl.cs (MemberCache.FindMemberToOverride): Use
5739         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5740         to compare the invocationType.
5741
5742         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5743         When comparing two type parameters, only do the signature-only
5744         comparision for method type parameters.
5745
5746 2004-10-11  Martin Baulig  <martin@ximian.com>
5747
5748         * report.cs: Don't make --fatal abort on warnings, we have
5749         -warnaserror for that.
5750
5751 2004-10-11  Martin Baulig  <martin@ximian.com>
5752
5753         * typemanager.cs
5754         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5755         (TypeManager.IsEqual): Call ourself recursively instead of using
5756         Type.IsEqual(). 
5757
5758 2004-10-11  Martin Baulig  <martin@ximian.com>
5759
5760         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5761         on our own type parameters, not on the ones we inherit from a containing
5762         class.
5763
5764         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5765         the comparision.
5766
5767         * generic.cs (TypeParameter.Define): We may only be called once.
5768
5769         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5770         instead of TypeManager.IsEqual().
5771
5772 2004-09-28  Martin Baulig  <martin@ximian.com>
5773
5774         * generic.cs
5775         (GenericConstraints.EffectiveBaseClass): New public property.
5776         (TypeParameter.GenericConstraints): New public property.
5777         (ConstructedType.CheckConstraints): Improved.
5778
5779         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5780         (Convert.TypeParameterConversion): New private method; use this in
5781         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5782         for all conversions related to type parameters.
5783
5784 2004-09-24  Martin Baulig  <martin@ximian.com>
5785
5786         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5787         type parameter conversions for type parameters which are known to
5788         be reference types.
5789
5790 2004-09-24  Martin Baulig  <martin@ximian.com>
5791
5792         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5793         `IsValueType' properties.
5794
5795         * support.cs (ReflectionConstraints): Use
5796         Type.GetGenericParameterConstraints() instead of the old hack.
5797
5798 2004-09-24  Martin Baulig  <martin@ximian.com>
5799
5800         * generic.cs (GenericConstraints): Moved here and made it an
5801         abstract class.
5802
5803         * support.cs (GenericConstraints): Moved to generic.cs.
5804
5805 2004-09-24  Martin Baulig  <martin@ximian.com>
5806
5807         * support.cs
5808         (ReflectionConstraints): Un-nested this class and made it public.
5809
5810         * typemanager.cs
5811         (TypeManager.GetTypeParameterConstraints): New public method.
5812         (TypeManager.HasConstructorConstraint): Use the attributes.
5813
5814 2004-09-24  Martin Baulig  <martin@ximian.com>
5815
5816         * support.cs (GenericConstraints): Replaced `HasConstructor',
5817         `IsReferenceType' and `IsValueType' with `Attributes'.
5818         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5819         method and made the .ctor public.
5820
5821         * generic.cs (Constraints.Attributes): New public property.
5822         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5823         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5824         `IsValueType' -> `HasValueTypeConstraint'.
5825
5826 2004-09-23  Martin Baulig  <martin@ximian.com>
5827
5828         * generic.cs (Constraints): Reflect latest runtime changes.
5829
5830 2004-09-23  Martin Baulig  <martin@ximian.com>
5831
5832         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5833         (Convert.ImplicitReferenceConversionExists): Likewise.
5834
5835 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5836
5837         * class.cs (Operator.Define): Add error 448 and 559 report.
5838         
5839 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5840
5841         * class.cs (MemberBase.IsTypePermitted): New protected
5842         method for checking error CS0610.
5843
5844 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5845
5846         * class.cs (TypeContainer.HasExplicitLayout): New property
5847         Returns whether container has StructLayout attribute set Explicit.
5848         (FieldMember): New abstract class for consts and fields.
5849         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5850         (Field): Reuse FieldMember.
5851
5852         * const.cs (Const): Reuse FieldMember.
5853
5854         * rootcontext.cs: EmitConstants call moved to class.
5855
5856 2004-09-22  Martin Baulig  <martin@ximian.com>
5857
5858         Marek and me just fixed one of our oldest bugs: #28562 :-)
5859
5860         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5861
5862         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5863         we're an EnumConstant, just return that.
5864         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5865         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5866         to get the value which'll actually be written into the attribute.
5867         However, we have to use GetValue() to access the attribute's value
5868         in the compiler.        
5869
5870 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5871
5872         * constant.cs (Constant.IsNegative): New abstract property
5873         IsNegative.
5874
5875         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5876         (StackAlloc.DoResolve): Reused IsNegative.
5877
5878 2004-09-22  Martin Baulig  <martin@ximian.com>
5879
5880         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5881         public method; like LookupTypeContainer, but also works for
5882         generic instances.
5883
5884         * report.cs (Report.SymbolRelatedToPreviousError): Use
5885         TypeManager.LookupGenericTypeContainer().       
5886
5887 2004-09-22  Martin Baulig  <martin@ximian.com>
5888
5889         Thanks to Peter Sestoft for this bug report.
5890
5891         * expression.cs (Conditional): If both the `trueExpr' and the
5892         `falseExpr' is a NullLiteral, return a NullLiteral.
5893
5894 2004-09-22  Martin Baulig  <martin@ximian.com>
5895
5896         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5897         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5898         for the "get_Current" call.
5899
5900 2004-09-21  Martin Baulig  <martin@ximian.com>
5901
5902         * convert.cs (Convert.ImplicitReferenceConversion): When
5903         converting to an interface type, first check whether we're
5904         converting from a reference type.
5905
5906 2004-09-14  Martin Baulig  <martin@ximian.com>
5907
5908         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5909
5910 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5911
5912         Fixed bug #61902
5913         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5914         called and is obsolete then this member suppress message
5915         when call is inside next [Obsolete] method or type.
5916
5917         * expression.cs: Use TestObsoleteMethodUsage member.
5918
5919 2004-09-14  Martin Baulig  <martin@ximian.com>
5920
5921         * genericparser.cs: Removed.
5922
5923 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5924
5925         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5926
5927 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5928
5929         * attribute.cs (Attribute.Resolve): Add error 653 report.
5930
5931         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5932         report.
5933         (Method.ApplyAttributeBuilder): Add error 685 report.
5934         (Operator.Define): Add error 564 report.
5935
5936         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5937
5938         * expression.cs (Invocation.DoResolve): Add error
5939         245 and 250 report.
5940
5941         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5942         error 674 report.
5943
5944 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5945
5946         * class.cs (ConstructorInitializer.Resolve):
5947         Wrong error number (515->516).
5948
5949 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5950
5951         * class.cs (Indexer.Define): Add error 631 report.
5952
5953 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5954
5955         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5956
5957 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5958
5959         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5960
5961 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5962
5963         * cs-parser.jay: Added error CS0241 report.
5964
5965 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5966
5967         * cs-parser.jay (fixed_statement): Introduce a scope for the
5968         declaration in the 'fixed' statement.
5969
5970 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5971
5972         * cs-parser.jay: Added CS0230 error report.
5973
5974 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5975
5976         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5977
5978 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5979
5980         * expression.cs (Argument.Resolve): Added error CS0192 and
5981         CS0199 report.
5982
5983 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5984
5985         C# 2.0 #pragma warning feature
5986
5987         * cs-tokenizer.cs (PreProcessPragma): New method; 
5988         Handles #pragma directive.
5989
5990         * report.cs (WarningRegions): New class; Support
5991         class for #pragma warning directive. It tests whether
5992         warning is enabled for a given line.
5993
5994 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5995
5996         * const.cs: Add more descriptive error report, tahnks to
5997         Sebastien. 
5998
5999 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6000
6001         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6002
6003 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
6004
6005         * expression.cs: Apply patch from Ben: Remove dead code from
6006         ArrayCreation, and remove the TurnintoConstant call in const.cs,
6007         as that code just threw an exception anwyays.
6008
6009         * const.cs: Remove the call to the turnintoconstant, for details
6010         see bug: #63144
6011         
6012         * literal.cs: The type of the null-literal is the null type;  So
6013         we use a placeholder type (literal.cs:System.Null, defined here)
6014         for it.
6015
6016         * expression.cs (Conditional.DoResolve): Remove some old code that
6017         is no longer needed, conversions have been fixed.
6018
6019         (ArrayCreationExpression.DoResolve): Return false if we fail to
6020         resolve the inner expression.
6021
6022 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6023
6024         Fix test-290.cs.
6025         * cs-parser.jay (delegate_declaration): Record a delegate
6026         declaration as a type declaration.
6027         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6028
6029 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6030
6031         * parameter.cs: Do not crash if the type can not be resolved. 
6032
6033         * expression.cs: Report errors with unsafe pointers, fixes #64896
6034
6035 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6036
6037         * expression.cs: Pointer arith always needs to do a conv.i
6038         if the operand is a long. fix 65320
6039
6040 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6041
6042         Fixed cs0619-37.cs, cs0619-38.cs
6043
6044         * enum.cs (GetObsoleteAttribute): Removed.
6045
6046         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6047         on Enum member is double staged. The first is tested member
6048         and then enum.
6049
6050 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6051
6052         Fixed #56986, #63631, #65231
6053
6054         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6055         adds member to name container.
6056         (TypeContainer.AddToTypeContainer): New method, adds type to
6057         name container.
6058         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6059         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6060         AddOperator): Simplified by reusing AddToMemberContainer.
6061         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6062         instead of field.
6063         (Method.CheckForDuplications): Fixed implementation to test all
6064         possibilities.
6065         (MemberBase): Detection whether member is explicit interface
6066         implementation is now in constructor.
6067         (MemberBase.UpdateMemberName): Handles IndexerName.
6068         (Accessor): Changed to keep also location information.
6069         (AbstractPropertyEventMethod): Is derived from MemberCore.
6070         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6071         will be emited or not.
6072         (PropertyBase.AreAccessorsDuplicateImplementation):
6073         Tests whether accessors are not in collision with some method.
6074         (Operator): Is derived from MethodCore to simplify common
6075         operations.
6076
6077         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6078         must be performed.
6079         (DeclSpace.AddToContainer): Adds the member to defined_names
6080         table. It tests for duplications and enclosing name conflicts.
6081
6082         * enum.cs (EnumMember): Clean up to reuse the base structures
6083
6084 2004-09-03  Martin Baulig  <martin@ximian.com>
6085
6086         Merged latest changes into gmcs.  Please keep this comment in
6087         here, it makes it easier for me to see what changed in MCS since
6088         the last time I merged.
6089
6090 2004-09-03  Martin Baulig  <martin@ximian.com>
6091
6092         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6093         into TypeContainer, to make partial classes work again.
6094
6095 2004-09-03  Martin Baulig  <martin@ximian.com>
6096
6097         * rootcontext.cs (RootContext.V2): Removed.
6098
6099 2004-03-23  Martin Baulig  <martin@ximian.com>
6100
6101         * expression.cs (Invocation.OverloadResolve): Added `bool
6102         may_fail' argument and use it instead of the Location.IsNull() hack.
6103
6104 2004-09-09  Martin Baulig  <martin@ximian.com>
6105
6106         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6107
6108 2004-09-09  Martin Baulig  <martin@ximian.com>
6109
6110         * generic.cs (TypeParameter.DefineType): Added support for
6111         explicit interface methods.
6112
6113 2004-09-09  Martin Baulig  <martin@ximian.com>
6114
6115         * README.Changes: New document.  Started to list important changes
6116         between MCS and GMCS here.
6117
6118 2004-09-08  Martin Baulig  <martin@ximian.com>
6119
6120         * class.cs
6121         (TypeContainer.CheckRecursiveDefinition): New protected method.
6122         (TypeContainer.DefineType): Move the CS0146 check into
6123         CheckRecursiveDefinition().     
6124
6125 2004-09-06  Martin Baulig  <martin@ximian.com>
6126
6127         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6128         types for the constructor constraint.
6129
6130 2004-09-03  Martin Baulig  <martin@ximian.com>
6131
6132         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6133         into TypeContainer, to make partial classes work again.
6134
6135 2004-09-03  Martin Baulig  <martin@ximian.com>
6136
6137         * rootcontext.cs (RootContext.V2): Removed.
6138
6139 2004-03-23  Martin Baulig  <martin@ximian.com>
6140
6141         * expression.cs (Invocation.OverloadResolve): Added `bool
6142         may_fail' argument and use it instead of the Location.IsNull() hack.
6143
6144 2004-09-03  Martin Baulig  <martin@ximian.com>
6145
6146         Merged latest changes into gmcs.  Please keep this comment in
6147         here, it makes it easier for me to see what changed in MCS since
6148         the last time I merged.
6149
6150 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6151
6152         Fix #61128.
6153         * expression.cs (BetterConversion): Don't allow either conversion 
6154         to be null.  Remove redundant implicit conversion test when 'q ==
6155         null' -- when this function is invoked, we already know that the
6156         implicit conversion exists.
6157         (BetterFunction): Assume that 'best' is non-null.  Remove
6158         redundant reimplementation of IsApplicable when 'best' is null.
6159         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6160         number of arguments.
6161         (IsAncestralType): Extract from OverloadResolve.
6162         (OverloadResolve): Make robust to the MethodGroupExpr being
6163         unsorted.  Implement all the logic of Section 14.5.5.1, and
6164         support overloading of methods from multiple applicable types.
6165         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6166
6167         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6168         (RealError, Warning): Append type of report to related symbol.
6169
6170 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6171
6172         * enum.cs: Fixed CLS-Compliance checks for enum members.
6173         Error tests cs3008-8.cs, cs3014-8.cs
6174
6175 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6176
6177         Fixed bug #62342, #63102
6178         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6179         like ImplementMethod.
6180
6181 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6182
6183         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6184         Fixed bug #65170.
6185
6186 2004-09-02  Martin Baulig  <martin@ximian.com>
6187
6188         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6189         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6190         on the MethodBase.
6191
6192 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6193
6194         C# 2.0 Static classes implemented
6195
6196         * class.cs (TypeContainer): instance_constructors,
6197         initialized_fields, initialized_static_fields,
6198         default_constructor, base_inteface_types are protected to be
6199         accessible from StaticClass.
6200         (TypeContainer.DefineDefaultConstructor): New virtual method
6201         for custom default constructor generating
6202         (StaticClass): New class to handle "Static classes" feature.
6203
6204         * cs-parser.jay: Handle static keyword on class like instance
6205         of StaticClass.
6206
6207         * driver.cs: Added "/langversion" command line switch with two
6208         options (iso-1, default).
6209
6210 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6211
6212         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6213
6214 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6215
6216         * delegate.cs: Style.
6217
6218 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6219
6220         * delegate.cs: Add seperate instance expr field for miguel.
6221
6222 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6223
6224         * PointerArithmetic (Resolve): make sure we are not doing
6225         pointer arith on void*. Also, make sure we are resolved
6226         by not setting eclass until resolve.
6227
6228         All callers: Make sure that PointerArithmetic gets resolved.
6229
6230 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6231
6232         * ArrayCreation (LookupType): If the type does not resolve 
6233         to an array, give an error.
6234
6235 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6236
6237         * statement.cs (Try.Resolve): Fixed bug #64222
6238
6239 2004-08-27  Martin Baulig  <martin@ximian.com>
6240
6241         * class.cs
6242         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6243         crash here.     
6244
6245 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6246
6247         * ecore.cs (Constantify): Get underlying type via
6248         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6249         Windows in special cases.
6250
6251 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6252
6253         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6254         for obtaining also private methods.
6255         (GetRemoveMethod): Used GetRemoveMethod (true)
6256         for obtaining also private methods.
6257
6258 2004-09-02  Martin Baulig  <martin@ximian.com>
6259
6260         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6261         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6262         on the MethodBase.
6263
6264 2004-08-27  Martin Baulig  <martin@ximian.com>
6265
6266         * class.cs
6267         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6268         crash here.     
6269
6270 2004-08-25  Martin Baulig  <martin@ximian.com>
6271
6272         * support.cs (ReflectionParameters..ctor): If this is a generic
6273         method, retrieve and store its type parameters.
6274         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6275         (ReflectionParameters.GenericConstraints): The argument specifies
6276         the type parameter, not the method parameter.
6277         (InternalParameters.GenericConstraints): Likewise.
6278
6279         * generic.cs (TypeParameter.DefineType): Correctly handle
6280         constraints wrt. generic methods in interfaces and their
6281         implementations.        
6282
6283 2004-08-24  Martin Baulig  <martin@ximian.com>
6284
6285         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6286         (Constraints.IsSubclassOf): New internal method.
6287
6288         * typemanager.cs (TypeManager.FindMembers): Added special support
6289         for GenericTypeParameterBuilder's.      
6290         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6291         type parameters.
6292
6293 2004-08-24  Martin Baulig  <martin@ximian.com>
6294
6295         * typemanager.cs
6296         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6297         this for accessibility checks.
6298         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6299         IsNestedFamilyAccessible.
6300         (TypeManager.IsSubclassOf): New method, do what the name actually
6301         says.   
6302
6303 2004-08-24  Martin Baulig  <martin@ximian.com>
6304
6305         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6306         as a SimpleName, include the generic arity.
6307
6308 2004-08-24  Martin Baulig  <martin@ximian.com>
6309
6310         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6311         MethodAttributes.HideBySig for operators.
6312
6313 2004-08-23  Martin Baulig  <martin@ximian.com>
6314
6315         Back to the old error reporting system :-)
6316
6317         * report.cs (Message): Removed.
6318         (Report.MessageData, ErrorData, WarningData): Removed.
6319         (Report.Error, Warning): Back to the old system.
6320
6321 2004-08-23  Martin Baulig  <martin@ximian.com>
6322
6323         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6324
6325         * class.cs (TypeContainer.ParentContainer): New public virtual
6326         method; replaces the explicit interface implementation.
6327         (ClassPart.ParentContainer): Override.
6328
6329 2004-08-23  Martin Baulig  <martin@ximian.com>
6330
6331         * statement.cs (Switch): Added support for constant switches; see
6332         #59428 or test-285.cs.
6333
6334 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6335
6336         Fixed bug #62740.
6337         * statement.cs (GetEnumeratorFilter): Removed useless
6338         logic because C# specs is strict. GetEnumerator must be
6339         public.
6340
6341 2004-08-22  Martin Baulig  <martin@ximian.com>
6342
6343         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6344         a switch and may break, reset the barrier.  Fixes #59867.
6345
6346 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6347
6348         CLS-Compliance speed up (~5% for corlib)
6349
6350         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6351         New method. Tests container for CLS-Compliant names
6352
6353         * class.cs (TypeContainer.VerifyClsName): New method.
6354         Checks whether container name is CLS Compliant.
6355         (Constructor): Implements IMethodData.
6356
6357         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6358         low-case table for CLS Compliance test.
6359         (MemberCache.VerifyClsParameterConflict): New method.
6360         Checks method parameters for CS3006 error.
6361
6362         * enum.cs (EnumMember): Is derived from MemberCore.
6363         (Enum.VerifyClsName): Optimized for better performance.
6364
6365 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6366
6367         * report.cs: Renamed Error_T to Error and changed all
6368         references.
6369
6370 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6371
6372         * class.cs (TypeContainer.IndexerArrayList): New inner class
6373         container for indexers.
6374         (TypeContainer.DefaultIndexerName): New constant for default
6375         indexer name. Replaced all "Item" with this constant.
6376         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6377
6378         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6379         DefaultMemberAttribute constructor.
6380
6381 2004-08-05  Martin Baulig  <martin@ximian.com>
6382
6383         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6384         Fix bug #59429.
6385
6386 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6387
6388         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6389         multi platforms problem.
6390
6391         * compiler.csproj: Included shared files.
6392
6393 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6394
6395         Fix bug 60333, 55971 in the more general way
6396         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6397         Added arg_type argument for constant conversion.
6398         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6399
6400 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6401
6402         Fix bug #59760
6403         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6404         OperatorArrayList, MethodCoreArrayList for typecontainer
6405         containers. Changed class member types to these new types.
6406         (MethodArrayList.DefineMembers): Added test for CS0659.
6407
6408 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6409
6410         * cfold.cs: Synchronize the folding with the code in expression.cs
6411         Binary.DoNumericPromotions for uint operands.
6412
6413         * attribute.cs: Revert patch from Raja, it introduced a regression
6414         while building Blam-1.2.1 (hard to isolate a test case).
6415
6416 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6417
6418         Fix for #55382
6419         * class.cs:
6420         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6421         name collision.
6422         (MethodCore.parent_method): New member. The method we're overriding
6423         if this is an override method.
6424         (MethodCore.CheckBase): Moved from Method class and made common.
6425         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6426         private.
6427         (MethodCore.CheckForDuplications): New abstract method. For custom
6428         member duplication search in a container
6429         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6430         method and its return type.
6431         (Event.conflict_symbol): New member. Symbol with same name in the
6432         parent class.
6433
6434         * decl.cs:
6435         (MemberCache.FindMemberWithSameName): New method. The method
6436         is looking for conflict with inherited symbols.
6437
6438 2004-08-04  Martin Baulig  <martin@ximian.com>
6439
6440         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6441
6442         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6443
6444 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6445
6446         * report.cs (Message): New enum for better error, warning reference in
6447         the code.
6448         (MessageData): New inner abstract class. It generally handles printing of
6449         error and warning messages.
6450         Removed unused Error, Warning, Message methods.
6451
6452 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6453
6454         Fix for cs0592-8.cs test
6455         * attribute.cs
6456         (Attributable.ValidAttributeTargets): Made public.
6457         (Attribute.ExplicitTarget): New member for explicit target value.
6458         (Attribute.CheckTargets): Now we translate explicit attribute
6459         target to Target here.
6460
6461 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6462
6463         * ecore.cs (MethodGroupExpr): new IsBase property.
6464
6465         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6466
6467         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6468         rather than an instance expr.
6469
6470         (DelegateCreation.Emit): Use the method group rather than
6471         the instance expression. Also, if you have base.Foo as the
6472         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6473
6474         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6475
6476         (NewDelegate.DoResolve): Only check for the existance of Invoke
6477         if the method is going to be needed. Use MethodGroupExpr.
6478
6479         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6480
6481         * expression.cs: For pointer arith., make sure to use
6482         the size of the type, not the size of the pointer to
6483         the type.
6484
6485 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6486
6487         Fix for #60722
6488         * class.cs (Class): Added error CS0502 test.
6489
6490 2004-08-03  John Luke  <jluke@cfl.rr.com>
6491             Raja R Harinath  <rharinath@novell.com>
6492
6493         Fix for #60997.
6494         * attribute.cs (Attribute.complained_before): New flag.
6495         (Attribute.ResolveType, Attribute.Resolve),
6496         (Attribute.DefinePInvokeMethod): Set it.
6497         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6498         
6499 2004-08-03  Martin Baulig  <martin@ximian.com>
6500
6501         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6502         use a user-defined operator; we still need to do numeric
6503         promotions in case one argument is a builtin type and the other
6504         one has an implicit conversion to that type.  Fixes #62322.
6505
6506 2004-08-18  Martin Baulig  <martin@ximian.com>
6507
6508         * class.cs (Method.Define): Use the correct method name when
6509         creating the MethodBuilder for a generic method.
6510
6511 2004-08-17  Martin Baulig  <martin@ximian.com>
6512
6513         * generic.cs (Constraints): Support type parameter constraints.
6514
6515 2004-08-16  Martin Baulig  <martin@ximian.com>
6516
6517         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6518         (Token.GENERIC_DIMENSION): New token; this is returned if we
6519         encounter an unbound generic type in a typeof() expression.
6520
6521         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6522         this token is only generated while parsing a typeof() expression.
6523         (typeof_expression): Removed the old unbound_type hack.
6524
6525         * generic.cs (TypeArguments.IsUnbound): New public property.
6526
6527         * decl.cs (MemberName): Added support for unbound types.
6528
6529 2004-08-14  Martin Baulig  <martin@ximian.com>
6530
6531         * typemanager.cs
6532         (TypeManager.IsEqualGenericInstance): New static method.
6533         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6534         just used to check accessibility, so follow the rules of 26.1.6.        
6535
6536         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6537         ConstructedType instead of a TypeExpression if we have type arguments.
6538
6539         * cs-parser.jay (typeof_expression): Support unbound generic types.
6540
6541         * ecore.cs (UnboundTypeExpression): New public class.
6542
6543 2004-08-12  Martin Baulig  <martin@ximian.com>
6544
6545         * typemanager.cs (TypeManager.IsNestedChildOf): Use
6546         TypeManager.IsEqual() rather than `=='.
6547
6548         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6549         generic instances as well.
6550
6551 2004-08-12  Martin Baulig  <martin@ximian.com>
6552
6553         * expression.cs (Invocation.InferType): We can only infer method
6554         type parameters.  Fixes #62647.
6555
6556 2004-08-11  Martin Baulig  <martin@ximian.com>
6557
6558         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6559         before resolving the base classes.
6560
6561 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6562
6563         * Makefile: install .mdb file too.
6564
6565 2004-08-05  Martin Baulig  <martin@ximian.com>
6566
6567         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6568         initializer, the current type is just the TypeBuilder, not the
6569         instantiated generic type.
6570         (FieldExpr.IsFieldInitializer): New public property.
6571
6572 2004-08-04  Martin Baulig  <martin@ximian.com>
6573
6574         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6575
6576         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6577
6578 2004-08-03  Martin Baulig  <martin@ximian.com>
6579
6580         * class.cs (MethodData.Define): If we're an explicit
6581         implementation, remove the generic arity from the type name.
6582
6583 2004-08-03  Martin Baulig  <martin@ximian.com>
6584
6585         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6586         use a user-defined operator; we still need to do numeric
6587         promotions in case one argument is a builtin type and the other
6588         one has an implicit conversion to that type.  Fixes #62322.
6589
6590 2004-08-02  Martin Baulig  <martin@ximian.com>
6591
6592         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6593         `TypeExpr[]' array.
6594         (TypeContainer.GetClassBases): Return the unexpanded list of
6595         interfaces; we expand them later.
6596         (TypeContainer.DefineType): After creating the TypeBuilder, call
6597         TypeManager.ExpandInterfaces() to get an expanded and resolved
6598         list of interfaces.
6599
6600         * ecore.cs (TypeExpr.GetInterfaces): Removed
6601
6602         * generics.cs (Constraints.InterfaceConstraints): Remove.
6603         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6604         register the interface constraints.
6605
6606         * typemanager.cs
6607         (TypeManager.AddUserType): Removed the `ifaces' argument.
6608         (TypeManager.AddTypeParameter): Likewise.
6609         (TypeManager.AddUserInterface): Removed, was unused.
6610         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6611         `TypeExpr[]' array for the interfaces.
6612         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6613         has been defined, returns a list of the resolved interfaces types.
6614         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6615         (TypeManager.GetExplicitInterfaces): Likewise.  
6616
6617 2004-08-02  Martin Baulig  <martin@ximian.com>
6618
6619         * expression.cs (Invocation.EmitCall): If we're invoking a method
6620         on a type parameter, use the new `Constrained' prefix opcode.
6621
6622 2004-08-02  Martin Baulig  <martin@ximian.com>
6623
6624         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6625         (LocalInfo.IsThis): New public property.
6626         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6627
6628 2004-08-01  Martin Baulig  <martin@ximian.com>
6629
6630         * class.cs (TypeContainer.GetClassBases): Don't set the default
6631         here since we may get called from GetPartialBases().
6632         (TypeContainer.DefineType): If GetClassBases() didn't return a
6633         parent, use the default one.
6634
6635 2004-07-30  Martin Baulig  <martin@ximian.com>
6636
6637         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6638
6639         * class.cs (SourceMethod): New public class, derive from the
6640         symbol writer's ISourceMethod.
6641         (Method): Use the new symbol writer API.
6642
6643         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6644         as argument and use the new symbol writer.
6645
6646         * location.cs
6647         (SourceFile): Implement the symbol writer's ISourceFile.
6648         (Location.SymbolDocument): Removed.
6649         (Location.SourceFile): New public property.
6650
6651         * symbolwriter.cs: Use the new symbol writer API.
6652
6653 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6654
6655         * Makefile (install-local): Remove.  Functionality moved to
6656         executable.make.
6657
6658 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6659
6660         * Makefile: Install mcs.exe.config file together with mcs.exe.
6661         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6662         correct runtime version.
6663         
6664 2004-07-25  Martin Baulig  <martin@ximian.com>
6665
6666         * class.cs
6667         (TypeContainer.RegisterOrder): Removed, this was unused.
6668         (TypeContainer, interface_order): Removed.
6669         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6670         TypeContainer as argument since we can also be called with a
6671         `PartialContainer' for a partial class/struct/interface.
6672         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6673         of checking whether we're an `Interface' - we could be a
6674         `PartialContainer'.
6675         (PartialContainer.Register): Override; call
6676         AddClass()/AddStruct()/AddInterface() on our parent.
6677
6678         * cs-parser.jay (interface_member_declaration): Add things to the
6679         `current_container', not the `current_class'.
6680
6681         * rootcontext.cs (RegisterOrder): The overloaded version which
6682         takes an `Interface' was unused, removed.
6683
6684         * typemanager.cs (TypeManager.LookupInterface): Return a
6685         `TypeContainer', not an `Interface'.
6686         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6687         contain a `PartialContainer' for an interface, so check it's
6688         `Kind' to figure out what it is.
6689
6690 2004-07-25  Martin Baulig  <martin@ximian.com>
6691
6692         * class.cs (Class.DefaultTypeAttributes): New public constant.
6693         (Struct.DefaultTypeAttributes): Likewise.
6694         (Interface.DefaultTypeAttributes): Likewise.
6695         (PartialContainer.TypeAttr): Override this and add the
6696         DefaultTypeAttributes.
6697
6698 2004-07-25  Martin Baulig  <martin@ximian.com>
6699
6700         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6701         we can just use the `Parent' field instead.
6702
6703 2004-07-25  Martin Baulig  <martin@ximian.com>
6704
6705         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6706
6707 2004-07-25  Martin Baulig  <martin@ximian.com>
6708
6709         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6710         our parts before defining any methods.
6711         (TypeContainer.VerifyImplements): Make this virtual.
6712         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6713         on our PartialContainer.
6714
6715 2004-07-25  Martin Baulig  <martin@ximian.com>
6716
6717         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6718
6719         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6720         argument, we can just use the `Parent' field instead.
6721
6722         * class.cs
6723         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6724         (MemberBase.DoDefine): Likewise.
6725
6726 2004-07-24  Martin Baulig  <martin@ximian.com>
6727
6728         * decl.cs (MemberCore.Parent): New public field.
6729         (DeclSpace.Parent): Moved to MemberCore.
6730
6731         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6732         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6733         parent's .ctor.
6734         (FieldBase, Field, Operator): Likewise.
6735         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6736         (EventField, Event): Likewise.
6737
6738 2004-07-23  Martin Baulig  <martin@ximian.com>
6739
6740         * class.cs (PartialContainer): New public class.
6741         (ClassPart): New public class.
6742         (TypeContainer): Added support for partial classes.
6743         (TypeContainer.GetClassBases): Splitted some of the functionality
6744         out into GetNormalBases() and GetPartialBases().
6745
6746         * cs-tokenizer.cs (Token.PARTIAL): New token.
6747         (Tokenizer.consume_identifier): Added some hacks to recognize
6748         `partial', but only if it's immediately followed by `class',
6749         `struct' or `interface'.
6750
6751         * cs-parser.jay: Added support for partial clases.
6752
6753 2004-07-23  Martin Baulig  <martin@ximian.com>
6754
6755         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6756         a `DeclSpace' and also made it readonly.
6757         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6758         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6759         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6760
6761         * cs-parser.jay: Pass the `current_class', not the
6762         `current_container' (at the moment, this is still the same thing)
6763         to a new Method, Property, Event, Indexer or Constructor.
6764
6765 2004-07-23  Martin Baulig  <martin@ximian.com>
6766
6767         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6768         and removed the `current_interface' one.
6769         (struct_declaration, class_declaration, interface_declaration):
6770         Set `current_class' to the newly created class/struct/interface;
6771         set their `Bases' and call Register() before parsing their body.
6772
6773 2004-07-23  Martin Baulig  <martin@ximian.com>
6774
6775         * class.cs (Kind): New public enum.
6776         (TypeContainer): Made this class abstract.
6777         (TypeContainer.Kind): New public readonly field.
6778         (TypeContainer.CheckDef): New public method; moved here from
6779         cs-parser.jay.
6780         (TypeContainer.Register): New public abstract method.
6781         (TypeContainer.GetPendingImplementations): New public abstract
6782         method.
6783         (TypeContainer.GetClassBases): Removed the `is_class' and
6784         `is_iface' parameters.
6785         (TypeContainer.DefineNestedTypes): Formerly known as
6786         DoDefineType().
6787         (ClassOrStruct): Made this class abstract.
6788
6789         * tree.cs (RootTypes): New public type. 
6790
6791 2004-07-20  Martin Baulig  <martin@ximian.com>
6792
6793         * tree.cs (Tree.RecordNamespace): Removed.
6794         (Tree.Namespaces): Removed.
6795
6796         * rootcontext.cs (RootContext.IsNamespace): Removed.
6797
6798         * cs-parser.jay (namespace_declaration): Just create a new
6799         NamespaceEntry here.
6800
6801 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6802
6803         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6804         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6805         entry to make sure it runs in the correct runtime version.
6806         
6807 2004-07-18  Martin Baulig  <martin@ximian.com>
6808
6809         * generic.cs (ConstructedType.CheckConstraints): Improved
6810         constraints checking.
6811
6812 2004-07-18  Martin Baulig  <martin@ximian.com>
6813
6814         * expression.cs (Invocation.BetterMethod): Call
6815         TypeManager.TypeToCoreType() on all types and removed my previous
6816         hack; we're already doig the right thing here.
6817
6818 2004-07-17  Martin Baulig  <martin@ximian.com>
6819
6820         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6821
6822 2004-07-16  Martin Baulig  <martin@ximian.com>
6823
6824         * iterators.cs: Added generics support.
6825
6826 2004-07-16  Martin Baulig  <martin@ximian.com>
6827
6828         * iterators.cs: Rewrote this.  We're now using one single Proxy
6829         class for both the IEnumerable and the IEnumerator interface and
6830         `Iterator' derives from Class so we can use the high-level API.
6831
6832         * class.cs (TypeContainer.AddIterator): New method.
6833         (TypeContainer.DoDefineType): New protected virtual method, which
6834         is called from DefineType().
6835         (TypeContainer.DoDefineMembers): Call DefineType() and
6836         DefineMembers() on all our iterators.
6837         (TypeContainer.Emit): Call Emit() on all our iterators.
6838         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6839
6840         * codegen.cs (EmitContext.CurrentIterator): New public field.
6841
6842 2004-07-15  Martin Baulig  <martin@ximian.com>
6843
6844         * typemanager.cs
6845         (TypeManager.not_supported_exception_type): New type.   
6846
6847 2004-07-14  Martin Baulig  <martin@ximian.com>
6848
6849         * typemanager.cs
6850         (TypeManager.generic_ienumerable_type): New type.
6851         (TypeManager.generic_ienumerator_type): New type.
6852
6853         * rootcontext.cs
6854         (RootContext.interfaces_first_stage): Added
6855         "System.Collections.Generic.IEnumerator`1" and
6856         "System.Collections.Generic.IEnumerable`1".     
6857
6858 2004-07-14  Martin Baulig  <martin@ximian.com>
6859
6860         * iterators.cs: Use real error numbers.
6861
6862 2004-07-14  Martin Baulig  <martin@ximian.com>
6863
6864         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6865         requires this to be a System.Collection.IEnumerable and not a
6866         class implementing that interface.
6867         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6868
6869 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6870
6871         * class.cs: Fixed previous fix, it broke some error tests.
6872
6873 2004-07-12  Martin Baulig  <martin@ximian.com>
6874
6875         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6876         Fixes #61293.
6877
6878 2004-07-14  Martin Baulig  <martin@ximian.com>
6879
6880         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6881         an exclamation mark (!) for the generic arity to reflect the
6882         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6883
6884 2004-07-13  Martin Baulig  <martin@ximian.com>
6885
6886         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6887         specifiers being part of a type argument.
6888
6889 2004-07-13  Martin Baulig  <martin@ximian.com>
6890
6891         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6892         name for generic types.
6893
6894 2004-07-13  Martin Baulig  <martin@ximian.com>
6895
6896         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6897         bit to fix #60119.
6898
6899 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6900
6901         * assign.cs (LocalTemporary): Add new argument: is_address,If
6902         `is_address' is true, then the value that we store is the address
6903         to the real value, and not the value itself.
6904         
6905         * ecore.cs (PropertyExpr): use the new local temporary
6906         stuff to allow us to handle X.Y += z (where X is a struct)
6907
6908 2004-07-08  Martin Baulig  <martin@ximian.com>
6909
6910         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6911         not always return, just like we're doing in Using.Resolve().
6912
6913 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6914
6915         * cs-parser.jay (fixed_statement): flag this as Pinned.
6916
6917 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6918
6919         * typemanager.cs (TypeManager): Removed MakePinned method, this
6920         mechanism is replaced with the .NET 2.x compatible mechanism of
6921         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6922
6923         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6924         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6925         `IsFixed' property which has a different meaning.
6926
6927 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6928
6929         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6930         visible from inside a nested class, not just the names of the
6931         immediately enclosing class.
6932         Fix for bug #60730.
6933
6934 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6935
6936         * expression.cs (BetterConversion): Remove buggy special-case
6937         handling of "implicit constant expression conversions".  At this
6938         point, we already know that the conversion is possible -- we're
6939         only checking to see which is better.
6940
6941 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6942
6943         * cs-parser.jay: Added error CS0210 test.
6944
6945 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6946
6947         * cs-parser.jay: Added error CS0134 test.
6948
6949 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6950
6951         Fix bug #52507
6952         * cs-parser.jay: Added error CS0145 test.
6953
6954 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6955
6956         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6957
6958 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6959         
6960         * expression.cs (StackAlloc.Resolve): The argument may not
6961         be a constant; deal with this case.
6962         
6963 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6964
6965         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6966         GetIndexerAttributeValue.
6967         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6968
6969         * class.cs (Indexer.Define): Added error tests for CS0415,
6970         CS0609.
6971
6972 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6973
6974         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6975         property code.
6976
6977 2004-06-23  Martin Baulig  <martin@ximian.com>
6978
6979         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6980         neither return nor throw, reset the barrier as well.  Fixes #60457.
6981
6982 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6983
6984         * class.cs : EventAttributes is now set to None by default.
6985           This fixes bug #60459.
6986
6987 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6988
6989         Fix bug #60219
6990         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6991         Don't throw exception but return null (it's sufficient now).
6992
6993 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6994
6995         * typemanager.cs (GetArgumentTypes): Faster implementation.
6996
6997 2004-06-18  Martin Baulig  <martin@ximian.com>
6998
6999         * attribute.cs (Attribute.Resolve): Check whether we're an
7000         EmptyCast which a Constant child.  Fixes #60333.
7001
7002 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7003
7004         * statement.cs (EmitCollectionForeach): Account for the fact that
7005         not all valuetypes are in areas which we can take the address of.
7006         For these variables, we store to a temporary variable. Also, make
7007         sure that we dont emit a `callvirt' on a valuetype method.
7008
7009 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7010
7011         * expression.cs (StackAlloc.DoReSolve): Added test for
7012         negative parameter (CS0247).
7013
7014 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7015
7016         Fix bug #59792
7017         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7018
7019 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7020
7021         Fix bug #59781
7022         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7023         ulong.
7024
7025 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7026
7027         Fix bug #58254 & cs1555.cs, cs1556.cs
7028         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7029
7030 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7031
7032         * cs-parser.jay: Added error CS1669 test for indexers.
7033
7034 2004-06-18  Martin Baulig  <martin@ximian.com>
7035
7036         * generics.cs (GenericMethod.ctor): Don't take an Attributes
7037         argument.  Fixes #60441.
7038
7039 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
7040         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7041         The name needs to have the actual name of the method in order
7042         for other tests (such as the one in OverloadResolve for Invoke
7043         on a delegate) to work. As well, it does not really help
7044         error reporting because the method group had multiple methods.
7045         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7046         Make profiling work.
7047         
7048 2004-06-13  Martin Baulig  <martin@ximian.com>
7049
7050         * cs-parser.jay: Don't allow generic attributes.
7051
7052 2004-06-13  Martin Baulig  <martin@ximian.com>
7053
7054         * class.cs (MemberBase.DoDefineBase): New protected method.
7055         (MemberBase.DoDefine): Compute the `flags' in the new
7056         DoDefineBase() which must be called first.
7057         (Method.Define): Call DoDefineBase() first so we have the flags
7058         when defining the generic method.
7059
7060         * cs-parser.jay (interface_method_declaration): Support generic methods.
7061
7062 2004-06-13  Martin Baulig  <martin@ximian.com>
7063
7064         * decl.cs (TypeName): Removed.
7065         (MemberName): Removed TypeName and MemberNow; now we just have
7066         MemberName.
7067
7068         * cs-parser.jay: Don't distinguish between type arguments and type
7069         parameters in the grammar and simplified the rules a bit.  The
7070         reduce/reduce conflicts are now gone (except the one we inherited
7071         from mcs).
7072
7073 2004-06-11  Martin Baulig  <martin@ximian.com>
7074
7075         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7076         call this twice: for params and varargs methods.
7077
7078 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7079
7080         * class.cs:
7081         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7082
7083 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7084
7085         * attribute.cs (Attribute.GetValidTargets): Made public.
7086
7087         * class.cs: 
7088         (AbstractPropertyEventMethod): New class for better code sharing.
7089         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7090         CS1667 report.
7091         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7092
7093 2004-06-09  Martin Baulig  <martin@ximian.com>
7094
7095         * cs-parser.jay: Removed a reduce/reduce conflict.
7096
7097 2004-06-03  Martin Baulig  <martin@ximian.com>
7098
7099         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7100         GetSimpleName() and return a SimpleName.
7101
7102         * ecore.cs (SimpleName.Arguments): New public field.
7103         (SimpleName): Added overloaded ctor which takes an additional
7104         TypeArguments argument.
7105         (SimpleName.SimpleNameResolve): Added support for generic methods.
7106         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7107         formerly in MemberAccess.DoResolve(), but we also need it in
7108         SimpleNameResolve().
7109
7110         * expression.cs (MemberAccess.DoResolve): Use the new
7111         MethodGroupExpr.ResolveGeneric().       
7112
7113 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7114
7115         * decl.cs: If possible, use lookuptypedirect here. We can only do
7116         this if there is no `.' after the namespace. Avoids using
7117         LookupType, which does lots of slow processing.
7118         (FindNestedType) New method, does what it says :-).
7119         * namespace.cs: use LookupTypeDirect.
7120         * rootcontext.cs: use membercache, if possible.
7121         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7122
7123 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7124
7125         * expression.cs:
7126         According to the spec, 
7127
7128         In a member access of the form E.I, if E is a single identifier,
7129         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7130         field, property, localvariable, or parameter with the same type as
7131         the meaning of E as a type-name (§3.8), then both possible
7132         meanings of E are permitted.
7133
7134         We did not check that E as a simple-name had the same type as E as
7135         a type name.
7136
7137         This trivial check gives us 5-7% on bootstrap time.
7138
7139 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7140
7141         * expression.cs (Invocation.OverloadResolve): Avoid the
7142         use of hashtables and boxing here by allocating on demand.
7143
7144 2004-05-30  Martin Baulig  <martin@ximian.com>
7145
7146         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7147         we're doing a silent lookup.  Don't try to lookup nested types in
7148         TypeManager.object_type (thanks to Ben Maurer).
7149
7150 2004-05-30  Martin Baulig  <martin@ximian.com>
7151
7152         Committing a patch from Ben Maurer.
7153
7154         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7155
7156 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7157
7158         * convert.cs: add a trivial cache for overload operator resolution.
7159
7160 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7161
7162         * attribute.cs
7163         (AttributeTester.GetObsoleteAttribute): Returns instance of
7164         ObsoleteAttribute when type is obsolete.
7165
7166         * class.cs
7167         (TypeContainer.VerifyObsoleteAttribute): Override.
7168         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7169         (MethodCode.VerifyObsoleteAttribute): Override.
7170         (MemberBase.VerifyObsoleteAttribute): Override.
7171
7172         * decl.cs
7173         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7174         and report proper error.
7175
7176         *delegate.cs
7177         (Delegate.VerifyObsoleteAttribute): Override.
7178
7179         * ecore.cs
7180         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7181         and report proper error.
7182         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7183
7184         * enum.cs
7185         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7186         and enum member.
7187
7188         * expression.cs
7189         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7190         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7191         Added test for ObsoleteAttribute.
7192
7193         * statement.cs
7194         (Catch): Derived from Statement.
7195
7196 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7197
7198         * decl.cs: If possible, use lookuptypedirect here. We can only do
7199         this if there is no `.' after the namespace. Avoids using
7200         LookupType, which does lots of slow processing.
7201         (FindNestedType) New method, does what it says :-).
7202         * namespace.cs: use LookupTypeDirect.
7203         * rootcontext.cs: use membercache, if possible.
7204         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7205
7206 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7207
7208         * expression.cs:
7209         According to the spec, 
7210
7211         In a member access of the form E.I, if E is a single identifier,
7212         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7213         field, property, localvariable, or parameter with the same type as
7214         the meaning of E as a type-name (§3.8), then both possible
7215         meanings of E are permitted.
7216
7217         We did not check that E as a simple-name had the same type as E as
7218         a type name.
7219
7220         This trivial check gives us 5-7% on bootstrap time.
7221
7222 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7223
7224         Fixed bug #59071 & cs0160.cs
7225         * statement.cs (Try.Resolve): Check here whether order of catch
7226         clauses matches their dependencies.
7227
7228 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7229
7230         Fixed bug #58624
7231         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7232         unsafe type.
7233
7234 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7235
7236         * expression.cs (Invocation.OverloadResolve): Avoid the
7237         use of hashtables and boxing here by allocating on demand.
7238
7239 2004-05-30  Martin Baulig  <martin@ximian.com>
7240
7241         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7242         we're doing a silent lookup.  Don't try to lookup nested types in
7243         TypeManager.object_type (thanks to Ben Maurer).
7244
7245 2004-05-30  Martin Baulig  <martin@ximian.com>
7246
7247         Committing a patch from Ben Maurer.
7248
7249         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7250
7251 2004-05-29  Martin Baulig  <martin@ximian.com>
7252
7253         * class.cs (IMethodData.ShouldIgnore): New method.
7254
7255         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7256         `Location' argument, we don't need it anywhere.  Use
7257         `IMethodData.ShouldIgnore ()' instead of
7258         `MethodData.GetMethodFlags ()'.
7259         (TypeManager.AddMethod): Removed.
7260         (TypeManager.AddMethod2): Renamed to AddMethod.
7261
7262 2004-05-29  Martin Baulig  <martin@ximian.com>
7263
7264         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7265
7266         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7267         converting from a class type S to an interface type and we already
7268         have an object on the stack, don't box it again.  Fixes #52578.
7269
7270 2004-05-29  Martin Baulig  <martin@ximian.com>
7271
7272         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7273         Added support for `params' parameters.  Fixes #59267.
7274
7275 2004-05-29  Martin Baulig  <martin@ximian.com>
7276
7277         * literal.cs (NullPointer): Provide a private .ctor which sets
7278         `type' to TypeManager.object_type.  Fixes #59048.
7279
7280 2004-05-29  Martin Baulig  <martin@ximian.com>
7281
7282         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7283         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7284
7285         * ecore.cs (EventExpr.instance_expr): Make the field private.
7286
7287 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7288
7289         Fixed bug #50080 & cs0214-2.cs
7290         * expression.cs (Cast.DoResolve): Check unsafe context here.
7291         
7292         * statement.cs (Resolve.DoResolve): Likewise.
7293
7294 2004-05-26  Martin Baulig  <martin@ximian.com>
7295
7296         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7297
7298         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7299         (RootContext.LookupType): Pass down the `silent' flag.
7300
7301 2004-05-25  Martin Baulig  <martin@ximian.com>
7302
7303         * expression.cs
7304         (MethodGroupExpr.IdenticalTypeName): New public property.
7305         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7306         expression actually refers to a type.
7307
7308 2004-05-25  Martin Baulig  <martin@ximian.com>
7309
7310         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7311         for #56176 and made it actually work.
7312
7313 2004-05-25  Martin Baulig  <martin@ximian.com>
7314
7315         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7316         (FieldExpr, PropertyExpr): Override and implement
7317         CacheTemporaries.  Fixes #52279.
7318
7319 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7320
7321         * location.cs: In the new compiler listing a file twice is a
7322         warning, not an error.
7323
7324 2004-05-24  Martin Baulig  <martin@ximian.com>
7325
7326         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7327         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7328
7329 2004-05-24  Martin Baulig  <martin@ximian.com>
7330
7331         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7332         walking the `using' list.  Fixes #53921.
7333
7334 2004-05-24  Martin Baulig  <martin@ximian.com>
7335
7336         * const.cs (Const.LookupConstantValue): Added support for
7337         EmptyCast's; fixes #55251.
7338
7339 2004-05-24  Martin Baulig  <martin@ximian.com>
7340
7341         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7342         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7343         which does the CS0135 check.  The reason is that we first need to
7344         check whether the variable actually exists.
7345
7346 2004-05-24  Martin Baulig  <martin@ximian.com>
7347
7348         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7349         than RootContext.LookupType() to find the explicit interface
7350         type.  Fixes #58584.
7351
7352 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7353
7354         * Makefile: Simplify.  Use executable.make.
7355         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7356
7357 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7358
7359         * decl.cs:
7360         * enum.cs:
7361         Use the invariant culture when doing String.Compare for CLS case
7362         sensitivity.
7363         
7364 2004-05-23  Martin Baulig  <martin@ximian.com>
7365
7366         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7367         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7368
7369         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7370
7371 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7372
7373         * class.cs (MemberBase.Define): Reuse MemberType member for 
7374         resolved type. Other methods can use it too.
7375
7376 2004-05-23  Martin Baulig  <martin@ximian.com>
7377
7378         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7379         the variable also exists in the current block (otherwise, we need
7380         to report a CS0103).  Fixes #58670.
7381
7382 2004-05-23  Martin Baulig  <martin@ximian.com>
7383
7384         * flowanalysis.cs (Reachability.Reachable): Compute this
7385         on-the-fly rather than storing it as a field.
7386
7387 2004-05-23  Martin Baulig  <martin@ximian.com>
7388
7389         * flowanalysis.cs (Reachability.And): Manually compute the
7390         resulting `barrier' from the reachability.      
7391        
7392 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7393
7394         Fix bug #57835
7395         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7396         instance of ObsoleteAttribute when symbol is obsolete.
7397
7398         * class.cs
7399         (IMethodData): Extended interface for ObsoleteAttribute support.
7400
7401 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7402
7403         * attribute.cs: Fix bug #55970
7404
7405 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7406
7407         Fix bug #52705
7408         * attribute.cs
7409         (GetObsoleteAttribute): New method. Creates the instance of
7410         ObsoleteAttribute.
7411         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7412         ObsoleteAttribute when member is obsolete.
7413         (AttributeTester.Report_ObsoleteMessage): Common method for
7414         Obsolete error/warning reporting.
7415
7416         * class.cs
7417         (TypeContainer.base_classs_type): New member for storing parent type.
7418
7419         * decl.cs
7420         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7421         for this MemberCore.
7422
7423 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7424
7425         * attribute.cs, const.cs: Fix bug #58590
7426
7427 2004-05-21  Martin Baulig  <martin@ximian.com>
7428
7429         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7430         out parameters if the end of the method is unreachable.  Fixes
7431         #58098. 
7432
7433 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7434
7435         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7436         Hari was right, why extra method.
7437
7438 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7439
7440         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7441
7442 2004-05-20  Martin Baulig  <martin@ximian.com>
7443
7444         * delegate.cs: Convert this file to Unix mode - like the original
7445         version in mcs is.
7446
7447 2004-05-20  Martin Baulig  <martin@ximian.com>
7448
7449         * attribute.cs: Convert this file to Unix mode - like the original
7450         version in mcs is.
7451
7452 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7453
7454        Fix bug #58688 (MCS does not report error when the same attribute
7455        is assigned twice)
7456
7457        * attribute.cs (Attribute.Emit): Distinction between null and default.
7458
7459 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7460
7461        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7462        of a top-level attribute without an attribute target.
7463        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7464        Make non-static.
7465        (Attribute.Conditional_GetConditionName), 
7466        (Attribute.Obsolete_GetObsoleteMessage): Update.
7467        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7468        part of ScanForIndexerName.
7469        (Attribute.CanIgnoreInvalidAttribute): New function.
7470        (Attribute.ScanForIndexerName): Move to ...
7471        (Attributes.ScanForIndexerName): ... here.
7472        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7473        (Attributes.Search): New internal variant that can choose not to
7474        complain if types aren't resolved.  The original signature now
7475        complains.
7476        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7477        complaints suppressed.
7478        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7479        only if it not useful.
7480        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7481        top-level for attributes that are shared between the assembly
7482        and a top-level class.
7483        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7484        * class.cs: Update to reflect changes.
7485        (DefineIndexers): Fuse loops.
7486        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7487        a couple more variants of attribute names.
7488
7489 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7490
7491         Fix bug #52585 (Implemented explicit attribute declaration)
7492
7493         * attribute.cs:
7494         (Attributable.ValidAttributeTargets): New abstract method. It gets
7495         list of valid attribute targets for explicit target declaration.
7496         (Attribute.Target): It holds target itself.
7497         (AttributeSection): Removed.
7498         (Attribute.CheckTargets): New method. It checks whether attribute
7499         target is valid for the current element.
7500
7501         * class.cs:
7502         (EventProperty): New class. For events that are declared like
7503         property (with add and remove accessors).
7504         (EventField): New class. For events that are declared like field.
7505         class.cs
7506
7507         * cs-parser.jay: Implemented explicit attribute target declaration.
7508
7509         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7510         Override ValidAttributeTargets.
7511
7512         * parameter.cs:
7513         (ReturnParameter): Class for applying custom attributes on 
7514         the return type.
7515         (ParameterAtribute): New class. Class for applying custom
7516         attributes on the parameter type.
7517
7518 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7519
7520         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7521         definitions. 
7522
7523         (Method): Allow UNSAFE here.
7524
7525         * modifiers.cs: Support unsafe reporting.
7526
7527 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7528
7529         * decl.cs: Fix bug #58478.
7530
7531 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7532
7533         * statement.cs: When checking for unreachable code on an EmptyStatement,
7534         set the location. Fixes bug #58488.
7535
7536 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7537
7538         * driver.cs: Add -pkg handling.
7539
7540         From Gonzalo: UseShelLExecute=false
7541
7542 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7543
7544         * attribute.cs:
7545         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7546         for attribute.
7547         (Attribute.IsClsCompliaceRequired): Moved to base for better
7548         accesibility.
7549         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7550         when attribute is AttributeUsageAttribute.
7551         (Attribute.GetValidTargets): Simplified.
7552         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7553         attribute for this type.
7554         (Attribute.ApplyAttributes): Method renamed to Emit and make
7555         non-static.
7556         (GlobalAttributeSection): New class for special handling of global
7557         attributes (assembly, module).
7558         (AttributeSection.Emit): New method.
7559
7560         * class.cs: Implemented Attributable abstract methods.
7561         (MethodCore.LabelParameters): Moved to Parameter class.
7562         (Accessor): Is back simple class.
7563         (PropertyMethod): Implemented Attributable abstract class.
7564         (DelegateMethod): Implemented Attributable abstract class.
7565         (Event): New constructor for disctintion between normal Event
7566         and Event with accessors.
7567
7568         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7569
7570         * codegen.cs, const.cs, decl.cs, delegate.cs:
7571         (CommonAssemblyModulClass): Implemented Attributable abstract class
7572         and simplified.
7573
7574         * enum.cs: Implement IAttributeSupport interface.
7575         (EnumMember): New class for emum members. Implemented Attributable
7576         abstract class
7577
7578         * parameter.cs:
7579         (ParameterBase): Is abstract.
7580         (ReturnParameter): New class for easier [return:] attribute handling.
7581
7582         * typemanager.cs: Removed builder_to_attr.
7583
7584 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7585
7586         Fix bug #57151.
7587         * attribute.cs (Attribute.GetPositionalValue): New function.
7588         * class.cs (TypeContainer.VerifyMembers): New function.
7589         (TypeContainer.Emit): Use it.
7590         (ClassOrStruct): New base class for Class and Struct.
7591         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7592         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7593         class.
7594         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7595         then each non-static field should have a FieldOffset attribute.
7596         Otherwise, none of the fields should have a FieldOffset attribute.
7597         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7598         and FieldOffset attributes.
7599         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7600         (TypeManager.field_offset_attribute_type): New core types.
7601         (TypeManager.InitCoreTypes): Initialize them.
7602
7603 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7604
7605         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7606         Return correct type.
7607         From bug #58270.
7608
7609 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7610
7611         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7612         be implicitly converted to ulong.
7613         
7614         * expression.cs: The logic for allowing operator &, | and ^ worked
7615         was wrong, it worked before because we did not report an error in
7616         an else branch.  Fixes 57895.
7617
7618         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7619         allow volatile fields to be reference types.
7620
7621 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7622
7623         * driver.cs: Add support for /debug-
7624
7625 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7626
7627         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7628         Add a 'complain' parameter to silence errors.
7629         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7630         silently overlooked type-resolutions.
7631         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7632         to reflect changes.
7633         (Attributes.Search): New function.
7634         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7635         (Attributes.GetAttributeFullName): Remove hack.
7636         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7637         Update to reflect changes.
7638         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7639         Use Attributes.Search instead of nested loops.
7640
7641 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7642
7643         * decl.cs:
7644         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7645         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7646         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7647
7648         * report.cs: (Report.Warning): Renamed to Warning_T because of
7649         parameter collision.
7650
7651 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7652
7653         * expression.cs (MemberAccess.ResolveMemberAccess):
7654         Exit with non-zero status after Report.Error.
7655         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7656         Likewise.
7657         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7658
7659 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7660
7661         * support.cs: Don't hang when the file is empty.
7662
7663 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7664
7665         * support.cs: In SeekableStreamReader, compute the preamble size of the
7666           underlying stream. Position changes should take into account that initial
7667           count of bytes.
7668
7669 2004-05-03  Todd Berman  <tberman@sevenl.net>
7670
7671         * driver.cs: remove unused GetSysVersion function.
7672
7673 2004-05-03  Todd Berman  <tberman@sevenl.net>
7674
7675         * driver.cs: Remove the hack from saturday, as well as the hack
7676         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7677         link_paths to get that bit proper.
7678
7679 2004-05-01  Todd Berman  <tberman@sevenl.net>
7680
7681         * driver.cs: Try a LoadFrom before a Load, this checks the current
7682         path. This is currently a bug in mono that is be fixed, however, this
7683         provides a workaround for now. This will be removed when the bug
7684         is fixed.
7685
7686 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7687
7688         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7689         incomplete key pairs (#57941).
7690
7691 2004-05-01  Todd Berman  <tberman@sevenl.net>
7692
7693         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7694         from the GAC
7695
7696 2004-04-30  Jackson Harper  <jackson@ximian.com>
7697
7698         * codegen.cs: Open keys readonly.
7699         
7700 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7701
7702         * typemanager.cs: don't report cyclic struct layout when a struct
7703         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7704         which has 2 Pango.Rectangle fields.
7705
7706 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7707
7708         * expression.cs: Handle IntPtr comparisons with IL code
7709         rather than a method call.
7710
7711 2004-04-29  Martin Baulig  <martin@ximian.com>
7712
7713         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7714         the list of PropertyInfo's in class hierarchy and find the
7715         accessor.  Fixes #56013.
7716
7717 2004-04-29  Martin Baulig  <martin@ximian.com>
7718
7719         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7720
7721 2004-04-29  Martin Baulig  <martin@ximian.com>
7722
7723         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7724
7725         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7726
7727 2004-04-29  Martin Baulig  <martin@ximian.com>
7728
7729         * class.cs (ConstructorInitializer.Resolve): Check whether the
7730         parent .ctor is accessible.  Fixes #52146.
7731
7732 2004-04-29  Martin Baulig  <martin@ximian.com>
7733
7734         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7735
7736         * statement.cs (Using.EmitLocalVariableDecls): Use
7737         TypeManager.idisposable_type, not typeof (IDisposable).
7738         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7739
7740 2004-04-29  Martin Baulig  <martin@ximian.com>
7741
7742         * class.cs (Event.Define): Don't emit the field and don't set
7743         RTSpecialName and SpecialName for events on interfaces.  Fixes
7744         #57703. 
7745
7746 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7747
7748         Refactor Attribute.ApplyAttributes.
7749         * attribute.cs (Attributable): New base class for objects that can
7750         have Attributes applied on them.
7751         (Attribute): Make AttributeUsage fields public.
7752         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7753         (Attribute.IsInternalCall): New property.
7754         (Attribute.UsageAttr): Convert to a public read-only property.
7755         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7756         (Attribute.ResolveType, Attribute.Resolve)
7757         (Attribute.ScanForIndexerName): Update to reflect changes.
7758         (Attribute.CheckAttributeTarget): Re-format.
7759         (Attribute.ApplyAttributes): Refactor, to various
7760         Attributable.ApplyAttributeBuilder methods.
7761         * decl.cs (MemberCore): Make Attributable.
7762         * class.cs (Accessor): Make Attributable.
7763         (MethodData.ApplyAttributes): Use proper attribute types, not
7764         attribute names.
7765         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7766         (TypeContainer.ApplyAttributeBuilder)
7767         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7768         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7769         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7770         (Operator.ApplyAttributeBuilder): New factored-out methods.
7771         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7772         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7773         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7774         * parameter.cs (ParameterBase): New Attributable base class
7775         that can also represent Return types.
7776         (Parameter): Update to the changes.
7777
7778 2004-04-29  Jackson Harper  <jackson@ximian.com>
7779
7780         * driver.cs: Prefer the corlib system version when looking for
7781         assemblies in the GAC. This is still a hack, but its a better hack
7782         now.
7783         
7784 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7785
7786         * decl.cs, enum.cs: Improved error 3005 reporting.
7787   
7788         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7789         (related_symbols): New private member for list of symbols
7790         related to reported error/warning.
7791         
7792         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7793
7794 2004-04-29  Martin Baulig  <martin@ximian.com>
7795
7796         * ecore.cs (Expression.Constantify): If we're an enum and
7797         TypeManager.TypeToCoreType() doesn't give us another type, use
7798         t.UnderlyingSystemType.  Fixes #56178.  
7799
7800 2004-04-29  Martin Baulig  <martin@ximian.com>
7801
7802         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7803         interfaces and for each interface, only add members directly
7804         declared in that interface.  Fixes #53255.
7805
7806 2004-04-28  Martin Baulig  <martin@ximian.com>
7807
7808         * expression.cs (ConditionalLogicalOperator): Use a temporary
7809         variable for `left' to avoid that we evaluate it more than once;
7810         bug #52588.
7811
7812 2004-04-28  Martin Baulig  <martin@ximian.com>
7813
7814         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7815         `void[]' (CS1547).
7816
7817 2004-04-28  Martin Baulig  <martin@ximian.com>
7818
7819         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7820         void (CS1547).
7821
7822         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7823         whether the type is not void (CS1547).
7824
7825 2004-04-28  Martin Baulig  <martin@ximian.com>
7826
7827         * expression.cs (Unary.DoResolveLValue): Override this and report
7828         CS0131 for anything but Operator.Indirection.
7829
7830 2004-04-28  Martin Baulig  <martin@ximian.com>
7831
7832         Committing a patch from Ben Maurer; see bug #50820.
7833
7834         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7835         check for classes.
7836
7837         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7838         classes.        
7839
7840 2004-04-28  Martin Baulig  <martin@ximian.com>
7841
7842         Committing a patch from Ben Maurer; see bug #50820.
7843
7844         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7845         check for classes.
7846
7847         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7848         classes.        
7849
7850 2004-04-28  Martin Baulig  <martin@ximian.com>
7851
7852         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7853         (Block.AddLabel): Call DoLookupLabel() to only search in the
7854         current block.
7855
7856 2004-04-28  Martin Baulig  <martin@ximian.com>
7857
7858         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7859         comparing StringConstants and NullLiterals in Equality and Inequality.
7860
7861 2004-04-28  Jackson Harper  <jackson@ximian.com>
7862
7863         * driver.cs: Attempt to load referenced assemblies from the
7864         GAC. This is the quick and dirty version of this method that
7865         doesnt take into account versions and just takes the first
7866         canidate found. Will be good enough for now as we will not have more
7867         then one version installed into the GAC until I update this method.
7868
7869 2004-04-28  Martin Baulig  <martin@ximian.com>
7870
7871         * typemanager.cs (TypeManager.CheckStructCycles): New public
7872         static method to check for cycles in the struct layout.
7873
7874         * rootcontext.cs (RootContext.PopulateTypes): Call
7875         TypeManager.CheckStructCycles() for each TypeContainer.
7876         [Note: We only need to visit each type once.]
7877
7878 2004-04-28  Martin Baulig  <martin@ximian.com>
7879
7880         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7881
7882         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7883         success and added `out object value'.  Use a `bool resolved' field
7884         to check whether we've already been called rather than
7885         `ConstantValue != null' since this breaks for NullLiterals.
7886
7887 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7888
7889         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7890         setting of this flag, since the 'set' method may be non-public.
7891
7892 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7893
7894         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7895         check on current_vector.Block.
7896
7897 2004-04-27  Martin Baulig  <martin@ximian.com>
7898
7899         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7900         a field initializer.  Fixes #56459.
7901
7902 2004-04-27  Martin Baulig  <martin@ximian.com>
7903
7904         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7905         we're not attempting to use an indexer.  Fixes #52154.
7906
7907 2004-04-27  Martin Baulig  <martin@ximian.com>
7908
7909         * statement.cs (Return): Don't create a return label if we don't
7910         need it; reverts my change from January 20th.  Thanks to Ben
7911         Maurer for this.
7912
7913 2004-04-27  Martin Baulig  <martin@ximian.com>
7914
7915         According to the spec, `goto' can only leave a nested scope, but
7916         never enter it.
7917
7918         * statement.cs (Block.LookupLabel): Only lookup in the current
7919         block, don't recurse into parent or child blocks.
7920         (Block.AddLabel): Check in parent and child blocks, report
7921         CS0140/CS0158 if we find a duplicate.
7922         (Block): Removed this indexer for label lookups.
7923         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7924         this already does the error reporting for us.
7925
7926         * flowanalysis.cs
7927         (FlowBranching.UsageVector.Block): New public variable; may be null.
7928         (FlowBranching.CreateSibling): Added `Block' argument.
7929         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7930         label for the target of a `goto' and check whether we're not
7931         leaving a `finally'.
7932
7933 2004-04-27  Martin Baulig  <martin@ximian.com>
7934
7935         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7936         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7937         just for returns).
7938
7939 2004-04-27  Martin Baulig  <martin@ximian.com>
7940
7941         * statement.cs (Block.AddLabel): Also check for implicit blocks
7942         and added a CS0158 check.
7943
7944 2004-04-27  Martin Baulig  <martin@ximian.com>
7945
7946         * flowanalysis.cs (FlowBranchingLoop): New class.
7947         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7948         UsageVector's instead of an ArrayList.
7949         (FlowBranching.Label): Likewise.
7950         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7951         (FlowBranching.AddBreakVector): New method.
7952
7953 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * attribute.cs: Small regression fix: only convert the type if we
7956         the type is different, fixes System.Drawing build.
7957
7958 2004-04-27  Martin Baulig  <martin@ximian.com>
7959
7960         * attribute.cs (Attribute.Resolve): If we have a constant value
7961         for a named field or property, implicity convert it to the correct
7962         type.
7963
7964 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7965
7966         * statement.cs (Block.Block): Implicit blocks share
7967         'child_variable_names' fields with parent blocks.
7968         (Block.AddChildVariableNames): Remove.
7969         (Block.AddVariable): Mark variable as "used by a child block" in
7970         every surrounding block.
7971         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7972         been used in a child block, complain about violation of "Invariant
7973         meaning in blocks" rule.
7974         * cs-parser.jay (declare_local_variables): Don't use
7975         AddChildVariableNames.
7976         (foreach_statement): Don't create an implicit block: 'foreach'
7977         introduces a scope.
7978
7979 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7980
7981         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7982         converting from 0L to ulong.  Fixes 57522.
7983
7984 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7985
7986         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7987         derived class hides via 'new' keyword field from base class (test-242.cs).
7988         TODO: Handle this in the more general way.
7989         
7990         * class.cs (CheckBase): Ditto.
7991
7992 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7993
7994         * decl.cs (caching_flags): New member for storing cached values
7995         as bit flags.
7996         (MemberCore.Flags): New enum where bit flags for caching_flags
7997         are defined.
7998         (MemberCore.cls_compliance): Moved to caching_flags.
7999         (DeclSpace.Created): Moved to caching_flags.
8000
8001         * class.cs: Use caching_flags instead of DeclSpace.Created
8002         
8003 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8004
8005         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8006         if we are only a derived class, not a nested class.
8007
8008         * typemanager.cs: Same as above, but do this at the MemberLookup
8009         level (used by field and methods, properties are handled in
8010         PropertyExpr).   Allow for the qualified access if we are a nested
8011         method. 
8012
8013 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8014
8015         * class.cs: Refactoring.
8016         (IMethodData): New inteface; Holds links to parent members
8017         to avoid member duplication (reduced memory allocation).
8018         (Method): Implemented IMethodData interface.
8019         (PropertyBase): New inner classes for get/set methods.
8020         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8021         (Event): New inner classes for add/remove methods.
8022         (Event.DelegateMethod): Implemented IMethodData interface.
8023
8024         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8025         EmitContext (related to class.cs refactoring).
8026
8027 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8028
8029         * delegate.cs (Delegate.VerifyApplicability): If the number of
8030         arguments are the same as the number of parameters, first try to
8031         verify applicability ignoring  any 'params' modifier on the last
8032         parameter.
8033         Fixes #56442.
8034
8035 2004-04-08  Martin Baulig  <martin@ximian.com>
8036
8037         Merged latest changes into gmcs.  Please keep this comment in
8038         here, it makes it easier for me to see what changed in MCS since
8039         the last time I merged.
8040
8041 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8042
8043         * class.cs (TypeContainer.AddIndexer): Use
8044         'ExplicitInterfaceName' to determine if interface name was
8045         explicitly specified.  'InterfaceType' is not initialized at this time.
8046         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8047         Indexers array is already in the required order.  Initialize
8048         'IndexerName' only if there are normal indexers.
8049         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8050         (TypeContainer.Emit): Emit DefaultMember attribute only if
8051         IndexerName is initialized.
8052         Fixes #56300.
8053
8054 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8055
8056         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8057         Fixes #57007
8058
8059 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8060
8061         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8062         attributes.
8063         Fix for #56456.
8064
8065         * attribute.cs (Attribute.Resolve): Check for duplicate named
8066         attributes.
8067         Fix for #56463.
8068
8069 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8070
8071         * iterators.cs (MarkYield): track whether we are in an exception,
8072         and generate code accordingly.  Use a temporary value to store the
8073         result for our state.
8074
8075         I had ignored a bit the interaction of try/catch with iterators
8076         since their behavior was not entirely obvious, but now it is
8077         possible to verify that our behavior is the same as MS .NET 2.0
8078
8079         Fixes 54814
8080
8081 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8082
8083         * iterators.cs: Avoid creating temporaries if there is no work to
8084         do. 
8085
8086         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8087         Enumerations, use TypeManager.EnumToUnderlying and call
8088         recursively. 
8089
8090         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8091         bug #57013
8092
8093         (This.Emit): Use EmitContext.EmitThis to emit our
8094         instance variable.
8095
8096         (This.EmitAssign): Ditto.
8097
8098         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8099         codepaths, we will move all the functionality into
8100         Mono.CSharp.This 
8101
8102         (FieldExpr.EmitAssign): Ditto.
8103
8104         This fixes several hidden bugs that I uncovered while doing a code
8105         review of this today.
8106
8107         * codegen.cs (EmitThis): reworked so the semantics are more clear
8108         and also support value types "this" instances.
8109
8110         * iterators.cs: Changed so that for iterators in value types, we
8111         do not pass the value type as a parameter.  
8112
8113         Initialization of the enumerator helpers is now done in the caller
8114         instead of passing the parameters to the constructors and having
8115         the constructor set the fields.
8116
8117         The fields have now `assembly' visibility instead of private.
8118
8119 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8120
8121         * expression.cs (Argument.Resolve): Check if fields passed as ref
8122         or out are contained in a MarshalByRefObject.
8123
8124         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8125         another compiler type.
8126
8127 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8128
8129         * class.cs (Indexer.Define): use the new name checking method.
8130         Also, return false on an error.
8131         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8132         (is_identifier_[start/part]_character): make static.
8133
8134 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8135
8136         * expression.cs (Binary.ResolveOperator): Do no append strings
8137         twice: since we can be invoked more than once (array evaluation)
8138         on the same concatenation, take care of this here.  Based on a fix
8139         from Ben (bug #56454)
8140
8141 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8142
8143         * codegen.cs: Fix another case where CS1548 must be reported (when 
8144         delay-sign isn't specified and no private is available #56564). Fix
8145         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8146         error when MCS is used on the MS runtime and we need to delay-sign 
8147         (which seems unsupported by AssemblyBuilder - see #56621).
8148
8149 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8150
8151         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8152         (TypeManager.ComputeNamespaces): Faster implementation for
8153         Microsoft runtime.
8154
8155         * compiler.csproj: Updated AssemblyName to mcs.
8156
8157 2004-05-11  Jackson Harper  <jackson@ximian.com>
8158
8159         * Makefile: Preserve MONO_PATH
8160         
8161 2004-05-11  Jackson Harper  <jackson@ximian.com>
8162
8163         * Makefile: Use mono and mcs to build gmcs
8164         
8165 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8166
8167         * codegen.cs: Add patch from Robert Shade
8168         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8169         sync with mcs.
8170
8171 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8172
8173         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8174         incomplete key pairs (#57941).
8175
8176 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8177
8178         * codegen.cs: Fix another case where CS1548 must be reported (when 
8179         delay-sign isn't specified and no private is available #56564). Fix
8180         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8181         error when MCS is used on the MS runtime and we need to delay-sign 
8182         (which seems unsupported by AssemblyBuilder - see #56621).
8183
8184 2004-04-29  Jackson Harper  <jackson@ximian.com>
8185
8186         * Makefile: Set MONO_PATH to use the bootstrap corlib
8187         * driver.cs: Check the GAC for referenced assemblies.
8188                 
8189 2004-04-29  Martin Baulig  <martin@ximian.com>
8190
8191         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8192
8193 2004-04-07  Martin Baulig  <martin@ximian.com>
8194
8195         * expression.cs (Binary.ResolveOperator): Added special case for
8196         Equality/Inequality between a type parameter and a null literal.
8197
8198 2004-04-07  Martin Baulig  <martin@ximian.com>
8199
8200         * convert.cs: Check null literal -> type parameter conversions.
8201
8202 2004-04-07  Martin Baulig  <martin@ximian.com>
8203
8204         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8205         `class' and `struct' constraints.
8206
8207 2004-04-07  Martin Baulig  <martin@ximian.com>
8208
8209         * generic.cs (SpecialConstraint): New public enum.
8210         (Constraints.Resolve): Added support for the `class' and `struct'
8211         constraints.
8212
8213         * cs-parser.jay (type_parameter_constraint): Added support for the
8214         `class' and `struct' constraints.
8215
8216 2004-04-07  Martin Baulig  <martin@ximian.com>
8217
8218         * support.cs (GenericConstraints): Replaced `Types' by
8219         `ClassConstraint' and `InterfaceConstraints'; added
8220         `HasClassConstraint'.   
8221
8222 2004-04-07  Martin Baulig  <martin@ximian.com>
8223
8224         * generic.cs
8225         (Constraints.InterfaceConstraints): New public property.
8226         (Constraints.Types): Make this property public
8227         (TypeParameter): Implement IMemberContainer.
8228         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8229         instead of a TypeBuilder/MethodBuilder; pass the interface
8230         constraints to TypeManager.AddTypeParameter().
8231         (TypeParameter.DefineType): Just take an EmitContext and no
8232         TypeBuilder/MethodBuilder.  Use the new public API.
8233
8234         * typemanager.cs (TypeManager.AddTypeParameter): Added
8235         `TypeExpr[]' argument; add the interfaces to the
8236         `builder_to_ifaces' hash.
8237         (TypeManager.LookupMemberContainer): For
8238         GenericTypeParameterBuilders, get the TypeParameter from the
8239         `builder_to_type_param'.
8240         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8241         the TypeParameter and call FindMembers on it.
8242
8243 2004-04-07  Martin Baulig  <martin@ximian.com>
8244
8245         * class.cs
8246         (MethodCore.GenericMethod): Moved this field here from Method.
8247         (MethodCore.IsDuplicateImplementation): Take the number of type
8248         parameters into account if we're a generic method.
8249
8250         * expression.cs (Invocation.InferTypeArguments): Don't return true
8251         if `arguments' is null; we still need to check whether we actually
8252         don't need to infer anything in this case.
8253         (MemberAccess): Merged the functionality from GenericMemberAccess
8254         into this class.
8255
8256         * generic.cs (GenericMemberAccess): Removed.
8257
8258 2004-04-05  Martin Baulig  <martin@ximian.com>
8259
8260         * decl.cs (MemberCore): For generic classes, interfaces and
8261         structs, `Name' now includes the number of type parameters
8262         ("Stack!1.Node!1").
8263         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8264         encode the number of type arguments in the type name.
8265
8266         * expression.cs (Expression.MemberLookup): Removed the
8267         `num_type_args' argument; we now encode the number of type
8268         arguments in the type name.
8269
8270         * ecore.cs (SimpleName): Encode the number of type arguments in
8271         the type name itself.
8272
8273         * generic.cs (ConstructedType): Likewise.
8274
8275         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8276         `MemberName'; we now include the number of type parameters in the
8277         type name.
8278
8279         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8280         (TypeManager.MemberLookup): Removed the
8281         `num_type_args' argument; we now encode the number of type
8282         arguments in the type name.     
8283
8284 2004-04-03  Martin Baulig  <martin@ximian.com>
8285
8286         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8287         (MemberCore.MemberName): Moved here from MemberBase.
8288         (DeclSpace.SetParameterInfo): Just take the constraints as an
8289         ArrayList; we already have the type parameters in our
8290         `MemberName'; also do the CS0080 reporting here.
8291
8292         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8293         `IDENTIFIER opt_type_parameter_list'; when constructing our
8294         `MemberName', it'll already include our type parameters.
8295         (class_declaration, interface_declaration): Likewise.
8296         (delegate_declaration): Likewise.
8297         (MakeName): Take a MemberName and return a MemberName.
8298         The following two changes are required to avoid shift/reduce conflicts:
8299         (member_name): Don't include a TypeName anymore; ie. this is now
8300         just 'IDENTIFIER opt_type_parameter_list'.
8301         (property_declaration, event_declaration): Use a
8302         `namespace_or_type_name' instead of a `member_name'.            
8303
8304 2004-04-03  Martin Baulig  <martin@ximian.com>
8305
8306         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8307         `MemberName' class.
8308         (TypeName): Formerly known as MemberName.
8309
8310         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8311         instead of a `MemberName'.
8312
8313         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8314         (member_name): New rule; create a MemberName.
8315
8316 2004-04-02  Martin Baulig  <martin@ximian.com>
8317
8318         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8319         (CS0305 and CS0308).
8320
8321 2004-04-02  Martin Baulig  <martin@ximian.com>
8322
8323         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8324         support for nested types.
8325
8326 2004-04-02  Martin Baulig  <martin@ximian.com>
8327
8328         * ecore.cs (IAlias): New public interface.
8329         (TypeExpr, TypeExpression): Implement IAlias.
8330         (TypeAliasExpression): New public class.
8331
8332         * namespace.cs (Namespace): Implement IAlias.
8333         (Namespace.Lookup): Return an IAlias instead on an object.
8334         (Namespace.DefineName): Take an IAlias instead of an object.
8335         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8336         an object.
8337         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8338         Expression.
8339         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8340         object.
8341         (NamespaceEntry.Lookup): Likewise.
8342
8343         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8344         instead of a Type.      
8345
8346         * decl.cs (DeclSpace): Implement IAlias.
8347         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8348
8349         * generic.cs (ConstructedType): Improved error checking.
8350
8351 2004-04-02  Martin Baulig  <martin@ximian.com>
8352
8353         * convert.cs: Added type parameter conversions.
8354
8355         * ecore.cs
8356         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8357         (ClassCast.Emit): If the source type is a type parameter, box it.
8358         If the target type is a type parameter, emit an `unbox.any'
8359         instead of a `classcast'.1      
8360
8361 2004-04-01  Martin Baulig  <martin@ximian.com>
8362
8363         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8364
8365 2004-04-01  Martin Baulig  <martin@ximian.com>
8366
8367         * generic.cs (ConstructedType.CheckConstraints): Use
8368         Convert.ImplicitStandardConversionExists(); user-defined implicit
8369         conversions are not allowed according to the spec.
8370
8371 2004-03-30  Martin Baulig  <martin@ximian.com>
8372
8373         * expression.cs (New): Added support for type parameters.
8374
8375         * typemanager.cs
8376         (TypeManager.activator_type): New public static field.
8377         (TypeManager.activator_create_instance): Likewise.
8378
8379 2004-03-30  Martin Baulig  <martin@ximian.com>
8380
8381         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8382         public method.
8383
8384 2004-03-30  Martin Baulig  <martin@ximian.com>
8385
8386         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8387         the spec here: the argument type must be convertible to the
8388         constraints.
8389
8390 2004-03-30  Martin Baulig  <martin@ximian.com>
8391
8392         * generic.cs
8393         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8394         TypeManager.AddTypeParameter().
8395         (ConstructedType.CheckConstraints): Re-enable this and actually
8396         check whether we have a constructor constraint.
8397
8398         * typemanager.cs
8399         (TypeManager.builder_to_type_param): New static field.
8400         (TypeManager.AddTypeParameter): New static method.
8401         (TypeManager.LookupTypeParameter): New public method.
8402
8403 2004-03-30  Martin Baulig  <martin@ximian.com>
8404
8405         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8406         the new API to actually define the constructor constraint.
8407
8408         * typemanager.cs
8409         (TypeManager.new_constraint_attr_type): New static field.
8410         (TypeManager.InitCoreTypes): Initialize it.
8411
8412 2004-03-30  Martin Baulig  <martin@ximian.com>
8413
8414         * generic.cs (Constraints): Completed error checking, use correct
8415         error numbers.
8416
8417 2004-03-29  Martin Baulig  <martin@ximian.com>
8418
8419         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8420
8421         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8422         public version which takes a `ParameterData pd' instead of an
8423         `ArrayList args'.
8424
8425 2004-03-29  Martin Baulig  <martin@ximian.com>
8426
8427         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8428         not a MethodInfo.       
8429
8430 2004-03-29  Martin Baulig  <martin@ximian.com>
8431
8432         * expression.cs (Argument.ResolveMethodGroup): If we're a
8433         ConstructedType, call GetMemberAccess() on it.  
8434
8435 2004-03-29  Martin Baulig  <martin@ximian.com>
8436
8437         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8438         (MethodCore.CheckGenericOverride): When overriding a generic
8439         method, check whether the constraints match.
8440
8441         * support.cs (GenericConstraints): New public interface.
8442         (ParameterData.GenericConstraints): New public method.
8443
8444         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8445         method parameter and compute our constraints if appropriate.
8446         (Parameter.GenericConstraints): New public property.
8447
8448         * generic.cs (Constraints): Implement GenericConstraints.
8449
8450 2004-03-29  Martin Baulig  <martin@ximian.com>
8451
8452         * decl.cs (MemberCache.FindMemberToOverride): Use
8453         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8454
8455 2004-03-29  Martin Baulig  <martin@ximian.com>
8456
8457         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8458
8459 2004-03-29  Martin Baulig  <martin@ximian.com>
8460
8461         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8462         not allowed on non-generic declarations").
8463
8464 2004-03-29  Martin Baulig  <martin@ximian.com>
8465
8466         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8467         public version of this method.
8468
8469         * class.cs (MethodCore.IsDuplicateImplementation): Use
8470         Invocation.InferTypeArguments() to check this.
8471
8472 2004-03-29  Martin Baulig  <martin@ximian.com>
8473
8474         * convert.cs: Use TypeManager.IsDelegateType() instead of
8475         comparing types correctly.
8476
8477 2004-03-29  Martin Baulig  <martin@ximian.com>
8478
8479         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8480         types directly to make it work for generic instances.
8481
8482         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8483
8484 2004-03-29  Martin Baulig  <martin@ximian.com>
8485
8486         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8487         support for arrays.     
8488
8489 2004-03-24  Martin Baulig  <martin@ximian.com>
8490
8491         * decl.cs (DeclSpace.FindType): Also use
8492         TypeManager.CheckGeneric() for types from the using clauses.
8493
8494 2004-03-23  Martin Baulig  <martin@ximian.com>
8495
8496         * expression.cs (Invocation.OverloadResolve): Added `bool
8497         may_fail' argument and use it instead of the Location.IsNull() hack.
8498
8499 2004-03-23  Martin Baulig  <martin@ximian.com>
8500
8501         * expression.cs (Invocation.InferType): Use correct type inference
8502         rules here.     
8503
8504 2004-03-23  Martin Baulig  <martin@ximian.com>
8505
8506         * ecore.cs (MethodGroupExpr.Name): Use
8507         TypeManager.CSharpSignature() instead of just the name.
8508
8509         * expression.cs (Invocation.OverloadResolve): Provide better error
8510         reporting.
8511         (Invocation.DoResolve): OverloadResolve() never returns null
8512         without reporting an error, so removed the error -6 reporting here.
8513
8514 2004-03-23  Martin Baulig  <martin@ximian.com>
8515
8516         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8517         generic methods.
8518
8519         * cs-parser.jay (delegate_declaration): Support generic delegates.
8520
8521         * delegate.cs: Support generic delegates.
8522
8523 2004-03-22  Martin Baulig  <martin@ximian.com>
8524
8525         * expression.cs (Invocation.InferParamsTypeArguments): New static
8526         method; does type inference for params arguments.
8527
8528 2004-03-21  Martin Baulig  <martin@ximian.com>
8529
8530         * typemanager.cs (TypeManager.IsGenericMethod): New public static
8531         method; checks whether a method is a generic method.    
8532
8533         * expression.cs (Invocation.InferTypeArguments): New static method;
8534         infer type arguments for generic method invocation.
8535
8536         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8537         property; we set this to true if we're resolving a generic method
8538         invocation and the user specified type arguments, ie. we're not
8539         doing type inference.
8540
8541 2004-03-20  Martin Baulig  <martin@ximian.com>
8542
8543         * class.cs (MethodData.DeclaringType): New public property.
8544         (MethodData.Define): Set DeclaringType here.
8545         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8546         instead of OperatorMethodBuilder.DeclaringType.
8547
8548 2004-03-20  Martin Baulig  <martin@ximian.com>
8549
8550         * cs-tokenizer.cs (xtoken): Return a special
8551         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8552
8553         * cs-parser.jay (default_value_expression): Switch to the new
8554         syntax (14.5.13).
8555
8556 2004-03-19  Martin Baulig  <martin@ximian.com>
8557
8558         * decl.cs (MemberName): New class.  We use this to "construct"
8559         namespace_or_type_name's.
8560
8561         * generics.cs (TypeArguments.GetDeclarations): New public method;
8562         returns the type arguments as a string[] and reports a CS0081 if
8563         one of them is not an identifier.
8564
8565         * class.cs (MemberBase): The .ctor now takes the name as a
8566         MemberName instead of a string.
8567         (MemberBase.ExplicitInterfaceName): Changed type from string to
8568         Expression.
8569         (MemberBase.DoDefine): If we're an explicit implementation, the
8570         InterfaceType may be a generic instance.
8571
8572         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8573         (namespace_name): Call MemberName.GetName () to transform the
8574         MemberName into a string and ensure we don't have any type
8575         arguments.
8576         (type_name): Call MemberName.GetTypeExpression() to transfrom the
8577         MemberName into an expression.
8578         (method_header): Use namespace_or_type_name instead of member_name.     
8579
8580 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8581
8582         * rootcontext.cs: Add new types to the boot resolution.
8583
8584         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8585         MulticastDelegate is not allowed.
8586
8587         * typemanager.cs: Add new types to lookup: System.TypedReference
8588         and ArgIterator.
8589
8590         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8591         check for TypedReference or ArgIterator, they are not allowed. 
8592
8593         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8594         makes us properly catch 1510 in some conditions (see bug 56016 for
8595         details). 
8596
8597 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8598
8599         * CryptoConvert.cs: update from corlib version
8600         with endian fixes.
8601
8602 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8603
8604         * class.cs (Indexer.Define): Check indexername declaration
8605
8606 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8607
8608         * attribute.cs (IsClsCompliant): Fixed problem with handling
8609         all three states (compliant, not-compliant, undetected).
8610
8611 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8612
8613         * attribute.cs (Attribute): Location is now public.
8614         (Resolve): Store resolved arguments (pos_values) in attribute class.
8615         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8616         (GetClsCompliantAttributeValue): New method that gets
8617         CLSCompliantAttribute value.
8618         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8619         if exists else null.
8620         (AttributeTester): New class for CLS-Compliant verification routines.
8621
8622         * class.cs (Emit): Add CLS-Compliant verification.
8623         (Method.GetSignatureForError): Implemented.
8624         (Constructor.GetSignatureForError): Implemented
8625         (Constructor.HasCompliantArgs): Returns if constructor has
8626         CLS-Compliant arguments.
8627         (Constructor.Emit): Override.
8628         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8629         is needed to test only parameters.
8630         (FieldBase.GetSignatureForError): Implemented.
8631         (TypeContainer): New member for storing base interfaces.
8632         (TypeContainer.FindMembers): Search in base interfaces too.
8633
8634         * codegen.cs (GetClsComplianceAttribute): New method that gets
8635         assembly or module CLSCompliantAttribute value.
8636         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8637         for assembly.
8638         (ModuleClass.Emit): Add error 3012 test.
8639
8640         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8641
8642         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8643         state for all decl types.
8644         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8645         if CLS-Compliant tests are required.
8646         (IsClsCompliaceRequired): New method. Analyze whether code
8647         must be CLS-Compliant.
8648         (IsExposedFromAssembly): New method. Returns true when MemberCore
8649         is exposed from assembly.
8650         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8651         value or gets cached value.
8652         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8653         is explicitly marked with CLSCompliantAttribute.
8654         (IsIdentifierClsCompliant): New abstract method. This method is
8655         used to testing error 3005.
8656         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8657         for identifier and parameters CLS-Compliant testing.
8658         (VerifyClsCompliance): New method. The main virtual method for
8659         CLS-Compliant verifications.
8660         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8661         null. I don't know why is null (too many public members !).
8662         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8663         and get value of first CLSCompliantAttribute that found.
8664
8665         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8666         (VerifyClsCompliance): Override and add extra tests.
8667
8668         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8669         clscheck- disable CLS-Compliant verification event if assembly is has
8670         CLSCompliantAttribute(true).
8671
8672         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8673         ApllyAttribute is now called in emit section as in the other cases.
8674         Possible future Emit integration.
8675         (IsIdentifierClsCompliant): New override.
8676         (VerifyClsCompliance): New override.
8677         (GetEnumeratorName): Returns full enum name.
8678
8679         * parameter.cs (GetSignatureForError): Implemented.
8680
8681         * report.cs (WarningData): New struct for Warning message information.
8682         (LocationOfPreviousError): New method.
8683         (Warning): New method. Reports warning based on the warning table.
8684         (Error_T): New method. Reports error based on the error table.
8685
8686         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8687         verifications are done here.
8688
8689         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8690
8691         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8692         CLSCompliantAttribute.
8693         (all_imported_types): New member holds all imported types from other
8694         assemblies.
8695         (LoadAllImportedTypes): New method fills static table with exported types
8696         from all referenced assemblies.
8697         (Modules): New property returns all assembly modules.
8698
8699 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8700
8701         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8702         throwing a parser error.
8703
8704         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8705         which removes the hardcoded get_/set_ prefixes for properties, as
8706         IL allows for the properties to be named something else.  
8707
8708         Bug #56013
8709
8710         * expression.cs: Do not override operand before we know if it is
8711         non-null.  Fix 56207
8712
8713 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8714
8715         * typemanager.cs: support for pinned variables.
8716
8717 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8718
8719         * decl.cs, typemanager.cs: Avoid using an arraylist
8720         as a buffer if there is only one result set.
8721
8722 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8723
8724         * expression.cs: Make sure you cant call a static method
8725         with an instance expression, bug #56174.
8726
8727 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8728
8729         * class.cs (IsDuplicateImplementation): Improve error reporting to
8730         flag 663 (method only differs in parameter modifier).
8731
8732         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8733         in preprocessor directives.
8734
8735         * location.cs (LookupFile): Allow for the empty path.
8736
8737         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8738         better approach for some of that patch, but its failing with the
8739         CharSet enumeration.  For now try/catch will do.
8740
8741         * typemanager.cs: Do not crash if a struct does not have fields.
8742         Fixes 56150.
8743
8744 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8745
8746         * expression.cs: cs0213, cant fix a fixed expression.
8747         fixes 50231.
8748
8749 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8750
8751         * cs-parser.jay: detect invalid embeded statements gracefully.
8752         bug #51113.
8753
8754 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8755
8756         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8757         As a regex:
8758         s/
8759         the invocation type may not be a subclass of the tye of the item/
8760         The type of the item must be a subclass of the invocation item.
8761         /g
8762
8763         Fixes bug #50820.
8764
8765 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8766
8767         * attribute.cs: Added methods to get a string and a bool from an
8768         attribute. Required to information from AssemblyKeyFileAttribute,
8769         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8770         * codegen.cs: Modified AssemblyName creation to include support for
8771         strongnames. Catch additional exceptions to report them as CS1548.
8772         * compiler.csproj: Updated include CryptoConvert.cs.
8773         * compiler.csproj.user: Removed file - user specific configuration.
8774         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8775         Mono.Security assembly. The original class is maintained and tested in
8776         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8777         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8778         like CSC 8.0 (C# v2) supports.
8779         * Makefile: Added CryptoConvert.cs to mcs sources.
8780         * rootcontext.cs: Added new options for strongnames.
8781
8782 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8783
8784         * driver.cs: For --expect-error, report error code `2'
8785         if the program compiled with no errors, error code `1' if
8786         it compiled with an error other than the one expected.
8787
8788 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8789
8790         * compiler.csproj: Updated for Visual Studio .NET 2003.
8791         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8792         * compiler.sln: Updated for Visual Studio .NET 2003.
8793
8794 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8795
8796         * expression.cs: Fix bug #47234. We basically need to apply the
8797         rule that we prefer the conversion of null to a reference type
8798         when faced with a conversion to 'object' (csc behaviour).
8799
8800 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8801
8802         * statement.cs: Shorter form for foreach, eliminates
8803         a local variable. r=Martin.
8804
8805 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8806
8807         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8808         checks if we can use brtrue/brfalse to test for 0.
8809         * expression.cs: use the above in the test for using brtrue/brfalse.
8810         cleanup code a bit.
8811
8812 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8813
8814         * expression.cs: Rewrite string concat stuff. Benefits:
8815
8816         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8817         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8818         rather than a concat chain.
8819
8820         * typemanager.cs: Add lookups for more concat overloads.
8821
8822 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8823
8824         * expression.cs: Emit shorter il code for array init.
8825
8826         newarr
8827         dup
8828         // set 1
8829
8830         // set 2
8831
8832         newarr
8833         stloc.x
8834
8835         ldloc.x
8836         // set 1
8837
8838         ldloc.x
8839         // set 2
8840
8841 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8842
8843         * statement.cs: Before, two switch blocks would be merged if the
8844         total size of the blocks (end_item - begin_item + 1) was less than
8845         two times the combined sizes of the blocks.
8846
8847         Now, it will only merge if after the merge at least half of the
8848         slots are filled.
8849
8850         fixes 55885.
8851
8852 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8853
8854         * class.cs : csc build fix for GetMethods(). See bug #52503.
8855
8856 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8857
8858         * expression.cs: Make sure fp comparisons work with NaN.
8859         This fixes bug #54303. Mig approved this patch a long
8860         time ago, but we were not able to test b/c the runtime
8861         had a related bug.
8862
8863 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8864
8865         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8866
8867 2004-03-19  Martin Baulig  <martin@ximian.com>
8868
8869         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8870         two overloads may unify for some type parameter substitutions and
8871         report a CS0408 if appropriate.
8872
8873 2004-03-19  Martin Baulig  <martin@ximian.com>
8874
8875         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8876         error here and not in our caller.
8877
8878 2004-03-19  Martin Baulig  <martin@ximian.com>
8879
8880         * interface.cs: Completely killed this file.
8881         (Interface): We're now a TypeContainer and live in class.cs.
8882
8883         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8884         argument; we're now also called for interfaces.
8885         (TypeContainer.DefineMembers): Allow this method being called
8886         multiple times.
8887         (TypeContainer.GetMethods): New public method; formerly known as
8888         Interface.GetMethod().  This is used by PendingImplementation.
8889         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8890         it's now private and non-static.
8891         (Interface): Moved this here; it's now implemented similar to
8892         Class and Struct.
8893         (Method, Property, Event, Indexer): Added `bool is_interface'
8894         argument to their .ctor's.
8895         (MemberBase.IsInterface): New public field.
8896
8897         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8898         instances instead of InterfaceMethod, InterfaceProperty, etc.
8899         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8900         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8901
8902 2004-03-19  Martin Baulig  <martin@ximian.com>
8903
8904         * class.cs (MethodCore.IsDuplicateImplementation): New private
8905         method which does the CS0111 checking.
8906         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8907         Use IsDuplicateImplementation().
8908
8909 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8910
8911         * decl.cs (FindMemberToOverride): New method to find the correct
8912         method or property to override in the base class.
8913         * class.cs
8914             - Make Method/Property use the above method to find the
8915               version in the base class.
8916             - Remove the InheritableMemberSignatureCompare as it is now
8917               dead code.
8918
8919         This patch makes large code bases much faster to compile, as it is
8920         O(n) rather than O(n^2) to do this validation.
8921
8922         Also, it fixes bug 52458 which is that nested classes are not
8923         taken into account when finding the base class member.
8924
8925         Reviewed/Approved by Martin.
8926
8927 2004-03-17  Martin Baulig  <martin@ximian.com>
8928
8929         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8930         of type arguments into account; use the `real_num_type_args'
8931         approach like in DoResolveAsTypeStep().
8932
8933         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8934         nested types.
8935
8936 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8937
8938         * interface.cs: In all interface classes removed redundant
8939         member initialization.
8940
8941 2004-03-16  Martin Baulig  <martin@ximian.com>
8942
8943         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8944
8945 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8946
8947         * decl.cs (DefineTypeAndParents): New helper method to define a
8948         type's containers before the type itself is defined;  This is a
8949         bug exposed by the recent changes to Windows.Forms when an
8950         implemented interface was defined inside a class that had not been
8951         built yet.   
8952
8953         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8954
8955         (Check): Loop correctly to report errors modifiers
8956         (UNSAFE was not in the loop, since it was the same as TOP).
8957
8958         * interface.cs: Every interface member now takes a ModFlags,
8959         instead of a "is_new" bool, which we set on the base MemberCore. 
8960
8961         Every place where we called "UnsafeOk" in the interface, now we
8962         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8963         the unsafe settings from the member declaration instead of the
8964         container interface. 
8965
8966         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8967
8968         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8969         `set_indexer_name' to the pending bits (one per type).
8970
8971         We fixed a bug today that was picking the wrong method to
8972         override, since for properties the existing InterfaceMethod code
8973         basically ignored the method name.  Now we make sure that the
8974         method name is one of the valid indexer names.
8975
8976 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8977  
8978         * support.cs (SeekableStreamReader): Keep track of stream byte
8979         positions and don't mix them with character offsets to the buffer.
8980
8981         Patch from Gustavo Giráldez
8982
8983 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8984
8985         * interface.cs (InterfaceSetGetBase): Removed double member
8986         initialization, base class does it as well.
8987
8988 2004-03-13  Martin Baulig  <martin@ximian.com>
8989
8990         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8991         when compiling corlib.
8992
8993 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8994
8995         * convert.cs (ExplicitConversion): We were reporting an error on
8996         certain conversions (object_type source to a value type, when the
8997         expression was `null') before we had a chance to pass it through
8998         the user defined conversions.
8999
9000         * driver.cs: Replace / and \ in resource specifications to dots.
9001         Fixes 50752
9002
9003         * class.cs: Add check for duplicate operators.  Fixes 52477
9004
9005 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9006
9007         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9008         that are in the middle of the statements, not only at the end.
9009         Fixes #54987
9010
9011         * class.cs (TypeContainer.AddField): No longer set the
9012         `HaveStaticConstructor' flag, now we call it
9013         `UserDefineStaticConstructor' to diferentiate the slightly
9014         semantic difference.
9015
9016         The situation is that we were not adding BeforeFieldInit (from
9017         Modifiers.TypeAttr) to classes that could have it.
9018         BeforeFieldInit should be set to classes that have no static
9019         constructor. 
9020
9021         See:
9022
9023         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9024
9025         And most importantly Zoltan's comment:
9026
9027         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9028
9029         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9030          before its static fields are used', i.e. initialization does not need
9031          to be triggered by the first access to the type. Setting this flag
9032          helps the JIT to compile better code, since it can run the static
9033          constructor at JIT time, and does not need to generate code to call it
9034          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9035          this flag for lots of classes like String. 
9036          
9037          csc sets this flag if the type does not have an explicit static 
9038          constructor. The reasoning seems to be that if there are only static
9039          initalizers for a type, and no static constructor, then the programmer
9040          does not care when this initialization happens, so beforefieldinit
9041          can be used.
9042          
9043          This bug prevents the AOT compiler from being usable, since it 
9044          generates so many calls to mono_runtime_class_init that the AOT code
9045          is much slower than the JITted code. The JITted code is faster, 
9046          because it does not generate these calls if the vtable is type is
9047          already initialized, which is true in the majority of cases. But the
9048          AOT compiler can't do this."
9049
9050 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9051
9052         * class.cs (MethodData.Emit): Refactor the code so symbolic
9053         information is generated for destructors;  For some reasons we
9054         were taking a code path that did not generate symbolic information
9055         before. 
9056
9057 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9058
9059         * class.cs: Create a Constructor.CheckBase method that
9060         takes care of all validation type code. The method
9061         contains some code that was moved from Define.
9062
9063         It also includes new code that checks for duplicate ctors.
9064         This fixes bug #55148.
9065
9066 2004-03-09  Joshua Tauberer <tauberer@for.net>
9067
9068         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9069         a { ... }-style array creation invokes EmitStaticInitializers
9070         which is not good for reference-type arrays.  String, decimal
9071         and now null constants (NullCast) are not counted toward
9072         static initializers.
9073
9074 2004-03-05  Martin Baulig  <martin@ximian.com>
9075
9076         * location.cs (SourceFile.HasLineDirective): New public field;
9077         specifies whether the file contains or is referenced by a "#line"
9078         directive.
9079         (Location.DefineSymbolDocuments): Ignore source files which
9080         either contain or are referenced by a "#line" directive.        
9081
9082 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9083
9084         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9085         direct access to our parent, so check the method inline there.
9086
9087 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9088
9089         * expression.cs (Invocation.EmitCall): Miguel's last commit
9090         caused a regression. If you had:
9091
9092             T t = null;
9093             t.Foo ();
9094
9095         In Foo the implict this would be null.
9096
9097 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9098
9099         * expression.cs (Invocation.EmitCall): If the method is not
9100         virtual, do not emit a CallVirt to it, use Call.
9101
9102         * typemanager.cs (GetFullNameSignature): Improve the method to
9103         cope with ".ctor" and replace it with the type name.
9104
9105         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9106         as an argument the ConstructorBuilder where it is being defined,
9107         to catch the recursive constructor invocations.
9108
9109 2004-03-16  Martin Baulig  <martin@ximian.com>
9110
9111         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9112         ConstructedType, call ResolveType() on it to get the type rather
9113         than just using `expr.Type'.
9114
9115 2004-03-16  Martin Baulig  <martin@ximian.com>
9116
9117         * generics.cs (ConstructedType.GetMemberAccess): Take the
9118         EmitContext instead on the TypeExpr and use
9119         ec.TypeContainer.CurrentType/ec.ContainerType.
9120
9121 2004-03-16  Martin Baulig  <martin@ximian.com>
9122
9123         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9124         parameters before aliases.
9125
9126 2004-03-16  Martin Baulig  <martin@ximian.com>
9127
9128         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9129         New oublic function; checks whether two generic instances may become
9130         equal under some instantiations (26.3.1).
9131
9132         * class.cs (TypeContainer.Define): Call
9133         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9134         error.
9135
9136 2004-03-16  Martin Baulig  <martin@ximian.com>
9137
9138         * class.cs (TypeContainer.GetClassBases): Moved
9139         Error_TypeParameterAsBase() here and also check whether the base
9140         class is not an attribute.
9141
9142 2004-03-16  Martin Baulig  <martin@ximian.com>
9143
9144         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9145
9146 2004-03-16  Martin Baulig  <martin@ximian.com>
9147
9148         * class.cs (Error_TypeParameterAsBase): Use correct error number
9149         here (CS0689).  
9150
9151 2004-03-16  Martin Baulig  <martin@ximian.com>
9152
9153         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9154         for generics.
9155
9156         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9157         error reporting.
9158
9159 2004-03-15  Martin Baulig  <martin@ximian.com>
9160
9161         * typemanager.cs (TypeManager.GetFullName): New public method.
9162         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9163         argument; only return members with the correct number of type
9164         arguments.
9165         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9166         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9167         whether the number of type arguments matches.
9168
9169         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9170         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9171
9172         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9173         field; it's set by the protected .ctor when we're actually a
9174         GenericMemberAccess.
9175         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9176         arguments and pass it to MemberLookupFinal ().
9177
9178         * ecore.cs (Expression.MemberLookup): Added `int
9179         num_type_arguments' argument; only return members with the correct
9180         number of type arguments.
9181         (Expression.MemberLookupFailed): Check whether the MemberLookup
9182         failed because we did not have the correct number of type
9183         arguments; report CS0305 in this case.
9184
9185         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9186         `e.ResolveAsTypeTerminal()' already did so.
9187
9188 2004-03-15  Martin Baulig  <martin@ximian.com>
9189
9190         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9191         we're a ConstructedType; in this case, the caller must report an
9192         error (for instance CS0131).
9193
9194         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9195         (TypeArguments.Resolve): Actually report errors here.
9196
9197 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9198
9199         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9200         `set_indexer_name' to the pending bits (one per type).
9201
9202         We fixed a bug today that was picking the wrong method to
9203         override, since for properties the existing InterfaceMethod code
9204         basically ignored the method name.  Now we make sure that the
9205         method name is one of the valid indexer names.
9206
9207 2004-03-15  Martin Baulig  <martin@ximian.com>
9208
9209         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9210         for generic instances.
9211
9212 2004-03-13  Martin Baulig  <martin@ximian.com>
9213
9214         * class.cs (TypeContainer.DefineType): Call
9215         TypeManager.AddUserType() immediately after creating the
9216         TypeBuilder; pass all type parameters when creating the
9217         CurrentType.
9218
9219         * decl.cs (DeclSpace.FindNestedType): New public method.
9220         (DeclSpace.FindType): Added `int num_type_args' argument; only
9221         return types with the correct number of type parameters.
9222         (DeclSpace.CountTypeParams): New public property.
9223
9224         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9225         the number of type parameters; defaults to zero.
9226
9227         * generic.cs (TypeArguments.Count): New public property.
9228         (ConstructedType.DoResolveAsTypeStep): First call
9229         ds.FindNestedType() to find out whether we're nested in the
9230         current generic type; in this case, we inherit all type parameters
9231         from the current class.
9232
9233         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9234         num_type_args' argument.
9235         (RootContext.LookupType): Added overloaded version which takes the
9236         number of type arguments; only return types with the correct
9237         number of type arguments.
9238
9239         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9240         checks whether `Type t' has `int num_type_args'.
9241
9242 2004-03-13  Martin Baulig  <martin@ximian.com>
9243
9244         * generic.cs (GenericMethod.DefineType): New method; calls
9245         DefineType() on all the type parameters.
9246
9247         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9248         (MethodData.Define): If we're a generic method, call
9249         GenericMethod.DefineType() to define the type parameters.       
9250
9251 2004-03-10  Martin Baulig  <martin@ximian.com>
9252
9253         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9254         instead of IsAssignableFrom.    
9255
9256 2004-03-10  Martin Baulig  <martin@ximian.com>
9257
9258         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9259
9260         * support.cs (ParameterData.HasArrayParameter): New property.
9261         (ReflectionParameters.ctor): Take a MethodBase instead of a
9262         ParameterInfo[].  If we have any type parameters, get the generic
9263         method definition and ask it whether we have variable arguments.
9264
9265 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9266
9267         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9268         routines to check if a type is an enumerable/enumerator allow
9269         classes that implement the IEnumerable or IEnumerator interfaces.
9270
9271         * class.cs (Property, Operator): Implement IIteratorContainer, and
9272         implement SetYields.
9273
9274         (Property.Define): Do the block swapping for get_methods in the
9275         context of iterators.   We need to check if Properties also
9276         include indexers or not.
9277
9278         (Operator): Assign the Block before invoking the
9279         OperatorMethod.Define, so we can trigger the Iterator code
9280         replacement. 
9281
9282         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9283         Property and Operator classes are not created when we parse the
9284         declarator but until we have the block completed, so we use a
9285         singleton SimpleIteratorContainer.Simple to flag whether the
9286         SetYields has been invoked.
9287
9288         We propagate this setting then to the Property or the Operator to
9289         allow the `yield' to function.
9290
9291 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9292
9293         * codegen.cs: Implemented attribute support for modules.
9294         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9295         Assembly/Module functionality.
9296
9297         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9298         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9299         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9300
9301 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9302
9303         * interface.cs (FindMembers): The operation is performed on all base
9304         interfaces and not only on the first. It is required for future CLS Compliance patch.
9305
9306 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9307
9308         * statement.cs, codegen.cs:
9309         This patch deals with patterns such as:
9310
9311         public class List : IEnumerable {
9312
9313                 public MyEnumerator GetEnumerator () {
9314                         return new MyEnumerator(this);
9315                 }
9316
9317                 IEnumerator IEnumerable.GetEnumerator () {
9318                         ...
9319                 }
9320                 
9321                 public struct MyEnumerator : IEnumerator {
9322                         ...
9323                 }
9324         }
9325
9326         Before, there were a few things we did wrong:
9327         1) we would emit callvirt on a struct, which is illegal
9328         2) we emited ldarg when we needed to emit ldarga
9329         3) we would mistakenly call the interface methods on an enumerator
9330         type that derived from IEnumerator and was in another assembly. For example:
9331
9332         public class MyEnumerator : IEnumerator
9333
9334         Would have the interface methods called, even if there were public impls of the
9335         method. In a struct, this lead to invalid IL code.
9336
9337 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9338
9339         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9340           renamed to Emit.
9341
9342         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9343
9344 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9345
9346         * cs-parser.jay: Fix small regression: we were not testing V2
9347         compiler features correctly.
9348
9349         * interface.cs: If the emit context is null, then create one
9350
9351 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9352
9353         * decl.cs (GetSignatureForError): New virtual method to get full name
9354           for error messages.
9355
9356         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9357           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9358
9359         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9360           Duplicated members and code in these classes has been removed.
9361           Better encapsulation in these classes.
9362
9363 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * assign.cs (Assign.DoResolve): When dealing with compound
9366         assignments, there is a new rule in ECMA C# 2.4 (might have been
9367         there before, but it is documented here) that states that in:
9368
9369         a op= b;
9370
9371         If b is of type int, and the `op' is a shift-operator, then the
9372         above is evaluated as:
9373
9374         a = (int) a op b 
9375
9376         * expression.cs (Binary.ResolveOperator): Instead of testing for
9377         int/uint/long/ulong, try to implicitly convert to any of those
9378         types and use that in pointer arithmetic.
9379
9380         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9381         method to print information for from the type, not from the
9382         null-method we were given.
9383
9384 2004-02-01  Duncan Mak  <duncan@ximian.com>
9385
9386         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9387         parsing for cmd, fixes bug #53694.
9388
9389 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9390
9391         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9392         in the member name duplication tests. Property and operator name duplication
9393         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9394
9395 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9396
9397         * interface.cs (PopulateMethod): Fixed crash when interface method
9398         returns not existing type (error test cs0246-3.cs).
9399
9400 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9401
9402         * cs-parser.jay (interface_accessors): Re-write actions to also
9403         store attributes attached to get and set methods. Fix spelling
9404         while at it.
9405
9406         (inteface_property_declaration): Modify accordingly.
9407
9408         (InterfaceAccessorInfo): New helper class to store information to pass
9409         around between rules that use interface_accessors.
9410
9411         * interface.cs (Emit): Apply attributes on the get and set
9412         accessors of properties and indexers too.
9413
9414         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9415         right MethodBuilder when applying attributes to the get and set accessors.
9416
9417 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9418
9419         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9420
9421 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9422
9423         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9424
9425 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9426
9427         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9428         changes that treat `yield' specially when present before `break'
9429         or `return' tokens.
9430
9431         * cs-tokenizer.cs: yield is no longer a keyword.
9432
9433 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9434
9435         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9436         setting for default constructors.
9437         For default constructors are almost every time set wrong Modifier. The
9438         generated IL code has been alright. But inside mcs this values was
9439         wrong and this was reason why several of my CLS Compliance tests
9440         failed.
9441
9442 2004-02-27  Martin Baulig  <martin@ximian.com>
9443
9444         * generics.cs (ConstructedType.ResolveType): Make the nested type
9445         stuff actually work.
9446
9447 2004-02-25  Martin Baulig  <martin@ximian.com>
9448
9449         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9450         property; returns the type parameters just from the current type,
9451         ie. with the ones from outer classes.
9452         (DeclSpace.LookupGeneric): First search in the current class, then
9453         in outer classes.
9454         (DeclSpace.initialize_type_params): When hiding a type parameter
9455         from an outer class, put it into the `type_param_list' anyways.
9456
9457         * expression.cs (MemberAccess.expr): Made this field protected.
9458
9459         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9460         the type parameters from the current class.
9461
9462         * generic.cs (ConstructedType.ResolveType): Support nested generic
9463         types by taking the type parameters which we inherit from outer
9464         classes into account.
9465         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9466         support for nested generic types.
9467
9468 2004-02-23  Martin Baulig  <martin@ximian.com>
9469
9470         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9471         field and check whether we're nested inside a generic type.
9472         (DeclSpace.ResolveType): If we're resolving to a generic type
9473         definition, create a ConstructedType and return its resolved type.
9474         (DeclSpace.initialize_type_params): New private method;
9475         initializes the `type_param_list' field from the type parameters
9476         from this and all enclosing classes.
9477         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9478         we're already initialized.
9479
9480 2004-02-23  Martin Baulig  <martin@ximian.com>
9481
9482         * class.cs (Method.Define): Create the generic method before
9483         calling DoDefine().
9484         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9485         the TypeContainer one); we use this for generic methods.
9486
9487         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9488         parent's TypeBuilder.
9489
9490 2004-02-18  Martin Baulig  <martin@ximian.com>
9491
9492         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9493         to check for equality.
9494
9495 2004-02-05  Martin Baulig  <martin@ximian.com>
9496
9497         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9498         `ec.TypeContainer.CurrentType', use it instead of
9499         `ec.ContainerType' to check whether we're in the type's ctor.
9500
9501 2004-01-29  Martin Baulig  <martin@ximian.com>
9502
9503         * expression.cs (Invocation.DoResolve): If we're a
9504         `ConstructedType', then we're actually a generic method, so
9505         rewrite the expr as a GenericMemberAccess.
9506
9507         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9508         here; manually parse it into a string.
9509
9510 2004-01-28  Martin Baulig  <martin@ximian.com>
9511
9512         * typemanager.cs (TypeManager.IsEqual): New static method.
9513         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9514         check for equality instead of using `=='.
9515
9516 2004-01-26  Martin Baulig  <martin@ximian.com>
9517
9518         * decl.cs (DeclSpace.CurrentType): New public field.
9519
9520         * expression.cs (This.ResolveBase): If we have an
9521         `ec.TypeContainer.CurrentType', use it instead of
9522         `ec.ContainerType'.
9523
9524         * class.cs (TypeContainer.DefineType): If we're a generic type,
9525         create the `CurrentType' (unresolved).
9526         (TypeContainer.GenericType): New private field.
9527         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9528         it and store it in `GenericType' before creating the MemberCache.
9529         (TypeContainer.GetMembers): If we have a `GenericType', call
9530         TypeManager.FindMembers() on it.
9531
9532         * interface.cs (Interface.GenericType): New private field.
9533         (Interface.DefineType): If we're a generic type, create the
9534         `CurrentType' (unresolved).
9535         (Interface.DefineMembers): If we have a `CurrentType', resolve it
9536         and store it in `GenericType' before creating the MemberCache.
9537         (Interface.GetMembers): If we have a `GenericType', call
9538         TypeManager.FindMembers() on it.
9539
9540 2004-01-22  Martin Baulig  <martin@ximian.com>
9541
9542         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9543         not a QualifiedIdentifier.  This is what `type_name_expression'
9544         was previously doing.
9545         (type_name_expression): Removed; the code is now in
9546         `namespace_or_type_name'.
9547         (qualified_identifier): Removed, use `namespace_or_type_name'
9548         instead.
9549         (QualifiedIdentifier): Removed this class.      
9550
9551 2004-01-22  Martin Baulig  <martin@ximian.com>
9552
9553         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9554         not a string as alias name.
9555
9556 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9557
9558         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9559         #52730 bug, and instead compute correctly the need to use a
9560         temporary variable when requesting an address based on the
9561         static/instace modified of the field and the constructor.
9562  
9563 2004-01-21  Martin Baulig  <martin@ximian.com>
9564
9565         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9566         class and namespace before looking up aliases.  Fixes #52517.
9567
9568 2004-01-21  Martin Baulig  <martin@ximian.com>
9569
9570         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9571         assinged in a 'try'; fixes exception4.cs.
9572
9573 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9574         * class.cs : Implemented parameter-less constructor for TypeContainer
9575
9576         * decl.cs: Attributes are now stored here. New property OptAttributes
9577
9578         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9579
9580         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9581
9582 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9583
9584         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9585           (CSharpSignature): New method for indexer and property signature.
9586
9587 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9588
9589         * pending.cs (IsVirtualFilter): Faster implementation.
9590
9591 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9592
9593         * typemanager.cs: Avoid inclusion of same assembly more than once.
9594
9595 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9596
9597         * cs-parser.jay: Fixed problem where the last assembly attribute
9598           has been applied also to following declaration (class, struct, etc.)
9599           
9600 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9601
9602         * class.cs: Added error CS0538, CS0539 reporting.
9603         Fixed crash on Microsoft runtime when field type is void.
9604
9605         * cs-parser.jay: Added error CS0537 reporting.
9606
9607         * pending.cs: Added error CS0535 reporting.
9608         Improved error report for errors CS0536, CS0534.
9609
9610 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9611
9612         Merge a few bits from the Anonymous Method MCS tree.
9613
9614         * statement.cs (ToplevelBlock): New class for toplevel methods,
9615         will hold anonymous methods, lifted variables.
9616
9617         * cs-parser.jay: Create toplevel blocks for delegates and for
9618         regular blocks of code. 
9619
9620 2004-01-20  Martin Baulig  <martin@ximian.com>
9621
9622         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9623         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9624         and `NeedExplicitReturn'; added `IsLastStatement'.
9625         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9626         have a `ReturnLabel' or we're not unreachable.
9627
9628         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9629         child's reachability; don't just override ours with it.  Fixes
9630         #58058 (lluis's example).
9631         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9632         InFinally(), InLoop(), InSwitch() and
9633         BreakCrossesTryCatchBoundary() methods.
9634
9635         * statement.cs (Return): Do all error checking in Resolve().
9636         Unless we are the last statement in a top-level block, always
9637         create a return label and jump to it.
9638         (Break, Continue): Do all error checking in Resolve(); also make
9639         sure we aren't leaving a `finally'.
9640         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9641         statement in a top-level block.
9642         (Block.Flags): Added `IsDestructor'.
9643         (Block.IsDestructor): New public property.
9644
9645 2004-01-20  Martin Baulig  <martin@ximian.com>
9646
9647         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9648
9649 2004-01-20  Martin Baulig  <martin@ximian.com>
9650
9651         * statement.cs (Statement.ResolveUnreachable): New public method.
9652         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9653         (Block.Resolve): Resolve unreachable statements.
9654
9655 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9656
9657         * expression.cs: We need to fix the case where we do
9658         not have a temp variable here.
9659
9660         * assign.cs: Only expression compound assignments need
9661         temporary variables.
9662
9663 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9664
9665         * flowanalysis.cs: Reduce memory allocation in a few ways:
9666           - A block with no variables should not allocate a bit
9667             vector for itself.
9668           - A method with no out parameters does not need any tracking
9669             for assignment of the parameters, so we need not allocate
9670             any data for it.
9671           - The arrays:
9672                 public readonly Type[] VariableTypes;
9673                 public readonly string[] VariableNames;
9674             Are redundant. The data is already stored in the variable
9675             map, so we need not allocate another array for it.
9676           - We need to add alot of checks for if (params | locals) == null
9677             due to the first two changes.
9678
9679 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9680
9681         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9682         implement IMemoryLocation, we store a copy on a local variable and
9683         take the address of it.  Patch from Benjamin Jemlich
9684
9685         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9686         to use a special "type_name_expression" rule which reduces the
9687         number of "QualifiedIdentifier" classes created, and instead
9688         directly creates MemberAccess expressions.
9689
9690 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9691
9692         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9693         that fixes #52853.  Null literal assignment to ValueType
9694
9695         * class.cs (MethodData.Emit): Instead of checking the name of the
9696         method to determine if its a destructor, create a new derived
9697         class from Method called Destructor, and test for that.  
9698
9699         * cs-parser.jay: Create a Destructor object instead of a Method.  
9700
9701         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9702
9703         Fixes: 52933
9704
9705 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9706
9707         * expression.cs (Binary.ResolveOperator): Perform an implicit
9708         conversion from MethodGroups to their delegate types on the
9709         Addition operation.
9710
9711         * delegate.cs: Introduce a new class DelegateCreation that is the
9712         base class for `NewDelegate' and `ImplicitDelegateCreation',
9713         factor some code in here.
9714
9715         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9716         conversion from MethodGroups to compatible delegate types. 
9717
9718         * ecore.cs (Expression.Resolve): Do not flag error 654
9719         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9720         we allow conversions from MethodGroups to delegate types now.
9721
9722         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9723         assignments in v2 either.
9724
9725 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9726
9727         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9728         static read-only fields in ctors.
9729
9730         Applied patch from Benjamin Jemlich 
9731
9732         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9733
9734 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9735
9736         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9737         here to return true, as they can be used like this:
9738
9739                 (XXX) int.MEMBER ()
9740
9741         Fixed 49836 and all the other dups
9742
9743 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9744
9745         * driver.cs: Implement /win32res and /win32icon.
9746
9747 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9748
9749         * cs-parser.jay: Add a rule to improve error handling for the
9750         common mistake of placing modifiers after the type.
9751
9752 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * cs-parser.jay (interface_event_declaration): Catch
9755         initialization of events on interfaces, and report cs0068
9756
9757         * cs-parser.jay (interface_event_declaration): Catch
9758         initialization of events. 
9759
9760         * ecore.cs: Better report missing constructors.
9761
9762         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9763         the error reporting done in the wrong place.  Fix.
9764
9765         * expression.cs (Binary.ResolveOperator): Catch the 
9766         operator + (E x, E y) error earlier, and later allow for implicit
9767         conversions in operator +/- (E e, U x) from U to the underlying
9768         type of E.
9769
9770         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9771         52596, if the container class is abstract, the default constructor
9772         is protected otherwise its public (before, we were always public).
9773
9774         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9775         fixed statement.
9776
9777         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9778         Jemlich that fixes bug #52597, MCS was generating invalid code for
9779         idisposable structs.   Thanks to Ben for following up with this
9780         bug as well.
9781
9782 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9783
9784         * driver.cs: Allow assemblies without code to be generated, fixes
9785         52230.
9786
9787 2004-01-07  Nick Drochak <ndrochak@gol.com>
9788
9789         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9790
9791 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9792
9793         * cs-parser.jay: Add rules to improve error reporting if fields or
9794         methods are declared at the namespace level (error 116)
9795
9796         * Add rules to catch event add/remove
9797
9798 2004-01-04  David Sheldon <dave-mono@earth.li>
9799
9800   * expression.cs: Added matching ")" to error message for 
9801   CS0077
9802
9803 2004-01-03 Todd Berman <tberman@gentoo.org>
9804
9805         * ecore.cs, attribute.cs:
9806         Applying fix from #52429.
9807
9808 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9809
9810         * ecore.cs, expression.cs, statement.cs:
9811         Total rewrite of how we handle branching. We
9812         now handle complex boolean expressions with fewer
9813         jumps. As well if (x == 0) no longer emits a ceq.
9814
9815         if (x is Foo) is much faster now, because we generate
9816         better code.
9817
9818         Overall, we get a pretty big improvement on our benchmark
9819         tests. The code we generate is smaller and more readable.
9820
9821         I did a full two-stage bootstrap. The patch was reviewed
9822         by Martin and Miguel.
9823
9824 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9825
9826         * cs-parser.jay: Make primary_expression not take a QI.
9827         we dont need this because the member_access rule covers
9828         us here. So we replace the rule with just IDENTIFIER.
9829
9830         This has two good effects. First, we remove a s/r conflict.
9831         Second, we allocate many fewer QualifiedIdentifier objects.
9832
9833 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9834
9835         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9836         set the correct information via SRE. This prevents
9837         hanging on the MS runtime. Fixes #29374.
9838
9839 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9840
9841         * convert.cs: correctly handle conversions to value types
9842         from Enum and ValueType as unboxing conversions.
9843
9844         Fixes bug #52569. Patch by Benjamin Jemlich.
9845
9846 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9847
9848         * expression.cs (BetterConversion): Prefer int -> uint
9849         over int -> ulong (csc's behaviour). This fixed bug #52046.
9850
9851 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9852
9853         * decl.cs (MemberCache.FindMembers): now returns a
9854         MemberInfo [].
9855
9856         * typemanager.cs: In general, go with with ^^.
9857         (CopyNewMethods): take an IList.
9858         (RealMemberLookup): Only allocate an arraylist
9859         if we copy from two sets of methods.
9860
9861         This change basically does two things:
9862         1) Fewer array lists allocated due to CopyNewMethods.
9863         2) the explicit cast in MemberList costed ALOT.
9864
9865 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9866
9867         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9868         a hashtable to avoid needless string allocations when an identifier is
9869         used more than once (the common case).
9870
9871 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9872
9873         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9874         is broken, it will not return anything. So, we
9875         have to use the information we have in mcs to
9876         do the task.
9877
9878         * typemanager.cs: Add a cache for GetInterfaces,
9879         since this will now be used more often (due to ^^)
9880
9881         (GetExplicitInterfaces) New method that gets the
9882         declared, not effective, interfaces on a type
9883         builder (eg, if you have interface IFoo, interface
9884         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9885         { IBar }.
9886
9887         This patch makes MCS able to bootstrap itself on
9888         Windows again.
9889
9890 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9891
9892         * expression.cs: Remove the Nop's that Miguel put
9893         in by mistake.
9894
9895 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9896
9897         * report.cs, codegen.cs: Give the real stack trace to
9898         the error when an exception is thrown.
9899
9900 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9901
9902         * decl.cs: only allocate hashtables for ifaces if 
9903         it is an iface!
9904
9905 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9906
9907         * expression.cs: fix the error from cs0121-2.cs
9908         (a parent interface has two child interfaces that
9909         have a function with the same name and 0 params
9910         and the function is called through the parent).
9911
9912 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9913
9914         * class.cs, rootcontext.cs, typmanager.cs: do not
9915         leak pointers.
9916
9917 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9918
9919         * codegen.cs: remove stack for the ec flow branching.
9920         It is already a linked list, so no need.
9921
9922 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9923
9924         * Makefile: Allow custom profiler here.
9925
9926 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9927
9928         * typemanager.cs (LookupType):
9929           - Use a static char [], because split takes
9930             a param array for args, so it was allocating
9931             every time.
9932           - Do not store true in a hashtable, it boxes.
9933
9934 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9935
9936         * flowanalysis.cs: bytify common enums.
9937
9938 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9939
9940         * modifiers.cs: Add a new set of flags for the
9941         flags allowed on explicit interface impls.
9942         * cs-parser.jay: catch the use of modifiers in
9943         interfaces correctly.
9944         * class.cs: catch private void IFoo.Blah ().
9945
9946         All related to bug #50572.
9947
9948 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9949
9950         * decl.cs: Rewrite the consistant accessability checking.
9951         Accessability is not linear, it must be implemented in
9952         a tableish way. Fixes #49704.
9953
9954 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9955
9956         * expression.cs: Handle negation in a checked context.
9957         We must use subtraction from zero. Fixes #38674.
9958
9959 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9960
9961         * class.cs: Ignore static void main in DLLs.
9962         * rootcontext.cs: Handle the target type here,
9963         since we are have to access it from class.cs
9964         * driver.cs: account for the above.
9965
9966 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9967
9968         * report.cs: Give line numbers and files if available.
9969
9970 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9971
9972         * driver.cs: Implement /addmodule.
9973
9974         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9975         ModuleBuilders.
9976
9977 2003-12-20  Martin Baulig  <martin@ximian.com>
9978
9979         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9980         (FieldBase.IsAssigned): Removed this field.
9981         (FieldBase.SetAssigned): New public method.
9982         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9983
9984 2003-12-20  Martin Baulig  <martin@ximian.com>
9985
9986         * expression.cs (LocalVariableReference.DoResolve): Don't set
9987         `vi.Used' if we're called from DoResolveLValue().
9988
9989         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9990         returns the usage vector it just merged into the current one -
9991         pass this one to UsageWarning().
9992         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9993         of the `EmitContext', don't call this recursively on our children.
9994
9995 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9996
9997         * driver.cs: Implement /target:module.
9998
9999 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10000
10001         * support.cs (CharArrayHashtable): New helper class.
10002
10003         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10004         char arrays, not strings, so we can avoid creating a string in
10005         consume_identifier if the identifier is a keyword.
10006
10007 2003-12-16  Martin Baulig  <martin@ximian.com>
10008
10009         * statement.cs (LocalInfo.Assigned): Removed this property.
10010         (LocalInfo.Flags): Removed `Assigned'.
10011         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10012         and uses flow analysis.
10013         (Block.UsageWarning): Made this method private.
10014         (Block.Resolve): Call UsageWarning() if appropriate.
10015
10016         * expression.cs (LocalVariableReference.DoResolve): Always set
10017         LocalInfo.Used here.
10018
10019 2003-12-13  Martin Baulig  <martin@ximian.com>
10020
10021         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10022         any value here; we're now using flow analysis to figure out
10023         whether a statement/block returns a value.
10024
10025 2003-12-13  Martin Baulig  <martin@ximian.com>
10026
10027         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10028         working again.
10029         (FlowBranching.MergeFinally): Don't call
10030         `branching.CheckOutParameters()' here, this is called in
10031         MergeTopBlock().
10032         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10033         when adding the `finally' vector.       
10034
10035 2003-12-13  Martin Baulig  <martin@ximian.com>
10036
10037         * flowanalysis.cs
10038         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10039         actually work and also fix #48962.
10040
10041 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10042
10043         * decl.cs: Do not check System.Object for nested types,
10044         since we know it does not have any. Big bang for buck:
10045
10046         BEFORE:
10047            Run 1:   8.35 seconds
10048            Run 2:   8.32 seconds
10049            corlib:  17.99 seconds
10050         AFTER:
10051            Run 1:   8.17 seconds
10052            Run 2:   8.17 seconds
10053            corlib:  17.39 seconds
10054
10055 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10056
10057         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10058         time we are returning 0 members, so we save alot here.
10059
10060 2003-12-11  Martin Baulig  <martin@ximian.com>
10061
10062         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10063         `MergeChild()', also just take the `FlowBranching' as argument;
10064         call Merge() on it and return the result.
10065         (FlowBranching.Merge): We don't need to do anything if we just
10066         have one sibling.
10067
10068 2003-12-11  Martin Baulig  <martin@ximian.com>
10069
10070         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10071         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10072         Maurer for this idea.
10073
10074 2003-12-11  Martin Baulig  <martin@ximian.com>
10075
10076         * flowanalysis.cs (MergeResult): This class is now gone; we now
10077         use the `UsageVector' for this.  The reason for this is that if a
10078         branching just has one sibling, we don't need to "merge" them at
10079         all - that's the next step to do.
10080         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10081         `MergeResult'.
10082
10083 2003-12-11  Martin Baulig  <martin@ximian.com>
10084
10085         Reworked flow analyis and made it more precise and bug-free.  The
10086         most important change is that we're now using a special `Reachability'
10087         class instead of having "magic" meanings of `FlowReturns'.  I'll
10088         do some more cleanups and optimizations and also add some more
10089         documentation this week.
10090
10091         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10092         largely reworked this class.
10093         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10094         the new `Reachability' class instead of having "magic" values here.
10095         (FlowBranching): We're now using an instance of `Reachability'
10096         instead of having separate `Returns', `Breaks' etc. fields.
10097
10098         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10099         based on flow analysis; ignore the return value of block.Emit ().
10100
10101 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10102
10103         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10104         if they are private.
10105
10106 2003-12-09  Martin Baulig  <martin@ximian.com>
10107
10108         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10109         call them directly on the UsageVector.
10110
10111 2003-12-09  Martin Baulig  <martin@ximian.com>
10112
10113         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10114         Changed return type from `FlowReturns' to `Reachability'.
10115
10116 2003-12-09  Martin Baulig  <martin@ximian.com>
10117
10118         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10119         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10120         `Reachable' fields with a single `Reachability' one.
10121
10122 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10123
10124         * class.cs (FindMembers): Remove foreach's.
10125
10126         Bootstrap times:
10127
10128         BEFORE
10129                 Run 1:   8.74 seconds
10130                 Run 2:   8.71 seconds
10131
10132         AFTER
10133                 Run 1:   8.64 seconds
10134                 Run 2:   8.58 seconds
10135
10136
10137 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10138
10139         * cs-parser.jay:
10140         * gen-treedump.cs:
10141         * statement.cs:
10142         This patch does a few things:
10143                 1. EmptyStatement is now a singleton, so it is never reallocated.
10144                 2. All blah is EmptyStatement constructs have been changed to
10145                    blah == EmptyStatement.Value, which is much faster and valid
10146                    now that EmptyStatement is a singleton.
10147                 3. When resolving a block, rather than allocating a new array for
10148                    the non-empty statements, empty statements are replaced with
10149                    EmptyStatement.Value
10150                 4. Some recursive functions have been made non-recursive.
10151         Mainly the performance impact is from (3), however (1) and (2) are needed for
10152         this to work. (4) does not make a big difference in normal situations, however
10153         it makes the profile look saner.
10154
10155         Bootstrap times:
10156
10157         BEFORE
10158         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10159         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10160         Total memory allocated: 56397 KB
10161
10162         AFTER
10163         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10164         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10165         Total memory allocated: 55666 KB
10166
10167 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10168
10169         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10170         than the hashtable in a hashtable version
10171
10172         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10173         we always end up concating a string. This results in a huge perf
10174         loss, because many strings have to be tracked by the GC. In this
10175         patch, we first use a hashtable that works with two keys, so that
10176         the strings do not need to be concat'ed.
10177
10178         Bootstrap times:
10179         BEFORE
10180                 Run 1:   8.74 seconds
10181                 Run 2:   8.71 seconds
10182
10183         AFTER
10184                 Run 1:   8.65 seconds
10185                 Run 2:   8.56 seconds
10186
10187 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10188
10189         * Makefile: Add a new target `do-time' that does a quick and simple
10190         profile, leaving easy to parse output.
10191
10192 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10193
10194         * codegen.cs (Init): Create the dynamic assembly with 
10195         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10196
10197 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10198
10199         * support.cs: Make the PtrHashtable use only one
10200         instance of its comparer.
10201
10202 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10203
10204         * typemanager.cs: Fix lookup of GetNamespaces.
10205
10206 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10207
10208         * expression.cs: Removed redundant line.
10209
10210         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10211         ArrayLists, use for loops with bounds.  
10212
10213         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10214         arraylist.
10215
10216         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10217         arraylists, use for loop with bounds.
10218
10219         The above three changes give us a 0.071 second performance
10220         improvement out of 3.294 seconds down to 3.223.  On my machine
10221         the above changes reduced the memory usage by 1,387 KB during
10222         compiler bootstrap.
10223
10224         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10225         QualifiedIdentifiers.  Before we created a new string through
10226         concatenation, and mostly later on, the result would be
10227         manipulated by DecomposeQI through string manipulation.
10228
10229         This reduced the compiler memory usage for bootstrapping from
10230         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10231         compile times in 0.05 seconds.
10232
10233 2003-11-28  Dick Porter  <dick@ximian.com>
10234
10235         * support.cs: Do string compares with the Invariant culture.
10236
10237         * rootcontext.cs: 
10238         * gen-treedump.cs: 
10239         * expression.cs: 
10240         * driver.cs: 
10241         * decl.cs: 
10242         * codegen.cs: 
10243         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10244         the comparison is done with the Invariant culture.
10245
10246 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10247
10248         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10249         GetEnumerator method.
10250
10251         (ProbeCollectionType): Iterate starting at the most specific type
10252         upwards looking for a GetEnumerator
10253
10254         * expression.cs: Shift count can be up to 31 for int/uint and 63
10255         for long/ulong.
10256
10257 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10258
10259         * statement.cs (Block.LookupLabel): Also look for the label on the
10260         children blocks.  Use a hash table to keep track of visited
10261         nodes. 
10262
10263         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10264         we actually did transform the other operand, otherwise fall back
10265         to the common codepath that casts to long.
10266
10267         * cs-tokenizer.cs: Use the same code pattern as the int case.
10268         Maybe I should do the parsing myself, and avoid depending on the
10269         Parse routines to get this done.
10270
10271 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10272
10273         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10274         which fixes bug 51347.  This time test it.
10275
10276         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10277         attributes for example can not tell the difference between these.
10278         The difference was only a syntax feature of the language. 
10279
10280         * attribute.cs: Apply attributes to delegates.
10281
10282         * delegate.cs: Call the apply attributes method.
10283
10284 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10285
10286         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10287         comparing 0 vs Byte.MinValue, not the value
10288
10289         (ImplicitConversionRequired): When reporting a conversion error,
10290         use error 31 to print out the constant error instead of the
10291         simpler 29.
10292
10293         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10294         which fixes bug 51347.
10295
10296 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10297
10298         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10299         which fixes the -warnaserror command line option.
10300
10301 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10302
10303         * cfold.cs (DoNumericPromotions): During constant folding of
10304         additions on UIntConstant, special case intconstants with
10305         IntConstants like we do on the expression binary operator. 
10306
10307 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10308
10309         * convert.cs (ImplicitReferenceConversion): We were missing a case
10310         (System.Enum are not value types or class types, so we need to
10311         classify them separatedly).
10312
10313         * driver.cs: We do not support error 2007.
10314
10315 2003-11-12 Jackson Harper <jackson@ximian.com>
10316
10317         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10318         system directory. Also use the full file name so users can
10319         libraries names mscorlib-o-tron.dll in a non system dir.
10320         
10321 2004-01-04  David Sheldon <dave-mono@earth.li>
10322
10323         * expression.cs: Added matching ")" to error message for CS0077.
10324
10325 2003-12-19  Martin Baulig  <martin@ximian.com>
10326
10327         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10328         static method; see documentation in the method.
10329         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10330
10331         * convert.cs (Convert.ImplicitReferenceConversion,
10332         Convert.ImplicitReferenceConversionExists): Add support for
10333         generic type declarations; see gen-36.cs.
10334
10335 2003-12-19  Martin Baulig  <martin@ximian.com>
10336
10337         * pending.cs (Pending.InterfaceMethod): Use
10338         `Type.IsAssignableFrom()' instead of `=='.
10339
10340 2003-12-18  Martin Baulig  <martin@ximian.com>
10341
10342         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10343         byref types first.
10344
10345         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10346         `expr_type.Equals (target_type)' instead of `=='.
10347
10348 2003-12-08  Martin Baulig  <martin@ximian.com>
10349
10350         * generics.cs (Constraints.Types): Removed.
10351         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10352         to Type's.
10353         (Constraints.ResolveTypes): New public method; resolves the
10354         TypeExpr's to Type's.
10355         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10356         longer takes the constraints.
10357         (TypeParameter.DefineMethod): Likewise.
10358         (TypeParameter.DefineType): New public method.  Calls
10359         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10360         the constraints.
10361
10362 2003-12-08  Martin Baulig  <martin@ximian.com>
10363
10364         * convert.cs (Convert.ImplicitConversionStandard): Use
10365         `expr_type.Equals (target_type)' instead of `=='.
10366
10367 2003-12-08  Martin Baulig  <martin@ximian.com>
10368
10369         * typemanager.cs (TypeManager.GetReferenceType): Call
10370         `Type.MakeByRefType ()'.
10371
10372 2003-12-08  Martin Baulig  <martin@ximian.com>
10373
10374         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10375         just has some special meaning in some situations.  For instance,
10376         it is allowed to use `where' as the name of a variable etc.
10377
10378 2003-12-04  Martin Baulig  <martin@ximian.com>
10379
10380         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10381         `Type.MakeArrayType()' for array types.
10382
10383 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10384
10385         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10386         debugging message.
10387
10388         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10389         corlib to compile.
10390
10391 2003-11-16  Martin Baulig  <martin@ximian.com>
10392
10393         * codegen.cs (EmitContext.IsGeneric): Removed.
10394
10395         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10396         ResolveGeneric() on the DeclSpace.
10397
10398 2003-11-16  Martin Baulig  <martin@ximian.com>
10399
10400         * generic.cs (TypeArguments.Resolve):
10401         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10402         `ResolveType()' on it to get the Type.
10403
10404 2003-11-15  Martin Baulig  <martin@ximian.com>
10405
10406         * generic.cs (ConstructedType.GetInterfaces): Override this.
10407
10408 2003-11-14  Martin Baulig  <martin@ximian.com>
10409
10410         * interface.cs (Interface.DefineType): Define all type parameters
10411         before adding the interfaces we inherit.
10412
10413 2003-11-11  Martin Baulig  <martin@ximian.com>
10414
10415         * generic.cs (ConstructedType.ResolveType): Always call
10416         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10417
10418 2003-11-10  Martin Baulig  <martin@ximian.com>
10419
10420         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10421         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10422         calling `ResolveType()' on them, directly assign their `Type'.
10423
10424 2003-11-08  Martin Baulig  <martin@ximian.com>
10425
10426         * generic.cs (ConstructedType): Override `IsClass' etc.
10427
10428 2003-11-08  Martin Baulig  <martin@ximian.com>
10429
10430         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10431         return value and the `out parent' parameter.
10432         (TypeContainer.DefineType): Moved the CS0644 check into
10433         GetClassBases().  Don't pass the interface types to the
10434         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10435         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10436
10437         * ecore.cs (TypeExpr.IsAttribute): New property.
10438         (TypeExpr.GetInterfaces): New method.
10439
10440         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10441         TypeExpr instead of a Type.
10442         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10443         (Interface.DefineType): Don't pass the interface types to the
10444         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10445         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10446
10447         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10448         instead of a `Type[]'.
10449         (TypeManager.RegisterBuilder): Likewise.
10450         (TypeManager.AddUserInterface): Likewise.
10451         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10452         `Type[]' and also return a `TypeExpr[]'.
10453         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10454
10455 2003-11-08  Martin Baulig  <martin@ximian.com>
10456
10457         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10458         Expression.     
10459
10460 2003-11-08  Martin Baulig  <martin@ximian.com>
10461
10462         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10463         TypeManager.ResolveExpressionTypes().
10464
10465         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10466         instead of an Expression.
10467         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10468         (TypeExpression): New public class; formerly known as `TypeExpr'.
10469
10470         * expression.cs (ComposedCast): Derive from TypeExpr.
10471
10472         * typemanager.cs (TypeManager.system_*_expr): These are now
10473         TypExpr's instead of Expression's.
10474         (TypeManager.ResolveExpressionTypes): New public static function;
10475         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10476         of them.        
10477
10478 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10479
10480         * expression.cs (New.DoResolve): Do not dereference value that
10481         might be a null return.
10482
10483         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10484         sure that the constant value has the right type.  Fixes an
10485         unreported bug, similar to 50425.
10486
10487         * const.cs (Const.LookupConstantValue): Call
10488         ImplicitStandardConversionExists before doing a conversion to
10489         avoid havng the TypeManager.ChangeType do conversions.
10490
10491         Reduced the number of casts used
10492
10493         (Const.ChangeType): New routine to enable reuse of the constant
10494         type changing code from statement.
10495
10496         * typemanager.cs (ChangeType): Move common initialization to
10497         static global variables.
10498
10499         Fixes #50425.
10500
10501         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10502         every value type to go through, even if it was void.  Fix that. 
10503
10504         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10505         character of the define, and the is_identifier_part_character for
10506         the rest of the string.
10507
10508 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10509
10510         * expression.cs (UnaryMutator.EmitCode): When I updated
10511         LocalVariableReference.DoResolve, I overdid it, and dropped an
10512         optimization done on local variable references.
10513
10514 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10515
10516         * ecore.cs: Convert the return from Ldlen into an int.
10517
10518 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10519
10520         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10521         the accessibility, this is a special case for toplevel non-public
10522         classes (internal for instance).
10523
10524 2003-10-20  Nick Drochak <ndrochak@gol.com>
10525
10526         * ecore.cs: Fix typo and build.  Needed another right paren.
10527
10528 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10529
10530         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10531         `internal' case regular and protected, but not allowing protected
10532         to be evaluated later.  Bug 49840
10533
10534 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10537         to kb.Nlast, and not the kb.nFirst to isolate the switch
10538         statement.
10539
10540         Extract the underlying type, so enumerations of long/ulong are
10541         treated like long/ulong.
10542
10543 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * expression.cs (New): Overload the meaning of RequestedType to
10546         track the possible creation of the NewDelegate type, since
10547         DoResolve is invoked more than once for new constructors on field
10548         initialization.
10549
10550         See bugs: #48800 and #37014
10551
10552         * cs-parser.jay (declare_local_constants): Take an arraylist
10553         instead of a single constant.
10554
10555         (local_constant_declaration): It should take a
10556         constant_declarators, not a constant_declarator.  Fixes 49487
10557
10558         * convert.cs: Fix error report.
10559
10560 2003-10-13 Jackson Harper <jackson@ximian.com>
10561
10562         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10563         bug #49611
10564         
10565 2003-11-03  Martin Baulig  <martin@ximian.com>
10566
10567         * expression.cs (ArrayAccess.GetStoreOpcode): Added
10568         `out bool has_type_arg'; if set, we need to pass the type to
10569         ig.Emit().
10570         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10571         Stelem_Any/Ldelem_Any for generic parameters.   
10572
10573 2003-11-02  Martin Baulig  <martin@ximian.com>
10574
10575         * expression.cs (Invocation.EmitCall): Use
10576         `TypeManager.IsValueType()' to check whether it's a value type.
10577         Don't set `struct_call' when calling a method on a type parameter.
10578
10579 2003-11-02  Martin Baulig  <martin@ximian.com>
10580
10581         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10582         and removed the TypeBuilder argument.
10583
10584         * typemanager.cs (TypeManager.IsValueType): Return
10585         `t.IsGenericParameter || t.IsValueType'.
10586
10587 2003-10-25  Martin Baulig  <martin@ximian.com>
10588
10589         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10590         call ConstructedType.Resolve() on it.
10591
10592         * generic.cs (ConstructedType.Resolve): Set `type' on success.
10593
10594 2003-10-25  Martin Baulig  <martin@ximian.com>
10595
10596         * class.cs (TypeContainer.GetClassBases): Changed
10597         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
10598         CS8214 reporting here.
10599         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10600         instead of a `Type' for our parent.  In case of a recursive
10601         declaration (see tests/gen-23.cs for an example), our parent is a
10602         ConstructedType and it doesn't have its type set.  So, first
10603         create our own TypeBuilder, then call constructed.Resolve() to get
10604         the parent's type and finally TypeBuilder.SetParent() it.
10605
10606         * ecore.cs (TypeExpr.Name): New public virtual property.
10607
10608         * generic.cs
10609         (ConstructedType): We're now a TypeExpr and not just an Expression.
10610         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10611         arguments here; this is done later.
10612         (ConstructedType.Resolve): New public method to resolve the type
10613         arguments and bind them.
10614
10615 2003-10-21  Martin Baulig  <martin@ximian.com>
10616
10617         * convert.cs: Use `TypeManager.IsValueType' instead of
10618         'type.IsValueType' everywhere.
10619
10620         * typemanager.cs (TypeManager.IsValueType): Return true for type
10621         parameters.  The reason for this is that we need to box a type
10622         parameter when converting it to a reference type.
10623
10624         * cs-parser.jay: Added support for default value expressions.
10625
10626         * generics.cs (DefaultValueExpression): New public class.       
10627
10628 2003-10-17  Martin Baulig  <martin@ximian.com>
10629
10630         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10631         TypeContainer so we can also use this for Interfaces.
10632         (TypeParameter.Resolve): Likewise.
10633
10634         * interface.cs (Interface.DefineType): Added support for generic
10635         interfaces.
10636
10637         * cs-parser.jay: Added support for generic structs and interfaces.
10638
10639 2003-10-17  Martin Baulig  <martin@ximian.com>
10640
10641         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10642         call generic methods :-)
10643
10644 2003-10-16  Martin Baulig  <martin@ximian.com>
10645
10646         * cs-parser.jay (namespace_or_type_name): Only create a
10647         GenericMemberAccess if we actually have type arguments.
10648
10649 2003-10-13  Martin Baulig  <martin@ximian.com>
10650
10651         * class.cs (Method.Define): If we're a generic method, call
10652         TypeBuilder.DefineGenericMethod () before resolving
10653         the parameters.
10654         (MethodData): Added .ctor which takes an additional MethodBuilder
10655         argument; this is used for generic methods.
10656         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10657         we already have a MethodBuilder.
10658
10659 2003-10-10  Martin Baulig  <martin@ximian.com>
10660
10661         * class.cs (Method): Added .ctor which takes a `GenericMethod'
10662         instead of a `DeclSpace'.  This is used for generic methods.
10663
10664         * cs-parser.jay (method_header): Added support for generic
10665         methods; create a `GenericMethod' instance and pass it to the
10666         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10667         parameters and locals.
10668
10669         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10670         since we already have the location.  Check whether we're a generic
10671         type declaration or a generic method and create the correct type
10672         parameter.
10673
10674         * generic.cs (TypeParameter.DefineMethod): New public method.
10675         (GenericMethod): New public class; derives from DeclSpace and is
10676         used for generic methods.       
10677
10678 2003-10-09  Martin Baulig  <martin@ximian.com>
10679
10680         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10681         to the .ctor.
10682         (MethodCore.DoDefineParameters): Removed the TypeContainer
10683         argument; use the DeclSpace which was passed to the .ctor instead.
10684         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10685         TypeContainer; we only need a DeclSpace here.
10686
10687 2003-10-09  Martin Baulig  <martin@ximian.com>
10688
10689         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10690         to the .ctor.
10691         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10692         EmitContext's .ctor.    
10693
10694 2003-10-09  Martin Baulig  <martin@ximian.com>
10695
10696         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10697         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10698         AsAccessible(), moved them as well.
10699
10700         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10701
10702 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10703
10704         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10705         generation for >=, as spotted by Paolo, bug 48679.  
10706         Patch from David Waite.
10707
10708         * cs-tokenizer.cs: Add handling for #pragma.
10709
10710         * cs-parser.jay: Allow for both yield and yield return in the
10711         syntax.  The anti-cobolization of C# fight will go on!
10712
10713         * class.cs (TypeBuilder.DefineType): Catch error condition here
10714         (Parent.DefineType erroring out and returning null).
10715
10716         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10717         coping with enumerations variables, we were mistakenly processing
10718         them as a regular value type instead of built-in types.  Fixes the
10719         bug #48063
10720
10721         * typemanager.cs (IsBuiltinOrEnum): New method.
10722
10723 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10724
10725         * cs-parser.jay: Upgrade: yield now needs the return clause.
10726
10727 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10728
10729         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10730
10731 2003-09-29  Martin Baulig  <martin@ximian.com>
10732
10733         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10734         inflated generic methods.
10735
10736         * generics.cs (ConstructedType): Distinguish between open and
10737         closed constructed types; correctly resolve the arguments.
10738
10739 2003-09-22  Martin Baulig  <martin@ximian.com>
10740
10741         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10742         all type arguments meet their constraints.
10743
10744 2003-09-19  Martin Baulig  <martin@ximian.com>
10745
10746         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10747         `MemberCache parent' argument.  Normally, an interface doesn't
10748         have a parent type except System.Object, but we use this in gmcs
10749         for generic type parameters.
10750
10751 2003-09-18  Martin Baulig  <martin@ximian.com>
10752
10753         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10754         on `type.IsInterface'; don't check whether the type has a parent
10755         to determine whether it's an interface.
10756
10757 2003-09-17  Martin Baulig  <martin@ximian.com>
10758
10759         * generic.cs (ConstructedType.ToString): Always use `name' as the
10760         type name.
10761
10762 2003-09-15  Martin Baulig  <martin@ximian.com>
10763
10764         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10765
10766         * generic.cs (Constraints.Resolve): New public method; this is
10767         called to resolve the constraint types and to check whether all
10768         the constraints are correct.
10769         (Constraints.Types): New public property.
10770         (TypeParameter.Resolve): New public method; resolves all the
10771         type's constraints.
10772
10773         * class.cs (TypeContainer.DefineType): Call
10774         TypeParameter.Resolve() before actually defining the type.
10775
10776 2003-09-15  Martin Baulig  <martin@ximian.com>
10777
10778         * class.cs (TypeContainer.DefineType): Added an error flag to
10779         avoid reporting duplicate CS0146's ("class definition is
10780         circular.").
10781
10782         * driver.cs (Driver.MainDriver): Abort if
10783         RootContext.ResolveTree() reported any errors.
10784
10785 2003-09-07  Martin Baulig  <martin@ximian.com>
10786
10787         * report.cs (Error, Warning): Added overloaded versions which take
10788         a `params object[] args' and call String.Format().
10789
10790 2003-09-07  Martin Baulig  <martin@ximian.com>
10791
10792         * decl.cs (DeclSpace..ctor): Don't call
10793         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10794         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10795         (DeclSpace.RecordDecl): New method.
10796
10797         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10798
10799 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10800
10801         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10802         value attributes to be applied to ParameterBuilders.
10803
10804         * class.cs (MethodCore.LabelParameters): Make static and more
10805         generic so that it can be used from other places - like interface
10806         methods, for instance.
10807
10808         * interface.cs (Interface.Emit): Call LabelParameters before
10809         emitting attributes on the InterfaceMethod.
10810
10811 2003-09-07  Martin Baulig  <martin@ximian.com>
10812
10813         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10814         if the number of type parameters doesn't match.
10815
10816 2003-09-04  Martin Baulig  <martin@ximian.com>
10817
10818         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10819         for arrays of generic type params (ie. `!0[]').
10820
10821 2003-09-04  Martin Baulig  <martin@ximian.com>
10822
10823         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10824         for the moment.
10825
10826 2003-09-04  Martin Baulig  <martin@ximian.com>
10827
10828         * decl.cs (DeclSpace.LookupGeneric): New method.
10829         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10830         moment.
10831
10832         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10833         argument, not just a string.
10834         (TypeParameter.Define): New public method; this is called to
10835         actually define the generic parameter; after this, you can use the
10836         new `Type' property to get the type.
10837
10838 2003-09-04  Martin Baulig  <martin@ximian.com>
10839
10840         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10841         is now an ArrayList; initialize the result of the `TypeParameters'
10842         property here.
10843         (DeclSpace.GetGenericData): Removed.
10844         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10845         implement this in a different way.
10846         (DeclSpace.GetTypeParameters): Removed; there's now a
10847         `TypeParameters' property.
10848         (DeclSpace.TypeParameters): New public property.
10849
10850         * generic.cs (Constraints): Make this class public.
10851         (TypeParameter): New public class.
10852
10853 2003-09-04  Martin Baulig  <martin@ximian.com>
10854
10855         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10856         generic parameters.
10857
10858         * class.cs (TypeContainer.DefineType): Call
10859         TypeBuilder.DefineGenericParameter () on all generic parameters if
10860         this is a generic type.
10861
10862 2003-08-28  Martin Baulig  <martin@ximian.com>
10863
10864         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10865         sample-stack.il".
10866
10867         * sample-hello.cs: Compile this with gmcs: "gmcs
10868         /r:sample-stack.dll sample-hello.cs".
10869
10870 2003-08-28  Martin Baulig  <martin@ximian.com>
10871
10872         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10873         the parameters to the generic type.
10874
10875 2003-08-28  Martin Baulig  <martin@ximian.com>
10876
10877         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10878
10879 2003-08-28  Martin Baulig  <martin@ximian.com>
10880
10881         * cs-parser.jay (opt_type_argument_list): Use
10882         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10883         (primary_expression): Replace `qualified_identifier' with `type_name'.
10884         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10885
10886         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10887         parser to check whether it is syntactically a type parameter list;
10888         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10889         this case.
10890
10891 2003-08-26  Martin Baulig  <martin@ximian.com>
10892
10893         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10894         resolving aliases; fixes #47927.
10895
10896 2003-08-26  Martin Baulig  <martin@ximian.com>
10897
10898         * statement.cs (Using.DoResolve): This is internally emitting a
10899         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10900         do not always return.  Fixes #47681.
10901
10902 2003-08-26  Martin Baulig  <martin@ximian.com>
10903
10904         * decl.cs (MemberCore): Moved WarningNotHiding(),
10905         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10906         into MemberBase.
10907         (AdditionResult): Make this nested in DeclSpace.
10908         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10909         argument; call NamespaceEntry.Define() unless we're nested in a
10910         class or struct.
10911
10912         * namespace.cs (Namespace.DefineName): New public function.  This
10913         is called from DeclSpace's .ctor to add 
10914         (Namespace.Lookup): Include DeclSpaces in the lookup.
10915
10916         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10917
10918         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10919
10920 2003-08-25  Martin Baulig  <martin@ximian.com>
10921
10922         * convert.cs (Convert.ExplicitReferenceConversion): When
10923         converting from an interface type to a class, unbox if the target
10924         type is a struct type.  Fixes #47822.
10925
10926 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10927
10928         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10929         #47854.
10930
10931 2003-08-22  Martin Baulig  <martin@ximian.com>
10932
10933         * class.cs (TypeManager.DefineType): When defining a nested type,
10934         call DefineType() on our parent; fixes #47801.
10935
10936 2003-08-22  Martin Baulig  <martin@ximian.com>
10937
10938         * class.cs (MethodData.Define): While checking if a method is an
10939         interface implementation, improve the test a bit more to fix #47654.
10940
10941 2003-08-22  Martin Baulig  <martin@ximian.com>
10942
10943         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10944         correctly; fixes #47722.
10945
10946 2003-08-22  Martin Baulig  <martin@ximian.com>
10947
10948         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10949         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10950
10951         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10952
10953 2003-08-22  Martin Baulig  <martin@ximian.com>
10954
10955         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10956         can only be assigned in static constructors.  Fixes #47161.
10957
10958 2003-08-22  Martin Baulig  <martin@ximian.com>
10959
10960         Rewrote and improved the flow analysis code.
10961
10962         * flowbranching.cs (FlowBranching): Make this class abstract.
10963         (FlowBranching.CreateBranching): New static function to create a
10964         new flow branching.
10965         (FlowBranchingBlock, FlowBranchingException): New classes.
10966         (FlowBranching.UsageVector.Type): New public readonly field.
10967         (FlowBranching.UsageVector.Breaks): Removed the setter.
10968         (FlowBranching.UsageVector.Returns): Removed the setter.
10969         (FlowBranching.UsageVector): Added Break(), Return(),
10970         NeverReachable() and Throw() methods to modify the reachability.
10971         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10972         done by FlowBranching.Merge().
10973         (FlowBranching.UsageVector.MergeChild): New method; merges the
10974         merge result into the current vector.
10975         (FlowBranching.Merge): New abstract method to merge a branching.
10976
10977 2003-08-12  Martin Baulig  <martin@ximian.com>
10978
10979         * expression.cs (Indirection.CacheTemporaries): Create the
10980         LocalTemporary with the pointer type, not its element type.
10981
10982 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10983
10984         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10985         token was a keyword or not.
10986
10987         Add `error' options where an IDENTIFIER was expected;  Provide
10988         CheckToken and CheckIdentifierToken convenience error reporting
10989         functions. 
10990
10991         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10992
10993         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10994         NameSpaceEntry NameSpaceEntry.
10995
10996         (LookupInterfaceOrClass): Avoid creating a full qualified name
10997         from namespace and name: avoid doing lookups when we know the
10998         namespace is non-existant.   Use new Tree.LookupByNamespace which
10999         looks up DeclSpaces based on their namespace, name pair.
11000
11001         * driver.cs: Provide a new `parser verbose' to display the
11002         exception thrown during parsing.  This is turned off by default
11003         now, so the output of a failure from mcs is more graceful.
11004
11005         * namespace.cs: Track all the namespaces defined in a hashtable
11006         for quick lookup.
11007
11008         (IsNamespace): New method
11009
11010 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11013         we know that we need to concatenate (full typename can never be
11014         null). 
11015
11016         * class.cs: ditto.
11017
11018         * statement.cs: Use a bitfield;  Do not initialize to null things
11019         which are done by the constructor by default.
11020
11021         * cs-parser.jay: bug fix, parameter was 4, not 3.
11022
11023         * expression.cs: Just use the property;
11024
11025         * statement.cs: No need for GetVariableInfo method.
11026
11027 2003-08-08  Martin Baulig  <martin@ximian.com>
11028
11029         * flowanalysis.cs (FlowReturns): This is now nested in the
11030         `FlowBranching' class.
11031         (MyBitVector): Moved this here from statement.cs.
11032         (FlowBranching.SiblingType): New enum type.
11033         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11034
11035 2003-08-07  Martin Baulig  <martin@ximian.com>
11036
11037         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11038         `FlowBranching' class and called `BranchingType'.
11039
11040 2003-08-07  Martin Baulig  <martin@ximian.com>
11041
11042         * flowanalysis.cs: Moved all the control flow analysis code into
11043         its own file.
11044
11045 2003-08-07  Martin Baulig  <martin@ximian.com>
11046
11047         * assign.cs (Assign.DoResolve): `target' must either be an
11048         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11049         #37319.
11050
11051 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * expression.cs (BinaryMethod): This kind of expression is created by the
11054         Binary class if it determines that the operator has to be handled
11055         by a method.
11056
11057         (BinaryDelegate): This kind of expression is created if we are
11058         dealing with a + or - operator on delegates.
11059
11060         (Binary): remove method, argumetns, and DelegateOperator: when
11061         dealing with methods, 
11062
11063         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11064
11065         * statement.cs (Block): use bitfields for the three extra booleans
11066         we had in use.   Remove unused topblock parameter.
11067
11068         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11069
11070         * assign.cs: Drop extra unneeded tests.
11071
11072 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11075
11076         * statement.cs (Foreach): Use VariableStorage instead of
11077         LocalBuilders.   
11078
11079         * codegen.cs (VariableStorage): New class used by clients that
11080         require a variable stored: locals or fields for variables that
11081         need to live across yield.
11082
11083         Maybe provide a convenience api for EmitThis+EmitLoad?
11084
11085         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11086         these bad boys.
11087
11088 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11089
11090         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11091         RemapParameterLValue): New methods that are used to turn a
11092         precomputed FieldInfo into an expression like this:
11093
11094                 instance.FieldInfo
11095
11096         The idea is to use this instead of making LocalVariableReference
11097         have more than one meaning.
11098
11099         * cs-parser.jay: Add error production to BASE.
11100
11101         * ecore.cs: Deal with TypeManager.GetField returning null, which
11102         is now a valid return value.
11103
11104         (FieldExprNoAddress): New expression for Fields whose address can
11105         not be taken.
11106
11107         * expression.cs (LocalVariableReference): During the resolve
11108         phases, create new expressions if we are in a remapping context.
11109         Remove code that dealt with remapping here.
11110
11111         (ParameterReference): same.
11112
11113         (ProxyInstance): New expression, like the `This' expression, but
11114         it is born fully resolved.  We know what we are doing, so remove
11115         the errors that are targeted to user-provided uses of `this'.
11116
11117         * statement.cs (Foreach): our variable is now stored as an
11118         Expression;  During resolution, follow the protocol, dont just
11119         assume it will return this.
11120
11121 2003-08-06  Martin Baulig  <martin@ximian.com>
11122
11123         * support.cs (SeekableStreamReader.cs): New public class.
11124
11125         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11126         SeekableStreamReader instead of the normal StreamReader.
11127
11128 2003-08-04  Martin Baulig  <martin@ximian.com>
11129
11130         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11131         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11132         deambiguate casts and delegate invocations.
11133         (parenthesized_expression): Use the new tokens to ensure this is
11134         not a cast of method invocation.
11135
11136         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11137         when reading a `)' and Deambiguate_CloseParens () was previously
11138         called.
11139
11140         * expression.cs (ParenthesizedExpression): New class.  This is
11141         just used for the CS0075 test.
11142         (Binary.DoResolve): Check for CS0075.   
11143
11144 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11145
11146         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11147         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11148         reference comparison.
11149
11150         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11151         examine the ReturnType for equality - this is necessary in the
11152         cases of implicit and explicit operators whose signature also
11153         includes the return type.
11154
11155 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11156
11157         * namespace.cs: Cache the result of the namespace computation,
11158         instead of computing it every time.
11159
11160 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11161
11162         * decl.cs: Use a global arraylist that we reuse over invocations
11163         to avoid excesive memory consumption.  Reduces memory usage on an
11164         mcs compile by one meg (45 average).
11165
11166         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11167         private, work around that.
11168
11169 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11170
11171         * literal.cs (IntLiteral): Define Zero and One static literals. 
11172
11173         * cs-parser.jay (integer_literal): use static literals to reduce
11174         memory usage for the most used literals (0, 1 and -1).  211kb
11175         reduced in memory usage.
11176
11177         Replace all calls to `new ArrayList' with `new
11178         ArrayList(4)' which is a good average number for most allocations,
11179         and also requires only 16 bytes of memory for its buffer by
11180         default. 
11181
11182         This reduced MCS memory usage in seven megabytes for the RSS after
11183         bootstrapping.
11184
11185 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11186
11187         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11188         handle params methods the correct way by forming only one
11189         applicable set with params and normal methods in them. Earlier we
11190         were looking at params methods only if we found no normal methods
11191         which was not the correct thing to do.
11192
11193         (Invocation.BetterFunction): Take separate arguments indicating
11194         when candidate and the best method are params methods in their
11195         expanded form.
11196
11197         This fixes bugs #43367 and #46199.
11198
11199         * attribute.cs: Documentation updates.
11200
11201         (CheckAttribute): Rename to CheckAttributeTarget.
11202         (GetValidPlaces): Rename to GetValidTargets.
11203
11204         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11205         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11206
11207         Fixes bug #44468.
11208
11209 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11210
11211         * codegen.cs: Compute IsGeneric correctly.
11212
11213         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11214         resolution. 
11215
11216         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11217         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11218         regressions, and I was chasing more bugs than I required.
11219
11220         * interface.cs: Use expressions for base type names (like classes
11221         and structs have been doing for a while now), and resolve that.
11222         This patch should probably go into head as well.
11223
11224         This makes it one less user of FindType.
11225
11226 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11227
11228         This compiler can not self host currently.  Need to fix that.
11229         
11230         * Makefile: compile to `gmcs.exe'
11231
11232         * driver.cs: Turn on v2 by default on gmcs.
11233
11234         * generic.cs (ConstructedType): Does no longer take a container
11235         type argument;  That will be taken care of later.
11236
11237         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11238         Use SimpleName to resolve for now, so we can continue the work on
11239         the parser, until we get Type.GetType that understands generics.
11240
11241         (ConstructedType.ToString): Implement
11242
11243         (TypeArguments.Resolve): Resolve the child expressions as types. 
11244         
11245         * cs-parser.jay: Rename interface_constraints to
11246         type_parameter_constraints
11247
11248         (namespace_or_type_name): Only use constructed types for the basic
11249         construction, we will deal with identifier<...> later.
11250
11251         (type/type_name): No longer call DecomposeQI, as
11252         namespace_or_type_name is always decoded now.
11253         
11254 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11255
11256         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11257         closely: we eliminate methods in base types when we have an
11258         applicable method in a top-level type.
11259
11260         Please see section 14.5.5.1 for an exact description of what goes
11261         on. 
11262
11263         This fixes bug #45127 and a host of other related to corlib compilation.
11264
11265         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11266         array is the method corresponding to the top-level type (this is
11267         because of the changes made to icall.c) so we change this
11268         accordingly.
11269
11270         (MethodGroupExpr.Name): This too.
11271
11272         * typemanager.cs (GetElementType): New method which does the right
11273         thing when compiling corlib. 
11274
11275         * everywhere: Make use of the above in the relevant places.
11276
11277 2003-07-22  Martin Baulig  <martin@ximian.com>
11278
11279         * cs-parser.jay (invocation_expression): Moved
11280         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11281         `cast_expression', but create a InvocationOrCast which later
11282         resolves to either an Invocation or a Cast.
11283
11284         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11285         method; call this before EmitStatement() to make sure that this
11286         expression can be used as a statement.
11287
11288         * expression.cs (InvocationOrCast): New class; resolves to either
11289         an Invocation or a Cast.
11290
11291         * statement.cs (StatementExpression): Call ResolveStatement() on
11292         the ExpressionStatement before emitting it.
11293
11294 2003-07-21  Martin Baulig  <martin@ximian.com>
11295
11296         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11297         `ref' and `out' attributes match; fixes #46220.
11298         (MemberAccess.ResolveMemberAccess): You can't reference a type
11299         through an expression; fixes #33180.
11300         (Indexers.GetIndexersForType): Don't return the indexers from
11301         interfaces the class implements; fixes #46502.
11302
11303 2003-07-21  Martin Baulig  <martin@ximian.com>
11304
11305         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11306         CS0661 checks; fixes bug #30442.
11307
11308 2003-07-21  Martin Baulig  <martin@ximian.com>
11309
11310         * decl.cs (AdditionResult): Added `Error'.
11311
11312         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11313
11314         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11315         cs0031.cs actually work.
11316
11317  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11318  
11319         * cs-parser.jay (namespace_name): do not use
11320         namespace_or_type_name, use qualified_identifier, because
11321         namespace_or_type_name will soon return a composed expression
11322         instead of a string.
11323  
11324         (namespace_or_type_name): Instead of returning a string, now this
11325         production returns an expression.
11326  
11327         * codegen.cs (EmitContext): Setup IsGeneric property based on
11328         whether our DeclSpace is generic, our the method is generic.
11329  
11330         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11331         the method is generic.
11332  
11333         * cs-parser.jay (type_arguments, opt_type_argument_list,
11334         type_parameters, type_parameter_list, opt_type_parameter_list,
11335         type_parameter,, opt_type_parameter_constraints_clauses,
11336         type_parameter_constraints_clauses,
11337         type_parameter_constraint_clause, type_parameter_constraint,
11338         interface_constraints): Add new production
11339  
11340         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11341         DeclSpace is generic or not.
11342  
11343         (DeclSpace.SetParameterInfo): New routine, used to set the
11344         parameter info for a type.
11345  
11346         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11347         returns a GenericTypeExpr
11348  
11349         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11350         generic, lookup the generic argument.
11351  
11352         * attribute.cs: Do not allow TypeParameterExpressions in
11353         Attributes.
11354  
11355         * class.cs: Do not allow the Main method to be defined in a
11356         Generic container.
11357  
11358         * expression.cs (SizeOf): Do not allow generic types to be used as
11359         arguments to sizeof.
11360  
11361         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11362         it: whether a type is generic or not.  Only works for types we are
11363         currently building for now.
11364         
11365 2003-07-20  Martin Baulig  <martin@ximian.com>
11366
11367         * namespace.cs: Fixed that bug which caused a crash when compiling
11368         the debugger's GUI.
11369
11370 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11371
11372         * typemanager.cs (LookupTypeReflection): Never expose types which
11373         are NotPublic, NestedPrivate, NestedAssembly, or
11374         NestedFamANDAssem.  We used to return these, and later do a check
11375         that would report a meaningful error, but the problem is that we
11376         would not get the real match, if there was a name override.
11377
11378 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * namespace.cs (Namespace, Name): Do not compute the namespace
11381         name dynamically, compute it in the constructor.  This reduced
11382         memory usage by 1697 KB.
11383
11384         * driver.cs: Use --pause to pause at the end.
11385
11386 2003-07-17  Peter Williams  <peter@newton.cx>
11387
11388         * Makefile: Change the name of the test target so that it doesn't
11389         conflict with the recursive test target.
11390
11391 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11394         AddressOf): Do not use EmitThis, that was wrong, use the actual
11395         this pointer.
11396
11397 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11398
11399         * class.cs (MethodData.Define): While checking if a method is an
11400         interface implementation, improve the test: If we are not public
11401         (use new test here: use the computed MethodAttributes directly,
11402         instead of the parsed modifier flags) check if the `implementing'
11403         method comes from an interface or not.
11404
11405         * pending.cs (VerifyPendingMethods): Slightly better error
11406         message.
11407
11408         * makefile: add test target that does the mcs bootstrap.
11409
11410 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11411
11412         * interface.cs (Define): Do nothing here since there are no
11413         members to populate etc. Move the attribute emission out of here
11414         since this was just totally the wrong place to put it. Attribute
11415         application happens during the 'Emit' phase, not in the 'Define'
11416         phase.
11417
11418         (Emit): Add this method and move the attribute emission here
11419
11420         * rootcontext.cs (EmitCode): Call the Emit method on interface
11421         types too.
11422
11423 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11424
11425         * expression.cs (OverloadResolve): Report error only if Location
11426         is not 'Null' which means that there was a probe going on.
11427
11428 2003-07-14  Martin Baulig  <martin@ximian.com>
11429
11430         * expression.cs (ConditionalLogicalOperator): New public class to
11431         implement user defined conditional logical operators.
11432         This is section 14.11.2 in the spec and bug #40505.
11433
11434 2003-07-14  Martin Baulig  <martin@ximian.com>
11435
11436         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11437
11438 2003-07-14  Martin Baulig  <martin@ximian.com>
11439
11440         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11441
11442         * ecore.cs (IVariable.VerifyFixed): New interface method.
11443
11444         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11445         operator, check whether the variable is actually fixed.  Fixes bug
11446         #36055.  Set a variable definitely assigned when taking its
11447         address as required by the spec.
11448
11449         * statement.cs (LocalInfo.IsFixed): New field.
11450         (LocalInfo.MakePinned): Set `IsFixed' to true.
11451
11452 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11453
11454         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11455         for .ctors, ensure that we only ask for members declared in the
11456         attribute type (BindingFlags.DeclaredOnly).
11457
11458         Fixes bug #43632.
11459
11460         * expression.cs (Error_WrongNumArguments): Report error 1501
11461         correctly the way CSC does.
11462
11463 2003-07-13  Martin Baulig  <martin@ximian.com>
11464
11465         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11466         lookup on the fully qualified name, to make things like "X.X" work
11467         where "X.X" is a fully qualified type name, but we also have a
11468         namespace "X" in the using list.  Fixes #41975.
11469
11470 2003-07-13  Martin Baulig  <martin@ximian.com>
11471
11472         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11473         function. If we're a CompoundAssign, we need to create an embedded
11474         CompoundAssign, not an embedded Assign.
11475         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11476         Fixes #45854.
11477
11478 2003-07-13  Martin Baulig  <martin@ximian.com>
11479
11480         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11481         work to fix bug #46088.
11482
11483 2003-07-13  Ravi Pratap <ravi@ximian.com>
11484
11485         * class.cs (Operator.Emit): Do not emit attributes here - it is
11486         taken care of by the Method class that we delegate too. This takes
11487         care of bug #45876.
11488
11489 2003-07-10  Martin Baulig  <martin@ximian.com>
11490
11491         * expression.cs (TypeOfVoid): New class.
11492         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11493
11494 2003-07-10  Martin Baulig  <martin@ximian.com>
11495
11496         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11497         bug #35957.
11498
11499 2003-07-10  Martin Baulig  <martin@ximian.com>
11500
11501         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11502         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11503
11504         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11505
11506         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11507
11508 2003-07-10  Martin Baulig  <martin@ximian.com>
11509
11510         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11511         of decimal.  Fixes #42850.
11512
11513         NOTE: I also fixed the created byte blob, but this doesn't work on
11514         the MS runtime and csc never produces any byte blobs for decimal
11515         arrays.
11516
11517 2003-07-10  Martin Baulig  <martin@ximian.com>
11518
11519         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11520         structs; fixes #32068.
11521         (Block.AddChildVariableNames): Fixed #44302.
11522
11523 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11524
11525         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11526
11527 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11528
11529         * attribute.cs: And this test is onger needed.
11530
11531 2003-07-08  Martin Baulig  <martin@ximian.com>
11532
11533         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11534         inaccessible types.  Fixes #36313.
11535
11536         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11537
11538         * namespace.cs (NamespaceEntry): Create implicit entries for all
11539         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11540         implicit entries for N1.N2 and N1.
11541
11542 2003-07-08  Martin Baulig  <martin@ximian.com>
11543
11544         Rewrote the handling of namespaces to fix a lot of the issues
11545         wrt. `using' aliases etc.
11546
11547         * namespace.cs (Namespace): Splitted this class into a
11548         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11549
11550         * typemanager.cs (TypeManager.IsNamespace): Removed.
11551         (TypeManager.ComputeNamespaces): Only compute namespaces from
11552         loaded assemblies here, not the namespaces from the assembly we're
11553         currently compiling.
11554
11555 2003-07-08  Martin Baulig  <martin@ximian.com>
11556
11557         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11558
11559 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11560
11561         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11562         already fixed it.  
11563
11564         I thought about the memory savings here, but LookupTypeReflection
11565         is used under already very constrained scenarios.  Compiling
11566         corlib or mcs only exposes one hit, so it would not really reduce
11567         any memory consumption.
11568
11569 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11570
11571         * typemanager.cs: fixes bug #45889 by only adding public types from
11572         other assemblies to the list of known types.
11573
11574 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11575
11576         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11577         on the type we resolved.
11578
11579 2003-07-05  Martin Baulig  <martin@ximian.com>
11580
11581         * pending.cs (PendingImplementation.ParentImplements): Don't
11582         create the proxy if the parent is abstract.
11583
11584         * class.cs (TypeContainer.DefineIndexers): Process explicit
11585         interface implementations first.  Fixes #37714.
11586
11587 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11590         defined recursively;  but since we modify the input parameters
11591         (left is set to `this' temporarily), we reset this value if the
11592         left_is_explicit is false, which gives the original semantics to
11593         the code.  
11594
11595         * literal.cs (NullPointer): new class used to represent a null
11596         literal in a pointer context.
11597
11598         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11599         type is a pointer, use a NullPointer object instead of a
11600         NullLiteral.   Closes 43687
11601
11602         (ExplicitConversion): Convert pointer values using
11603         the conv opcode to the proper type.
11604
11605         * ecore.cs (New): change ValueTypeVariable property into a method,
11606         that returns whether the valuetype is suitable for being used.
11607
11608         * expression.cs (Binary.DoNumericPromotions): Only return if we
11609         the int constant was a valid uint, and we can return both left and
11610         right as uints.  If not, we continue processing, to trigger the
11611         type conversion.  This fixes 39018.
11612
11613         * statement.cs (Block.EmitMeta): During constant resolution, set
11614         the CurrentBlock property on the emitcontext, so that we resolve
11615         constants propertly.
11616
11617 2003-07-02  Martin Baulig  <martin@ximian.com>
11618
11619         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11620         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11621
11622         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11623         than emitting it here.
11624
11625         * statement.cs: Fixed some more flow analysis bugs.
11626
11627 2003-07-02  Martin Baulig  <martin@ximian.com>
11628
11629         * class.cs (MethodData.Define): When implementing interface
11630         methods, set Final unless we're Virtual.
11631
11632         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11633         check work for interface methods.
11634
11635 2003-07-01  Martin Baulig  <martin@ximian.com>
11636
11637         * ecore.cs (EmitContext.This): Replaced this property with a
11638         GetThis() method which takes a Location argument.  This ensures
11639         that we get the correct error location for a CS0188.
11640
11641 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11642
11643         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11644         ImplicitStandardConversion.
11645
11646         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11647
11648 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11649
11650         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11651         optimization.
11652
11653 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11654
11655         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11656         constructors.
11657
11658         (MethodData.Define): Turn off initlocals for unsafe methods.
11659
11660 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11663         complete;  Fixes #37521.
11664
11665         * delegate.cs: Use Modifiers.TypeAttr to compute the
11666         TypeAttributes, instead of rolling our own.  This makes the flags
11667         correct for the delegates.
11668
11669 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11670
11671         * class.cs (Constructor.Define): Set the private flag for static
11672         constructors as well.
11673
11674         * cs-parser.jay (statement_expression): Set the return value to
11675         null, to avoid a crash when we catch an error.
11676
11677 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * cs-parser.jay: Applied patch from Jackson that adds support for
11680         extern and unsafe modifiers to destructor declarations.
11681
11682         * expression.cs: Report error 21 if the user is trying to index a
11683         System.Array.
11684
11685         * driver.cs: Add an error message, suggested by the bug report.
11686
11687         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11688         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11689
11690 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11691
11692         * namespace.cs: Add some information to reduce FAQs.
11693
11694 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11695
11696         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11697         underlying enumeration types.  Fixes #43915.
11698
11699         * expression.cs: Treat ushort/short as legal values to be used in
11700         bitwise operations.
11701
11702 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11703
11704         * delegate.cs: transfer custom attributes for paramenters from
11705         the delegate declaration to Invoke and BeginInvoke.
11706
11707 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11708
11709         * attribute.cs: handle custom marshalers and emit marshal info
11710         for fields, too.
11711
11712 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11713
11714         * makefile.gnu: Added anonymous.cs to the compiler sources.
11715
11716 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11717
11718         * iterators.cs: Change the name of the proxy class to include two
11719         underscores.
11720
11721         * cs-parser.jay: Update grammar to include anonymous methods.
11722
11723         * anonymous.cs: new file.
11724
11725 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11726
11727         * class.cs (Field.Define): Add missing test for pointers and
11728         safety. 
11729
11730 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11731
11732         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11733         we use the stobj opcode.
11734
11735         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11736         since it wasn't the correct fix. 
11737
11738         It still is puzzling that we are required to use stobj for IntPtr
11739         which seems to be a ValueType.
11740
11741 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11742
11743         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11744         during regular simple name resolution.   Now, the trick is that
11745         instead of returning for processing the simplename, we do a
11746         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11747         contextual lookup type).   If a match is found, return that, if
11748         not, return for further composition.
11749
11750         This fixes long-standing 30485.
11751
11752         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11753         using the address to initialize an object, do an Stobj instead of
11754         using the regular Stelem.
11755
11756         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11757         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11758         Because if we are a BaseIndexerAccess that value will be true.
11759         Fixes 43643.
11760
11761         * statement.cs (GotoCase.Resolve): Return after reporting an
11762         error, do not attempt to continue. 
11763
11764         * expression.cs (PointerArithmetic.Emit): If our operand is a
11765         long, convert our constants to match the operand before
11766         multiplying.  Convert to I type before adding.   Fixes 43670.
11767
11768 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11769
11770         * enum.cs (ImplicitConversionExists) : Rename to
11771         ImplicitEnumConversionExists to remove ambiguity. 
11772
11773         * ecore.cs (NullCast): New type of cast expression class which
11774         basically is very similar to EmptyCast with the difference being
11775         it still is a constant since it is used only to cast a null to
11776         something else
11777         (eg. (string) null)
11778
11779         * convert.cs (ImplicitReferenceConversion): When casting a null
11780         literal, we return a NullCast.
11781
11782         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11783         should be around anymore.
11784
11785         The renaming (reported was slightly wrong). Corrections:
11786
11787         ConvertImplicitStandard -> ImplicitConversionStandard
11788         ConvertExplicitStandard -> ExplicitConversionStandard
11789
11790         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11791         before passing them in !
11792
11793         * convert.cs (ImplicitConversionStandard): When comparing for
11794         equal expr and target types, ensure that expr is not a
11795         NullLiteral.
11796
11797         In general, we must not be checking (expr_type ==
11798         target_type) in the top level conversion methods
11799         (ImplicitConversion, ExplicitConversion etc). This checking is
11800         done in the methods that they delegate to.
11801
11802 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11803
11804         * convert.cs: Move Error_CannotConvertType,
11805         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11806         ImplicitNumericConversion, ImplicitConversionExists,
11807         ImplicitUserConversionExists, StandardConversionExists,
11808         FindMostEncompassedType, FindMostSpecificSource,
11809         FindMostSpecificTarget, ImplicitUserConversion,
11810         ExplicitUserConversion, GetConversionOperators,
11811         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11812         TryImplicitIntConversion, Error_CannotConvertImplicit,
11813         ConvertImplicitRequired, ConvertNumericExplicit,
11814         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11815         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11816         its own file.
11817
11818         Perform the following renames:
11819
11820         StandardConversionExists -> ImplicitStandardConversionExists
11821         ConvertImplicit -> ImplicitConversion
11822         ConvertImplicitStandard -> ImplicitStandardConversion
11823         TryImplicitIntConversion -> ImplicitIntConversion
11824         ConvertImplicitRequired -> ImplicitConversionRequired
11825         ConvertNumericExplicit -> ExplicitNumericConversion
11826         ConvertReferenceExplicit -> ExplicitReferenceConversion
11827         ConvertExplicit -> ExplicitConversion
11828         ConvertExplicitStandard -> ExplicitStandardConversion
11829
11830 2003-05-19  Martin Baulig  <martin@ximian.com>
11831
11832         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11833         (TypeInfo): Added support for structs having structs as fields.
11834
11835         * ecore.cs (FieldExpr): Implement IVariable.
11836         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11837         VariableInfo for the field.
11838
11839 2003-05-18  Martin Baulig  <martin@ximian.com>
11840
11841         * expression.cs (This.DoResolve): Report a CS0027 if we're
11842         emitting a field initializer.
11843
11844 2003-05-18  Martin Baulig  <martin@ximian.com>
11845
11846         * expression.cs (This.ResolveBase): New public function.
11847         (This.DoResolve): Check for CS0188.
11848
11849         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11850         This.Resolve().
11851
11852         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11853         `instance_expression' to null if we don't have any non-static
11854         methods.
11855
11856 2003-05-18  Martin Baulig  <martin@ximian.com>
11857
11858         Reworked the way how local variables and parameters are handled by
11859         the flow analysis code.
11860
11861         * statement.cs (TypeInfo, VariableMap): New public classes.
11862         (VariableInfo): New public class.  This is now responsible for
11863         checking whether a variable has been assigned.  It is used for
11864         parameters and local variables.
11865         (Block.EmitMeta): Take the InternalParameters as argument; compute
11866         the layout of the flow vectors here.
11867         (Block.LocalMap, Block.ParameterMap): New public properties.
11868         (FlowBranching): The .ctor doesn't get the InternalParameters
11869         anymore since Block.EmitMeta() now computes the layout of the flow
11870         vector.
11871         (MyStructInfo): This class is now known as `StructInfo' and nested
11872         in `TypeInfo'; we don't access this directly anymore.
11873
11874         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11875         property and removed IsAssigned(), IsFieldAssigned(),
11876         SetAssigned() and SetFieldAssigned(); we now call them on the
11877         VariableInfo so we don't need to duplicate this code everywhere.
11878
11879         * expression.cs (ParameterReference): Added `Block block' argument
11880         to the .ctor.
11881         (LocalVariableReference, ParameterReference, This): The new
11882         VariableInfo class is now responsible for all the definite
11883         assignment stuff.
11884
11885         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11886         IsParameterAssigned, SetParameterAssigned): Removed.
11887
11888 2003-05-18  Martin Baulig  <martin@ximian.com>
11889
11890         * typemanager.cs (InitCoreTypes): Try calling
11891         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11892         the 3-args-version.  Corlib now also needs our `void_type'.
11893         (GetMethod): Added overloaded version which takes an optional
11894         `bool report_errors' to allow lookups of optional methods.
11895
11896 2003-05-12  Martin Baulig  <martin@ximian.com>
11897
11898         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11899         only used for locals and not for parameters.
11900
11901 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11902
11903         * support.cs (InternalParameters.ParameterType): Return the
11904         ExternalType of the parameter.
11905
11906         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11907         they were unused.
11908
11909 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11910
11911         * class.cs (MethodData.Define): Do not set the `newslot' on
11912         interface members, if they are also flagged as "override".
11913
11914         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11915         better code for ++i and i++.  This only works for static fields
11916         and local variables.
11917
11918         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11919         want to pull the DeclSpace out of the builder_to_declspace instead
11920         of the TypeBuilder (like in TypeContainer.FindMembers).
11921
11922         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11923         instead of LookupTypeContainer.  Fixes the crash on .NET for
11924         looking up interface members.
11925
11926         * const.cs: Create our own emit context during the Definition
11927         stage, so that constants are evaluated in the proper context, when
11928         a recursive definition happens.
11929
11930 2003-05-11  Martin Baulig  <martin@ximian.com>
11931
11932         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11933         new block for a switch section.
11934         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11935         the adding/lookup in the switch block.  Fixes #39828.
11936
11937 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11938
11939         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11940         functionality: I needed to convert the data after I had performed
11941         the add/sub operation into the operands type size.
11942
11943         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11944         pass the type for the box operation, otherwise the resulting
11945         object would have been of type object.
11946
11947         (BoxedCast): Add constructor to specify the type to box as.
11948
11949 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * iterators.cs: I was reusing the `count' variable inadvertently,
11952         take steps to not allow this to happen.
11953
11954 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11957         by creating an array at the point where the params starts and
11958         putting all those arguments there, then adjusting the size of the
11959         array.
11960
11961 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11962
11963         * expression.cs (New.AddressOf): Implement interface
11964         IMemoryLocation.  This is used when the `new' operator is used in
11965         the context of an invocation to a method on a value type.
11966
11967         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11968         example. 
11969
11970         * namespace.cs: Also check the using aliases here.
11971
11972         * driver.cs: Move the test for using validity after the types have
11973         been entered, so we do a single pass that also includes the using
11974         aliases. 
11975
11976         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11977         in the regular case.   CreateSiblingForFinally is doing extra
11978         error checking.
11979
11980         * attribute.cs (GetAttributeArgumentExpression): Store the result
11981         on an out value, and use the return value to indicate failure
11982         instead of using null (which is a valid return for Constant.GetValue).
11983
11984         * statement.cs: Perform the analysis flow for the increment
11985         portion after the statement, because this will be the real flow of
11986         execution.  Fixes #42385
11987
11988         * codegen.cs (EmitContext.EmitArgument,
11989         EmitContext.EmitStoreArgument): New helper functions when the
11990         RemapToProxy flag is set.
11991
11992         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11993         function.
11994
11995         Add support for remapping parameters. 
11996
11997         * iterators.cs: Propagate parameter values;  Store parameter
11998         values in the proxy classes.
11999
12000 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12001
12002         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12003         need a proxy reference;  I do not know what I was thinking
12004
12005         * cs-parser.jay (constructor_initializer): catch another error,
12006         and display nice message.
12007
12008         (field_declaration): catch void field declaration
12009         to flag a better error. 
12010
12011         * class.cs (MemberBase.CheckBase): Report an error instead of a
12012         warning if a new protected member is declared in a struct. 
12013         (Field.Define): catch the error of readonly/volatile.
12014
12015         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12016
12017         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12018         volatile variable is taken
12019
12020 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12021
12022         * statement.cs (Fixed.Resolve): Report an error if we are not in
12023         an unsafe context.
12024
12025 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12026
12027         * typemanager.cs: reuse the code that handles type clashes for
12028         delegates and enumerations.
12029
12030         * class.cs (Report28): Always report.
12031
12032         * expression.cs (EncodeAsAttribute): Allow nulls here.
12033
12034 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12037         the functionality for testing whether an expression is valid for
12038         an attribute here.  Also handle the case of arrays of elements
12039         being stored. 
12040
12041         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12042         encoding a linear array into an array of objects that are suitable
12043         to be passed to an CustomAttributeBuilder.
12044
12045         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12046
12047         * ecore.cs: (FieldExpr): Handle field remapping here.
12048
12049         * iteratators.cs: Pass the instance variable (if the method is an
12050         instance method) to the constructors, so we can access the field
12051         variables on the class.
12052
12053         TODO: Test this with structs.  I think the THIS variable on
12054         structs might have to be a pointer, and not a refenrece
12055
12056 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12057
12058         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12059         local variables to fields in a proxy class.
12060
12061         * iterators.cs (PopulateProxy): Rename our internal fields to
12062         <XXX>.  
12063         Create a <THIS> field if we are an instance method, so we can
12064         reference our parent container variables.
12065         (MapVariable): Called back from the EmitContext code to enter a
12066         new variable to field mapping into the proxy class (we just create
12067         a FieldBuilder).
12068
12069         * expression.cs
12070         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12071         for using the remapped locals to fields.
12072
12073         I placed the code here, because that gives the same semantics to
12074         local variables, and only changes the Emit code.
12075
12076         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12077         statements inside iterators.
12078         (VariableInfo): Add a FieldBuilder for the cases when we are
12079         remapping local variables to fields in a proxy class
12080
12081         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12082         current_block != null.
12083
12084         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12085         not cope with strings, as it has been moved to the
12086         TableSwitchEmit.  Fixed bug in switch generation.
12087
12088         * expression.cs (New.DoResolve): Provide more context for the user
12089         when reporting an error.
12090
12091         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12092         pointers. 
12093
12094         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12095         check the permissions for it.  Note than in a type-resolution
12096         context the check was already present in DeclSpace.ResolveType,
12097         but was missing from the MemberAccess.
12098
12099         (ArrayCreation.CheckIndices): warn if the user has
12100         more nested levels of expressions, but there are no more
12101         dimensions specified.  Avoids crash on bug 41906.
12102
12103 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * statement.cs (Block): replace Implicit bool, for a generic
12106         flags.   
12107         New flag: `Unchecked'.  This is used during the EmitMeta phase
12108         (which is out-of-line with the regular Resolve/Emit process for a
12109         statement, as this is done ahead of time, but still gets a chance
12110         to call constant resolve).
12111
12112         (Block.Flags): new enum for adding a new flag.
12113
12114         (Block.EmitMeta): track the state of unchecked.
12115
12116         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12117         to enable constant resolution to work there as well.
12118
12119 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12120
12121         * typemanager.cs (ienumerable_type): Also look up
12122         System.Collections.IEnumerable. 
12123
12124 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12125
12126         TODO: Test more than one conditional per method.
12127
12128         * class.cs (Indexer.Define): Report the location where the user is
12129         referencing the unsupported feature.
12130
12131         (MethodData): Overload the use of `conditionals' to
12132         minimize the creation of needless ArrayLists.   This saves roughly
12133         212kb on my machine.
12134
12135         (Method): Implement the new IIteratorContainer interface.
12136         (Method.SetYields): Implement the method by setting the ModFlags
12137         to contain METHOD_YIELDS.
12138
12139         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12140         which just got set to null.
12141
12142         * iterators.cs: New file.
12143
12144         (Yield, YieldBreak): New statements.
12145
12146         * statement.cs (Return.Resolve): Flag an error if we are used in
12147         an iterator method.
12148
12149         * codegen.cs (InIterator): New flag set if the code is being
12150         compiled in an iterator method.
12151
12152         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12153         internal modifier, and we just use it to avoid adding extra
12154         fields, as this is seldom used.  
12155
12156         * cs-parser.jay: Add yield_statement (yield and yield break).
12157
12158         * driver.cs: New flag -v2 to turn on version 2 features. 
12159
12160         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12161         hashtable when v2 is enabled.
12162
12163 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12164
12165         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12166         there is already a namespace defined with this name.
12167
12168         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12169         people upgraded their corlibs.
12170
12171         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12172         always use fully qualified types, no need to use the compiler
12173         front end.
12174
12175         (TypeManager.IsNamespace): Use binarysearch.
12176
12177         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12178         AddDelegate): I did not quite use the new IsValid API properly: I
12179         have to pass the short-name and the fullname.  I was passing only
12180         the basename instead of the fullname sometimes. 
12181
12182         (TypeContainer.DefineType): call NamespaceClash.
12183
12184         * interface.cs (Interface.DefineType): use NamespaceClash before
12185         defining the type.
12186
12187         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12188         defining the type.
12189
12190         * enum.cs: (Enum.DefineType): use NamespaceClash before
12191         defining the type.
12192
12193         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12194         speed increase.  First, use the negative_hits cache when we get a
12195         negative.  Second, add the type with its full original name
12196         instead of the new . and + encoded name (reflection uses + to
12197         separate type from a nested type).  Use LookupTypeReflection
12198         directly which bypasses the type->name hashtable (that we already
12199         know does not contain the type.
12200
12201         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12202         location/container type. 
12203
12204         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12205
12206 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12207
12208         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12209
12210         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12211         method is being referenced in the method group from a static
12212         context, and report error 120 if so.
12213
12214         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12215         Error118. 
12216
12217         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12218         is created, we create the A namespace).
12219
12220         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12221         Fixes #41591
12222
12223 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12224
12225         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12226         invocation to ModuleBuilder.GetType with the same values will
12227         return a new type instance, so we need to cache its return
12228         values. 
12229
12230         * expression.cs (Binary.ResolveOperator): Only allow the compare
12231         operators on enums if they are of the same type.
12232
12233         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12234         types of ValueType on their own case.  Before we were giving them
12235         the same treatment as objects.
12236
12237         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12238         fullname.  Short name is used to compare against container name.
12239         Fullname is used to check against defined namespace names.
12240
12241         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12242         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12243
12244         (Method.CheckBase): Call parent.
12245         (MemberBase.CheckBase): Check for protected members on sealed
12246         classes.
12247         (PropertyBase.CheckBase): Call parent.
12248         (Field.Define): Call parent.
12249
12250         * report.cs: Negative error codes are now mapped to 8000 - code,
12251         so that the display is render more nicely.
12252
12253         * typemanager.cs: Do not use try/catch, instead report a regular
12254         error. 
12255
12256         (GetPointerType, GetReferenceType): These methods provide
12257         mechanisms to obtain the T* and T& from a T.  We had the code
12258         previously scattered around the code base, and it also used
12259         TypeManager.LookupType that would go through plenty of caches.
12260         This one goes directly to the type source.
12261
12262         In some places we did the Type.GetType followed by
12263         ModuleBuilder.GetType, but not in others, so this unifies the
12264         processing as well.
12265
12266         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12267         statements now that we have namespace information.
12268
12269         * typemanager.cs (IsNamespace): New method, returns whether the
12270         string presented is a namespace or not.
12271
12272         (ComputeNamespaces): New public entry point, computes the list of
12273         available namespaces, using the GetNamespaces API call in Mono, or
12274         the slower version in MS.NET.   
12275
12276         Now before we start the semantic analysis phase, we have a
12277         complete list of namespaces including everything that the user has
12278         provided.
12279
12280         Deleted old code to cache namespaces in .nsc files.
12281
12282 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12283
12284         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12285         class/struct location definition Location for the implicit
12286         constructor location.
12287
12288         (Operator.Define): Use the location of the operator for the
12289         implicit Method definition.
12290
12291         (Constructor.Emit): use the constructor location for the implicit
12292         base initializer constructor.
12293
12294         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12295         and the Expression class now contains two new methods:
12296
12297         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12298         isolate type lookup from the rest of the resolution process.
12299
12300         Since we use Expressions to hold type definitions due to the way
12301         we parse the input we have historically overloaded Resolve to
12302         perform the Type lookups if a special flag is passed.  Now this is
12303         eliminated and two methods take their place. 
12304
12305         The differences in the two methods between xStep and xTerminal is
12306         that xStep is involved in our current lookup system that uses
12307         SimpleNames to compose a name, while xTerminal is used just to
12308         catch the case where the simplename lookup failed.
12309
12310 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12311
12312         * expression.cs (ResolveMemberAccess): Remove redundant code.
12313         TypeExpr expressions are always born fully resolved.
12314
12315         * interface.cs (PopulateMethod): Do not lookup the types twice.
12316         We were doing it once during SemanticAnalysis and once during
12317         PopulateMethod.
12318
12319         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12320         in local variable type definitions, were being returned as a
12321         SimpleName (we decomposed everything into a string), that is
12322         because primary_expression was being used instead of a type in the
12323         grammar (reduce/reduce conflicts).
12324
12325         The part that was wrong is that we converted the expression into a
12326         string (an oversimplification in one hand, compounded with primary
12327         expressions doing string concatenation).
12328
12329         So things like:
12330
12331         A.B.C [] x;
12332
12333         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12334         using clauses from working on this particular context.  And a type
12335         was being matched directly against "A.B.C[]".
12336
12337         We now use the correct approach, and allow for ComposedCast to be
12338         part of the unary expression.  So the "A.B.C []" become a composed
12339         cast of "A.B.C" (as a nested group of MemberAccess with a
12340         SimpleName at the end) plus the rank composition "[]". 
12341
12342         Also fixes 35567
12343
12344 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12345
12346         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12347         for the access level checking.
12348
12349         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12350         `TypeContainer container', because I kept getting confused when I
12351         was debugging this code.
12352
12353         * expression.cs (Indexers): Instead of tracking getters/setters,
12354         we now track them in parallel.  We create one arraylist less, but
12355         most importantly it is possible now for the LValue code to find a
12356         matching get for a set.
12357
12358         (IndexerAccess.DoResolveLValue): Update the code.
12359         GetIndexersForType has been modified already to extract all the
12360         indexers from a type.  The code assumed it did not.
12361
12362         Also make the code set the correct return type for the indexer.
12363         This was fixed a long time ago for properties, but was missing for
12364         indexers.  It used to be void_type.
12365
12366         (Binary.Emit): Test first for doubles instead of
12367         floats, as they are more common.
12368
12369         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12370         when dealing with floats and the <=, >= operators.  This fixes bug
12371         #39314 
12372
12373         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12374         to load the array value by emitting a load on the foreach variable
12375         type.  This was incorrect.  
12376
12377         We now emit the code to load an element using the the array
12378         variable type, and then we emit the conversion operator.
12379
12380         Fixed #40176
12381
12382 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12383
12384         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12385
12386 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12389         test for protection before we test for signatures. 
12390
12391         (MethodSignature.ToString): implement.
12392
12393         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12394         to the case where we reduced into a LongConstant.
12395
12396         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12397         depend on whether the information is acurrate, because the
12398         Microsoft runtime will always claim that the array type is public,
12399         regardless of the real state.
12400
12401         If the type is a pointer, another problem happens: the type is
12402         reported as non-public in Microsoft.  
12403
12404         In both cases we have to call CheckAccessLevel recursively with
12405         the underlying type as the argument to be tested.
12406
12407 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * assign.cs (Assign.Emit): If we are dealing with a compound
12410         assignment expression, we should use the code path that stores the
12411         intermediate result in a temporary value.  This fixes #40903.
12412
12413         *expression.cs (Indirection.ToString): Provide ToString method for
12414         debugging. 
12415
12416 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12417
12418         * class.cs: Null out fields holding references to Block objects so
12419         they can be garbage collected.
12420
12421         * expression.cs (OverloadResolve): Remove unused local.
12422
12423 2003-04-07  Martin Baulig  <martin@ximian.com>
12424
12425         * codegen.cs (EmitContext.CurrentFile): New public field.
12426         (EmitContext.Mark): Use the CurrentFile to check whether the
12427         location is in the correct file.
12428         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12429
12430 2003-04-07  Martin Baulig  <martin@ximian.com>
12431
12432         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12433
12434         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12435         location.  [FIXME: The location argument which gets passed to this
12436         method is sometimes wrong!]
12437
12438 2003-04-07  Nick Drochak <ndrochak@gol.com>
12439
12440         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12441
12442 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12443
12444         * expression.cs (Indirection.EmitAssign): We were using the
12445         temporary, but returning immediately instead of continuing the
12446         EmitAssing flow.
12447
12448 2003-04-06  Martin Baulig  <martin@ximian.com>
12449
12450         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12451         if it's a nested child, but also deriving from the outer class.
12452         See test 190.cs.
12453
12454         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12455         nested child, but also deriving from the outer class.  See
12456         test-190.cs.
12457         (FilterWithClosure): We may access private members of the outer
12458         class if we're a nested child and deriving from the outer class.
12459         (RealMemberLookup): Only set `closure_private_ok' if the
12460         `original_bf' contained BindingFlags.NonPublic.
12461
12462 2003-04-05  Martin Baulig  <martin@ximian.com>
12463
12464         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12465         probe if its a type parameter, and if so, flag an error.
12466
12467         * decl.cs: Move here the SetParameterInfo code from class.cs.
12468         Handle IsGeneric here.
12469
12470         Handle a variety of errors in the parameter info definition.
12471
12472         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12473         type parameters here.
12474
12475         * cs-parser.jay (class_declaration): report errors for parameters
12476         here as well.
12477
12478 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12479
12480         * generic.cs: New file, contains support code for generics.
12481
12482         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12483         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12484
12485         Update parser for the above removals.
12486
12487         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12488         now taken care of in the parser.
12489
12490 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12491
12492         * class.cs (Event.Define): Do not allow abstract events to have
12493         initializers. 
12494
12495 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12496
12497         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12498         block in event declarations.
12499
12500         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12501         value type, get its address.
12502
12503         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12504         leaving a class on the stack instead of a boolean value (int
12505         0/1).  Change the code so we compare against null, and then the
12506         result against zero.
12507
12508         * class.cs (TypeContainer.GetClassBases): We were checking for the
12509         parent class being sealed too late.
12510
12511         * expression.cs (Binary.Emit): For <= and >= when dealing with
12512         floating point values, use cgt.un and clt.un instead of cgt and
12513         clt alone.
12514
12515 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12516
12517         * statement.cs: Apply the same optimization as MS: skip the 
12518         GetEnumerator returning an IEnumerator, and use the one returning a 
12519         CharEnumerator instead. This allows us to avoid the try-finally block 
12520         and the boxing.
12521
12522 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12523
12524         * cs-parser.jay: Attributes cannot be applied to
12525                          namespaces. Fixes #40473
12526
12527 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12528
12529         * class.cs:
12530         (Add*): check if the name is valid using the full name for constants,
12531         fields, properties and events.
12532
12533 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12536         char constants to be part of the enumeration.
12537
12538         * expression.cs (Conditional.DoResolve): Add support for operator
12539         true. Implements the missing functionality from 14.12
12540
12541         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12542         operator true/false as required by the spec.
12543
12544         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12545         implicit conversion to boolean.
12546
12547         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12548         also one where the type implements `operator true'. 
12549
12550         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12551         get an expression that will invoke operator true based on an
12552         expression.  
12553
12554         (GetConversionOperators): Removed the hack that called op_True
12555         here.  
12556
12557         (Expression.ResolveBoolean): Move this from Statement.
12558
12559 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12560
12561         * ecore.cs (FieldExpr): do not allow initialization of initonly
12562         fields on derived classes
12563
12564 2003-03-13  Martin Baulig  <martin@ximian.com>
12565
12566         * statement.cs (Block.Emit): Call ig.BeginScope() and
12567         ig.EndScope() when compiling with debugging info; call
12568         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12569
12570 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12571
12572         * expression.cs (Indexers): Do not construct immediately, allow
12573         for new members to be appended as we go.  Fixes 38143
12574
12575 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12576
12577         * expression.cs: save/restore context when resolving an unchecked
12578         expression.
12579
12580 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12581
12582         * cfold.cs: Catch division by zero in modulus operator during
12583         constant folding.
12584
12585 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12586
12587         * interface.cs (Interface.DefineMembers): Avoid defining members
12588         twice. 
12589
12590 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12591
12592         * driver.cs: handle the +/- options for -noconfig
12593
12594         * statement.cs (Unckeched.Resolve): Also track the state of
12595         unchecked in the Resolve phase.
12596
12597 2003-02-27  Martin Baulig  <martin@ximian.com>
12598
12599         * ecore.cs (Expression.MemberLookup): Don't create a
12600         MethodGroupExpr for something which is not a method.  Fixes #38291.
12601
12602 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * class.cs (MemberBase.CheckParameters): Also check that the type
12605         is unmanaged if it is a pointer.
12606
12607         * expression.cs (SizeOf.Resolve): Add location information.
12608
12609         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12610         a managed type is declared.
12611
12612         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12613         parameter modifiers as well.  Fixes bug 38606
12614
12615         * class.cs: Very sad.  Am backing out the speed up changes
12616         introduced by the ArrayList -> Array in the TypeContainer, as they
12617         were not actually that much faster, and introduced a bug (no error
12618         reports on duplicated methods).
12619
12620         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12621         source first, this will guarantee that we have a valid expression
12622         before calling in lower levels functions that will require a
12623         resolved object.  Then use this original_source in the
12624         target.ResolveLValue instead of the original source that was
12625         passed to us.
12626
12627         Another change.  Use target.Resolve instead of LValueResolve.
12628         Although we are resolving for LValues, we will let the Assign code
12629         take care of that (it will be called again from Resolve).  This
12630         basically allows code like this:
12631
12632         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12633         class Y { void A (X x) { x [0] += o; }
12634
12635         The problem was that the indexer was trying to resolve for
12636         set_Item (idx, object o) and never finding one.  The real set_Item
12637         was set_Item (idx, X).  By delaying the process we get the right
12638         semantics. 
12639
12640         Fixes bug 36505
12641
12642 2003-02-23  Martin Baulig  <martin@ximian.com>
12643
12644         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12645         while calling DoEmit ().
12646
12647         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12648         source files; if you use the #line directive inside a method, the
12649         compiler stops emitting line numbers for the debugger until it
12650         reaches the end of the method or another #line directive which
12651         restores the original file.
12652
12653 2003-02-23  Martin Baulig  <martin@ximian.com>
12654
12655         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12656
12657 2003-02-23  Martin Baulig  <martin@ximian.com>
12658
12659         * statement.cs (Block.AddChildVariableNames): We need to call this
12660         recursively, not just for our immediate children.
12661
12662 2003-02-23  Martin Baulig  <martin@ximian.com>
12663
12664         * class.cs (Event.Define): Always make the field private, like csc does.
12665
12666         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12667         actually work, fixes bug #37521.
12668
12669 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12670
12671         * delegate.cs: When creating the various temporary "Parameters"
12672         classes, make sure that we call the ComputeAndDefineParameterTypes
12673         on those new parameters (just like we do with the formal ones), to
12674         allow them to be resolved in the context of the DeclSpace.
12675
12676         This fixes the bug that Dick observed in Bugzilla #38530.
12677
12678 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * expression.cs (ResolveMemberAccess): When resolving a constant,
12681         do not attempt to pull a constant if the value was not able to
12682         generate a valid constant.
12683
12684         * const.cs (LookupConstantValue): Do not report more errors than required.
12685
12686 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12687
12688         * expression.cs: fixes bug #38328.
12689
12690 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12691
12692         * class.cs: Changed all the various members that can be part of a
12693         class from being an ArrayList to be an Array of the right type.
12694         During the DefineType type_list, interface_list, delegate_list and
12695         enum_list are turned into types, interfaces, delegates and enums
12696         arrays.  
12697
12698         And during the member population, indexer_list, event_list,
12699         constant_list, field_list, instance_constructor_list, method_list,
12700         operator_list and property_list are turned into their real arrays.
12701
12702         Although we could probably perform this operation earlier, for
12703         good error reporting we need to keep the lists and remove the
12704         lists for longer than required.
12705
12706         This optimization was triggered by Paolo profiling the compiler
12707         speed on the output of `gen-sample-program.pl' perl script. 
12708
12709         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12710         not crash in methods like MemberLookupFailed that use this field.  
12711
12712         This problem arises when the compiler fails to resolve a type
12713         during interface type definition for example.
12714
12715 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12716
12717         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12718         inherit from System.Object, so we have to stop at null, not only
12719         when reaching System.Object.
12720
12721 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12724         DeclaredOnly because the parent indexer might have had a different
12725         name, but did not loop until the top of the hierarchy was reached.
12726
12727         The problem this one fixes is 35492: when a class implemented an
12728         indexer from an interface, we were getting the interface method
12729         (which was abstract) and we were flagging an error (can not invoke
12730         abstract method).
12731
12732         This also keeps bug 33089 functioning, and test-148 functioning.
12733
12734         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12735         out if a method is special is to see if it is declared in a
12736         property or event, or whether it is one of the predefined operator
12737         names.   This should fix correctly #36804.
12738
12739 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12740
12741         The goal here is to remove the dependency on EmptyCast.Peel ().
12742         Killing it completely.
12743
12744         The problem is that currently in a number of places where
12745         constants are expected, we have to "probe" for an EmptyCast, and
12746         Peel, which is not the correct thing to do, as this will be
12747         repetitive and will likely lead to errors. 
12748
12749         The idea is to remove any EmptyCasts that are used in casts that
12750         can be reduced to constants, so we only have to cope with
12751         constants. 
12752
12753         This bug hunt was triggered by Bug 37363 and the desire to remove
12754         the duplicate pattern where we were "peeling" emptycasts to check
12755         whether they were constants.  Now constants will always be
12756         constants.
12757
12758         * ecore.cs: Use an enumconstant here instead of wrapping with
12759         EmptyCast.  
12760
12761         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12762         throwing me off.  By handling this we can get rid of a few hacks.
12763
12764         * statement.cs (Switch): Removed Peel() code.
12765
12766 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12767
12768         * class.cs: Location information for error 508
12769
12770         * expression.cs (New.DoResolve): Add a guard against double
12771         resolution of an expression.  
12772
12773         The New DoResolve might be called twice when initializing field
12774         expressions (see EmitFieldInitializers, the call to
12775         GetInitializerExpression will perform a resolve on the expression,
12776         and later the assign will trigger another resolution
12777
12778         This leads to bugs (#37014)
12779
12780         * delegate.cs: The signature for EndInvoke should contain any ref
12781         or out parameters as well.  We were not doing this in the past. 
12782
12783         * class.cs (Field.Define): Do not overwrite the type definition
12784         inside the `volatile' group.  Turns out that volatile enumerations
12785         were changing the type here to perform a validity test, which
12786         broke conversions. 
12787
12788 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12789
12790         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12791         and structs, we do not want to load the instance variable
12792
12793         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12794         enum_type has to be handled like an object reference (implicit
12795         conversions exists from this to object), but the regular IsClass
12796         and IsValueType tests will never return true for this one.
12797
12798         Also we use TypeManager.IsValueType instead of type.IsValueType,
12799         just for consistency with the rest of the code (this is only
12800         needed if we ever use the construct exposed by test-180.cs inside
12801         corlib, which we dont today).
12802
12803 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12804
12805         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12806         just InternalCall.
12807
12808 2003-02-09  Martin Baulig  <martin@ximian.com>
12809
12810         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12811         (Namespace.DefineNamespaces): New static public method; this is
12812         called when we're compiling with debugging to add all namespaces
12813         to the symbol file.
12814
12815         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12816         pass it to the Namespace's .ctor.
12817
12818         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12819         and MethodBase arguments; pass the namespace ID to the symwriter;
12820         pass the MethodBase instead of the token to the symwriter.
12821         (SymbolWriter.DefineNamespace): New method to add a namespace to
12822         the symbol file.
12823
12824 2003-02-09  Martin Baulig  <martin@ximian.com>
12825
12826         * symbolwriter.cs: New file.  This is a wrapper around
12827         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12828         methods here in near future.
12829
12830 2003-02-09  Martin Baulig  <martin@ximian.com>
12831
12832         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12833         ILGenerator.MarkSequencePoint() which are actually used by the
12834         symbol writer.
12835
12836 2003-02-09  Martin Baulig  <martin@ximian.com>
12837
12838         * location.cs (SourceFile): New public sealed class.  This
12839         contains the name and an index which is used in the location's token.
12840         (Location): Reserve an appropriate number of bits in the token for
12841         the source file instead of walking over that list, this gives us a
12842         really huge performance improvement when compiling with debugging.
12843
12844         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12845         `SourceFile' argument instead of a string.
12846         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12847         but don't parse/tokenize here, we need to generate the list of all
12848         source files before we do that.
12849         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12850         the files.
12851
12852         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12853         instead of a string.
12854
12855         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12856         of a string.
12857
12858 2003-02-09  Martin Baulig  <martin@ximian.com>
12859
12860         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12861         filename on `#line default'.
12862
12863 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12864
12865         * statement.cs: don't clear the pinned var when the fixed statement
12866         returns from the method (fixes bug#37752).
12867
12868 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12869
12870         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12871         to IsValueType.
12872
12873 2003-02-07  Martin Baulig  <martin@ximian.com>
12874
12875         * driver.cs: Removed the `--debug-args' command line argument.
12876
12877         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12878         automatically by the AsssemblyBuilder.
12879         (CodeGen.InitializeSymbolWriter): We don't need to call any
12880         initialization function on the symbol writer anymore.  This method
12881         doesn't take any arguments.
12882
12883 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12884
12885         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12886         from referenced assemblies as well.
12887
12888 2003-02-02  Martin Baulig  <martin@ximian.com>
12889
12890         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12891
12892 2003-02-02  Martin Baulig  <martin@ximian.com>
12893
12894         * class.cs (Constructor.Emit): Open the symbol writer before
12895         emitting the constructor initializer.
12896         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12897         single-stepping through constructor initializers.
12898
12899 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12900
12901         * class.cs: Handle error 549: do not allow virtual methods in
12902         sealed classes. 
12903
12904 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12905
12906         * decl.cs: Check access levels when resolving types
12907
12908 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12909
12910         * statement.cs: Add parameters and locals set in catch blocks that might 
12911         return to set vector
12912
12913 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12914
12915         * class.cs (Operator): Set the SpecialName flags for operators.
12916
12917         * expression.cs (Invocation.DoResolve): Only block calls to
12918         accessors and operators on SpecialName methods.
12919
12920         (Cast.TryReduce): Handle conversions from char constants.
12921
12922
12923 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12924
12925         * statement.cs: small memory and time optimization in FlowBranching.
12926
12927 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12928
12929         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12930         problem that the last fix but in the other sid (Set).
12931
12932         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12933         access when there is no indexer in the hierarchy.
12934
12935 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12936
12937         * class.cs: Combine some if statements.
12938
12939 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12940
12941         * driver.cs: fixed bug #37187.
12942
12943 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12944
12945         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12946         any indexer, it's needed to build a list with all the indexers in the
12947         hierarchy (AllGetters), else we have problems. Fixes #35653.
12948
12949 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12950
12951         * class.cs (MethodData.Define): It is wrong for an interface
12952         implementation to be static in both cases: explicit and implicit.
12953         We were only handling this in one case.
12954
12955         Improve the if situation there to not have negations.
12956
12957         * class.cs (Field.Define): Turns out that we do not need to check
12958         the unsafe bit on field definition, only on usage.  Remove the test.
12959
12960 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12961
12962         * driver.cs: use assembly.Location instead of Codebase (the latest
12963         patch made mcs fail when using MS assemblies).
12964
12965 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12966
12967         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12968         get the path to *corlib.dll.
12969
12970 2003-01-21  Nick Drochak <ndrochak@gol.com>
12971
12972         * cs-tokenizer.cs:
12973         * pending.cs:
12974         * typemanager.cs: Remove compiler warnings
12975
12976 2003-01-20  Duncan Mak  <duncan@ximian.com>
12977
12978         * AssemblyInfo.cs: Bump the version number to 0.19.
12979
12980 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12981
12982         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12983
12984 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12985
12986         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12987
12988 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * cs-parser.jay: Small fix: we were not comparing the constructor
12991         name correctly.   Thanks to Zoltan for the initial pointer.
12992
12993 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12994
12995         * cs-tokenizer.cs: Set file name when specified with #line
12996
12997 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12998
12999         * cs-parser.jay: Only perform the constructor checks here if we
13000         are named like the class;  This will help provider a better
13001         error.  The constructor path is taken when a type definition is
13002         not found, but most likely the user forgot to add the type, so
13003         report that rather than the constructor error.
13004
13005 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13006
13007         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13008         allocations.
13009
13010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13011
13012         * cs-parser.jay: Add cleanup call.
13013
13014 2003-01-13  Duncan Mak  <duncan@ximian.com>
13015
13016         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13017         consistent with other methods.
13018
13019 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13020
13021         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13022
13023 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13024
13025         * attribute.cs: only set GuidAttr to true when we have a
13026         GuidAttribute.
13027
13028 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13029
13030         * ecore.cs:
13031         * expression.cs:
13032         * typemanager.cs: fixes to allow mcs compile corlib with the new
13033         Type.IsSubclassOf fix.
13034
13035 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13036
13037         * expression.cs (LocalVariableReference.DoResolve): Classify a
13038         constant as a value, not as a variable.   Also, set the type for
13039         the variable.
13040
13041         * cs-parser.jay (fixed_statement): take a type instead of a
13042         pointer_type, so we can produce a better error message later.
13043
13044         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13045         as an error.  
13046
13047         (For.DoEmit): Make inifinite loops have a
13048         non-conditional branch back.
13049
13050         (Fixed.DoEmit): First populate the pinned variables, then emit the
13051         statement, then clear the variables.  Before I was emitting the
13052         code once for each fixed piece.
13053
13054
13055 2003-01-08  Martin Baulig  <martin@ximian.com>
13056
13057         * statement.cs (FlowBranching.MergeChild): A break in a
13058         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13059
13060 2003-01-08  Martin Baulig  <martin@ximian.com>
13061
13062         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13063         lives in the same number space than `param_map'.  Fixes #36154.
13064
13065 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13066
13067         * cs-parser.jay (constructor_declaration): Set the
13068         Constructor.ModFlags before probing for it.  This makes the
13069         compiler report 514, 515 and 132 (the code was there, but got
13070         broken). 
13071
13072         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13073         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13074         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13075
13076 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13077
13078         * enum.cs: create the enum static fields using the enum type.
13079
13080 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13081
13082         * class.cs: don't try to create the ParamBuilder for the return
13083         type if it's not needed (and handle it breaking for the ms runtime
13084         anyway).
13085
13086 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13087
13088         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13089
13090 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13091
13092         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13093         the command.   This showed up while compiling the JANET source
13094         code, which used \r as its only newline separator.
13095
13096 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13097
13098         * class.cs (Method.Define): If we are an operator (because it
13099         reuses our code), then set the SpecialName and HideBySig.  #36128
13100
13101 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13102
13103         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13104         exception, report error 120 `object reference required'.
13105
13106         * driver.cs: Add --pause option, used during to measure the size
13107         of the process as it goes with --timestamp.
13108
13109         * expression.cs (Invocation.DoResolve): Do not allow methods with
13110         SpecialName to be invoked.
13111
13112 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13113
13114         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13115         number before adding it.
13116
13117 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13118
13119         * ecore.cs (StandardImplicitConversion): When in an unsafe
13120         context, we allow conversion between void * to any other pointer
13121         type. This fixes bug #35973.
13122
13123 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13124
13125         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13126         is not thrown when extensionless outputs are used 
13127
13128 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13129
13130         * rootcontext.cs: fixed compilation of corlib.
13131
13132 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * attribute.cs (Attributes.Contains): Add new method.
13135
13136         * class.cs (MethodCore.LabelParameters): if the parameter is an
13137         `out' parameter, check that no attribute `[In]' has been passed.
13138
13139         * enum.cs: Handle the `value__' name in an enumeration.
13140
13141 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13142
13143         * decl.cs: Added special case to allow overrides on "protected
13144         internal" methods
13145
13146 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13147
13148         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13149         since it makes much more sense.
13150
13151         (Attributes.ctor): Don't require a Location parameter.
13152
13153         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13154
13155         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13156         since we already have that information per attribute.
13157
13158         * everywhere : make appropriate changes.
13159
13160         * class.cs (LabelParameters): Write the code which actually
13161         applies attributes to the return type. We can't do this on the MS
13162         .NET runtime so we flag a warning in the case an exception is
13163         thrown.
13164
13165 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13166
13167         * const.cs: Handle implicit null conversions here too.
13168
13169 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13170
13171         * class.cs (MethodCore.LabelParameters): Remove the extra
13172         Type [] parameter since it is completely unnecessary. Instead
13173         pass in the method's attributes so that we can extract
13174         the "return" attribute.
13175
13176 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13177
13178         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13179         of ignoring it and letting the compile continue.
13180
13181         * typemanager.cs (ChangeType): use an extra argument to return an
13182         error condition instead of throwing an exception.
13183
13184 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13185
13186         * expression.cs (Unary.TryReduce): mimic the code for the regular
13187         code path.  Perform an implicit cast in the cases where we can
13188         implicitly convert to one of the integral types, and then reduce
13189         based on that constant.   This fixes bug #35483.
13190
13191 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13192
13193         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13194
13195 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13196
13197         * namespace.cs: fixed bug #35489.
13198
13199 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * class.cs: Remove some dead code.
13202
13203         * cs-parser.jay: Estimate the number of methods needed
13204         (RootContext.MethodCount);
13205
13206         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13207         numbers instead of StringBuilders.
13208
13209         * support.cs (PtrHashtable): Add constructor with initial size;
13210         We can now reduce reallocations of the method table.
13211
13212 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13213
13214         * attribute.cs (ApplyAttributes): Keep track of the emitted
13215         attributes on a per-target basis. This fixes bug #35413.
13216
13217 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13218
13219         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13220         default to the Windows 1252 encoding.
13221
13222         (UnixParseOption): Support version, thanks to Alp for the missing
13223         pointer. 
13224
13225         * AssemblyInfo.cs: Add nice assembly information.
13226
13227         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13228         (bug 35169).
13229
13230         * cs-parser.jay: Allow a trailing comma before the close bracked
13231         in the attribute_section production.
13232
13233         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13234         address of the instance was being taken, I will take this out,
13235         because we take the address of the object immediately here.
13236
13237 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13238
13239         * typemanager.cs (AreMultipleAllowed): Take care of the most
13240         obvious case where attribute type is not in the current assembly -
13241         stupid me ;-)
13242
13243 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13244
13245         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13246         definitions, instead of doing that afterwards.  
13247
13248         Also we use a nice little hack, depending on the constructor, we
13249         know if we are a "composed" name or a simple name.  Hence, we
13250         avoid the IndexOf test, and we avoid 
13251
13252         * codegen.cs: Add code to assist in a bug reporter to track down
13253         the source of a compiler crash. 
13254
13255 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13256
13257         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13258         types have been emitted for a given element and flag an error
13259         if something which does not have AllowMultiple set is used more
13260         than once.
13261
13262         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13263         attribute types and their corresponding AllowMultiple properties
13264
13265         (AreMultipleAllowed): Check the property for a given type.
13266
13267         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13268         property in the case we have a TypeContainer.
13269
13270         (Attributes.AddAttribute): Detect duplicates and just skip on
13271         adding them. This trivial fix catches a pretty gross error in our
13272         attribute emission - global attributes were being emitted twice!
13273
13274         Bugzilla bug #33187 is now fixed.
13275
13276 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13277
13278         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13279         instead of pp_and).
13280
13281         * expression.cs (Binary.ResolveOperator): I can only use the
13282         Concat (string, string, string) and Concat (string, string,
13283         string, string) if the child is actually a concatenation of
13284         strings. 
13285
13286 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13287
13288         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13289         context where we need a 2-character lookahead.
13290
13291         * pending.cs (PendingImplementation): Rework so we can keep track
13292         of interface types all the time, and flag those which were
13293         implemented by parents as optional.
13294
13295 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * expression.cs (Binary.ResolveOperator): Use
13298         String.Concat(string,string,string) or
13299         String.Concat(string,string,string,string) when possible. 
13300
13301         * typemanager: More helper methods.
13302
13303
13304 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13305
13306         * pending.cs: remove the bogus return from GetMissingInterfaces()
13307         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13308
13309 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13310
13311         * namespace.cs: avoid duplicated 'using xxx' being added to
13312         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13313         when we get more than one 'using' statement for the same namespace.
13314         Report a CS0105 warning for it.
13315
13316 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13317
13318         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13319         of calling getChar/putback, uses internal knowledge of it.    
13320
13321         (xtoken): Reorder tokenizer so most common patterns are checked
13322         first.  This reduces the compilation time in another 5% (from 8.11s
13323         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13324
13325         The parsing time is 22% of the compilation in mcs, and from that
13326         64% is spent on the tokenization process.  
13327
13328         I tried using a binary search for keywords, but this is slower
13329         than the hashtable.  Another option would be to do a couple of
13330         things:
13331
13332                 * Not use a StringBuilder, instead use an array of chars,
13333                   with a set value.  Notice that this way we could catch
13334                   the 645 error without having to do it *afterwards*.
13335
13336                 * We could write a hand-parser to avoid the hashtable
13337                   compares altogether.
13338
13339         The identifier consumption process takes 37% of the tokenization
13340         time.  Another 15% is spent on is_number.  56% of the time spent
13341         on is_number is spent on Int64.Parse:
13342
13343                 * We could probably choose based on the string length to
13344                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13345                   computations. 
13346
13347         Another 3% is spend on wrapping `xtoken' in the `token' function.
13348
13349         Handle 0xa0 as whitespace (#34752)
13350
13351 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13352
13353         * typemanager.cs (IsCLRType): New routine to tell whether a type
13354         is one of the builtin types.  
13355
13356         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13357         typecode in more places instead of doing pointer comparissions.
13358         We could leverage some knowledge about the way the typecodes are
13359         laid out.
13360
13361         New code to cache namespaces in assemblies, it is currently not
13362         invoked, to be used soon.
13363
13364         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13365
13366         * expression.cs (Binary.ResolveOperator): specially handle
13367         strings, and do not perform user-defined operator overloading for
13368         built-in types.
13369
13370 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13373         internalcall as it is a pretty simple operation;  Avoid whenever
13374         possible to call Char.IsLetter.
13375
13376         (consume_identifier): Cut by half the number of
13377         hashtable calls by merging the is_keyword and GetKeyword behavior.
13378
13379         Do not short-circuit, because if we do, we
13380         report errors (ie, #if false && true would produce an invalid
13381         directive error);
13382
13383
13384 2002-11-24  Martin Baulig  <martin@ximian.com>
13385
13386         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13387         check constant ranges and report a CS0221.  Fixes #33186.
13388
13389 2002-11-24  Martin Baulig  <martin@ximian.com>
13390
13391         * cs-parser.jay: Make this work for uninitialized variable
13392         declarations in the `for' initializer.  Fixes #32416.
13393
13394 2002-11-24  Martin Baulig  <martin@ximian.com>
13395
13396         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13397         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13398
13399 2002-11-24  Martin Baulig  <martin@ximian.com>
13400
13401         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13402         argument; if true, we also check for user-defined conversions.
13403         This is only needed if both arguments are of a user-defined type.
13404         Fixes #30443, added test-175.cs.
13405         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13406
13407         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13408
13409 2002-11-24  Martin Baulig  <martin@ximian.com>
13410
13411         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13412         function to get the store opcode.
13413         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13414         only emit the Ldelema if the store opcode is Stobj.  You must run
13415         both test-34 and test-167 to test this.  Fixes #34529.
13416
13417 2002-11-23  Martin Baulig  <martin@ximian.com>
13418
13419         * ecore.cs (Expression.MemberLookup): Added additional
13420         `qualifier_type' argument which is used when we're being called
13421         from MemberAccess.DoResolve() and null if we're called from a
13422         SimpleName lookup.
13423         (Expression.MemberLookupFailed): New method to report errors; this
13424         does the CS1540 check and reports the correct error message.
13425
13426         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13427         argument for the CS1540 check and redone the way how we're dealing
13428         with private members.  See the comment in the source code for details.
13429         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13430         `closure_start_type' to `closure_qualifier_type' and check whether
13431         it's not null.  It was not this filter being broken, it was just
13432         being called with the wrong arguments.
13433
13434         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13435         and pass it the correct `qualifier_type'; this also does the error
13436         handling for us.
13437
13438 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * expression.cs (Invocation.EmitParams): If the we are dealing
13441         with a non-built-in value type, load its address as well.
13442
13443         (ArrayCreation): Use a a pretty constant instead
13444         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13445         static initializers.  
13446
13447         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13448         because they are not really value types, just glorified integers. 
13449
13450         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13451
13452         * ecore.cs: Remove redundant code for enumerations, make them use
13453         the same code path as everything else, fixes the casting issue
13454         with enumerations in Windows.Forms.
13455
13456         * attribute.cs: Do only cast to string if it is a string, the
13457         validation happens later.
13458
13459         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13460         people upgrade their corlibs.
13461
13462         * ecore.cs: Oops, enumerations were not following the entire code path
13463
13464 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * typemanager.cs (FilterWithClosure): Commented out the test for
13467         1540 in typemanager.cs, as it has problems when accessing
13468         protected methods from a parent class (see test-174.cs). 
13469
13470         * attribute.cs (Attribute.ValidateGuid): new method.
13471         (Attribute.Resolve): Use above.
13472
13473 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13476
13477         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13478         handling for enumerations, as we only needed the TypeContainer
13479         functionality to begin with (this is required for the fix below to
13480         work for enums that reference constants in a container class for
13481         example). 
13482
13483         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13484
13485         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13486         a valid TypeBuilder to perform lookups on.o
13487
13488         * class.cs (InheritableMemberSignatureCompare): Use true in the
13489         call to GetGetMethod and GetSetMethod, because we are comparing
13490         the signature, and we need to get the methods *even* if they are
13491         private. 
13492
13493         (PropertyBase.CheckBase): ditto.
13494
13495         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13496         GotoCase.Resolve): Use Peel on EmpytCasts.
13497
13498         * ecore.cs (EmptyCast): drop child, add Peel method.
13499
13500 2002-11-17  Martin Baulig  <martin@ximian.com>
13501
13502         * ecore.cs (EmptyCast.Child): New public property.
13503
13504         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13505         label resolved to an EmptyCast.  Fixes #34162.
13506         (GotoCase.Resolve): Likewise.
13507         (Block.EmitMeta): Likewise.
13508
13509 2002-11-17  Martin Baulig  <martin@ximian.com>
13510
13511         * expression.cs (Invocation.BetterConversion): Prefer int over
13512         uint; short over ushort; long over ulong for integer literals.
13513         Use ImplicitConversionExists instead of StandardConversionExists
13514         since we also need to check for user-defined implicit conversions.
13515         Fixes #34165.  Added test-173.cs.
13516
13517 2002-11-16  Martin Baulig  <martin@ximian.com>
13518
13519         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13520         with the `true' and `false' literals.  Fixes #33151.
13521
13522 2002-11-16  Martin Baulig  <martin@ximian.com>
13523
13524         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13525         October 22nd; don't do the cs1540 check for static members.
13526
13527         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13528         now using our own filter here and doing the cs1540 check again.
13529
13530 2002-11-16  Martin Baulig  <martin@ximian.com>
13531
13532         * support.cs (InternalParameters): Don't crash if we don't have
13533         any fixed parameters.  Fixes #33532.
13534
13535 2002-11-16  Martin Baulig  <martin@ximian.com>
13536
13537         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13538         when looking up static methods to make this work on Windows.
13539         Fixes #33773.
13540
13541 2002-11-16  Martin Baulig  <martin@ximian.com>
13542
13543         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13544         a setter rather than using PropertyInfo.CanWrite.
13545
13546 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13547
13548         * class.cs: Allow acces to block member by subclasses. Fixes build
13549         breaker.
13550
13551 2002-11-14  Martin Baulig  <martin@ximian.com>
13552
13553         * class.cs (Constructor.Emit): Added the extern/block check.
13554         Fixes bug #33678.
13555
13556 2002-11-14  Martin Baulig  <martin@ximian.com>
13557
13558         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13559         iteration while looking for indexers, this is needed because the
13560         indexer may have a different name in our base classes.  Fixed the
13561         error reporting (no indexers at all, not get accessor, no
13562         overloaded match).  Fixes bug #33089.
13563         (IndexerAccess.DoResolveLValue): Likewise.
13564
13565 2002-11-14  Martin Baulig  <martin@ximian.com>
13566
13567         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13568         indexers.  Fixes the first part of bug #33089.
13569         (MethodSignature.InheritableMemberSignatureCompare): Added support
13570         for properties.
13571
13572 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13573
13574         * attribute.cs (Attribute.Resolve): Catch the
13575         NullReferenceException and report it since it isn't supposed to
13576         happen. 
13577
13578 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13579
13580         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13581         LogicalOr and LogicalAnd that can benefit from recursively
13582         handling EmitBranchable.  The code now should be nice for Paolo.
13583
13584 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13585
13586         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13587         the Type lookups, as we perform quite a number of lookups on
13588         non-Types.  This can be removed once we can deterministically tell
13589         whether we have a type or a namespace in advance.
13590
13591         But this might require special hacks from our corlib.
13592
13593         * TODO: updated.
13594
13595         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13596         and double which avoids a conversion from an integer to a double.
13597
13598         * expression.cs: tiny optimization, avoid calling IsConstant,
13599         because it effectively performs the lookup twice.
13600
13601 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13602
13603         But a bogus return here to keep the semantics of the old code
13604         until the Mono runtime is fixed.
13605
13606         * pending.cs (GetMissingInterfaces): New method used to remove all
13607         the interfaces that are already implemented by our parent
13608         classes from the list of pending methods. 
13609
13610         * interface.cs: Add checks for calls after ResolveTypeExpr.
13611
13612 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13613
13614         * class.cs (Class.Emit): Report warning 67: event not used if the
13615         warning level is beyond 3.
13616
13617         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13618         being a NullLiteral.
13619
13620         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13621         specifiers. 
13622
13623         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13624         path that might fail if a type can not be resolved.
13625
13626         * expression.cs (Binary.Emit): Emit unsigned versions of the
13627         operators. 
13628
13629         * driver.cs: use error 5.
13630
13631 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13632
13633         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13634
13635 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * cs-parser.jay (switch_section): A beautiful patch from Martin
13638         Baulig that fixed 33094.
13639
13640 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13641
13642         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13643         Check whether the base is abstract and report an error if so.
13644
13645         * expression.cs (IndexerAccess.DoResolveLValue,
13646         IndexerAccess.DoResolve): ditto. 
13647
13648         (Invocation.DoResolve): ditto.
13649
13650         (Invocation.FullMethodDesc): Improve the report string.
13651
13652         * statement.cs (Block): Eliminate IsVariableDefined as it is
13653         basically just a wrapper for GetVariableInfo.
13654
13655         * ecore.cs (SimpleName): Use new 
13656
13657         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13658         type, as we return the actual parameter ref/unref state on a
13659         different call.
13660
13661 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * support.cs: Return proper flags REF/OUT fixing the previous
13664         commit.  
13665
13666         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13667         not used to mean `ref' but `ref or out' in ParameterReference
13668
13669         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13670         full type signature instead of calling TypeManger.CSharpName
13671         ourselves. 
13672
13673         * support.cs (InternalParameters.ParameterDesc): Do not compare
13674         directly to the modflags, because REF/OUT will actually be bitsets
13675         if set. 
13676
13677         * delegate.cs (VerifyMethod): Check also the modifiers.
13678
13679         * cs-tokenizer.cs: Fix bug where floating point values with an
13680         exponent where a sign was missing was ignored.
13681
13682         * driver.cs: Allow multiple assemblies to be specified in a single
13683         /r: argument
13684
13685 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13688         because identifiers after a parenthesis would end up in this kind
13689         of production, and we needed to desamiguate it for having casts
13690         like:
13691
13692                 (UserDefinedType *) xxx
13693
13694 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13695
13696         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13697         we should set on the Bindingflags.NonPublic, but not turn on
13698         private_ok.  private_ok controls whether a Private member is
13699         returned (this is chekced on the filter routine), while the
13700         BindingFlags.NonPublic just controls whether private/protected
13701         will be allowed.   This fixes the problem part of the problem of
13702         private properties being allowed to be used in derived classes.
13703
13704         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13705         so we can call the children DoResolveLValue method (this will
13706         properly signal errors on lvalue assignments to base properties)
13707
13708         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13709         getter are null, and we have a property info, we know that this
13710         happened because the lookup failed, so we report an error 122 for
13711         protection level violation.
13712
13713         We also silently return if setter and getter are null in the
13714         resolve functions, this condition only happens if we have flagged
13715         the error before.  This is the other half of the problem. 
13716
13717         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13718         not have accessibility information, that is why we were returning
13719         true in the filter function in typemanager.cs.
13720
13721         To properly report 122 (property is inaccessible because of its
13722         protection level) correctly, we report this error in ResolveAccess
13723         by failing if both the setter and the getter are lacking (ie, the
13724         lookup failed). 
13725
13726         DoResolve and DoLResolve have been modified to check for both
13727         setter/getter being null and returning silently, the reason being
13728         that I did not want to put the knowledge about this error in upper
13729         layers, like:
13730
13731         int old = Report.Errors;
13732         x = new PropertyExpr (...);
13733         if (old != Report.Errors)
13734                 return null;
13735         else
13736                 return x;
13737
13738         So the property expr is returned, but it is invalid, so the error
13739         will be flagged during the resolve process. 
13740
13741         * class.cs: Remove InheritablePropertySignatureCompare from the
13742         class, as we no longer depend on the property signature to compute
13743         whether it is possible to implement a method or not.
13744
13745         The reason is that calling PropertyInfo.GetGetMethod will return
13746         null (in .NET, in Mono it works, and we should change this), in
13747         cases where the Get Method does not exist in that particular
13748         class.
13749
13750         So this code:
13751
13752         class X { public virtual int A { get { return 1; } } }
13753         class Y : X { }
13754         class Z : Y { public override int A { get { return 2; } } }
13755
13756         Would fail in Z because the parent (Y) would not have the property
13757         defined.  So we avoid this completely now (because the alternative
13758         fix was ugly and slow), and we now depend exclusively on the
13759         method names.
13760
13761         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13762         reference method, instead of using the property.
13763
13764         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13765         routines are gone now.
13766
13767         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13768         names, they were incorrectly named.
13769
13770         * cs-tokenizer.cs: Return are more gentle token on failure. 
13771
13772         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13773         had an out-of-sync index variable, which caused it to remove from
13774         the list of pending methods the wrong method sometimes.
13775
13776 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13779         CanWrite, because those refer to this particular instance of the
13780         property, and do not take into account the fact that we can
13781         override single members of a property.
13782
13783         Constructor requires an EmitContext.  The resolution process does
13784         not happen here, but we need to compute the accessors before,
13785         because the resolution does not always happen for properties.
13786
13787         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13788         subclass, before we did not update this flag, but we did update
13789         bindingflags. 
13790
13791         (GetAccessors): Drop this routine, as it did not work in the
13792         presence of partially overwritten set/get methods. 
13793
13794         Notice that this broke the cs1540 detection, but that will require
13795         more thinking. 
13796
13797 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13798
13799         * class.cs:
13800         * codegen.cs:
13801         * driver.cs: issue a warning instead of an error if we don't support
13802         debugging for the platform. Also ignore a couple of errors that may
13803         arise when trying to write the symbols. Undo my previous patch.
13804
13805 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13806
13807         * driver.cs: ignore /debug switch except for Unix platforms.
13808
13809 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13810
13811         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13812
13813 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13814
13815         * driver.cs: Do not make mcs-debug conditional, so we do not break
13816         builds that use it.
13817
13818         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13819         review this patch.  But basically after all the children variables
13820         have been merged, the value of "Breaks" was not being set to
13821         new_breaks for Switch blocks.  I think that it should be set after
13822         it has executed.  Currently I set this to the value of new_breaks,
13823         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13824         conservative, but I do not understand this code very well.
13825
13826         I did not break anything in the build, so that is good ;-)
13827
13828         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13829
13830 2002-10-20  Mark Crichton  <crichton@gimp.org>
13831
13832         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13833
13834 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13835
13836         * cfold.cs: Fixed compile blocker.
13837
13838 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13839
13840         * driver.cs: I was chekcing the key, not the file.
13841
13842 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13843
13844         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13845         message that we were generating - we just need to silently return
13846         a null.
13847
13848 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13849
13850         * class.cs (Event.Define): Change my previous commit, as this
13851         breaks the debugger.  This is a temporary hack, as it seems like
13852         the compiler is generating events incorrectly to begin with.
13853
13854         * expression.cs (Binary.ResolveOperator): Added support for 
13855         "U operator - (E x, E y)"
13856
13857         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13858         y)".
13859
13860         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13861         init-only variables, but this path did not take into account that
13862         there might be also instance readonly variables.  Correct this
13863         problem. 
13864
13865         This fixes bug 32253
13866
13867         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13868         delegates as well.
13869
13870         * driver.cs: Change the extension for modules to `netmodule'
13871
13872         * cs-parser.jay: Improved slightly the location tracking for
13873         the debugger symbols.
13874
13875         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13876         modifiers that were specified instead of the hardcoded value
13877         (FamAndAssem).  This was basically ignoring the static modifier,
13878         and others.  Fixes 32429.
13879
13880         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13881         fixed a bug in the process (32476)
13882
13883         * expression.cs (ArrayAccess.EmitAssign): Patch from
13884         hwang_rob@yahoo.ca that fixes bug 31834.3
13885
13886 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13887
13888         * driver.cs: Make the module extension .netmodule.
13889
13890 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13891
13892         * driver.cs: Report an error if the resource file is not found
13893         instead of crashing.
13894
13895         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13896         false, like Emit does.
13897
13898 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13899
13900         * typemanager.cs: Remove unused private member.  Also reported mcs
13901         bug to report this as a warning like csc.
13902
13903 2002-10-15  Martin Baulig  <martin@gnome.org>
13904
13905         * statement.cs (Statement.Emit): Made this a virtual method; emits
13906         the line number info and calls DoEmit().
13907         (Statement.DoEmit): New protected abstract method, formerly knows
13908         as Statement.Emit().
13909
13910         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13911
13912 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13915         have fixed a remaining problem: not every AddXXXX was adding a
13916         fully qualified name.  
13917
13918         Now everyone registers a fully qualified name in the DeclSpace as
13919         being defined instead of the partial name.  
13920
13921         Downsides: we are slower than we need to be due to the excess
13922         copies and the names being registered this way.  
13923
13924         The reason for this is that we currently depend (on the corlib
13925         bootstrap for instance) that types are fully qualified, because
13926         we dump all the types in the namespace, and we should really have
13927         types inserted into the proper namespace, so we can only store the
13928         basenames in the defined_names array.
13929
13930 2002-10-10  Martin Baulig  <martin@gnome.org>
13931
13932         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13933         from bug #31834, see the bug report for a testcase which is
13934         miscompiled.
13935
13936 2002-10-10  Martin Baulig  <martin@gnome.org>
13937
13938         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13939         flow analysis code for this.
13940
13941         * statement.cs (Do, While, For): Tell the flow analysis code about
13942         infinite loops.
13943         (FlowBranching.UsageVector): Added support for infinite loops.
13944         (Block.Resolve): Moved the dead code elimination here and use flow
13945         analysis to do it.
13946
13947 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * class.cs (Field.Define): Catch cycles on struct type
13950         definitions. 
13951
13952         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13953         fields if the fields are static.  We only need to check instance
13954         fields. 
13955
13956         * expression.cs (As.DoResolve): Test for reference type.
13957
13958         * statement.cs (Using.ResolveExpression): Use
13959         ConvertImplicitRequired, not ConvertImplicit which reports an
13960         error on failture
13961         (Using.ResolveLocalVariableDecls): ditto.
13962
13963         * expression.cs (Binary.ResolveOperator): Report errors in a few
13964         places where we had to.
13965
13966         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13967
13968 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13969
13970         * expression.cs: Use StoreFromPtr instead of extracting the type
13971         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13972
13973         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13974         an enumeration value to a System.Enum, but System.Enum is not a
13975         value type, but an class type, so we need to box.
13976
13977         (Expression.ConvertExplicit): One codepath could return
13978         errors but not flag them.  Fix this.  Fixes #31853
13979
13980         * parameter.cs (Resolve): Do not allow void as a parameter type.
13981
13982 2002-10-06  Martin Baulig  <martin@gnome.org>
13983
13984         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13985         if it's a class type and not a struct.  Fixes #31815.
13986
13987 2002-10-06  Martin Baulig  <martin@gnome.org>
13988
13989         * statement.cs: Reworked the flow analysis code a bit to make it
13990         usable for dead code elimination.
13991
13992 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13993
13994         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13995
13996 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13999         to fix the test 165, will investigate deeper.
14000
14001 2002-10-04  Martin Baulig  <martin@gnome.org>
14002
14003         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14004         finally blocks actually work.
14005         (Try.Resolve): We don't need to create a sibling for `finally' if
14006         there is no finally block.
14007
14008 2002-10-04  Martin Baulig  <martin@gnome.org>
14009
14010         * class.cs (Constructor.Define): The default accessibility for a
14011         non-default constructor is private, not public.
14012
14013 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * class.cs (Constructor): Make AllowedModifiers public, add
14016         EXTERN.
14017
14018         * cs-parser.jay: Perform the modifiers test here, as the
14019         constructor for the Constructor class usually receives a zero
14020         because of the way we create it (first we create, later we
14021         customize, and we were never checking the modifiers).
14022
14023         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14024         is a version of LookupTypeReflection that includes the type-name
14025         cache.  This can be used as a fast path for functions that know
14026         the fully qualified name and are only calling into *.GetType() to
14027         obtain a composed type.
14028
14029         This is also used by TypeManager.LookupType during its type
14030         composition.
14031
14032         (LookupType): We now also track the real type name, as sometimes
14033         we can get a quey for the real type name from things like
14034         ComposedCast.  This fixes bug 31422.
14035
14036         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14037         complete type fullname, it does not have to go through the type
14038         resolution system to obtain the composed version of the type (for
14039         obtaining arrays or pointers).
14040
14041         (Conditional.Emit): Use the EmitBoolExpression to
14042         generate nicer code, as requested by Paolo.
14043
14044         (ArrayCreation.CheckIndices): Use the patch from
14045         hwang_rob@yahoo.ca to validate the array initializers. 
14046
14047 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * class.cs (ConstructorInitializer.Emit): simplify code by using
14050         Invocation.EmitCall, and at the same time, fix the bugs in calling
14051         parent constructors that took variable arguments. 
14052
14053         * ecore.cs (Expression.ConvertNumericExplicit,
14054         Expression.ImplicitNumericConversion): Remove the code that
14055         manually wrapped decimal (InternalTypeConstructor call is now gone
14056         as well).
14057
14058         * expression.cs (Cast.TryReduce): Also handle decimal types when
14059         trying to perform a constant fold on the type.
14060
14061         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14062
14063         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14064         that only turned off an error report, and did nothing else. 
14065
14066 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * driver.cs: Handle and ignore /fullpaths
14069
14070 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14071
14072         * expression.cs (Binary.ResolveOperator): Catch the case where
14073         DoNumericPromotions returns true, 
14074
14075         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14076
14077 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14078
14079         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14080         report error 70.
14081
14082 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14085         conversion exists, but it is also required that the conversion be
14086         performed.  This manifested in "(Type64Enum) 2".  
14087
14088         * class.cs (TypeManager.AddMethod): The fix is not to change
14089         AddEnum, because that one was using a fully qualified name (every
14090         DeclSpace derivative does), but to change the AddMethod routine
14091         that was using an un-namespaced name.  This now correctly reports
14092         the duplicated name.
14093
14094         Revert patch until I can properly fix it.  The issue
14095         is that we have a shared Type space across all namespaces
14096         currently, which is wrong.
14097
14098         Options include making the Namespace a DeclSpace, and merge
14099         current_namespace/current_container in the parser.
14100
14101 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14102
14103         * cs-parser.jay: Improve error reporting when we get a different
14104         kind of expression in local_variable_type and
14105         local_variable_pointer_type. 
14106
14107         Propagate this to avoid missleading errors being reported.
14108
14109         * ecore.cs (ImplicitReferenceConversion): treat
14110         TypeManager.value_type as a target just like object_type.   As
14111         code like this:
14112
14113         ValueType v = 1;
14114
14115         Is valid, and needs to result in the int 1 being boxed before it
14116         is assigned to the value type v.
14117
14118         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14119         to validate the enumeration name.
14120
14121         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14122         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14123         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14124
14125         * ecore.cs (TryImplicitIntConversion): When doing an
14126         implicit-enumeration-conversion, check if the type is 64-bits and
14127         perform a conversion before passing to EnumConstant.
14128
14129 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14130
14131         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14132         report ambiguous type references.  Unlike the MS version, we
14133         report what the ambiguity is.   Innovation at work ;-)
14134
14135         (DeclSpace.FindType): Require a location argument to
14136         display when we display an ambiguous error.
14137
14138         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14139
14140         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14141
14142         * expression.cs (EmitDynamicInitializers): Apply patch from
14143         hwang_rob@yahoo.ca that fixes the order in which we emit our
14144         initializers. 
14145
14146 2002-09-21  Martin Baulig  <martin@gnome.org>
14147
14148         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14149         delegate takes no arguments.
14150
14151 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14154         from integers.
14155
14156         * expression.cs: Extract the underlying type.
14157
14158         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14159
14160         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14161
14162 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14163
14164         * class.cs (TypeContainer.DefineType): We can not use the nice
14165         PackingSize with the size set to 1 DefineType method, because it
14166         will not allow us to define the interfaces that the struct
14167         implements.
14168
14169         This completes the fixing of bug 27287
14170
14171         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14172         means also structs.  This fixes part of the problem. 
14173         (Expresion.ImplicitReferenceConversionExists): ditto.
14174
14175         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14176         error if there were no errors reported during the type lookup
14177         process, to avoid duplicates or redundant errors.  Without this
14178         you would get an ambiguous errors plus a type not found.  We have
14179         beaten the user enough with the first error.  
14180
14181         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14182         reference. 
14183
14184         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14185         during the resolution process, stop the lookup, this avoids
14186         repeated error reports (same error twice).
14187
14188         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14189
14190         * typemanager.cs (LookupType): Redo the type lookup code to match
14191         the needs of System.Reflection.  
14192
14193         The issue is that System.Reflection requires references to nested
14194         types to begin with a "+" sign instead of a dot.  So toplevel
14195         types look like: "NameSpace.TopLevelClass", and nested ones look
14196         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14197         levels. 
14198
14199 2002-09-19  Martin Baulig  <martin@gnome.org>
14200
14201         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14202         says that a method always returns or always throws an exception,
14203         don't report the CS0161.
14204
14205         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14206         set `Returns = new_returns'.
14207
14208 2002-09-19  Martin Baulig  <martin@gnome.org>
14209
14210         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14211         to an enum constant, check for a CS0176.
14212
14213 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14214
14215         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14216         for operators that must be in pairs and report errors.
14217
14218         * ecore.cs (SimpleName.DoResolveType): During the initial type
14219         resolution process, when we define types recursively, we must
14220         check first for types in our current scope before we perform
14221         lookups in the enclosing scopes.
14222
14223         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14224
14225         (Invocation.VerifyArgumentsCompat): Call
14226         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14227         I thought we were supposed to always call this, but there are a
14228         few places in the code where we dont do it.
14229
14230 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14231
14232         * driver.cs: Add support in -linkres and -resource to specify the
14233         name of the identifier.
14234
14235 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * ecore.cs (StandardConversionExists): Sync with the conversion
14238         code: allow anything-* to void* conversions.
14239
14240         (FindMostSpecificSource): Use an Expression argument
14241         instead of a Type, because we might be handed over a Literal which
14242         gets a few more implicit conversions that plain types do not.  So
14243         this information was being lost.
14244
14245         Also, we drop the temporary type-holder expression when not
14246         required.
14247
14248 2002-09-17  Martin Baulig  <martin@gnome.org>
14249
14250         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14251         this is an explicit interface implementation.
14252
14253 2002-09-17  Martin Baulig  <martin@gnome.org>
14254
14255         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14256         different `IndexerName' attributes.
14257
14258         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14259         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14260         virtual CommonResolve().
14261
14262 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14263
14264         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14265         and convert that to the UnderlyingType.
14266
14267         * statement.cs (Foreach.Resolve): Indexers are just like variables
14268         or PropertyAccesses.
14269
14270         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14271         inside quoted strings, we were not doing this before.
14272
14273 2002-09-16  Martin Baulig  <martin@gnome.org>
14274
14275         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14276         resolve it.  This is needed for the definite assignment check of the
14277         instance expression, fixes bug #29846.
14278         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14279
14280 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14281
14282         * parameter.cs: Fix compile error.  Cannot reference static member
14283         from an instance object.  Is this an mcs bug?
14284
14285 2002-09-14  Martin Baulig  <martin@gnome.org>
14286
14287         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14288         multiple times.  Fixes bug #30295, added test-166.cs.
14289
14290 2002-09-14  Martin Baulig  <martin@gnome.org>
14291
14292         * statement.cs (Block.Emit): Don't emit unreachable code.
14293         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14294         `break' statements.
14295         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14296
14297 2002-09-14  Martin Baulig  <martin@gnome.org>
14298
14299         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14300         is set.
14301
14302 2002-09-14  Martin Baulig  <martin@gnome.org>
14303
14304         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14305         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14306         be false on the ms runtime.
14307
14308 2002-09-13  Martin Baulig  <martin@gnome.org>
14309
14310         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14311         the CS0038 error message.
14312
14313 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14314
14315         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14316         constant inside, return it.
14317
14318 2002-09-12  Martin Baulig  <martin@gnome.org>
14319
14320         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14321         implicit conversion can be done between enum types.
14322
14323         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14324         check whether an implicit conversion to the current enum's UnderlyingType
14325         exists and report an error if not.
14326
14327         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14328         without debugging support.
14329
14330         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14331         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14332
14333 2002-09-12  Martin Baulig  <martin@gnome.org>
14334
14335         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14336
14337         * ecore.cs (IMemberExpr.DeclaringType): New property.
14338         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14339         nonstatic member of an outer type (CS0038).
14340
14341 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14342
14343         * driver.cs: Activate the using-error detector at warning level
14344         4 (at least for MS-compatible APIs).
14345
14346         * namespace.cs (VerifyUsing): Small buglett fix.
14347
14348         * pending.cs (PendingImplementation): pass the container pointer. 
14349
14350         * interface.cs (GetMethods): Allow for recursive definition.  Long
14351         term, I would like to move every type to support recursive
14352         definitions, not the current ordering mechanism that we have right
14353         now.
14354
14355         The situation is this: Attributes are handled before interfaces,
14356         so we can apply attributes to interfaces.  But some attributes
14357         implement interfaces, we will now handle the simple cases
14358         (recursive definitions will just get an error).  
14359
14360         * parameter.cs: Only invalidate types at the end if we fail to
14361         lookup all types.  
14362
14363 2002-09-09  Martin Baulig  <martin@gnome.org>
14364
14365         * ecore.cs (PropertyExpr.Emit): Also check for
14366         TypeManager.system_int_array_get_length so this'll also work when
14367         compiling corlib.  Fixes #30003.
14368
14369 2002-09-09  Martin Baulig  <martin@gnome.org>
14370
14371         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14372         and throw an exception if we can't get the type's size.  Fixed #30040,
14373         added test-165.cs.
14374
14375 2002-09-09  Martin Baulig  <martin@gnome.org>
14376
14377         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14378
14379         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14380         context.  Fixes bug #30027.
14381
14382         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14383         virtual functions.  Fixes bug #30043, added test-164.cs.
14384
14385 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14386
14387         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14388
14389 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14390
14391         * driver.cs: Use an object to get the windows codepage since it's not a
14392         static property.
14393
14394 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14395
14396         * statement.cs (For.Emit): for infinite loops (test == null)
14397         return whether there is a break inside, not always "true".
14398
14399         * namespace.cs (UsingEntry): New struct to hold the name of the
14400         using definition, the location where it is defined, and whether it
14401         has been used in a successful type lookup.
14402
14403         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14404         strings.
14405
14406         * decl.cs: ditto.
14407
14408 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14409
14410         * attribute.cs : Fix incorrect code which relied on catching
14411         a NullReferenceException to detect a null being passed in
14412         where an object was expected.
14413
14414 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14415
14416         * statement.cs (Try): flag the catch variable as assigned
14417
14418         * expression.cs (Cast): Simplified by using ResolveType instead of
14419         manually resolving.
14420
14421         * statement.cs (Catch): Fix bug by using ResolveType.
14422
14423 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14424
14425         * expression.cs (BetterConversion): Special case for when we have
14426         a NullLiteral as the argument and we have to choose between string
14427         and object types - we choose string the way csc does.
14428
14429         * attribute.cs (Attribute.Resolve): Catch the
14430         NullReferenceException and report error #182 since the Mono
14431         runtime no more has the bug and having this exception raised means
14432         we tried to select a constructor which takes an object and is
14433         passed a null.
14434
14435 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14436
14437         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14438         message (1502, 1503) when we can't locate a method after overload
14439         resolution. This is much more informative and closes the bug
14440         Miguel reported.
14441
14442         * interface.cs (PopulateMethod): Return if there are no argument
14443         types. Fixes a NullReferenceException bug.
14444
14445         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14446         expressions too. Previously we were checking only in one place for
14447         positional arguments leaving out named arguments.
14448
14449         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14450         type to the enum type is not allowed. Remove code corresponding to
14451         that.
14452
14453         (ConvertNumericExplicit): Allow explicit conversions from
14454         the underlying type to enum type. This precisely follows the spec
14455         and closes a bug filed by Gonzalo.
14456
14457 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14458
14459         * compiler.csproj:
14460         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14461
14462 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14463
14464         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14465         it was important that we stored the right value after the
14466         reduction in `converted'.
14467
14468 2002-09-04  Martin Baulig  <martin@gnome.org>
14469
14470         * location.cs (Location.SymbolDocument): Use full pathnames for the
14471         source files.
14472
14473 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14474
14475         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14476         of the expression resolve mechanism, because that will catch the
14477         SimpleName error failures.
14478
14479         (Conditional): If we can not resolve the
14480         expression, return, do not crash.
14481
14482 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14483
14484         * cs-tokenizer.cs:
14485         (location): display token name instead of its number.
14486
14487 2002-08-28  Martin Baulig  <martin@gnome.org>
14488
14489         * expression.cs (Binary.ResolveOperator): Don't silently return
14490         but return an error if an operator cannot be applied between two
14491         enum types.
14492
14493 2002-08-28  Martin Baulig  <martin@gnome.org>
14494
14495         * class.cs (Constructor.Define): Set the permission attributes
14496         correctly instead of making all constructors public.
14497
14498 2002-08-28  Martin Baulig  <martin@gnome.org>
14499
14500         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14501         for private members before reporting a CS0103; if we find anything,
14502         it's a CS0122.
14503
14504 2002-08-28  Martin Baulig  <martin@gnome.org>
14505
14506         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14507         to check whether `closure_start_type == closure_invocation_type',
14508         we also need to check whether `m.DeclaringType == closure_invocation_type'
14509         before bypassing the permission checks.  We might be accessing
14510         protected/private members from the base class.
14511         (TypeManager.RealMemberLookup): Only set private_ok if private
14512         members were requested via BindingFlags.NonPublic.
14513
14514         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14515
14516         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14517         MethodGroupExpr.IsExplicitImpl if appropriate.
14518         (Invocation.DoResolve): Don't report the CS0120 for explicit
14519         interface implementations.
14520
14521 2002-08-27  Martin Baulig  <martin@gnome.org>
14522
14523         * expression.cs (Invocation.DoResolve): If this is a static
14524         method and we don't have an InstanceExpression, we must report
14525         a CS0120.
14526
14527 2002-08-25  Martin Baulig  <martin@gnome.org>
14528
14529         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14530         `==' between a valuetype and an object.
14531
14532 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14533
14534         * ecore.cs (TypeExpr): Provide a ToString method.
14535
14536 2002-08-24  Martin Baulig  <martin@gnome.org>
14537
14538         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14539         now called proggie.dbg and it's a binary file.
14540
14541 2002-08-23  Martin Baulig  <martin@gnome.org>
14542
14543         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14544
14545 2002-08-23  Martin Baulig  <martin@gnome.org>
14546
14547         * struct.cs (MyStructInfo.ctor): Make this work with empty
14548         structs; it's not allowed to use foreach() on null.
14549
14550 2002-08-23  Martin Baulig  <martin@gnome.org>
14551
14552         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14553         writer the full pathname of the generated assembly.
14554
14555 2002-08-23  Martin Baulig  <martin@gnome.org>
14556
14557         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14558         A `finally' block never returns or breaks; improved handling of
14559         unreachable code.
14560
14561 2002-08-23  Martin Baulig  <martin@gnome.org>
14562
14563         * statement.cs (Throw.Resolve): Allow `throw null'.
14564
14565 2002-08-23  Martin Baulig  <martin@gnome.org>
14566
14567         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14568         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14569         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14570         MemberLookup would return a wrong event if this is an explicit
14571         interface implementation and the class has an event with the same
14572         name.
14573
14574 2002-08-23  Martin Baulig  <martin@gnome.org>
14575
14576         * statement.cs (Block.AddChildVariableNames): New public method.
14577         (Block.AddChildVariableName): Likewise.
14578         (Block.IsVariableNameUsedInChildBlock): Likewise.
14579         (Block.AddVariable): Check whether a variable name has already
14580         been used in a child block.
14581
14582         * cs-parser.jay (declare_local_variables): Mark all variable names
14583         from the current block as being used in a child block in the
14584         implicit block.
14585
14586 2002-08-23  Martin Baulig  <martin@gnome.org>
14587
14588         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14589         find the symbol writer.
14590
14591         * driver.cs: csc also allows the arguments to /define being
14592         separated by commas, not only by semicolons.
14593
14594 2002-08-23  Martin Baulig  <martin@gnome.org>
14595
14596         * interface.cs (Interface.GetMembers): Added static check for events.
14597
14598 2002-08-15  Martin Baulig  <martin@gnome.org>
14599
14600         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14601         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14602
14603         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14604         why the MethodData.EmitDestructor() change was necessary.
14605
14606 2002-08-20  Martin Baulig  <martin@gnome.org>
14607
14608         * class.cs (TypeContainer.FindMembers): Added static check for events.
14609
14610         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14611
14612         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14613         use Type.GetEvents(), not Type.FindMembers().
14614
14615 2002-08-20  Martin Baulig  <martin@gnome.org>
14616
14617         * decl.cs (MemberCache): Added a special method cache which will
14618         be used for method-only searched.  This ensures that a method
14619         search will return a MethodInfo with the correct ReflectedType for
14620         inherited methods.      
14621
14622 2002-08-20  Martin Baulig  <martin@gnome.org>
14623
14624         * decl.cs (DeclSpace.FindMembers): Made this public.
14625
14626 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14627
14628         * delegate.cs: fixed build on windows.
14629         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14630
14631 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14632
14633         * ecore.cs (StandardConversionExists): Return a false
14634         if we are trying to convert the void type to anything else
14635         since that is not allowed.
14636
14637         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14638         we flag error 70 in the event an event is trying to be accessed
14639         directly from outside the declaring type.
14640
14641 2002-08-20  Martin Baulig  <martin@gnome.org>
14642
14643         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14644         MemberCache from typemanager.cs to decl.cs.
14645
14646 2002-08-19  Martin Baulig  <martin@gnome.org>
14647
14648         * class.cs (TypeContainer): Implement IMemberContainer.
14649         (TypeContainer.DefineMembers): Create the MemberCache.
14650         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14651         return public members if BindingFlags.Public was given, check
14652         whether members are static.
14653
14654 2002-08-16  Martin Baulig  <martin@gnome.org>
14655
14656         * decl.cs (DeclSpace.Define): Splitted this in Define and
14657         DefineMembers.  DefineMembers is called first and initializes the
14658         MemberCache.
14659
14660         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14661         DefineMembers() on all our DeclSpaces.
14662
14663         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14664         but call DefineMembers() on all nested interfaces.  We call their
14665         Define() in our new Define() function.
14666
14667         * interface.cs (Interface): Implement IMemberContainer.
14668         (Interface.Define): Moved all code except the attribute stuf to
14669         DefineMembers().
14670         (Interface.DefineMembers): Initialize the member cache.
14671
14672         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14673         need this anymore since we can use MemberCache.FindMembers directly.
14674
14675 2002-08-19  Martin Baulig  <martin@gnome.org>
14676
14677         * typemanager.cs (MemberCache): When creating the cache for an
14678         interface type, add all inherited members.
14679         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14680         to `out bool used_cache' and documented it.
14681         (TypeManager.MemberLookup): If we already used the cache in the first
14682         iteration, we don't need to do the interfaces check.
14683
14684 2002-08-19  Martin Baulig  <martin@gnome.org>
14685
14686         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14687         here from IMemberFinder and don't implement this interface anymore.
14688         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14689
14690         * typemanager.cs (IMemberFinder): This interface is now only used by
14691         classes which actually support the member cache.
14692         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14693         since we only put DeclSpaces into this Hashtable.
14694         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14695         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14696
14697 2002-08-16  Martin Baulig  <martin@gnome.org>
14698
14699         * typemanager.cs (ICachingMemberFinder): Removed.
14700         (IMemberFinder.MemberCache): New property.
14701         (TypeManager.FindMembers): Merged this with RealFindMembers().
14702         This function will never be called from TypeManager.MemberLookup()
14703         so we can't use the cache here, just the IMemberFinder.
14704         (TypeManager.MemberLookup_FindMembers): Check whether the
14705         IMemberFinder has a MemberCache and call the cache's FindMembers
14706         function.
14707         (MemberCache): Rewrote larger parts of this yet another time and
14708         cleaned it up a bit.
14709
14710 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14711
14712         * driver.cs (LoadArgs): Support quoting.
14713
14714         (Usage): Show the CSC-like command line arguments.
14715
14716         Improved a few error messages.
14717
14718 2002-08-15  Martin Baulig  <martin@gnome.org>
14719
14720         * typemanager.cs (IMemberContainer.Type): New property.
14721         (IMemberContainer.IsInterface): New property.
14722
14723         The following changes are conditional to BROKEN_RUNTIME, which is
14724         defined at the top of the file.
14725
14726         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14727         class'es members, but add all members from TypeHandle.ObjectType
14728         if we're an interface.
14729         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14730         is the current type.
14731         (MemberCache.CacheEntry.Container): Removed this field.
14732         (TypeHandle.GetMembers): Include inherited members.
14733
14734 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14735
14736         * typemanager.cs: fixed compilation and added a comment on a field that
14737         is never used.
14738
14739 2002-08-15  Martin Baulig  <martin@gnome.org>
14740
14741         * class.cs (ConstructorInitializer.Resolve): In the
14742         Expression.MemberLookup call, use the queried_type as
14743         invocation_type.
14744
14745         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14746         declared' attribute, it's always true.
14747         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14748         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14749         temporary wrapper for FindMembers which tells MemberLookup whether
14750         members from the base classes are included in the return value.
14751         This will go away soon.
14752         (TypeManager.MemberLookup): Use this temporary hack here; once the
14753         new MemberCache is completed, we don't need to do the DeclaredOnly
14754         looping here anymore since the MemberCache will take care of this.
14755         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14756         (MemberCache): When creating the MemberCache for a class, get
14757         members from the current class and all its base classes.
14758         (MemberCache.CacheEntry.Container): New field.  This is a
14759         temporary hack until the Mono runtime is fixed to distinguish
14760         between ReflectedType and DeclaringType.  It allows us to use MCS
14761         with both the MS runtime and the unfixed Mono runtime without
14762         problems and without accecting performance.
14763         (MemberCache.SearchMembers): The DeclaredOnly looping from
14764         TypeManager.MemberLookup is now done here.      
14765
14766 2002-08-14  Martin Baulig  <martin@gnome.org>
14767
14768         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14769         Type.GetFields on dynamic types but get the fields from the
14770         corresponding TypeContainer.
14771         (MyStructInfo.GetStructInfo): Added check for enum types.
14772
14773         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14774         (MemberList.SyncRoot): Implemented.
14775         (TypeManager.FilterWithClosure): No need to check permissions if
14776         closure_start_type == closure_invocation_type, don't crash if
14777         closure_invocation_type is null.
14778
14779 2002-08-13  Martin Baulig  <martin@gnome.org>
14780
14781         Rewrote TypeContainer.FindMembers to use a member cache.  This
14782         gives us a speed increase of about 35% for the self-hosting MCS
14783         build and of about 15-20% for the class libs (both on GNU/Linux).
14784
14785         * report.cs (Timer): New class to get enhanced profiling.  This
14786         whole class is "TIMER" conditional since it remarkably slows down
14787         compilation speed.
14788
14789         * class.cs (MemberList): New class.  This is an IList wrapper
14790         which we're now using instead of passing MemberInfo[]'s around to
14791         avoid copying this array unnecessarily.
14792         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14793         (ICachingMemberFinder, IMemberContainer): New interface.
14794         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14795         has already been checked, otherwise use it for the name comparision.
14796         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14797         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14798         if possible.  Returns a MemberList, not a MemberInfo [].
14799         (TypeHandle): New class, implements IMemberContainer.  We create
14800         one instance of this class per type, it contains a MemberCache
14801         which is used to do the member lookups.
14802         (MemberCache): New class.  Each instance of this class contains
14803         all members of a type and a name-based hash table.
14804         (MemberCache.FindMembers): This is our new member lookup
14805         function.  First, it looks up all members of the requested name in
14806         the hash table.  Then, it walks this list and sorts out all
14807         applicable members and returns them.
14808
14809 2002-08-13  Martin Baulig  <martin@gnome.org>
14810
14811         In addition to a nice code cleanup, this gives us a performance
14812         increase of about 1.4% on GNU/Linux - not much, but it's already
14813         half a second for the self-hosting MCS compilation.
14814
14815         * typemanager.cs (IMemberFinder): New interface.  It is used by
14816         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14817         Enum, Delegate or Interface.
14818         (TypeManager.finder_to_member_finder): New PtrHashtable.
14819         (TypeManager.finder_to_container): Removed.
14820         (TypeManager.finder_to_delegate): Removed.
14821         (TypeManager.finder_to_interface): Removed.
14822         (TypeManager.finder_to_enum): Removed.
14823
14824         * interface.cs (Interface): Implement IMemberFinder.
14825
14826         * delegate.cs (Delegate): Implement IMemberFinder.
14827
14828         * enum.cs (Enum): Implement IMemberFinder.
14829
14830         * class.cs (TypeContainer): Implement IMemberFinder.
14831
14832 2002-08-12  Martin Baulig  <martin@gnome.org>
14833
14834         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14835
14836 2002-08-12  Martin Baulig  <martin@gnome.org>
14837
14838         * ecore.cs (ITypeExpression): New interface for expressions which
14839         resolve to a type.
14840         (TypeExpression): Renamed to TypeLookupExpression.
14841         (Expression.DoResolve): If we're doing a types-only lookup, the
14842         expression must implement the ITypeExpression interface and we
14843         call DoResolveType() on it.
14844         (SimpleName): Implement the new ITypeExpression interface.
14845         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14846         hack, the situation that we're only looking up types can't happen
14847         anymore when this method is called.  Moved the type lookup code to
14848         DoResolveType() and call it.
14849         (SimpleName.DoResolveType): This ITypeExpression interface method
14850         is now doing the types-only lookup.
14851         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14852         (ResolveFlags): Added MaskExprClass.
14853
14854         * expression.cs (MemberAccess): Implement the ITypeExpression
14855         interface.
14856         (MemberAccess.DoResolve): Added support for a types-only lookup
14857         when we're called via ITypeExpression.DoResolveType().
14858         (ComposedCast): Implement the ITypeExpression interface.
14859
14860         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14861         Expression.Resolve() with ResolveFlags.Type instead.
14862
14863 2002-08-12  Martin Baulig  <martin@gnome.org>
14864
14865         * interface.cs (Interface.Define): Apply attributes.
14866
14867         * attribute.cs (Attribute.ApplyAttributes): Added support for
14868         interface attributes.
14869
14870 2002-08-11  Martin Baulig  <martin@gnome.org>
14871
14872         * statement.cs (Block.Emit): Only check the "this" variable if we
14873         do not always throw an exception.
14874
14875         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14876         whether the property has a set accessor.
14877
14878 2002-08-11  Martin Baulig  <martin@gnome.org>
14879
14880         Added control flow analysis support for structs.
14881
14882         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14883         with control flow analysis turned off.
14884         (IVariable): New interface.
14885         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14886         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14887         (FieldExpr.DoResolve): Resolve the instance expression with flow
14888         analysis turned off and do the definite assignment check after the
14889         resolving when we know what the expression will resolve to.
14890
14891         * expression.cs (LocalVariableReference, ParameterReference):
14892         Implement the new IVariable interface, only call the flow analysis
14893         code if ec.DoFlowAnalysis is true.
14894         (This): Added constructor which takes a Block argument.  Implement
14895         the new IVariable interface.
14896         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14897         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14898         This does the definite assignment checks for struct members.
14899
14900         * class.cs (Constructor.Emit): If this is a non-static `struct'
14901         constructor which doesn't have any initializer, call
14902         Block.AddThisVariable() to tell the flow analysis code that all
14903         struct elements must be initialized before control returns from
14904         the constructor.
14905
14906         * statement.cs (MyStructInfo): New public class.
14907         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14908         argument to this indexer.  If non-zero, check an individual struct
14909         member, not the whole struct.
14910         (FlowBranching.CheckOutParameters): Check struct members.
14911         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14912         overloaded versions of these methods which take an additional
14913         `int field_idx' argument to check struct members.
14914         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14915         overloaded versions of these methods which take an additional
14916         `string field_name' argument to check struct member.s
14917         (VariableInfo): Implement the IVariable interface.
14918         (VariableInfo.StructInfo): New public property.  Returns the
14919         MyStructInfo instance of the variable if it's a struct or null.
14920         (Block.AddThisVariable): New public method.  This is called from
14921         Constructor.Emit() for non-static `struct' constructor which do
14922         not have any initializer.  It creates a special variable for the
14923         "this" instance variable which will be checked by the flow
14924         analysis code to ensure that all of the struct's fields are
14925         initialized before control returns from the constructor.
14926         (UsageVector): Added support for struct members.  If a
14927         variable/parameter is a struct with N members, we reserve a slot
14928         in the usage vector for each member.  A struct is considered fully
14929         initialized if either the struct itself (slot 0) or all its
14930         members are initialized.
14931
14932 2002-08-08  Martin Baulig  <martin@gnome.org>
14933
14934         * driver.cs (Driver.MainDriver): Only report an error CS5001
14935         if there were no compilation errors.
14936
14937         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14938         `UnsafeContext' property to determine whether the parent is in
14939         unsafe context rather than checking the parent's ModFlags:
14940         classes nested in an unsafe class are unsafe as well.
14941
14942 2002-08-08  Martin Baulig  <martin@gnome.org>
14943
14944         * statement.cs (UsageVector.MergeChildren): Distinguish between
14945         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14946         we return.  Added test17() and test18() to test-154.cs.
14947
14948 2002-08-08  Martin Baulig  <martin@gnome.org>
14949
14950         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14951         Family access, make sure the invoking type isn't a subclass of the
14952         queried type (that'd be a CS1540).
14953
14954         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14955         this method which takes an additional `Type invocation_type'.
14956
14957         * expression.cs (BaseAccess.DoResolve): Use the base type as
14958         invocation and query type.
14959         (MemberAccess.DoResolve): If the lookup failed and we're about to
14960         report a CS0122, try a lookup with the ec.ContainerType - if this
14961         succeeds, we must report a CS1540.
14962
14963 2002-08-08  Martin Baulig  <martin@gnome.org>
14964
14965         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14966         (MethodGroupExpr): Implement the IMemberExpr interface.
14967
14968         * expression (MemberAccess.ResolveMemberAccess): No need to have
14969         any special code for MethodGroupExprs anymore, they're now
14970         IMemberExprs.   
14971
14972 2002-08-08  Martin Baulig  <martin@gnome.org>
14973
14974         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14975         Family, FamANDAssem and FamORAssem permissions.
14976         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14977
14978 2002-08-08  Martin Baulig  <martin@gnome.org>
14979
14980         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14981         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14982         or loop block.
14983
14984 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14985
14986         * driver.cs: implemented /resource option to embed managed resources.
14987
14988 2002-08-07  Martin Baulig  <martin@gnome.org>
14989
14990         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14991         (FieldBase.HasFieldInitializer): New public property.
14992         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14993         returns the field initializer and makes sure it is only resolved once.
14994         (TypeContainer.EmitFieldInitializers): Call
14995         FieldBase.GetInitializerExpression to get the initializer, this ensures
14996         that it isn't resolved multiple times.
14997
14998         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14999         the resolving process (SimpleName/MemberLookup) that we're currently
15000         emitting a field initializer (which must not access any instance members,
15001         this is an error CS0236).
15002
15003         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15004         argument, if the `IsFieldInitializer' flag is set, we must report and
15005         error CS0236 and not an error CS0120.   
15006
15007 2002-08-07  Martin Baulig  <martin@gnome.org>
15008
15009         * ecore.cs (IMemberExpr): New public interface.
15010         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15011         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15012         if the expression is an IMemberExpr.
15013
15014         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15015         to be null, implicitly default to `this' if we're non-static in
15016         this case.  Simplified the code a lot by using the new IMemberExpr
15017         interface.  Also fixed bug #28176 here.
15018
15019 2002-08-06  Martin Baulig  <martin@gnome.org>
15020
15021         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15022         ParameterReferences during semantic analysis so that we can do a
15023         type-only search when resolving Cast, TypeOf and SizeOf.
15024         (block): Pass the `current_local_parameters' to the Block's
15025         constructor.
15026
15027         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15028         argument to the constructor.
15029         (ConstructorInitializer.Resolve): Create a temporary implicit
15030         block with the parameters.
15031
15032         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15033         references here if we aren't doing a type-only search.
15034
15035         * statement.cs (Block): Added constructor which takes a
15036         `Parameters parameters' argument.
15037         (Block.Parameters): New public property.
15038
15039         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15040         to `Parameters' and made it public readonly.
15041
15042 2002-08-06  Martin Baulig  <martin@gnome.org>
15043
15044         * ecore.cs (Expression.Warning): Made this public as well.
15045
15046         * report.cs (Report.Debug): Print the contents of collections.
15047
15048 2002-08-06  Martin Baulig  <martin@gnome.org>
15049
15050         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15051         used to tell Resolve() which kinds of expressions it may return.
15052         (Expression.Resolve): Added overloaded version of this method which
15053         takes a `ResolveFlags flags' argument.  This can be used to tell
15054         Resolve() which kinds of expressions it may return.  Reports a
15055         CS0118 on error.
15056         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15057         ResolveFlags.SimpleName.
15058         (Expression.Error118): Added overloaded version of this method which
15059         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15060         which kinds of expressions are allowed.
15061
15062         * expression.cs (Argument.ResolveMethodGroup): New public method.
15063         Resolves an argument, but allows a MethodGroup to be returned.
15064         This is used when invoking a delegate.
15065
15066         * TODO: Updated a bit.
15067
15068 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15069
15070         Fixed compilation with csc.
15071
15072         * ecore.cs: Expression.Error made public. Is this correct? Should
15073         Warning be made public too?
15074
15075         * expression.cs: use ea.Location instead of ea.loc.
15076         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15077
15078 2002-08-06  Martin Baulig  <martin@gnome.org>
15079
15080         * ecore.cs (Expression.loc): Moved the location here instead of
15081         duplicating it in all derived classes.
15082         (Expression.Location): New public property.
15083         (Expression.Error, Expression.Warning): Made them non-static and
15084         removed the location argument.
15085         (Expression.Warning): Added overloaded version which takes an
15086         `int level' argument.
15087         (Expression.Error118): Make this non-static and removed the
15088         expression and location arguments.
15089         (TypeExpr): Added location argument to the constructor.
15090
15091         * expression.cs (StaticCallExpr): Added location argument to
15092         the constructor.
15093         (Indirection, PointerArithmetic): Likewise.
15094         (CheckedExpr, UnCheckedExpr): Likewise.
15095         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15096         (StringPtr): Likewise.
15097
15098
15099 2002-08-05  Martin Baulig  <martin@gnome.org>
15100
15101         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15102
15103         * assign.cs (Assign.DoResolve): Check whether the source
15104         expression is a value or variable.
15105
15106         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15107         while resolving the corresponding blocks.
15108
15109         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15110         an error, don't silently return null.
15111
15112         * statement.cs (Block.AddVariable): Do the error reporting here
15113         and distinguish between CS0128 and CS0136.
15114         (Block.DoResolve): Report all unused labels (warning CS0164).
15115         (LabeledStatement): Pass the location to the constructor.
15116         (LabeledStatement.HasBeenReferenced): New property.
15117         (LabeledStatement.Resolve): Set it to true here.
15118
15119         * statement.cs (Return.Emit): Return success even after reporting
15120         a type mismatch error (CS0126 or CS0127), this is what csc does and
15121         it avoids confusing the users with any consecutive errors.
15122
15123 2002-08-05  Martin Baulig  <martin@gnome.org>
15124
15125         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15126
15127         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15128
15129         * expression.cs (MemberAccess.DoResolve): Silently return if an
15130         error has already been reported.
15131
15132         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15133         error has already been reported.
15134
15135 2002-08-05  Martin Baulig  <martin@gnome.org>
15136
15137         * statement.cs (UsageVector): Only initialize the `parameters'
15138         vector if we actually have any "out" parameters.
15139
15140 2002-08-05  Martin Baulig  <martin@gnome.org>
15141
15142         * expression.cs (Binary.ResolveOperator): When combining delegates,
15143         they must have the same type.
15144
15145 2002-08-05  Martin Baulig  <martin@gnome.org>
15146
15147         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15148         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15149         work with the ms runtime and we also don't need it: if we're a
15150         PropertyBuilder and not in the `indexer_arguments' hash, then we
15151         are a property and not an indexer.
15152
15153         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15154         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15155         since the latter one doesn't work with the ms runtime.
15156
15157 2002-08-03  Martin Baulig  <martin@gnome.org>
15158
15159         Fixed bugs #27998 and #22735.
15160
15161         * class.cs (Method.IsOperator): New public field.
15162         (Method.CheckBase): Report CS0111 if there's already a method
15163         with the same parameters in the current class.  Report CS0508 when
15164         attempting to change the return type of an inherited method.
15165         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15166         and it's not marked abstract or extern.
15167         (PropertyBase): New abstract base class for Property and Indexer.
15168         (PropertyBase.CheckBase): Moved here from Property and made it work
15169         for indexers.
15170         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15171         the same so we can reuse it there.
15172         (Property, Indexer): Derive from PropertyBase.
15173         (MethodSignature.inheritable_property_signature_filter): New delegate
15174         to find properties and indexers.
15175
15176         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15177         argument and improved error reporting.
15178
15179         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15180         EmptyReadOnlyParameters and made it a property.
15181
15182         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15183         version of this method which takes a `PropertyInfo indexer'.
15184         (TypeManager.RegisterIndexer): New method.
15185
15186         * class.cs: Added myself as author of this file :-)
15187
15188 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15189
15190         * class.cs: fixed compilation on windoze.
15191
15192 2002-08-03  Martin Baulig  <martin@gnome.org>
15193
15194         * interface.cs (Interface.GetInterfaceBases): Check whether all
15195         base interfaces are at least as accessible than the current one.
15196
15197         * class.cs (TypeContainer.GetClassBases): Check whether base types
15198         are at least as accessible than the current type.
15199         (TypeContainer.AsAccessible): Implemented and made non-static.
15200         (MemberBase.CheckParameters): Report errors if the accessibility
15201         checks fail.
15202
15203         * delegate.cs (Delegate.Delegate): The default visibility is
15204         internal for top-level types and private for nested types.
15205         (Delegate.Define): Report errors if the accessibility checks fail.
15206
15207         * enum.cs (Enum.Enum): The default visibility is internal for
15208         top-level types and private for nested types.
15209         (Enum.DefineType): Compute the correct visibility.
15210
15211         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15212         function which takes a `bool is_toplevel' instead of a TypeContainer.
15213
15214         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15215         builtin type.
15216
15217 2002-08-02  Martin Baulig  <martin@gnome.org>
15218
15219         * expression.cs (LocalVariableReferenc): Added constructor which
15220         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15221         (LocalVariableReference.IsReadOnly): New property.
15222         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15223         variable is readonly, use our own readonly flag to do this; you can
15224         use the new constructor to get a writable reference to a read-only
15225         variable.
15226
15227         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15228         reference to the local variable.
15229
15230 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * rootcontext.cs (ResolveCore): Also include System.Exception
15233
15234         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15235         we reach an EmptyStatement.
15236
15237         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15238         is also fine.
15239
15240         * expression.cs (Binary.ResolveOperator): Check error result in
15241         two places.
15242
15243         use brtrue/brfalse directly and avoid compares to null.
15244
15245 2002-08-02  Martin Baulig  <martin@gnome.org>
15246
15247         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15248         Fixes bug #28407, added test-155.cs.
15249
15250 2002-08-01  Martin Baulig  <martin@gnome.org>
15251
15252         * class.cs (Event.EmitDefaultMethod): Make this work with static
15253         events.  Fixes #28311, added verify-3.cs.
15254
15255 2002-08-01  Martin Baulig  <martin@gnome.org>
15256
15257         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15258         `is_disposable' fields.
15259         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15260         `hm.is_disposable' if we're using the collection pattern.
15261         (Foreach.EmitCollectionForeach): Use the correct type for the
15262         enumerator's local variable, only emit the try/finally block if
15263         necessary (fixes #27713).
15264
15265 2002-08-01  Martin Baulig  <martin@gnome.org>
15266
15267         * ecore.cs (Expression.report118): Renamed to Error118 and made
15268         it public static.
15269
15270         * statement.cs (Throw.Resolve): Check whether the expression is of
15271         the correct type (CS0118) and whether the type derives from
15272         System.Exception (CS0155).
15273         (Catch.Resolve): New method.  Do the type lookup here and check
15274         whether it derives from System.Exception (CS0155).
15275         (Catch.CatchType, Catch.IsGeneral): New public properties.
15276
15277         * typemanager.cs (TypeManager.exception_type): Added.
15278
15279 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * driver.cs: Updated About function.
15282
15283 2002-07-31  Martin Baulig  <martin@gnome.org>
15284
15285         Implemented Control Flow Analysis.
15286
15287         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15288         (EmitContext.CurrentBranching): Added.
15289         (EmitContext.StartFlowBranching): Added.
15290         (EmitContext.EndFlowBranching): Added.
15291         (EmitContext.KillFlowBranching): Added.
15292         (EmitContext.IsVariableAssigned): Added.
15293         (EmitContext.SetVariableAssigned): Added.
15294         (EmitContext.IsParameterAssigned): Added.
15295         (EmitContext.SetParameterAssigned): Added.
15296         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15297         Added control flow analysis stuff here.
15298
15299         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15300         resolve the expression as lvalue.
15301         (LocalVariableReference.DoResolve): Check whether the variable has
15302         already been assigned.
15303         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15304         the parameter as assigned here.
15305         (ParameterReference.DoResolve): Check whether the parameter has already
15306         been assigned.
15307         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15308         expression as lvalue.
15309
15310         * statement.cs (FlowBranching): New class for the flow analysis code.
15311         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15312         (LabeledStatement.IsDefined): New public property.
15313         (LabeledStatement.AddUsageVector): New public method to tell flow
15314         analyis that the label may be reached via a forward jump.
15315         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15316         flow analysis.
15317         (VariableInfo.Number): New public field.  This is used by flow analysis
15318         to number all locals of a block.
15319         (Block.CountVariables): New public property.  This is the number of
15320         local variables in this block (including the locals from all parent
15321         blocks).
15322         (Block.EmitMeta): Number all the variables.
15323
15324         * statement.cs: Added flow analysis support to all classes.
15325
15326 2002-07-31  Martin Baulig  <martin@gnome.org>
15327
15328         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15329         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15330         then use this argument.
15331
15332         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15333
15334         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15335         use this to specify /define options.
15336
15337 2002-07-29  Martin Baulig  <martin@gnome.org>
15338
15339         * statement.cs (Fixed): Moved all code that does variable lookups
15340         and resolvings from Emit to Resolve.
15341
15342         * statement.cs (For): Moved all code that does variable lookups
15343         and resolvings from Emit to Resolve.
15344
15345         * statement.cs (Using): Moved all code that does variable lookups
15346         and resolvings from Emit to Resolve.
15347
15348 2002-07-29  Martin Baulig  <martin@gnome.org>
15349
15350         * attribute.cs (Attribute.Resolve): Explicitly catch a
15351         System.NullReferenceException when creating the
15352         CustromAttributeBuilder and report a different warning message.
15353
15354 2002-07-29  Martin Baulig  <martin@gnome.org>
15355
15356         * support.cs (ParameterData.ParameterName): Added method to
15357         get the name of a parameter.
15358
15359         * typemanager.cs (TypeManager.IsValueType): New public method.
15360
15361 2002-07-29  Martin Baulig  <martin@gnome.org>
15362
15363         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15364         is a flag which specifies that it's either ref or out.
15365         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15366         the out parameter to `out Parameter.Modifier mod', also set the
15367         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15368
15369         * support.cs (InternalParameters.ParameterModifier): Distinguish
15370         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15371         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15372
15373         * expression.cs (Argument.GetParameterModifier): Distinguish
15374         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15375         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15376
15377 2002-07-29  Martin Baulig  <martin@gnome.org>
15378
15379         * expression.cs (ParameterReference.ParameterReference): Added
15380         `Location loc' argument to the constructor.
15381
15382         * cs-parser.jay: Pass location to ParameterReference.
15383
15384 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15385
15386         * statement.cs (Try): Initialize the location.
15387
15388         * cs-parser.jay: pass location to Try.
15389
15390         * expression.cs (Unary.Reduce): Change the prototype to return
15391         whether a constant fold could be performed or not.  The result is
15392         returned in an out parameters.  In the case of Indirection and
15393         AddressOf, we want to perform the full tests.
15394
15395 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * statement.cs (Statement.Emit): Flag dead code.
15398
15399 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15400
15401         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15402
15403 2002-07-27  Martin Baulig  <martin@gnome.org>
15404
15405         * class.cs (MethodData.Define): Put back call to
15406         TypeManager.AddMethod(), accidentally commented this out.
15407
15408         * report.cs (Debug): New public method to print debugging information,
15409         this is `[Conditional ("DEBUG")]'.
15410
15411 2002-07-26  Martin Baulig  <martin@gnome.org>
15412
15413         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15414         (switch_statement): Push the current_block to the switch_stack and
15415         pop it again when we're done with the switch.
15416         (switch_section): The new block is a child of the current_block.
15417         Fixes bug #24007, added test-152.cs.
15418
15419 2002-07-27  Martin Baulig  <martin@gnome.org>
15420
15421         * expression.cs (Invocation.EmitArguments): When calling a varargs
15422         function with only its fixed arguments, we need to pass an empty
15423         array.
15424
15425 2002-07-27  Martin Baulig  <martin@gnome.org>
15426
15427         Mono 0.13 has been released.
15428
15429 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15430
15431         * driver.cs: Rename --resource to --linkres, because that is what
15432         we do currently, we dont support --resource yet.
15433
15434         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15435
15436 2002-07-25  Martin Baulig  <martin@gnome.org>
15437
15438         * class.cs (MethodData): New public class.  This is a `method builder'
15439         class for a method or one accessor of a Property/Indexer/Event.
15440         (MethodData.GetMethodFlags): Moved here from MemberBase.
15441         (MethodData.ApplyAttributes): Likewise.
15442         (MethodData.ApplyObsoleteAttribute): Likewise.
15443         (MethodData.ApplyConditionalAttribute): Likewise.
15444         (MethodData.ApplyDllImportAttribute): Likewise.
15445         (MethodData.CheckAbstractAndExternal): Likewise.
15446         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15447         (MethodData.Emit): Formerly known as Method.Emit().
15448         (MemberBase): Moved everything which was specific to a single
15449         accessor/method to MethodData.
15450         (Method): Create a new MethodData and call Define() and Emit() on it.
15451         (Property, Indexer, Event): Create a new MethodData objects for each
15452         accessor and call Define() and Emit() on them.
15453
15454 2002-07-25  Martin Baulig  <martin@gnome.org>
15455
15456         Made MethodCore derive from MemberBase to reuse the code from there.
15457         MemberBase now also checks for attributes.
15458
15459         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15460         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15461         as virtual.
15462         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15463         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15464         (MemberBase.ApplyAttributes): New virtual method; applies the
15465         attributes to a method or accessor.
15466         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15467         (MemberBase.ApplyConditionalAttribute): Likewise.
15468         (MemberBase.ApplyDllImportAttribute): Likewise.
15469         (MemberBase.CheckAbstractAndExternal): Likewise.
15470         (MethodCore.ParameterTypes): This is now a property instead of a
15471         method, it's initialized from DoDefineParameters().
15472         (MethodCore.ParameterInfo): Removed the set accessor.
15473         (MethodCore.DoDefineParameters): New protected virtual method to
15474         initialize ParameterTypes and ParameterInfo.
15475         (Method.GetReturnType): We can now simply return the MemberType.
15476         (Method.GetMethodFlags): Override the MemberBase version and add
15477         the conditional flags.
15478         (Method.CheckBase): Moved some code from Define() here, call
15479         DoDefineParameters() here.
15480         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15481         here to avoid some larger code duplication.
15482         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15483         ensure that abstract and external accessors don't declare a body.
15484
15485         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15486         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15487         lookup in the attribute's parent classes, so we need to abort as soon
15488         as we found the first match.
15489         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15490         the attribute has no arguments.
15491
15492         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15493         of a Method.
15494
15495 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15496
15497         * cs-parser.jay: reverted previous patch.
15498
15499 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15500
15501         * cs-parser.jay: fixed bug #22119.
15502
15503 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15504
15505         * attribute.cs: fixed compilation. The error was:
15506         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15507         be assigned to before control leaves the current method."
15508         [FIXME:  Filed as bug #28186: MCS must report this error.]
15509
15510 2002-07-25  Martin Baulig  <martin@gnome.org>
15511
15512         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15513         method to pull the condition name ouf of a Conditional attribute.
15514         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15515         the obsolete message and error flag out of an Obsolete attribute.
15516
15517         * class.cs (Method.GetMethodFlags): New public method to get the
15518         TypeManager.MethodFlags for this method.
15519         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15520         private methods.
15521         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15522         if we're overriding a virtual function, set the new private variable
15523         `parent_method'; call the new TypeManager.AddMethod().
15524
15525         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15526         the MethodBuilder and the Method in a PtrHashtable.
15527         (TypeManager.builder_to_method): Added for this purpose.
15528         (TypeManager.MethodFlags): Added IsObsoleteError.
15529         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15530         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15531         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15532         the message from the attribute.
15533
15534 2002-07-24  Martin Baulig  <martin@gnome.org>
15535
15536         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15537         preprocessor directives, ensure that the argument to #define/#undef is
15538         exactly one identifier and that it's actually an identifier.
15539
15540         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15541         did not work ....
15542
15543 2002-07-24  Martin Baulig  <martin@gnome.org>
15544
15545         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15546         initialize it to TypeManager.object_type in the constructor.
15547         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15548         of the `hm.get_current' method if we're using the collection pattern.
15549         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15550         for the explicit conversion to make it work when we're using the collection
15551         pattern and the `Current' property has a different return type than `object'.
15552         Fixes #27713.
15553
15554 2002-07-24  Martin Baulig  <martin@gnome.org>
15555
15556         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15557         does not match, but don't report any errors.  This method is called in
15558         order for all methods in a MethodGroupExpr until a matching method is
15559         found, so we don't want to bail out if the first method doesn't match.
15560         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15561         matches, report the 123.  Fixes #28070.
15562
15563 2002-07-24  Martin Baulig  <martin@gnome.org>
15564
15565         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15566         TypeManager.TypeToCoreType() to the top of the method so the
15567         following equality checks will work.  Fixes #28107.
15568
15569 2002-07-24  Martin Baulig  <martin@gnome.org>
15570
15571         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15572         operand is of type uint, and the other operand is of type sbyte,
15573         short or int, the operands are converted to type long." -
15574         Actually do what this comment already told us.  Fixes bug #28106,
15575         added test-150.cs.
15576
15577 2002-07-24  Martin Baulig  <martin@gnome.org>
15578
15579         * class.cs (MethodBase): New abstract class.  This is now a base
15580         class for Property, Indexer and Event to avoid some code duplication
15581         in their Define() and DefineMethods() methods.
15582         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15583         generic methods for Define() and DefineMethods().
15584         (FieldBase): Derive from MemberBase, not MemberCore.
15585         (Property): Derive from MemberBase, not MemberCore.
15586         (Property.DefineMethod): Moved all the code from this method to the
15587         new MethodBase.DefineAccessor(), just call it with appropriate
15588         argumetnts.
15589         (Property.Define): Call the new Property.DoDefine(), this does some
15590         sanity checks and we don't need to duplicate the code everywhere.
15591         (Event): Derive from MemberBase, not MemberCore.
15592         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15593         accessors, this will also make them work with interface events.
15594         (Indexer): Derive from MemberBase, not MemberCore.
15595         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15596         (Indexer.Define): Use the new MethodBase functions.
15597
15598         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15599         argument to the constructor.
15600         (Interface.FindMembers): Added support for interface events.
15601         (Interface.PopluateEvent): Implemented.
15602
15603         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15604
15605 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15606
15607         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15608         but this is required to check for a method name being the same as
15609         the containing class.  
15610
15611         Handle this now.
15612
15613 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15614
15615         * interface.cs: initialize variable.
15616
15617 2002-07-23  Martin Baulig  <martin@gnome.org>
15618
15619         Implemented the IndexerName attribute in interfaces.
15620
15621         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15622         name if this is an explicit interface implementation.
15623         (Indexer.InterfaceIndexerName): New public variable.  If we're
15624         implementing an interface indexer, this is the IndexerName in that
15625         interface.  Otherwise, it's the IndexerName.
15626         (Indexer.DefineMethod): If we're implementing interface indexer,
15627         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15628         and Pending.ImplementIndexer methods.
15629         (Indexer.Define): Also define the PropertyBuilder if we're
15630         implementing an interface indexer and this is neither an explicit
15631         interface implementation nor do the IndexerName match the one in
15632         the interface.
15633
15634         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15635         If a method is defined here, then we always need to create a proxy
15636         for it.  This is used when implementing interface indexers.
15637         (Pending.IsInterfaceIndexer): New public method.
15638         (Pending.ImplementIndexer): New public method.
15639         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15640         This is used when implementing interface indexers to define a proxy
15641         if necessary.
15642         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15643         define a proxy if necessary.
15644
15645         * interface.cs (Interface.IndexerName): New public variable.
15646         (Interface.PopulateIndexer): Set the IndexerName.
15647         (Interface.DefineIndexers): New private method.  Populate all the
15648         indexers and make sure their IndexerNames match.
15649
15650         * typemanager.cs (IndexerPropertyName): Added support for interface
15651         indexers.
15652
15653 2002-07-22  Martin Baulig  <martin@gnome.org>
15654
15655         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15656         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15657         ret if HasReturnLabel.
15658         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15659         variables.
15660
15661         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15662         and set the ec.LoopBeginTryCatchLevel.
15663         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15664         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15665         the current ec.TryCatchLevel, the branch goes out of an exception
15666         block.  In this case, we need to use Leave and not Br.
15667
15668 2002-07-22  Martin Baulig  <martin@gnome.org>
15669
15670         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15671         block unless the block does not always return or it is contained in
15672         another try { ... } catch { ... } block.  Fixes bug #26506.
15673         Added verify-1.cs to the test suite.
15674
15675 2002-07-22  Martin Baulig  <martin@gnome.org>
15676
15677         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15678         then we do not always return.  Fixes bug #24985.
15679
15680 2002-07-22  Martin Baulig  <martin@gnome.org>
15681
15682         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15683         lookup on a per-class level; ie. walk up the class hierarchy until we
15684         found at least one applicable method, then choose the best among them.
15685         Fixes bug #24463 and test-29.cs.
15686
15687 2002-07-22  Martin Baulig  <martin@gnome.org>
15688
15689         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15690         return types of the methods.  The return type is not part of the
15691         signature and we must not check it to make the `new' modifier work.
15692         Fixes bug #27999, also added test-147.cs.
15693         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15694
15695         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15696         on the method's return type.
15697
15698 2002-07-21  Martin Baulig  <martin@gnome.org>
15699
15700         * assign.cs: Make this work if the rightmost source is a constant and
15701         we need to do an implicit type conversion.  Also adding a few more tests
15702         to test-38.cs which should have caught this.
15703
15704         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15705         target in the makefile for this.  The makefile.gnu is primarily intended
15706         for end-users who don't want to debug the compiler.
15707
15708 2002-07-21  Martin Baulig  <martin@gnome.org>
15709
15710         * assign.cs: Improved the Assign class so it can now handle embedded
15711         assignments (X = Y = Z = something).  As a side-effect this'll now also
15712         consume less local variables.  test-38.cs now passes with MCS, added
15713         a few new test cases to that test.
15714
15715 2002-07-20  Martin Baulig  <martin@gnome.org>
15716
15717         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15718         instructions.  Fixes bug #27977, also added test-146.cs.
15719
15720 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15721
15722         * cs-tokenizer.cs: fixed getHex ().
15723
15724 2002-07-19  Martin Baulig  <martin@gnome.org>
15725
15726         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15727         not Type.GetType() to lookup the array type.  This is needed when
15728         we're constructing an array of a user-defined type.
15729         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15730         single-dimensional arrays, but also for single-dimensial arrays of
15731         type decimal.
15732
15733 2002-07-19  Martin Baulig  <martin@gnome.org>
15734
15735         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15736         this function is called, it's not allowed to share LocalBuilders
15737         among ILGenerators.
15738
15739 2002-07-19  Martin Baulig  <martin@gnome.org>
15740
15741         * expression.cs (Argument.Resolve): Report an error 118 when trying
15742         to pass a type as argument.
15743
15744 2002-07-18  Martin Baulig  <martin@gnome.org>
15745
15746         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15747         Conv_R_Un for the signed `long' type.
15748
15749 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15750
15751         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15752         `expr' for the temporary result, as that will fail if we do
15753         multiple resolves on the same expression.
15754
15755 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15758         ec.TypeContainer for looking up aliases. 
15759
15760         * class.cs (TypeContainer): Remove LookupAlias from here.
15761
15762         * decl.cs (DeclSpace); Move here.
15763
15764 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15765
15766         * class.cs (FindMembers): Only call filter if the constructor
15767         bulider is not null.
15768
15769         Also handle delegates in `NestedTypes' now.  Now we will perform
15770         type lookups using the standard resolution process.  This also
15771         fixes a bug.
15772
15773         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15774         This uses Expressions (the limited kind that can be parsed by the
15775         tree) instead of strings.
15776
15777         * expression.cs (ComposedCast.ToString): Implement, used to flag
15778         errors since now we have to render expressions.
15779
15780         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15781         FormArrayType. 
15782
15783         * ecore.cs (SimpleName.ToString): ditto.
15784
15785         * cs-parser.jay: Instead of using strings to assemble types, use
15786         Expressions to assemble the type (using SimpleName, ComposedCast,
15787         MemberAccess).  This should fix the type lookups in declarations,
15788         because we were using a different code path for this.
15789
15790         * statement.cs (Block.Resolve): Continue processing statements
15791         even when there is an error.
15792
15793 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * class.cs (Event.Define): Also remove the `remove' method from
15796         the list of pending items.
15797
15798         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15799         generate more compact code. 
15800
15801 2002-07-17  Martin Baulig  <martin@gnome.org>
15802
15803         * const.cs (Const.LookupConstantValue): Add support for constant
15804         `unchecked' and `checked' expressions.
15805         Also adding test case test-140.cs for this.
15806
15807 2002-07-17  Martin Baulig  <martin@gnome.org>
15808
15809         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15810         check whether mi.ReturnType implements the IEnumerator interface; the
15811         `==' and the IsAssignableFrom() will fail in this situation.
15812
15813 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15814
15815         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15816         here too.
15817
15818 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15819
15820         * expression.cs: fixed bug #27811.
15821
15822 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15825         Molaro: when we are a ref, the value already contains a pointer
15826         value, do not take the address of it.
15827
15828 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15829         * removed mb-parser.jay and mb-tokenizer.cs
15830
15831 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15832
15833         * expression.cs: check against the building corlib void type.
15834
15835 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15836
15837         * ecore.cs: fix for valuetype static readonly fields: when 
15838         initializing them, we need their address, not the address of a copy.
15839
15840 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15841
15842         * typemanager.cs: register also enum_type in corlib.
15843
15844 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15845
15846         * class.cs: allow calling this (but not base) initializers in structs.
15847
15848 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15849
15850         * ecore.cs: make sure we compare against the building base types
15851         in GetTypeSize ().
15852
15853 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15854
15855         * typemanager.cs: fix TypeToCoreType() to handle void and object
15856         (corlib gets no more typerefs after this change).
15857
15858 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15859
15860         * expression.cs (ArrayCreation.EmitArrayArguments): use
15861         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15862
15863         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15864         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15865         array indexes, the runtime actually forbids them.
15866
15867         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15868         for array arguments here.
15869
15870         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15871         instead of the default for ValueTypes.
15872
15873         (New.DoEmit): Use IsValueType instead of
15874         IsSubclassOf (value_type)
15875         (New.DoResolve): ditto.
15876         (Invocation.EmitCall): ditto.
15877
15878         * assign.cs (Assign): ditto.
15879
15880         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15881         Statements *are* currently doing part of their resolution during
15882         Emit.  
15883
15884         Expressions do always resolve during resolve, but statements are
15885         only required to propagate resolution to their children.
15886
15887 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15890
15891         (LoadAssembly): Do not add the dll if it is already specified
15892
15893         (MainDriver): Add the System directory to the link path at the end,
15894         after all the other -L arguments. 
15895
15896         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15897         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15898         ldelem.u1) and using the opposite for sbytes.
15899
15900         This fixes Digger, and we can finally run it.
15901
15902         * driver.cs (UnixParseOption): Move the option parsing here.  
15903         (CSCParseOption): Implement CSC-like parsing of options.
15904
15905         We now support both modes of operation, the old Unix way, and the
15906         new CSC-like way.  This should help those who wanted to make cross
15907         platform makefiles.
15908
15909         The only thing broken is that /r:, /reference: and /lib: are not
15910         implemented, because I want to make those have the same semantics
15911         as the CSC compiler has, and kill once and for all the confussion
15912         around this.   Will be doing this tomorrow.
15913
15914         * statement.cs (Unsafe.Resolve): The state is checked during
15915         resolve, not emit, so we have to set the flags for IsUnsfe here.
15916
15917 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15920         not catch the Error_ObjectRefRequired in SimpleName (as it is
15921         possible to have a class/instance variable name that later gets
15922         deambiguated), we have to check this here.      
15923
15924 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15925
15926         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15927         make static and put into Expression.
15928
15929         (Event.Define): Register the private field of the event with the 
15930         TypeManager so that GetFieldFromEvent can get at it.
15931
15932         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15933         keep track of the private field associated with an event which
15934         has no accessors.
15935
15936         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15937         private field.
15938
15939         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15940
15941 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * expression.cs (Binary.EmitBranchable): this routine emits the
15944         Binary expression in a branchable context.  This basically means:
15945         we need to branch somewhere, not just get the value on the stack.
15946
15947         This works together with Statement.EmitBoolExpression.
15948
15949         * statement.cs (Statement.EmitBoolExpression): Use
15950         EmitBranchable. 
15951
15952 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15953
15954         * statement.cs (For): Reduce the number of jumps in loops.
15955
15956         (For): Implement loop inversion for the For statement.
15957
15958         (Break): We can be breaking out of a Try/Catch controlled section
15959         (foreach might have an implicit try/catch clause), so we need to
15960         use Leave instead of Br.
15961
15962         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15963         now).  If the instace expression supports IMemoryLocation, we use
15964         the AddressOf method from the IMemoryLocation to extract the
15965         address instead of emitting the instance.
15966
15967         This showed up with `This', as we were emitting the instance
15968         always (Emit) instead of the Address of This.  Particularly
15969         interesting when This is a value type, as we dont want the Emit
15970         effect (which was to load the object).
15971
15972 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15973
15974         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15975
15976         * statement.cs (Checked): Set the CheckedState during the resolve
15977         process too, as the ConvCast operations track the checked state on
15978         the resolve process, and not emit.
15979
15980         * cs-parser.jay (namespace_member_declaration): Flag that we have
15981         found a declaration when we do.  This is used to flag error 1529
15982
15983         * driver.cs: Report ok when we display the help only.
15984
15985 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15986
15987         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15988
15989 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * cs-tokenizer.cs (define): We also have to track locally the
15992         defines.  AllDefines is just used for the Conditional Attribute,
15993         but we also need the local defines for the current source code. 
15994
15995 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15996
15997         * statement.cs (While, For, Do): These loops can exit through a
15998         Break statement, use this information to tell whether the
15999         statement is the last piece of code.
16000
16001         (Break): Flag that we break.
16002
16003         * codegen.cs (EmitContexts): New `Breaks' state variable.
16004
16005 2002-07-03  Martin Baulig  <martin@gnome.org>
16006
16007         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16008         modifiers in method declarations in structs.  Otherwise, you won't
16009         be able to override things like Object.Equals().
16010
16011 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * class.cs (Method, Property, Indexer): Do not allow the public
16014         modifier to be used in explicit interface implementations.
16015
16016         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16017         override modifiers in method declarations in structs
16018
16019 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16020
16021         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16022         integer or real overflow, report an error
16023
16024 2002-07-02  Martin Baulig  <martin@gnome.org>
16025
16026         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16027         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16028         to tell the runtime about our newly created System.Object and
16029         System.ValueType types.
16030
16031 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16032
16033         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16034         struct instead of Ldarg/Starg.
16035
16036 2002-07-02  Martin Baulig  <martin@gnome.org>
16037
16038         * expression.cs (Indirection.Indirection): Call
16039         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16040
16041 2002-07-02  Martin Baulig  <martin@gnome.org>
16042
16043         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16044         ValueType, call TypeManager.TypeToCoreType() on it.
16045         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16046         the OpCodes.Newarr argument.
16047
16048 2002-07-02  Martin Baulig  <martin@gnome.org>
16049
16050         * expression.cs (Invocation.EmitCall): When compiling corlib,
16051         replace all calls to the system's System.Array type to calls to
16052         the newly created one.
16053
16054         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16055         System.Array methods.
16056         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16057         from the system's System.Array type which must be replaced.
16058
16059 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16060
16061         * typemanager.cs: load unverifiable_code_ctor so we can build
16062         corlib using the correct type. Avoid using GetTypeCode() with
16063         TypeBuilders.
16064         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16065         TypeManager.object_type to allow building corlib.
16066
16067 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16068
16069         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16070
16071 2002-07-01  Martin Baulig  <martin@gnome.org>
16072
16073         * class.cs: Make the last change actually work, we need to check
16074         whether `ifaces != null' to avoid a crash.
16075
16076 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16077
16078         * class.cs: when we build structs without fields that implement
16079         interfaces, we need to add the interfaces separately, since there is
16080         no API to both set the size and add the interfaces at type creation
16081         time.
16082
16083 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16084
16085         * expression.cs: the dimension arguments to the array constructors
16086         need to be converted if they are a long.
16087
16088 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16089
16090         * class.cs: don't emit ldarg.0 if there is no parent constructor
16091         (fixes showstopper for corlib).
16092
16093 2002-06-29  Martin Baulig  <martin@gnome.org>
16094
16095         MCS now compiles corlib on GNU/Linux :-)
16096
16097         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16098         ie. check for MethodImplOptions.InternalCall.
16099
16100         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16101         and TypeManager.attribute_type are null, so we must explicitly check
16102         whether parent is not null to find out whether it's an attribute type.
16103         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16104         and SetBuilder, not only if the property is neither abstract nor external.
16105         This is necessary to set the MethodImplOptions on the accessor methods.
16106         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16107         SetBuilder, see Property.Emit().
16108
16109         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16110         populate "System.Object", "System.ValueType" and "System.Attribute" since
16111         they've already been populated from BootCorlib_PopulateCoreTypes().
16112
16113 2002-06-29  Martin Baulig  <martin@gnome.org>
16114
16115         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16116         is the NullLiteral, we also need to make sure that target_type is not
16117         an enum type.   
16118
16119 2002-06-29  Martin Baulig  <martin@gnome.org>
16120
16121         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16122         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16123         before calling BootstrapCorlib_ResolveDelegate ().
16124
16125 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16126
16127         * statement.cs: fixed build-breaker. All tests passed ok.
16128
16129 2002-06-27  Martin Baulig  <martin@gnome.org>
16130
16131         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16132         for System.Decimal when compiling corlib.
16133
16134 2002-06-27  Martin Baulig  <martin@gnome.org>
16135
16136         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16137         switch blocks which contain nothing but a default clause.
16138
16139 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16140
16141        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16142
16143 2002-06-27  Martin Baulig  <martin@gnome.org>
16144
16145         * ecore.cs (PropertyExpr.PropertyExpr): Call
16146         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16147
16148         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16149         is already a TypeBuilder.
16150
16151 2002-06-27  Martin Baulig  <martin@gnome.org>
16152
16153         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16154         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16155         the "from an array-type to System.Array" case.  This makes it work
16156         when compiling corlib.
16157
16158 2002-06-27  Martin Baulig  <martin@gnome.org>
16159
16160         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16161         non-static PropertyExpr, set its InstanceExpression.  This makes
16162         the `ICollection.Count' property work in System/Array.cs.
16163
16164 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16165
16166         * driver.cs: Made error handling more consistent.  Errors now
16167         tracked by Report class, so many methods which used to return int
16168         now return void.  Main() now prints success/failure and 
16169         errors/warnings message.
16170
16171         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16172         the magic number return values (123 and 124).  Now, if the
16173         expected error occurs, the compiler exits with success (exit value
16174         0).  If the compilation completes without seeing that particular
16175         error, the compiler exits with failure (exit value 1).  The
16176         makefile in mcs/errors has been changed to handle the new behaviour.
16177
16178         * report.cs: Made 'expected error' number a property and renamed
16179         it from 'Probe' to 'ExpectedError'.
16180
16181         * genericparser.cs: Removed error handling support, since it is
16182         now all done by Report class.
16183
16184         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16185         class, so parse() no longer returns an int.
16186
16187         * namespace.cs: Use Report.Error instead of GenericParser.error
16188
16189 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16190
16191         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16192         TypeContainer.AddOperator): At the front of the list put the
16193         explicit implementations, so they get resolved/defined first. 
16194
16195 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16196
16197         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16198         interface type is implemented by this TypeContainer.  Used during
16199         explicit interface implementation.
16200
16201         (Property.Define, Indexer.Define, Method.Define): Validate that
16202         the given interface in the explicit implementation is one of the
16203         base classes for the containing type.
16204
16205         Also if we are explicitly implementing an interface, but there is
16206         no match in the pending implementation table, report an error.
16207
16208         (Property.Define): Only define the property if we are
16209         not explicitly implementing a property from an interface.  Use the
16210         correct name also for those properties (the same CSC uses,
16211         although that is really not needed).
16212
16213         (Property.Emit): Do not emit attributes for explicitly implemented
16214         properties, as there is no TypeBuilder.
16215
16216         (Indexer.Emit): ditto.
16217
16218         Hiding then means that we do not really *implement* a pending
16219         implementation, which makes code fail.
16220
16221 2002-06-22  Martin Baulig  <martin@gnome.org>
16222
16223         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16224         the return value of Object.GetType().  [FIXME: we need to do this whenever
16225         we get a type back from the reflection library].
16226
16227 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16228
16229         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16230
16231 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16232
16233         * attribute.cs: Return null if we can not look up the type.
16234
16235         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16236         the interface types found.
16237
16238         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16239         interface types found.
16240
16241         * typemanager.cs (GetInterfaces): Make this routine returns alll
16242         the interfaces and work around the lame differences between
16243         System.Type and System.Reflection.Emit.TypeBuilder in the results
16244         result for GetInterfaces.
16245
16246         (ExpandInterfaces): Given an array of interface types, expand and
16247         eliminate repeated ocurrences of an interface.  This expands in
16248         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16249         be IA, IB, IC.
16250
16251 2002-06-21  Martin Baulig  <martin@gnome.org>
16252
16253         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16254         on System.Enum.
16255
16256 2002-06-21  Martin Baulig  <martin@gnome.org>
16257
16258         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16259         and called with one of the core types, return the corresponding typebuilder for
16260         that type.
16261
16262         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16263         element type.
16264
16265 2002-06-21  Martin Baulig  <martin@gnome.org>
16266
16267         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16268         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16269         (Expression.ConvertReferenceExplicit): Likewise.
16270
16271         * expression.cs (ElementAccess.DoResolve): Likewise.
16272         (ElementAccess.DoResolveLValue): Likewise.
16273
16274 2002-06-10  Martin Baulig  <martin@gnome.org>
16275
16276         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16277         add the "value" parameter to the parameter list.
16278
16279         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16280         to our caller.
16281
16282 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16285         the argument to an int, uint, long or ulong, per the spec.  Also
16286         catch negative constants in array creation.
16287
16288 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16289
16290         * class.cs: do not allow the same interface to appear twice in
16291         the definition list.
16292
16293 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16294
16295         * ecore.cs: don't use ldlen with System.Array.
16296
16297 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16298
16299         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16300
16301 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16302
16303         * modifiers.cs: produce correct field attributes for protected
16304         internal. Easy fix so miguel can work on ther harder stuff:-)
16305
16306 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16307
16308         * pending.cs: New file.  Move the code from class.cs here.
16309         Support clearning the pending flag for all methods (when not doing
16310         explicit interface implementation).
16311
16312 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16313
16314         * rootcontext.cs: added a couple more types needed to bootstrap.
16315
16316 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16317
16318         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16319         constructor in the type, instead of any constructor in the type
16320         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16321         a bug in the Mono runtime when applying the params attribute). 
16322
16323 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16324         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16325
16326 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16327
16328         * expression.cs (Unary.ResolveOperator): Use TypeManager
16329         to resolve the type.
16330
16331 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16332
16333         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16334         attached.
16335
16336         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16337         with each member too.
16338
16339         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16340         field builders too - this takes care of the enum member case.
16341
16342 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16343
16344         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16345         address-of operator on both value types and pointers.
16346
16347 2002-06-10  Martin Baulig  <martin@gnome.org>
16348
16349         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16350         PropertyBuilder to the `property_builders' list.
16351
16352         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16353         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16354         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16355         find any indexers which are inherited from an interface.
16356
16357 2002-06-09  Martin Baulig  <martin@gnome.org>
16358
16359         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16360         the same type as the constant if necessary.  There's also a test-130.cs
16361         for this.
16362
16363         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16364
16365         * typemanager.cs (TypeManager.ChangeType): Previously known as
16366         Enum.ChangeEnumType().
16367
16368 2002-06-09  Martin Baulig  <martin@gnome.org>
16369
16370         * expression.cs (Cast.TryReduce): Added support for consts.
16371
16372 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16373
16374         * class.cs (Accessor): Hold attributes information so we can pass
16375         it along.
16376
16377         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16378         Modify to pass in attributes attached to the methods.
16379
16380         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16381
16382         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16383         to handle the Accessor kind :-)
16384
16385         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16386
16387 2002-06-08  Martin Baulig  <martin@gnome.org>
16388
16389         * expression.cs (Unary.TryReduceNegative): Added support for
16390         ULongConstants.
16391
16392 2002-06-08  Martin Baulig  <martin@gnome.org>
16393
16394         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16395         name can't be found in the `defined_names' - the caller will do a
16396         MemberLookup in this case and thus find methods in System.Enum
16397         such as Enum.IsDefined().
16398
16399 2002-06-08  Martin Baulig  <martin@gnome.org>
16400
16401         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16402         Convert.ChangeType() which works with TypeBuilder created types.
16403         (Enum.LookupEnumValue, Enum.Define): Use it here.
16404
16405         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16406         `TypeBuilder.BaseType != null' check.
16407         (TypeContainer.FindMembers): Only lookup parent members if we
16408         actually have a parent.
16409         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16410         (ConstructorInitializer.Resolve): Likewise.
16411
16412         * interface.cs (Interface.FindMembers): Added
16413         `TypeBuilder.BaseType != null' check.
16414
16415         * rootcontext.cs (RootContext.ResolveCore): Added
16416         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16417         classes_second_stage.
16418
16419         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16420         debug_type and trace_type when compiling with --nostdlib.       
16421
16422 2002-06-07  Martin Baulig  <martin@gnome.org>
16423
16424         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16425         (AddField): Set it to true when adding a non-static field.
16426         (DefineType): Use `have_nonstatic_fields' to find out whether we
16427         have non-static fields, not `Fields != null'.
16428
16429 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16430
16431         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16432         dereferencing a null on the static-field code path)
16433
16434 2002-05-30  Martin Baulig  <martin@gnome.org>
16435
16436         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16437         to take command line arguments.  Use reflection to call the new
16438         custom `Initialize' function on the symbol writer and pass it the
16439         command line arguments.
16440
16441         * driver.cs (--debug-args): New command line argument to pass command
16442         line arguments to the symbol writer.
16443
16444 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16447         the target type for indexers and properties.  Thanks to Joe for
16448         catching this.
16449
16450 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * typemanager.cs (MethodFlags): returns the method flags
16453         (Obsolete/ShouldIgnore) that control warning emission and whether
16454         the invocation should be made, or ignored. 
16455
16456         * expression.cs (Invocation.Emit): Remove previous hack, we should
16457         not do this on matching a base type, we should do this based on an attribute
16458
16459         Only emit calls to System.Diagnostics.Debug and
16460         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16461         on the command line.
16462
16463         * rootcontext.cs: Global settings for tracing and debugging.
16464
16465         * cs-tokenizer.cs (define): New utility function to track
16466         defines.   Set the global settings for TRACE and DEBUG if found.
16467
16468 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16469
16470         * interface.cs (Populate*): Pass in the TypeContainer as well as
16471         the DeclSpace as parameters so that we can create EmitContexts and
16472         then use that to apply attributes etc.
16473
16474         (PopulateMethod, PopulateEvent, PopulateProperty)
16475         (PopulateIndexer): Apply attributes everywhere.
16476
16477         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16478         etc.
16479
16480         (ApplyAttributes): Update accordingly.
16481
16482         We now apply interface attributes for all members too.
16483
16484 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16485
16486         * class.cs (Indexer.Define); Correctly check if we are explicit
16487         implementation (instead of checking the Name for a ".", we
16488         directly look up if the InterfaceType was specified).
16489
16490         Delay the creation of the PropertyBuilder.
16491
16492         Only create the PropertyBuilder if we are not an explicit
16493         interface implementation.   This means that explicit interface
16494         implementation members do not participate in regular function
16495         lookups, and hence fixes another major ambiguity problem in
16496         overload resolution (that was the visible effect).
16497
16498         (DefineMethod): Return whether we are doing an interface
16499         implementation. 
16500
16501         * typemanager.cs: Temporary hack until we get attributes in
16502         interfaces (Ravi is working on that) and we get IndexerName
16503         support in interfaces.
16504
16505         * interface.cs: Register the indexers as properties.
16506
16507         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16508         warning, I have verified that this is a bug in the .NET runtime
16509         (JavaScript suffers of the same problem).
16510
16511         * typemanager.cs (MemberLookup): When looking up members for
16512         interfaces, the parent of an interface is the implicit
16513         System.Object (so we succeed in searches of Object methods in an
16514         interface method invocation.  Example:  IEnumerable x;  x.ToString
16515         ()) 
16516
16517 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16518
16519         * class.cs (Event): Events should also register if they do
16520         implement the methods that an interface requires.
16521
16522         * typemanager.cs (MemberLookup); use the new GetInterfaces
16523         method. 
16524
16525         (GetInterfaces): The code used to lookup interfaces for a type is
16526         used in more than one place, factor it here. 
16527
16528         * driver.cs: Track the errors at the bottom of the file, we kept
16529         on going.
16530
16531         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16532         instance if the method we are calling is static!
16533
16534 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16535
16536         * attribute.cs (ApplyAttributes): Make this function filter out
16537         the IndexerName attribute (as that attribute in reality is never
16538         applied) and return the string constant for the IndexerName
16539         attribute. 
16540
16541         * class.cs (TypeContainer.Emit): Validate that all the indexers
16542         have the same IndexerName attribute, and if so, set the
16543         DefaultName attribute on the class. 
16544
16545         * typemanager.cs: The return value might contain other stuff (not
16546         only methods).  For instance, consider a method with an "Item"
16547         property and an Item method.
16548
16549         * class.cs: If there is a problem with the parameter types,
16550         return. 
16551
16552 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16553
16554         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16555         looks at user defined conversion after making a call to 
16556         StandardConversionExists - we need this for overload resolution.
16557
16558         * expression.cs : Update accordingly the various method calls.
16559
16560         This fixes 2 bugs filed against implicit user defined conversions 
16561
16562 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16563
16564         * statement.cs: Track the result of the assignment.
16565
16566 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * expression.cs (MemberAccess): Improved error reporting for
16569         inaccessible members.
16570
16571 2002-05-22  Martin Baulig  <martin@gnome.org>
16572
16573         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16574         itself with debugging support.
16575
16576 2002-05-22  Martin Baulig  <martin@gnome.org>
16577
16578         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16579         Removed, this isn't needed anymore.
16580
16581 2002-05-20  Martin Baulig  <martin@gnome.org>
16582
16583         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16584         be underlying type for an enum.
16585
16586 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16587
16588         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16589         that splits out the loading of just the core types.
16590
16591         * rootcontext.cs (ResolveCore): Split the struct resolution in
16592         two, so we can load the enumeration underlying types before any
16593         enums are used.
16594
16595         * expression.cs (Is): Bandaid until we fix properly Switch (see
16596         bug #24985 for details).
16597
16598         * typemanager.cs (ImplementsInterface): The hashtable will contain
16599         a null if there are no interfaces implemented.
16600
16601 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * cs-parser.jay (indexer_declarator): It is fine to have array
16604         parameters
16605
16606 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * typemanager.cs: (RegisterBuilder): New function used to register
16609         TypeBuilders that implement interfaces.  Since
16610         TypeBuilder.GetInterfaces (as usual) does not work with lame
16611         Reflection.Emit. 
16612         (AddUserType): register interfaces.
16613
16614         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16615         dealing with TypeBuilder.  Also, arrays are showing up as
16616         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16617         methods can not be invoked on them!
16618
16619         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16620         (ImplicitReferenceConversionExists): Split out from
16621         StandardConversionExists. 
16622
16623         * expression.cs (As): We were only implementing one of the three
16624         cases for the as operator.  We now implement them all.
16625         (Is): Implement the various other cases for Is as well.
16626
16627         * typemanager.cs (CACHE): New define used to control if we want or
16628         not the FindMembers cache.  Seems to have a negative impact on
16629         performance currently
16630
16631         (MemberLookup): Nested types have full acess to
16632         enclosing type members
16633
16634         Remove code that coped with instance/static returns for events, we
16635         now catch this in RealFindMembers.
16636
16637         (RealFindMembers): only perform static lookup if the instance
16638         lookup did not return a type or an event.  
16639
16640 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16641
16642         * assign.cs (CompoundAssign): We pass more semantic information
16643         now to Compound Assignments than we did before: now we have all
16644         the information at hand, and now we resolve the target *before* we
16645         do the expression expansion, which allows the "CacheValue" method
16646         to have the effect we intended (before, a [x] += 1 would generate
16647         two differen ArrayAccess expressions from the ElementAccess,
16648         during the resolution process).
16649
16650         (CompoundAssign.DoResolve): Resolve target and original_source here.
16651
16652 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * expression.cs (ArrayAccess): dropped debugging information. 
16655
16656         * typemanager.cs: Small bug fix: I was always returning i_members,
16657         instead of one of i_members or s_members (depending on which had
16658         the content).
16659
16660         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16661         method is invoked before any code generation takes place, and it
16662         is a mechanism to inform that the expression will be invoked more
16663         than once, and that the method should use temporary values to
16664         avoid having side effects
16665
16666         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16667
16668         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16669         implementation.
16670
16671         * expression.cs (Indirection, ArrayAccess): Add support for
16672         CacheTemporaries in these two bad boys. 
16673
16674         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16675         ldobj or ldind_ref.  
16676         (StoreFromPtr): Handle stobj as well.
16677
16678         * expression.cs (UnaryMutator): Share more code.
16679
16680         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16681         down: I was not tracking the Filter function as well, which
16682         was affecting the results of the cache.
16683
16684 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * attribute.cs: Remove the hack to handle the CharSet property on
16687         StructLayouts. 
16688
16689 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16690
16691         * attribute.cs (DoResolve): More uglyness, we now only try to
16692         resolve the attribute partially, to extract the CharSet
16693         information (only if we are a StructLayout attribute).  Otherwise 
16694
16695         (GetExtraTypeInfo): Add some code to conditionally kill in the
16696         future this.   I am more and more convinced that the .NET
16697         framework has special code to handle the attribute setting on
16698         certain elements.
16699
16700         * expression.cs (IsParamsMethodApplicable): Revert my previous
16701         foreach change here, it was wrong.
16702
16703 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16704
16705         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16706         (pp_expr): do not abort on unknown input, just return.
16707         (eval): abort if there are pending chars.
16708
16709         * attribute.cs (Attribute.Resolve): Positional parameters are
16710         optional.  Deal with that case.
16711
16712         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16713         the Ansi/Unicode/Auto information for the type.
16714
16715         (TypeContainer.DefineType): instantiate the EmitContext here, as
16716         we will be using it during the type definition (to resolve
16717         attributes) and during the emit phase.
16718
16719         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16720         to pull type information out of the attributes
16721
16722         (Attribute.Resolve): track the constructor builder, and allow for
16723         multiple invocations (structs and classes will use this).
16724
16725         * ecore.cs (MemberLookupFinal): new version with all the
16726         parameters customizable.
16727
16728         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16729         constructors.  Return if the result value is null (as the error
16730         would have been flagged already by MemberLookupFinal)
16731
16732         Do not allow instances of abstract classes or interfaces to be
16733         created.
16734
16735         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16736         We have to compare the assembly property here when dealing with
16737         FamANDAssem and Assembly access modifiers, because we might be
16738         creating an assembly from *modules* (that means that we are not
16739         getting TypeBuilders for types defined in other modules that are
16740         part of this assembly).
16741
16742         (Method.Emit): If the method is marked abstract and has a body,
16743         emit an error. 
16744
16745         (TypeContainer.DefineMembers): If both the defined member and the
16746         parent name match are methods, then do not emit any warnings: let
16747         the Method.Define routine take care of flagging warnings.  But if
16748         there is a mismatch (method overrides something else, or method is
16749         overriwritten by something, then emit warning).
16750
16751         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16752         set to null, this means `do not check for the return type on the
16753         signature'. 
16754
16755         (Method.Define): set the return type for the method signature to
16756         null, so that we get methods with the same name and parameters and
16757         different return types.  This is used to flag warning 114 (you are
16758         hiding a method, and you probably want to use the new/override
16759         keywords instead).
16760
16761         * typemanager.cs (MemberLookup): Implemented proper access
16762         control, closing a long standing set of bug reports.  The problem
16763         was that the Framework only has two bits: Public and NonPublic,
16764         and NonPublic includes private and protected methods, but we need
16765         to enforce the FamANDAssem, FamOrAssem and Family. 
16766
16767 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * statement.cs (GotoCase): Return true: Ammounts to giving up
16770         knowledge on whether we return or not, and letting the other case
16771         be responsible for it.
16772
16773 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16774
16775         * driver.cs: Do not load directories for each file processed, only
16776         do it if there is a pattern.
16777
16778         * ecore.cs: Report readonly assigns here as well, as we might have
16779         been resolved only by MemberAccess.
16780
16781         (SimpleName.SimpleNameResolve): Also be useful for LValue
16782         resolution.   We need this to propagate assign to local readonly variables
16783
16784         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16785         do not want to reuse potential criteria memory.
16786
16787         * class.cs (MyEventBuilder): Set reflected_type;
16788
16789         * ecore.cs (Constantify): Added support for constifying bools.
16790
16791         (RootContext.LookupType): Added a cache for values looked up in
16792         the declaration space.
16793
16794         * typemanager.cs (FindMembers): Now is a front-end to
16795         RealFindMembers, and provides a two-level hashtable-based cache to
16796         the request.  
16797
16798         15% performance improvement: from 22.5 to 19.2 seconds.
16799
16800         * expression.cs (IsParamsMethodApplicable): use foreach.
16801         (Invocation.DoResolve): ditto.
16802         (New.DoResolve): ditto.
16803         (ArrayCreation.DoResolve): ditto.
16804
16805         * ecore.cs (FindMostEncompassingType): use foreach.
16806
16807         * delegate.cs (NewDelegate.DoResolve): Use foreach
16808
16809         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16810         (RemoveMethods): use foreach.
16811
16812         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16813         nested foreach statements instead of for, and also break out of
16814         the inner loop once a match is found.
16815
16816         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16817
16818 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16819
16820         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16821         we actually unwrap the expression to allow for extra information
16822         to be extracted. 
16823
16824         * expression.cs: Use Shr_Un on unsigned operations. 
16825
16826 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16827
16828         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16829         applicable operators was not being considered correctly. This closes
16830         the bug Miguel reported.
16831
16832 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16833
16834         * attribute.cs: check that the type derives from System.Attribute
16835         and report the correct error in that case (moved the duplicate code to
16836         its own method, too).
16837
16838 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16839
16840         * attribute.cs: lookup attribute type name as the spec says: first the
16841         bare attribute name and then name + "Attribute" (nant compiles with
16842         mcs after this fix).
16843
16844 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16847         Because of the way we parse things, we should try to see if a
16848         UIntConstant can fit in an integer.
16849
16850 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16851
16852         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16853         when we are in an explicit context.
16854
16855         (ConvertReferenceExplicit): When converting from Iface type S to Class
16856         T make sure the rules are implemented as an OR.
16857
16858         * parameter.cs (ParameterType): Make it a property for now although the
16859         purpose really isn't anything immediate.
16860
16861         * expression.cs (Is*Applicable): Do better checking on the parameter type
16862         of a ref/out parameter. The ones from the system assemblies are already 
16863         marked with the correct type so we don't need to do any correction.
16864
16865         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16866         the object type is standard too so include that.
16867
16868 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16869
16870         * ecore.cs (StandardConversionExists): Augment with missing code:
16871         deal with IntConstant, LongConstants and Enumerations.
16872
16873         * assign.cs: Report the error, instead of failing silently
16874
16875         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16876         typecontainer that they are declared, because the
16877         typecontainer/namespace will have the list of using clauses that
16878         need to be applied.
16879
16880         Assembly Attributes were escaping the normal registration
16881         mechanism. 
16882
16883         (EmitCode): Apply attributes within an EmitContext that represents
16884         the container they were declared on.
16885
16886         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16887
16888 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16889
16890         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16891         Revamp completely - make much cleaner as we now operate only
16892         on a set of Types.
16893
16894         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16895         to implement the logic detailed in the spec more correctly.
16896
16897         (UserDefinedConversion): Update accordingly.
16898
16899 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * statement.cs: Return flow analysis information up.
16902
16903         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16904         and the default.
16905
16906         (token): Do not consume an extra character before calling
16907         decimal_digits.
16908
16909 2002-05-06  Piers Haken <piersh@friskit.com>
16910
16911         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16912
16913 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16914
16915         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16916         EmitContext during the instance constructor initializer
16917         resolution, to stop access to instance variables.
16918
16919         This is mandated by the spec, last paragraph of the `constructor
16920         initializers' section. 
16921
16922 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16923
16924         * cs-parser.jay, class.cs (Accessor): new class used to represent
16925         an accessor (get or set).  In the past we used `null' to represent
16926         a missing accessor.  But this is ambiguous because there was no
16927         way to tell in abstract indexers/properties if one of them was
16928         specified.
16929
16930         Now there is a way of addressing that.
16931
16932         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16933         instead of FindMembers.
16934
16935         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16936         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16937
16938         * attribute.cs: Treat indexers and properties as the same in terms
16939         of applying attributes
16940
16941         * ecore.cs (FindMostEncompassedType): Use statically initialized
16942         EmptyExpressions()s like we do elsewhere to avoid creating useless
16943         objects (and we take this out of the tight loop).
16944
16945         (GetConversionOperators): Move the code to extract the actual
16946         operators to a separate routine to clean things up.
16947
16948 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16949
16950         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16951         events are always registered FieldBuilders.
16952
16953         * class.cs (FieldBase): New class shared by Fields 
16954
16955         * delegate.cs: If we are a toplevel delegate, use our full name.
16956         If we are a nested delegate, then only use our tail name.
16957
16958 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16959
16960         * expression.cs (IsApplicable): Ensure that we add the "&" to
16961         ref/out types before comparing it with the type of the argument.
16962
16963         (IsParamsMethodApplicable): Ditto.
16964
16965         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16966         silly me ;-)
16967
16968         * delegate.cs : Handle the case when we have more than one applicable
16969         method. Flag an error only when we finish checking all.
16970
16971 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16972
16973         * expression.cs: Add support for boolean static initializers.
16974
16975 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16976
16977         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16978
16979         * parameter.cs (ComputeParameterTypes,
16980         ComputeAndDefineParameterTypes): Better error handling: now we
16981         clear the `types' cache if we fail during any of the type lookups.
16982         We also return the status code correctly to our caller
16983
16984         * delegate.cs: If we fail to define a delegate, abort the extra
16985         steps. 
16986
16987         * expression.cs (Binary.ResolveOperator): for
16988         operator==(object,object) and operator !=(object, object) we also
16989         have to verify that there is an implicit conversion from one to
16990         the other.
16991
16992         (ArrayAccess.DoResolve): Array Access can operate on
16993         non-variables. 
16994
16995 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16996
16997         * assign.cs (CompoundAssign): A new class used as a "flag" that
16998         the assignment actually is happening as part of a compound
16999         assignment operator.
17000
17001         During compound assignment, a few new rules exist to enable things
17002         like:
17003
17004         byte b |= 1 + 2
17005
17006         From the spec:
17007
17008         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17009         to the type of x) if y is implicitly convertible to the type of x,
17010         and the operator is a builtin operator and the return type of the
17011         operator is explicitly convertible to the type of x. 
17012
17013         * rootcontext.cs: Reset warning level to 2.  4 catches various
17014         "interesting" features in mcs, we must clean this up at some
17015         point, but currently am trying to kill other bugs ;-)
17016
17017         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17018         in container classes as well.  
17019
17020         * expression.cs (Binary.ResolveOperator): Handle string case
17021         before anything else (as operator overloading does emit an error
17022         before doing anything else).
17023
17024         This code could go away when we move to a table driven model, but
17025         i could not come up with a good plan last night.
17026
17027 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17028
17029         * typemanager.cs (CSharpName): reimplementation using regex.
17030         * class.cs: added null check for fields in Emit
17031         * rootcontext.cs: set warninglevel to 4
17032
17033 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17034
17035         * typemanager.cs (CSharpName): reimplemented with Lupus
17036         suggestion.
17037
17038 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * statement.cs (If): correclty implement Resolve, because we were
17041         not catching sem errors in there.  The same process is needed
17042         everywhere else. 
17043         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17044
17045
17046         (Statement.Warning_DeadCodeFound): Factorize code.
17047         (While): Report dead code here too.
17048
17049         (Statement): Added Resolve virtual method to allow
17050         for resolution split from the emit code.
17051
17052 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17053
17054         * statement.cs (EmitBoolExpression): No longer try to resolve the
17055         expression here.    
17056         (MakeBoolean): New utility function that resolve, implicitly
17057         converts to boolean and tags the expression. 
17058
17059
17060         (If, Do): Implement dead code elimination.
17061         (While): Implement loop inversion
17062
17063         (Do, While, For, If): Resolve the expression prior to calling our
17064         code generation.
17065
17066 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17067
17068         * class.cs:
17069           - added method Report28 (warning: program has more than one entry point)
17070           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17071           - modified method Method.Define, the part at the end of the method
17072
17073         * rootcontext.cs: added static public Location EntryPointLocation;
17074           
17075         * ../errors/cs0028.cs : Add test case for the above warning.              
17076
17077         * typemanager.cs:
17078           - modified method CSharpName to allow arrays of primitive type to
17079             be printed nicely (e.g. instead of System.Int32[][] it now prints
17080             int[][])
17081           - added method CSharpSignature: returns the signature of a method
17082             in string format to be used in reporting errors, warnings, etc.
17083
17084         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17085         with String.Empty.
17086
17087 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17088
17089         * delegate.cs (Define): Fix extremely silly bug where I was
17090         setting the type of the 'object' parameter of the BeginInvoke
17091         method to System.IAsyncResult instead of System.Object ;-)
17092
17093 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17096         here. 
17097
17098         (Constructor.Emit): return if we fail to initialize the
17099         constructor.  Another door closed!  
17100
17101         * expression.cs (New.DoResolve): Improve error message (from -6 to
17102         1501).  Use DeclaredOnly lookup to find the exact constructor.
17103
17104         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17105         loop.  This is useful.
17106
17107         * cs-parser.jay: Adjust the default parameters so that destructors
17108         have the proper signature.
17109
17110 2002-04-26  Martin Baulig  <martin@gnome.org>
17111
17112         * driver.cs (LoadAssembly): If `assembly' contains any characters
17113         which are only valid in path names and not in assembly names
17114         (currently slash, backslash and point), use Assembly.LoadFrom ()
17115         instead of Assembly.Load () on the `assembly' (before iteration
17116         over the link_paths).
17117
17118 2002-04-26  Martin Baulig  <martin@gnome.org>
17119
17120         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17121
17122 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17123
17124         * class.cs (Property): use the new typemanager.MemberLookup
17125
17126         (TypeContainer.MemberLookup): Implement using the
17127         TypeManager.MemberLookup now. 
17128
17129         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17130         and return MemberInfos, so that these can be used without an
17131         EmitContext (what we had before).
17132
17133 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * expression.cs: Fix the case where the argument to params if the
17136         type of the params.  I omitted handling this before.   Fixed
17137
17138 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17139
17140         * driver.cs: Call BootCorlib_PopulateCoreType
17141
17142         * class.cs (Property.CheckBase): Check for properties only, not
17143         for all members. 
17144
17145         * interface.cs: Temporary hack: try/catch around the
17146         CustomAttributeBuilder, because I am getting an exception that I
17147         do not understand.
17148
17149         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17150         types whose definitions are required to be there (attributes are
17151         defined before standard types).
17152
17153         Compute definitions as we boot the various types, as they are used
17154         immediately (value_type class will need object_type, but if we do
17155         not initialize object_type, we will pass a null, which will let
17156         the runtime pick the System.Object from the existing corlib, which
17157         is not what we want).
17158
17159 2002-04-22  Patrik Torstensson <totte@labs2.com>
17160
17161         * cs-tokenizer.cs: fixed a number of trim() issues.
17162
17163 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17164
17165         * expression.cs (Argument.Type): Ensure that we return the correct
17166         type when we have out or ref parameters [in which case we 
17167         append a "&"].
17168
17169 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17170
17171         * class.cs (Property, Indexer): Allow extern modifier in there. 
17172
17173         * typemanager.cs (InitBaseTypes): Initializes object_type and
17174         value_type, since those will be used early on during the bootstrap
17175         process to compile corlib.
17176
17177         (InitCoreTypes): Move code from here to InitBaseTypes.
17178
17179 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17180
17181         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17182         single-dimension arrays as using the ldlen opcode.  
17183
17184         Daniel Lewis discovered this optimization.  
17185
17186         * typemanager.cs: Add signature for System.Array::get_Length
17187
17188 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17189
17190         * statement.cs: report the error when the foreach does not apply to an
17191         array nor a collection.
17192
17193 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17194
17195         * expression.cs: Add implicit conversions to the operator ~.
17196
17197         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17198
17199         * typemanager.cs: Locate the decimal constructor.
17200
17201 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17202
17203         * attribute.cs: use the new property of TypeOf.
17204         * expression.cs: added 'get' property around typearg.
17205
17206         These changes fix a build breaker reported by NickD. Is this the
17207         correct way to fix?  If not, please, revert my changes and make it
17208         work :-).
17209
17210 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17211
17212         * attribute.cs: Add support for typeof in attribute invocations.
17213         I am not sure that this is right though.
17214
17215 2002-04-14  Duncan Mak  <duncan@ximian.com>
17216
17217         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17218         Binary.Operator.Division case.
17219
17220 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17221
17222         * class.cs (DefineType): Ensure that we do a proper check on
17223         attribute types and also register it with the TypeManager.
17224
17225         (TypeContainer.Targets): The default for attribute types is
17226         AttributeTargets.All.
17227
17228         * attribute.cs (ApplyAttributes): Registering the attribute type
17229         is done elsewhere, not when we discover we have a Usage attribute.
17230
17231 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17232
17233         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17234         and get rid of is_delegate parameter.
17235
17236         * everywhere : update.
17237
17238 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17239
17240         * cs-parser.jay (compilation_unit): Revamp completely to use
17241         some new ideas that I got from Rhys' grammar to solve the problems
17242         with assembly level attributes.
17243
17244         (outer_declaration): New grammar production.
17245
17246         (attribute_sections): Add.
17247
17248         (opt_attributes): Base on attribute_sections
17249
17250         (namespace_declaration): Allow opt_attributes to tackle the case
17251         when we have assembly level attributes - we are clever in this
17252         regard now ;-)
17253
17254         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17255         attributes in the non-global context.
17256
17257         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17258         instead of SetGlobalAttributes.
17259
17260         * class.cs, rootcontext.cs : Ensure we define and generate 
17261         attribute types before anything else.
17262
17263         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17264         and flag the new error -20 for the case when the attribute type
17265         does not have valid targets specified. csc does not catch this.
17266
17267         * ../errors/errors.txt : update for error # -20
17268
17269 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17270
17271         * support.cs (InternalParameters.ParameterModifier): Do some null
17272         checking and return sane values.
17273
17274         * class.cs (Method.Define): If we are a PInvoke method, ensure
17275         that we are static and extern. Report error # 601
17276
17277         * ../errors/cs0601.cs : Add test case for the above error.
17278
17279 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17280
17281         * rootcontext.cs (attribute_types): We need to keep type of
17282         all attribute types separately and emit code for them first.
17283
17284         (RegisterAttribute) : Implement.
17285
17286         * class.cs (DefineType): Check if the current Type is a custom
17287         attribute type and register it accordingly.
17288
17289         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17290         adding the first attribute twice and rename to
17291
17292         (SetGlobalAttributes): this.
17293
17294         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17295         lookups.
17296
17297         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17298         if we are processing global arguments. Hmm, I am unsure of this.
17299
17300 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17301
17302         * expression.cs: added static array of strings to avoid calling
17303         Enum.ToString () for Operator in Binary. Significant recover of
17304         performance.
17305
17306 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * class.cs (FindMembers): Allow the Builders of the various
17309         members to be null.  If they are skip them.  This only happens
17310         during the PInvoke declaration.
17311
17312 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17313
17314         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17315         failure, so we do not keep going afterwards.
17316
17317         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17318         wanted to pass `false' as the `is_delegate' argument.  If this is
17319         the case, why not use delegate_type == null to mean `is_delegate =
17320         false' and anything else as is_delegate = true.
17321
17322 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17323
17324         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17325         code for the section, not the beginning of the tests.
17326
17327 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17330
17331         * expression.cs (Binary): same.  Warn about errors where we have
17332         Enum/Enum in operator + as well.
17333
17334 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17335
17336         * statement.cs:
17337                 - added support for switch(bool)
17338                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17339                 - add TableSwitchEmit() to handle table-based switch statements
17340
17341 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17342
17343         * expression.cs (Invocation.OverloadResolve): Factor out code which
17344         does parameter compatibility checking with arguments so that we can 
17345         re-use the code even from Delegate.VerifyApplicability
17346
17347         (VerifyArgumentsCompat): Move above code here.
17348
17349         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17350         and instead make a call to the above method.
17351
17352 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17353
17354         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17355         We use it to keep track of classes which are attribute types.
17356
17357 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17358
17359         * delegate.cs (Delegate.Define): Correctly define the types in the
17360         presence of fixed and array parameters.
17361
17362         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17363         doing FindMembers.
17364
17365         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17366         include NonPublic after the first iteration.
17367
17368         * class.cs (Indexer.CheckBase): Only check if both parents are
17369         non-null. 
17370
17371         * cs-parser.jay (accessor_body): If empty, set to null.
17372
17373         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17374         same code path here to resolve constants names that we did have in
17375         MemberAccess.DoResolve.  There is too much code duplicated here.
17376
17377 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17380
17381         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17382         to MakeUnionSet.
17383
17384         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17385         tokens, numbers and strings.
17386
17387         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17388         parenthesis.
17389
17390         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17391         asyncronous parameters and the regular parameters.  
17392
17393         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17394         specify the target directory.
17395
17396         * expression.cs: (This.DoResolve): Simplify
17397         (As.Emit): Optimize, do not generate IsInst if the expression is
17398         always of the given type.
17399
17400         (Is.DoResolve): Bug fix, we were reporting both always/never for
17401         the is expression.
17402
17403         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17404         creating too many unnecessary arrays.
17405
17406 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17407
17408         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17409         fields instead of rolling our own initializer.   Takes care of all
17410         implicit conversions, and drops unnecessary static checks/argument.
17411
17412 2002-03-31  Dick Porter  <dick@ximian.com>
17413
17414         * driver.cs: use the GetDirectories() return values properly, and
17415         use "/" as path separator.
17416
17417 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17418
17419         * expression.cs (Unary): Optimize - - expr into expr.
17420         (Binary): Optimize a + (-b) into a -b.
17421
17422         * codegen.cs (CodeGen): Made all methods static.
17423
17424 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * rootcontext.cs: 
17427
17428         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17429         TypeBuilder property.
17430
17431         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17432         instead. 
17433
17434         * tree.cs: Removed the various RecordXXXX, and replaced with a
17435         single RecordDecl.  Removed all the accessor methods, and just
17436         left a single access point Type 
17437
17438         * enum.cs: Rename DefineEnum to DefineType.
17439
17440         * decl.cs: New abstract method `DefineType' used to unify the
17441         Defines for Enumerations, Interfaces, TypeContainers and
17442         Delegates.
17443
17444         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17445         LookupBaseClasses method that used to live in class.cs and
17446         interface.cs here, and renamed to FindType.
17447
17448         * delegate.cs: Implement DefineType.  Take advantage of the
17449         refactored pattern for locating the parent builder without taking
17450         the parent_builder argument (which we know does not work if we are
17451         nested, and triggering a toplevel definition).
17452
17453 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17454
17455         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17456         accessibility of a member has changed during override and report
17457         an error if so.
17458
17459         * class.cs (Method.Define, Property.Define): Only complain on
17460         overrides if the method is private, any other accessibility is
17461         fine (and since we just checked the permission is the same, we are
17462         good to go).
17463
17464         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17465         and elif are processed always.  The other pre-processing
17466         directives are only processed if we are "taking" the path
17467
17468 2002-03-29  Martin Baulig  <martin@gnome.org>
17469
17470         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17471         current location is not Null.
17472
17473         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17474         a separate method so we can profile it.
17475
17476         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17477         `span.Seconds' are just seconds, but no minutes or hours.
17478         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17479
17480 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17481
17482         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17483         Remove the gratuitous set of Final:
17484
17485                                 // If an interface implementation, then we can set Final.
17486                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17487                                     implementing.DeclaringType.IsInterface)
17488                                         flags |= MethodAttributes.Final;
17489
17490         I do not know what I was smoking when I used that.
17491
17492
17493         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17494         step into fixing the name resolution issues for delegates and
17495         unifying the toplevel name resolution.
17496
17497 2002-03-28  Martin Baulig  <martin@gnome.org>
17498
17499         * class.cs (Method.Emit): If we have a symbol writer, call its
17500         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17501         tell it about the current method.
17502
17503         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17504         writer that we're going to emit the first byte of IL code for a new
17505         statement (a new source line).
17506         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17507         EmitContext.Mark() before emitting any code.
17508
17509         * location.cs (SymbolDocument): Return null when we're Null.
17510
17511         * statement.cs (Statement): Moved the `Location loc' variable here.
17512         (Statement.EmitBoolExpression): If we have a symbol writer, call
17513         ec.Mark() before emitting any code to tell it that we're at the
17514         beginning of a new statement.
17515         (StatementExpression): Added `Location' argument to the constructor.
17516         (Block): Added public readonly variable `StartLocation' and public
17517         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17518         (Block): Added constructor which takes a start and end location.
17519         (Block.SetEndLocation): New method. This sets the end location.
17520         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17521         local variables we create.
17522         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17523         each statement and do also mark the begin and end of the block.
17524
17525         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17526         tell it the current lexer.Location, use Location.Null for the end of the
17527         block.
17528         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17529         current block, set its end location using SetEndLocation().
17530         (statement_expression): StatementExpression constructor now takes the
17531         lexer.Location as additional argument.
17532         (for_statement, declare_local_variables): Likewise.
17533         (declare_local_variables): When creating a new implicit block, use the
17534         new Block constructor and pass it the lexer.Location.
17535
17536 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17539         members also on the parent interfaces recursively.
17540
17541 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * report.cs: Use new formats, since Gonzalo finished the missing
17544         bits. 
17545
17546         * expression.cs (Binary.ResolveOperator): added missing operator|
17547         operator& and operator^ for bool/bool.
17548
17549         * cs-parser.jay: CheckDef now takes a Location argument that is
17550         used to report errors more precisly (instead of reporting the end
17551         of a definition, we try to track something which is a lot closer
17552         to the source of the problem).
17553
17554         * cs-tokenizer.cs: Track global token use, so we can properly flag
17555         the use of #define/#undef after the first token has been seen.
17556
17557         Also, rename the reportXXXX to Error_DescriptiveName
17558
17559         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17560         TypeContainer, so that Enum and Interface can use this too.
17561
17562         * class.cs (TypeContainer.LookupInterfaceOrClass,
17563         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17564         `builder' argument.  Typically this was used to pass the parent
17565         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17566         the definition).  
17567
17568         The problem is that a nested class could trigger the definition of
17569         a toplevel class, and the builder would be obviously wrong in that
17570         case. 
17571
17572         So we drop this argument, and we compute dynamically the
17573         TypeBuilder/ModuleBuilder (the correct information was available
17574         to us anyways from DeclSpace.Parent)
17575
17576         * interface.cs (Interface.DefineInterface): Drop builder
17577         parameter cleanup like class.cs
17578
17579         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17580         like class.cs
17581
17582         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17583         values. 
17584
17585         (Try.Emit): Propagate the returns value from the statement.
17586
17587         (Return.Emit): Even if we are leavning 
17588
17589         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17590
17591         * modifiers.cs: Fix the computation of MethodAttributes flags.
17592
17593 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17594
17595         * driver.cs: allow compilation of files that start with '/'.
17596         Add a default case when checking the argument of --target.
17597
17598 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17599
17600         * interface.cs: Implement the same search algorithm for types in
17601         the interface code.
17602
17603         * delegate.cs: Do not allow multiple definition.
17604
17605         * Recovered ChangeLog that got accidentally amputated
17606
17607         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17608
17609         * rootcontext.cs: Load manually enum to allow core classes to
17610         contain enumerations.
17611
17612         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17613         Update to new static methods in TypeManager.
17614
17615         * typemanager.cs (GetMethod, GetConstructor): Use our
17616         implementation of FindMembers to find the members, since during
17617         corlib compilation, the types are TypeBuilders and GetMethod and
17618         GetConstructor do not work.
17619
17620         Make all methods in TypeManager static.
17621
17622         (InitCodeHelpers): Split the functionality from
17623         the InitCodeTypes function.
17624
17625         * driver.cs: Call InitCodeHelpers after we have populated the
17626         types. 
17627
17628         * cs-parser.jay (delegate_declaration): we did not used to compute
17629         the delegate name correctly for void delegates.
17630
17631 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * rootcontext.cs (RootContext): Init the interface_resolve_order
17634         and type_container_resolve_order always.
17635
17636         (ResolveCore, BootstrapCorlib_ResolveClass,
17637         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17638         compiler when compiling with --nostdlib
17639
17640         * class.cs (TypeContainer.DefineType): Check that our parent is
17641         not null.  This test is most important when we are bootstraping
17642         the core types.
17643
17644         * codegen.cs: Split out the symbol writing code.
17645
17646 2002-03-25  Martin Baulig  <martin@gnome.org>
17647
17648         * driver.cs (-g): Made -g an alias for --debug.
17649
17650 2002-03-24  Martin Baulig  <martin@gnome.org>
17651
17652         * codegen.cs (SymbolWriter): New public variable. Returns the
17653         current symbol writer.
17654         (CodeGen): Added `bool want_debugging_support' argument to the
17655          constructor. If true, tell the ModuleBuild that we want debugging
17656         support and ask it for the ISymbolWriter.
17657         (Save): If we have a symbol writer, call it's Close() method after
17658         saving the assembly.
17659
17660         * driver.c (--debug): New command line argument to create a
17661         debugger information file.
17662
17663         * location.cs (SymbolDocument): New public property. Returns an
17664         ISymbolDocumentWriter object for the current source file or null
17665         if we don't have a symbol writer.
17666
17667 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * driver.cs (LoadAssembly): Correctly return when all the paths
17670         have been tried and not before.
17671
17672         * statement.cs (Switch.Emit): return the actual coverage for this
17673         statement (returns/not-returns)
17674
17675         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17676         switch of the statement if we are the last switch section.  That
17677         kills two problems: try/catch problems (we used to emit an empty
17678         nop at the end) and switch statements where all branches would
17679         return. 
17680
17681 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * driver.cs: Add default assemblies (the equivalent to the
17684         Microsoft CSC.RSP file)
17685
17686         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17687         also update tokens_seen and set it to false.
17688
17689         * driver.cs: Implement --recurse for Mike.
17690
17691         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17692         correctly splitting out the paths.
17693
17694 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * interface.cs (Interface.PopulateProperty): Instead of using
17697         `parent' as the declaration space for the set parameters, use
17698         `this' 
17699
17700         * support.cs (InternalParameters): InternalParameters constructor
17701         takes a DeclSpace instead of a TypeContainer.
17702
17703         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17704         types are being initialized, load the address of it before calling
17705         the function.  
17706
17707         (New): Provide a mechanism to disable the generation of local
17708         value type temporaries when the caller will be providing us with
17709         an address to store it.
17710
17711         (ArrayCreation.EmitDynamicInitializers): Use it.
17712
17713 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17714
17715         * expression.cs (Invocation.EmitArguments): Only probe for array
17716         property if there is more than one argument.  Sorry about that.
17717
17718         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17719         empty param arrays.
17720
17721         * class.cs (Method.LabelParameters): Fix incorrect code path that
17722         prevented the `ParamArrayAttribute' from being applied to the
17723         params attribute.
17724
17725 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17726
17727         * support.cs (ReflectionParameters): Correctly compute whether the
17728         last argument is a params array.  Fixes the problem with
17729         string.Split ('a')
17730
17731         * typemanager.cs: Make the assemblies array always be non-null
17732         (empty, but non-null)
17733
17734         * tree.cs (RecordDecl): New function that abstracts the recording
17735         of names.  This reports error 101, and provides a pointer to the
17736         previous declaration.  Fixes a crash in the compiler.
17737
17738         * cs-parser.jay (constructor_declaration): Update to new grammar,
17739         and provide a constructor_body that can be empty.
17740
17741 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17742
17743         * driver.cs: Add support for --resources.
17744
17745         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17746         Make all types for the various array helper methods be integer.
17747
17748         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17749         CheckState to ConvCast.
17750
17751         (ConvCast): Now it takes a `checked' state argument, to avoid
17752         depending on the emit context for the conversion, and just using
17753         the resolve time setting.
17754
17755         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17756         instead of Invocation.EmitArguments.  We do not emit the original
17757         arguments, instead we emit those which have been converted to
17758         unsigned int expressions.
17759
17760         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17761
17762         * codegen.cs: ditto.
17763
17764         * expression.cs (LocalVariableReference): Drop the use of the
17765         Store function that depended on the variable index.
17766
17767         * statement.cs (VariableInfo): Drop the `Idx' property from this
17768         class, as this is not taking into account the indexes for
17769         temporaries tat we generate during the execution, getting the
17770         indexes wrong.
17771
17772         * class.cs: First emit class initializers, then call the parent
17773         constructor. 
17774
17775         * expression.cs (Binary): Fix opcode emision.
17776         (UnaryMutator.EmitCode): Support checked code generation
17777
17778         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17779         matches for events for both the Static and Instance scans,
17780         pointing to the same element.   Fix that.
17781
17782 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17783
17784         * rootcontext.cs (ResolveTree): Always set the
17785         interface_resolve_order, because nested interfaces will be calling
17786         into us.
17787
17788         * class.cs (GetInterfaceOrClass): Track the same resolution
17789         process used by TypeManager.LookupType.  This fixes the nested
17790         type lookups in class declarations (separate path from
17791         LookupType). 
17792
17793         (TypeContainer.DefineType): Also define nested interfaces.
17794         (TypeContainer.RegisterOrder): New public function used to
17795         register the order in which child interfaces need to be closed.
17796
17797         Nested interfaces need to be closed after their parents have been
17798         created. 
17799
17800         * interface.cs (InterfaceAttr): Put all the logic for computing
17801         the interface attribute here. 
17802
17803         (DefineInterface): Register our interface order with the
17804         RootContext or with the TypeContainer depending on the case.
17805
17806 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * cs-parser.jay: rework foreach statement to work with the new
17809         changes to the policy on SimpleNames.
17810
17811         * report.cs: support Stacktrace on warnings as well.
17812
17813         * makefile: drop --unsafe and /unsafe from the compile.
17814
17815 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17816
17817         * ecore.cs (StandardConversionExists): Modify to take an Expression
17818         as the first parameter. Ensure we do null -> reference type conversion
17819         checking.
17820
17821         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17822         temporary Expression objects.
17823
17824 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17825
17826         * interface.cs: workaround bug in method overloading resolution
17827         (there is already a bugzilla bug for it).
17828
17829 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17830
17831         We could also solve this problem by having a separate path for
17832         performing type lookups, instead of DoResolve, we could have a
17833         ResolveType entry point, and only participating pieces of the
17834         production (simplename, deref, array) would implement this. 
17835
17836         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17837         signal SimpleName to only resolve type names and not attempt to
17838         resolve anything else.
17839
17840         * expression.cs (Cast): Set the flag.
17841
17842         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17843
17844         * class.cs: Only report 108 if there is no `new' modifier.
17845
17846         * cs-parser.jay: rework foreach statement to work with the new
17847         changes to the policy on SimpleNames.
17848         
17849         * report.cs: support Stacktrace on warnings as well.
17850
17851         * makefile: drop --unsafe and /unsafe from the compile.
17852
17853 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17854
17855         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17856         lookups here, instead of doing that at parse time.  This means
17857         that our grammar will not introduce `LocalVariableReferences' as
17858         expressions at this point.  That solves the problem of code like
17859         this:
17860
17861         class X {
17862            static void Main ()
17863            { int X = 1;
17864             { X x = null }}}
17865
17866         This is only half the fix.  The full fix requires parameters to
17867         also be handled in this way.
17868
17869         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17870         makes the use more obvious of the DeclSpace.  The
17871         ec.TypeContainer.TypeBuilder is now only used to pull the
17872         TypeBuilder for it.
17873
17874         My theory is that I can get rid of the TypeBuilder completely from
17875         the EmitContext, and have typecasts where it is used (from
17876         DeclSpace to where it matters).  
17877
17878         The only pending problem is that the code that implements Aliases
17879         is on TypeContainer, and probably should go in DeclSpace.
17880
17881         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17882         lookups here, instead of doing that at parse time.  This means
17883         that our grammar will not introduce `LocalVariableReferences' as
17884         expressions at this point.  That solves the problem of code like
17885         this:
17886
17887         class X {
17888            static void Main ()
17889            { int X = 1;
17890             { X x = null }}}
17891
17892         This is only half the fix.  The full fix requires parameters to
17893         also be handled in this way.
17894
17895         * class.cs (Property.DefineMethod): When implementing an interface
17896         method, set newslot, when implementing an abstract method, do not
17897         set the flag (before we tried never setting it, or always setting
17898         it, which is the difference).
17899         (Indexer.DefineMethod): same.
17900         (Method.DefineMethod): same.
17901
17902         * ecore.cs: Only set the status used flag if we get back a Field.
17903
17904         * attribute.cs: Temporary hack, so Paolo can keep working.
17905
17906 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17907
17908         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17909         the unmanaged type in the case we have a MarshalAs attribute.
17910
17911         (Resolve): Handle the case when we are parsing the special MarshalAs
17912         attribute [we need to store the unmanaged type to use later]
17913
17914         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17915         MarshalAs Attribute.
17916
17917         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17918         on parameters and accordingly set the marshalling info.
17919
17920 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * class.cs: Optimizing slightly by removing redundant code after
17923         we switched to the `NoTypes' return value.
17924         (Property.DefineMethod): use NoTypes here too.
17925
17926         This fixes the bug I introduced in my last batch of changes.
17927
17928 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17929
17930         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17931
17932         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17933         Enums since those are types too. 
17934
17935         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17936
17937         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17938         thanks to a call during the lookup process.
17939
17940 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17941
17942         * statement.cs (Foreach): Lots of work to accomodate a particular
17943         kind of foreach statement that I had not kept in mind.  It is
17944         possible to have foreachs on classes that provide a GetEnumerator
17945         method that return objects that implement the "pattern" for using
17946         a foreach, there is no need to support GetEnumerator
17947         specifically. 
17948
17949         This is needed to compile nant.
17950
17951         * decl.cs: Only report 114 if the member is not `Finalize' and if
17952         the warning level is at least 2.
17953
17954         * class.cs: Moved the compare function from Method to
17955         MethodSignature. 
17956
17957         (MethodSignature.InheritableMemberSignatureCompare): Add new
17958         filter function that is used to extract inheritable methods from a
17959         class. 
17960
17961         (Method.Define): Use the new `inheritable_method_signature_filter'
17962         delegate
17963
17964         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17965         command. 
17966
17967 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17970
17971         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17972
17973         * expression.cs: Pass location information to
17974         ConvertImplicitStandard. 
17975
17976         * class.cs: Added debugging code to track return values from
17977         interfaces. 
17978
17979 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * expression.cs (Is.DoResolve): If either side of the `is' is an
17982         interface, do not flag the warning.
17983
17984         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17985         for interfaces
17986
17987         * report.cs: Allow for --fatal to be used with --probe.
17988
17989         * typemanager.cs (NoTypes): Move the definition for the empty Type
17990         array here. 
17991
17992         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17993         properties. 
17994         (TypeContainer.DefineProxy): New function used to proxy to parent
17995         implementations when implementing interfaces.
17996         (TypeContainer.ParentImplements): used to lookup if our parent
17997         implements a public function that is required by an interface.
17998         (TypeContainer.VerifyPendingMethods): Hook this up.
17999
18000         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18001         `modules' and `assemblies' arraylists into arrays.  We only grow
18002         these are the very early start up of the program, so this improves
18003         the speedof LookupType (nicely measured).
18004
18005         * expression.cs (MakeByteBlob): Replaced unsafe code with
18006         BitConverter, as suggested by Paolo.
18007
18008         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18009         folding of string concatenation, but if either side is a string,
18010         and the other is not, then return null, and let the runtime use
18011         the concatenation on the string plus the object (using
18012         `Object.ToString'). 
18013
18014 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18015
18016         Constant Folding has been implemented now.
18017
18018         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18019         the error instead on types that are not supported in one's
18020         complement. 
18021
18022         * constant.cs (Constant and all children): New set of functions to
18023         perform implict and explicit conversions.
18024
18025         * ecore.cs (EnumConstant): Implement the new functions to perform
18026         conversion by proxying to the child expression.
18027
18028         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18029         own separate setting that can not be turned off from the command
18030         line using --unchecked or --checked and is only controlled using
18031         the checked/unchecked statements and expressions.  This setting is
18032         used by the constant folder to flag errors.
18033
18034         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18035         ConstantCheckState as well.   
18036
18037         During Resolve, they also have to flag the state, because the
18038         constant folder runs completely in the Resolve phase.
18039
18040         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18041         well.
18042
18043 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * cfold.cs: New file, this file contains the constant folder.
18046
18047         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18048         argument to track whether we are using the resulting address to
18049         load or store a value and provide better error messages. 
18050
18051         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18052         new AddressOf arguments.
18053
18054         * statement.cs (Foreach.EmitCollectionForeach): Update
18055
18056         * expression.cs (Argument.Emit): Call AddressOf with proper
18057         arguments to track usage.
18058
18059         (New.DoEmit): Call AddressOf with new arguments.
18060
18061         (Unary.Emit): Adjust AddressOf call.
18062
18063 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18064
18065         * cs-parser.jay (member_access): Change the case for pre-defined types
18066         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18067         this suggestion.
18068
18069         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18070         a method body.
18071
18072         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18073         essentially like methods and apply attributes like MethodImplOptions to them too.
18074
18075         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18076         not being null.
18077
18078         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18079         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18080         is the DeclSpace.
18081
18082         * Update code everywhere accordingly.
18083
18084         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18085
18086         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18087
18088 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18089
18090         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18091         try performing lookups against those instead of jumping straight into using
18092         the 'using' clauses.
18093
18094         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18095
18096         (LookupType): Perform lookups in implicit parents too.
18097
18098         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18099         sequence as RootContext.LookupType. 
18100
18101         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18102         the various cases of namespace lookups into this method.
18103
18104 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18105
18106         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18107         in positional arguments)
18108
18109         * class.cs (Operator): Update the AllowedModifiers to contain
18110         extern. 
18111
18112         * cs-parser.jay: Update operator declaration to allow for the
18113         operator body to be empty.
18114
18115         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18116         values. 
18117
18118 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * class.cs (Method.Emit): Label parameters.
18121
18122         * driver.cs: Return 1 or 0 as the program exit code.
18123
18124 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18125
18126         * expression.cs: Special case the `null' object when trying to
18127         auto-compute the type, as anything can be explicitly converted to
18128         that. 
18129
18130         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18131         spotting this Paolo.
18132
18133         (Expression.ImplicitNumericConversion): Perform comparissions of
18134         the type using the underlying type in the case of an enumeration
18135         rather than using the enumeration type for the compare.
18136
18137         Cope with the underlying == type case, which is not possible to
18138         catch before. 
18139
18140         (Expression.ConvertNumericExplicit): Perform comparissions of
18141         the type using the underlying type in the case of an enumeration
18142         rather than using the enumeration type for the compare.
18143
18144         * driver.cs: If the user does not supply an extension, assume .exe
18145
18146         * cs-parser.jay (if_statement): Rewrote so that we can track the
18147         location for the if statement.
18148
18149         * expression.cs (Binary.ConstantFold): Only concat strings when
18150         the operation is "+", not everything ;-)
18151
18152         * statement.cs (Statement.EmitBoolExpression): Take a location
18153         argument. 
18154         (If, While, Do): Track location.
18155
18156         * expression.cs (Binary.ResolveOperator): In the object + string
18157         case, I was missing a call to ConvertImplicit
18158
18159 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18160
18161         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18162         Location arguments. Ensure we use RootContext.LookupType to do our work
18163         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18164
18165         * interface.cs (PopulateMethod): Handle the type of the parameter being
18166         null gracefully.
18167
18168         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18169         have a params method with no fixed arguments and a call is made with no
18170         arguments.
18171
18172 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18173
18174         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18175         the verbatim-string-literal
18176
18177         * support.cs (InternalParameters.ParameterModifier): handle null
18178         fixed parameters.
18179         (InternalParameters.ParameterType): ditto.
18180
18181         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18182         duplicating the name of the variable parameter.
18183         (GetParameterByName): Fix bug where we were not looking up array
18184         paramters if they were the only present (thanks Paolo!).
18185         (GetParameterInfo): We only have an empty set of types if both
18186         fixed and array are set to null.
18187         (GetParameterInfo-idx): Handle FixedParameter == null
18188
18189         * cs-parser.jay: Handle the case where there is no catch
18190         statements (missing null test).
18191
18192 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * driver.cs (MainDriver): Be conservative on our command line
18195         handling.
18196
18197         Catch DirectoryNotFoundException when calling GetFiles.
18198
18199         (SplitPathAndPattern): Used to split the input specification into
18200         a path and a pattern that we can feed to Directory.GetFiles.
18201
18202 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18203
18204         * statement.cs (Fixed): Implement the last case of the Fixed
18205         statement (string handling).
18206
18207         * expression.cs (StringPtr): New class used to return a char * to
18208         a string;  Used by the Fixed statement.
18209
18210         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18211
18212         * expression.cs (Binary.ResolveOperator): Remove redundant
18213         MemberLookup pn parent type.
18214         Optimize union call, we do not need a union if the types are the same.
18215         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18216         type.
18217
18218         Specialize the use of MemberLookup everywhere, instead of using
18219         the default settings. 
18220
18221         (StackAlloc): Implement stackalloc keyword.
18222
18223         * cs-parser.jay: Add rule to parse stackalloc.
18224
18225         * driver.cs: Handle /h, /help, /?
18226
18227         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18228         before we supported unsafe code.
18229
18230         * makefile: add --unsafe to the self compilation of mcs.
18231
18232 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * expression.cs (PointerArithmetic): New class that is used to
18235         perform pointer arithmetic.
18236         (Binary.Resolve): Handle pointer arithmetic
18237         Handle pointer comparission.
18238         (ArrayPtr): Utility expression class that is used to take the
18239         address of an array.
18240
18241         (ElementAccess): Implement array access for pointers
18242
18243         * statement.cs (Fixed): Implement fixed statement for arrays, we
18244         are missing one more case before we are done.
18245
18246         * expression.cs (Indirection): Implement EmitAssign and set the
18247         ExprClass to Variable.  This allows pointer dereferences to be
18248         treated as variables, and to have values assigned to them.
18249
18250         * ecore.cs (Expression.StoreFromPtr): New utility function to
18251         store values dereferencing.
18252
18253 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18254
18255         * expression.cs (Binary.ResolveOperator): Ensure that we are
18256         not trying to operate on a void type - this fixes the reported
18257         bug.
18258
18259         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18260         the parent implementation is sealed.
18261
18262         * ../errors/cs0239.cs : Add.
18263
18264         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18265
18266         * typemanager.cs (unverifiable_code_type): Corresponds to 
18267         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18268         which have unsafe code in them.
18269
18270         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18271         unsafe context.
18272
18273 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * cs-tokenizer.cs: Add support for @"litreal strings"
18276
18277         Make tokenizer accept pre-processor directives
18278         on any column (remove the old C-like limitation). 
18279
18280         * rootcontext.cs (EmitCode): Emit any global attributes.
18281         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18282
18283         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18284
18285         * cs-parser.jay: Add support for global attributes.  
18286
18287 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * expression.cs (Indirection): New helper class.  Unary will
18290         create Indirection classes to be able to implement the
18291         IMemoryLocation interface on it.
18292
18293 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18294
18295         * cs-parser.jay (fixed_statement): reference the right statement.
18296
18297         * statement.cs (Fixed.Emit): Finish implementing the fixed
18298         statement for the &x case.
18299
18300 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18301
18302         * class.cs (Property.Define, Method.Define): Remove newslot when
18303         `implementing'.  
18304
18305         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18306         wrong.  NewSlot should only be used if the `new' keyword is present.
18307
18308         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18309         locating our system dir.  Sorry about this.
18310
18311 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18312
18313         * driver.cs (GetSystemDir): Compute correctly the location of our
18314         system assemblies.  I was using the compiler directory instead of
18315         the library directory.
18316
18317 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18318
18319         * expression.cs (BetterFunction): Put back in what Miguel commented out
18320         since it is the correct fix. The problem is elsewhere ;-)
18321
18322         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18323         parameters of the parms method are themselves compatible or not !
18324
18325         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18326         to check that a class implements an interface before saying that an implicit
18327         conversion was allowed. Use ImplementsInterface to do the checking.
18328
18329 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18330
18331         * class.cs (Method.Define): Track whether we are an explicit
18332         implementation or not.  And only call DefineMethodOverride if we
18333         are an explicit implementation.
18334
18335         (Property.DefineMethod): Ditto.
18336
18337 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18338
18339         * expression.cs (BetterFunction): Catch hideous bug which was
18340          preventing us from detecting ambiguous calls due to implicit casts i.e
18341         cs0121.
18342
18343 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * support.cs (Pair): Remove un-needed method.  I figured why I was
18346         getting the error in cs-parser.jay, the variable in a foreach loop
18347         is readonly, and the compiler does not really treat this as a variable.
18348
18349         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18350         instead of EQUALS in grammar.  
18351
18352         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18353
18354         * expression.cs (Unary.DoResolve): Check whether the argument is
18355         managed or not.
18356
18357 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * support.cs: Api for Pair to set a value.  Despite the fact that
18360         the variables are public the MS C# compiler refuses to compile
18361         code that accesses the field if the variable is part of a foreach
18362         statement. 
18363
18364         * statement.cs (Fixed): Begin implementation of the fixed
18365         statement.
18366
18367         (Block.AddVariable): Return the VariableInfo on success and null
18368         on failure instead of true/false. 
18369
18370         * cs-parser.jay (foreach): Catch errors on variables already
18371         defined (we were ignoring this value before) and properly unwind
18372         the block hierarchy
18373
18374         (fixed_statement): grammar for the fixed statement.
18375
18376 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18377
18378         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18379         pointer types to be incretemented.
18380
18381         (SizeOf): Implement.
18382
18383         * cs-parser.jay (pointer_member_access): Implement
18384         expr->IDENTIFIER production.
18385
18386         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18387         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18388         on safe contexts.
18389
18390         (Unary): Implement indirection.
18391
18392         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18393         use in non-unsafe context).
18394
18395         (SimpleName.DoResolve): Check for pointers in field access on safe
18396         contexts. 
18397
18398         (Expression.LoadFromPtr): Factor the load-indirect code in this
18399         function.  This was duplicated in UnboxCast and ParameterReference
18400
18401 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18402
18403         * expression.cs (ComposedCast): report an error if a pointer cast
18404         is used in a safe region.
18405
18406         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18407         pointer type casts in unsafe context.
18408
18409         * codegen.cs (EmitContext): Set up IsUnsafe.
18410
18411         * cs-parser.jay (non_expression_type): Add productions for pointer
18412         casts. 
18413
18414         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18415         code.  We should not use force into static mode if the method is
18416         not virtual.  Fixes bug in MIS
18417
18418         * statement.cs (Do.Emit, While.Emit, For.Emit,
18419         Statement.EmitBoolExpression): Add support to Do and While to
18420         propagate infinite loop as `I do return' semantics.
18421
18422         Improve the For case to also test for boolean constants.
18423
18424         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18425         to the list of attributes we can add.
18426
18427         Remove `EmitContext' argument.
18428
18429         * class.cs (Method.Define): Apply parameter attributes.
18430         (Constructor.Define): Apply parameter attributes.
18431         (MethodCore.LabelParameters): Move here the core of labeling
18432         parameters. 
18433
18434         * support.cs (ReflectionParameters.ParameterModifier,
18435         InternalParameters.ParameterModifier): Use IsByRef on the type and
18436         only return the OUT bit for these parameters instead of in/out/ref
18437         flags.
18438
18439         This is because I miss-understood things.  The ParameterInfo.IsIn
18440         and IsOut represent whether the parameter has the [In] and [Out]
18441         attributes set.  
18442
18443 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * ecore.cs (FieldExpr.Emit): Release temporaries.
18446
18447         * assign.cs (LocalTemporary.Release): new function.
18448
18449         * codegen.cs (EmitContext.GetTemporaryStorage,
18450         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18451         temporary storage.  Now we can "put back" localbuilders when we
18452         are done with them
18453
18454 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18455
18456         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18457         need to make a copy of the variable to generate verifiable code.
18458
18459 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18460
18461         * driver.cs: Compute dynamically the system directory.
18462
18463         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18464         Slower, but more generally useful.  Used by the abstract
18465         registering implementation. 
18466
18467         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18468         the rules for the special rule on Type/instances.  First check if
18469         we have the same name, and if so, try that special static path
18470         rather than the instance path.
18471
18472 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18475         for, while and if.
18476
18477         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18478         Enum, ValueType, Delegate or Array for non-corlib compiles.
18479
18480         * cs-tokenizer.cs: Catch long identifiers (645)
18481
18482         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18483         piece of code.
18484
18485         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18486         fix, we were returning too early, so we were not registering
18487         pending methods from abstract classes.
18488
18489         Do not register pending methods if the class is abstract.
18490
18491         * expression.cs (Conditional.DoResolve): Report circular implicit
18492         conversions when we neecd to compute it for conditional
18493         expressions. 
18494
18495         (Is.DoResolve): If the expression is always of the provided type,
18496         flag warning 183.  If the expression can not ever be of the
18497         provided type flag warning 184.
18498
18499         * class.cs: Catch 169 as well.
18500
18501         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18502         read. 
18503
18504 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18505
18506         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18507
18508 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18509
18510         * interface.cs: (PopulateMethod): Check for pointers being defined
18511         only if the unsafe context is active.
18512         (PopulateProperty): ditto.
18513         (PopulateIndexer): ditto.
18514
18515         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18516         specified.  If pointers are present, make sure that they are
18517         present in an unsafe context.
18518         (Constructor, Constructor.Define): ditto.
18519         (Field, Field.Define): ditto.
18520         (Property, Property.Define): ditto.
18521         (Event, Event.Define): ditto.
18522
18523         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18524         hashtable if there are classes or structs defined.
18525
18526         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18527         code, as the constant resolution moved.
18528
18529         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18530         the metadata, so we can flag error 133. 
18531
18532         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18533         pointer is being declared in an unsafe context.
18534
18535 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * modifiers.cs (Modifiers.Check): Require a Location argument.
18538         Report error 227 for Unsafe use.
18539
18540         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18541
18542         * statement.cs (For.Emit): If the test is null, then report that
18543         we do `return', as we wont reach anything afterwards.
18544
18545         (Switch.SwitchGoverningType): Track the expression that matched
18546         the conversion.
18547
18548         * driver.cs: Allow negative numbers as an error code to flag.
18549
18550         * cs-parser.jay: Handle 1551.
18551
18552         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18553
18554 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18555
18556         * cs-parser.jay: Report 1518 (type declaration can only contain
18557         class, struct, interface, enum or delegate)
18558
18559         (switch_label): Report 1523 (keywords `case' or `default' must
18560         preced code)
18561
18562         (opt_switch_sections): Report 1522 (empty switch)
18563
18564         * driver.cs: Report 1515 (response file specified multiple times)
18565         Report 1516 (Source file specified multiple times).
18566
18567         * expression.cs (Argument.Resolve): Signal 1510
18568
18569         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18570         access not allowed in static code)
18571
18572 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18573
18574         * typemanager.cs (IsPointerType): Utility method which we are going
18575         to need a lot.
18576
18577         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18578         the object type, so we take care of that.
18579
18580         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18581
18582         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18583         added to non-params parameters :-)
18584
18585         * typemanager.cs (CSharpName): Include 'void' type too. 
18586
18587         (void_ptr_type): Include in the set of core types.
18588
18589         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18590         duplicating code.
18591
18592         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18593         an unsafe context.
18594
18595         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18596         completely forgotten about it.
18597
18598 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18599
18600         * cs-parser.jay (pointer_type): Add. This begins our implementation
18601         of parsing rules for unsafe code.
18602
18603         (unsafe_statement): Implement.
18604
18605         (embedded_statement): Modify to include the above.
18606
18607         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18608
18609         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18610         if the current context is an unsafe one.
18611
18612         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18613         are handled differently, we need separate rules for them.
18614
18615         (local_variable_declaration): Update to use local_variable_pointer_type
18616         to allow variable declarations of unmanaged pointer types.
18617
18618         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18619         in unsafe contexts.
18620
18621         * ../errors/cs0214.cs : Add.
18622
18623 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18624
18625         * makefile: remove 'response' file when cleaning.
18626
18627 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * cs-parser.jay: Report 1524.
18630
18631 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * typemanager.cs (RegisterMethod): drop checking if we have
18634         registered this from here
18635
18636 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18637
18638         * class.cs (Method.EmitDestructor): Implement calling our base
18639         destructor. 
18640
18641         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18642         value of InFinally.
18643
18644         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18645         this routine and will wrap the call in a try/catch block.  Deal
18646         with the case.
18647
18648 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * ecore.cs (Expression.MemberLookup): instead of taking a
18651         parameter `same_type' that was used to tell whether we could
18652         access private members we compute our containing type from the
18653         EmitContext.
18654
18655         (FieldExpr): Added partial support for volatile fields.  This does
18656         not work for volatile fields exposed from assemblies, as I can not
18657         figure out how to extract the modreq from it.
18658
18659         Updated all the source files to use this.
18660
18661         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18662         because it is referenced by MemberLookup very often. 
18663
18664 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18665
18666         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18667         TypeBuilder.GetCustomAttributes to retrieve what we need.
18668
18669         Get rid of redundant default_member_attr_type as this is the same as
18670         default_member_type which already exists.
18671
18672         * interface.cs, attribute.cs : Update accordingly.
18673
18674 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18675
18676         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18677         work for TYpeBuilders though.  Ravi, can you please fix this?
18678
18679         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18680
18681         * expression.cs (Argument.Emit): Handle the case of ref objects
18682         being passed to ref functions;  
18683
18684         (ParameterReference.EmitLoad): Loads the content of the pointer
18685         without dereferencing.
18686
18687 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18690
18691 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18692
18693         * class.cs (Indexer.DefineMethod): Incorporate the interface
18694         type in the name of the method if we are doing explicit interface
18695         implementation.
18696
18697         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18698
18699         (BetterConversion): Fix extremely trivial bug where we were referring to
18700         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18701         again !
18702
18703         * ../errors/bug16.cs : Add although we have fixed it.
18704
18705 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18706
18707         * expression.cs (BaseIndexer): Begin implementation.
18708
18709         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18710
18711         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18712         production directly to remove a shift/reduce, and implement
18713         explicit interface implementation.
18714
18715         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18716         after a floating point suffix.
18717
18718         * expression.cs (DoNumericPromotions): Improved the conversion for
18719         uint/uint.  If we have a constant, we avoid doing a typecast to a
18720         larger type.
18721
18722         * class.cs (Indexer): Implement explicit interface implementation
18723         for indexers.
18724
18725 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18726
18727         * class.cs: make the default instance constructor public and hidebysig.
18728
18729 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18730
18731         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18732         so we can call it from elsewhere.
18733
18734         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18735         we emit it internally if the class has a defined indexer; otherwise the user
18736         emits it by decorating the class definition with the DefaultMemberAttribute.
18737
18738         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18739         attribute is not used on a type which defines an indexer.
18740
18741         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18742         character when we skip whitespace.
18743
18744         * ../errors/cs0646.cs : Add.
18745
18746 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18747
18748         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18749         again. 
18750
18751         * makefile: Add practical target `mcs3.exe' which builds the third
18752         generation compiler. 
18753
18754         * expression.cs (New): Fix structures constructor calling.
18755
18756         * class.cs (Property, Method, Indexer): Emit Final flag on the
18757         method if we are an interface implementation and we are not
18758         abstract. 
18759
18760         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18761         whether this property is referencing a `base' method.
18762
18763         * expression.cs (Invocation.EmitCall): take an extra argument:
18764         is_base, this is used to determine whether the `call' or
18765         `callvirt' opcode should be used.
18766
18767
18768         * delegate.cs: update EmitCall.
18769
18770         * class.cs (Method.Define): Set NewSlot for the cases where we are
18771         not implementing an interface method.
18772
18773         (Property.Define): ditto.
18774
18775 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18776
18777         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18778         'r'.  Allows mcs to parse itself fully.
18779
18780 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18781
18782         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18783         of the number of initializers that require the InitializeArray method.
18784
18785         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18786         update the above field where necessary.
18787
18788         (MakeByteBlob): Update accordingly.
18789
18790         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18791         greater than 2.
18792
18793         (EmitDynamicInitializers): Update in accordance with the new optimization.
18794
18795         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18796         same OpCode applies.
18797
18798         * cs-parser.jay : Fix some glaring errors I introduced.
18799
18800 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18801
18802         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18803         so that we can check for name clashes there too.
18804
18805         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18806         for interface indexers.
18807
18808         * interfaces.cs (Define): Emit the default member attribute.
18809
18810         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18811         variable was being referred to while setting the value ;-)
18812
18813 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18816         byte-by-byte information when we know the data is zero.
18817
18818         Make the block always a multiple of 4, because
18819         DefineInitializedData has a bug.
18820
18821         * assign.cs: Fix, we should assign from the temporary, not from
18822         the source. 
18823
18824         * expression.cs (MakeByteBlob): Fix my incorrect code.
18825
18826 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18827
18828         * typemanager.cs (EnumToUnderlying): This function is used to get
18829         the underlying type from an enumeration, because it does not
18830         always work. 
18831
18832         * constant.cs: Use the I4_S form for values between -128 and 127.
18833
18834         * statement.cs (Block.LookupLabel): Looks up a label.
18835         (Block): Drop support for labeled blocks.
18836
18837         (LabeledStatement): New kind of statement that represents a label
18838         only.
18839
18840         (Goto): Finally implement this bad boy.
18841
18842         * cs-parser.jay: Update to reflect new mechanism to implement
18843         labels.
18844
18845 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18846
18847         * codegen.cs (EmitContext.This): a codegen property that keeps the
18848         a single instance of this instead of creating many different this
18849         instances. 
18850
18851         * delegate.cs (Delegate.DoResolve): Update to use the property;
18852
18853         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18854
18855         * expression.cs (BaseAccess.DoResolve): Ditto.
18856
18857 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18858
18859         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18860         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18861
18862         (InitCoreTypes): Update accordingly.
18863
18864         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18865         so we can quickly store the state.
18866
18867         (ApplyAttributes): Set the correct implementation flags
18868         for InternalCall methods.
18869
18870 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * expression.cs (EmitCall): if a method is not virtual, then do
18873         not use callvirt on it.
18874
18875         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18876         user defined stuff) requires the use of stobj, which takes an
18877         address on the stack instead of an array and an index.  So emit
18878         the Ldelema operation for it.
18879
18880         (EmitStoreOpcode): Use stobj for valuetypes.
18881
18882         (UnaryMutator.EmitCode): Use the right 1 value depending on
18883         whether we are dealing with int64/uint64, float or doubles.
18884
18885         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18886         constructors that I implemented last night.
18887
18888         (Constructor.IsDefault): Fix to work properly for static
18889         constructors.
18890
18891         * cs-parser.jay (CheckDef): report method signature errors.
18892         Update error number 103 to be 132.
18893
18894         * decl.cs: New AdditionResult enumeration value: MethodExists.
18895         Although we do this check for methods later on in the semantic
18896         analysis, catching repeated default constructors is so easy that
18897         we catch these here. 
18898
18899         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18900         promotions code.
18901
18902         (ParameterReference.EmitAssign, Emit): handle
18903         bools as bytes.
18904
18905         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18906         (ArrayAccess.EmitStoreOpcode): ditto.
18907
18908         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18909
18910         * expression.cs (MakeByteBlob): Complete all the missing types
18911         (uint, short, ushort, byte, sbyte)
18912
18913         * class.cs: Only init instance field initializers on instance
18914         constructors. 
18915
18916         Rename `constructors' to instance_constructors. 
18917
18918         (TypeContainer.AddConstructor): Only add constructors to the list
18919         if it is not static.
18920
18921         Make sure that we handle default_static_constructor independently
18922         everywhere where we handle instance_constructors
18923
18924 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * class.cs: Do not lookup or create a base initializer for a
18927         static constructor.
18928
18929         (ConstructorInitializer.Resolve): use the proper type to lookup
18930         for constructors.
18931
18932         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18933
18934         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18935         in DeclSpace. 
18936
18937         * decl.cs: CloseType is now an virtual method, the default
18938         implementation just closes this type.
18939
18940 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18941
18942         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18943         to PreserveSig by default. Also emit HideBySig on such methods.
18944
18945         Basically, set the defaults to standard values.
18946
18947         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18948         argument, if candidate is better, it can't be worse than the best !
18949
18950         (Invocation): Re-write bits to differentiate between methods being
18951         applicable in their expanded form and their normal form - for params
18952         methods of course.
18953
18954         Get rid of use_standard everywhere as only standard conversions are allowed
18955         in overload resolution. 
18956
18957         More spec conformance.
18958
18959 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * driver.cs: Add --timestamp, to see where the compiler spends
18962         most of its time.
18963
18964         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18965         `this' in static code.
18966
18967         (SimpleName.DoResolve): Implement in terms of a helper function
18968         that allows static-references to be passed upstream to
18969         MemberAccess.
18970
18971         (Expression.ResolveWithSimpleName): Resolve specially simple
18972         names when called by MemberAccess to implement the special
18973         semantics. 
18974
18975         (Expression.ImplicitReferenceConversion): Handle conversions from
18976         Null to reference types before others, as Null's type is
18977         System.Object. 
18978
18979         * expression.cs (Invocation.EmitCall): Handle the special case of
18980         calling methods declared on a reference type from a ValueType
18981         (Base classes System.Object and System.Enum)
18982
18983         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18984         the left hand side is a TypeExpr, not on every enumeration. 
18985
18986         (Binary.Resolve): If types are reference types, then do a cast to
18987         object on operators != and == of both arguments.
18988
18989         * typemanager.cs (FindMembers): Extract instance and static
18990         members if requested.
18991
18992         * interface.cs (PopulateProperty): Use void_type instead of null
18993         as the return type for the setter method.
18994
18995         (PopulateIndexer): ditto.
18996
18997 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18998
18999         * support.cs (ReflectionParameters): Fix minor bug where we
19000         were examining the wrong parameter for the ParamArray attribute.
19001
19002         Cope with requests for the type of the parameter at position
19003         greater than the params parameter's. We now return the element
19004         type of the params array as that makes more sense.
19005
19006         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19007         accordingly as we no longer have to extract the element type
19008         ourselves.
19009
19010         (Invocation.OverloadResolve): Update.
19011
19012 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19013
19014         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19015         against IEnumerator, test whether the return value is a descendant
19016         of the IEnumerator interface.
19017
19018         * class.cs (Indexer.Define): Use an auxiliary method to implement
19019         the other bits of the method definition.  Begin support for
19020         explicit interface implementation.
19021
19022         (Property.DefineMethod): Use TypeManager.void_type instead of null
19023         for an empty return value.
19024
19025 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19028         dealing with a FieldExpr which is composed of a FieldBuilder, in
19029         the code path we did extract the constant, but we should have
19030         obtained the underlying value to be able to cast it (otherwise we
19031         end up in an infinite loop, this is what Ravi was running into).
19032
19033         (ArrayCreation.UpdateIndices): Arrays might be empty.
19034
19035         (MemberAccess.ResolveMemberAccess): Add support for section
19036         14.5.4.1 that deals with the special case of E.I when E is a type
19037         and something else, that I can be a reference to a static member.
19038
19039         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19040         handle a particular array type to create byte blobs, it is just
19041         something we dont generate byteblobs for.
19042
19043         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19044         arguments. 
19045
19046         * location.cs (Push): remove the key from the hashtable that we
19047         are about to add.   This happens for empty files.
19048
19049         * driver.cs: Dispose files after we have parsed them.
19050
19051         (tokenize): new function that only runs the tokenizer on its
19052         input, for speed testing.
19053
19054 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19055
19056         * class.cs (Event.Define): Define the private field only if there
19057         are no accessors defined.
19058
19059         * expression.cs (ResolveMemberAccess): If there is no associated
19060         field with the event, that means we have an event defined with its
19061         own accessors and we should flag error cs0070 since transforming
19062         ourselves into a field is not valid in that case.
19063
19064         * ecore.cs (SimpleName.DoResolve): Same as above.
19065
19066         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19067         and charset to sane values.
19068
19069 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19070
19071         * assign.cs (DoResolve): Perform check on events only if they 
19072         are being accessed outside the declaring type.
19073
19074         * cs-parser.jay (event_declarations): Update rules to correctly
19075         set the type of the implicit parameter etc.
19076
19077         (add_accessor, remove_accessor): Set current local parameters.
19078
19079         * expression.cs (Binary): For delegate addition and subtraction,
19080         cast the return value from the method into the appropriate delegate
19081         type.
19082
19083 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19084
19085         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19086         of these as the workaround is unnecessary.
19087
19088         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19089         delegate data - none of that is needed at all.
19090
19091         Re-write bits to extract the instance expression and the delegate method
19092         correctly.
19093
19094         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19095         on delegates too.
19096
19097         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19098         of attaching attributes instead of duplicating code everywhere.
19099
19100         * everywhere : Update code to do attribute emission using the above method.
19101
19102 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * expression.cs (IsParamsMethodApplicable): if there are not
19105         parameters, return immediately.
19106
19107         * ecore.cs: The 0 literal can be implicity converted to an enum
19108         type. 
19109
19110         (SimpleName.DoResolve): First lookup the type, then lookup the
19111         members. 
19112
19113         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19114         want to get its address.  If the InstanceExpression is not
19115         addressable, store the result in a temporary variable, then get
19116         the address of it.
19117
19118         * codegen.cs: Only display 219 errors on warning level or above. 
19119
19120         * expression.cs (ArrayAccess): Make it implement the
19121         IMemoryLocation interface.
19122
19123         (Binary.DoResolve): handle the operator == (object a, object b)
19124         and operator != (object a, object b) without incurring into a
19125         BoxedCast (because 5 != o should never be performed).
19126
19127         Handle binary enumerator operators.
19128
19129         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19130         value type, otherwise use Ldelem_ref.
19131
19132         Use precomputed names;
19133
19134         (AddressOf): Implement address of
19135
19136         * cs-parser.jay (labeled_statement): Fix recursive block
19137         addition by reworking the production.
19138
19139         * expression.cs (New.DoEmit): New has a special case:
19140                 
19141                  If we are dealing with a ValueType, we have a few
19142                  situations to deal with:
19143                 
19144                     * The target of New is a ValueType variable, that is
19145                       easy, we just pass this as the variable reference
19146                 
19147                     * The target of New is being passed as an argument,
19148                       to a boxing operation or a function that takes a
19149                       ValueType.
19150                 
19151                       In this case, we need to create a temporary variable
19152                       that is the argument of New.
19153
19154
19155 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19156
19157         * rootcontext.cs (LookupType): Check that current_type is not null before
19158         going about looking at nested types.
19159
19160         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19161         not implement the IAssignMethod interface any more.
19162
19163         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19164         where we tranform them into FieldExprs if they are being resolved from within
19165         the declaring type.
19166
19167         * ecore.cs (SimpleName.DoResolve): Do the same here.
19168
19169         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19170
19171         * ../errors/bug10.cs : Add.
19172
19173         * ../errors/cs0070.cs : Add.
19174
19175         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19176
19177         * assign.cs : Get rid of EventIsLocal everywhere.
19178
19179 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19180
19181         * ecore.cs (ConvertIntLiteral): finished the implementation.
19182
19183         * statement.cs (SwitchLabel): Convert the value we are using as a
19184         key before looking up the table.
19185
19186 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19187
19188         * codegen.cs (EmitTopBlock): Require a Location argument now.
19189
19190         * cs-parser.jay (constructor_declarator): We need to setup
19191         current_local_parameters before we parse the
19192         opt_constructor_initializer, to allow the variables to be bound
19193         to the constructor arguments.
19194
19195         * rootcontext.cs (LookupType): First lookup nested classes in our
19196         class and our parents before we go looking outside our class.
19197
19198         * expression.cs (ConstantFold): Extract/debox the values at the
19199         beginnning. 
19200
19201         * rootcontext.cs (EmitCode): Resolve the constants first before we
19202         resolve the types.  This is not really needed, but it helps debugging.
19203
19204         * statement.cs: report location.
19205
19206         * cs-parser.jay: pass location to throw statement.
19207
19208         * driver.cs: Small bug fix.
19209
19210         * report.cs: Updated format to be 4-zero filled digits.
19211
19212 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19213
19214         * expression.cs (CheckIndices): Fix minor bug where the wrong
19215         variable was being referred to ;-)
19216
19217         (DoEmit): Do not call EmitStaticInitializers when the 
19218         underlying type is System.Object.
19219
19220 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19221
19222         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19223         and do the usual workaround for SRE.
19224
19225         * class.cs (MyEventBuilder.EventType): New member to get at the type
19226         of the event, quickly.
19227
19228         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19229
19230         * assign.cs (Assign.DoResolve): Handle the case when the target
19231         is an EventExpr and perform the necessary checks.
19232
19233         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19234         interface.
19235
19236         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19237
19238         (EventExpr): Set the type in the constructor itself since we 
19239         are meant to be born fully resolved.
19240
19241         (EventExpr.Define): Revert code I wrote earlier.
19242                 
19243         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19244         instance expression is null. The instance expression is a This in that case
19245         or a null, depending on whether it is a static method or not.
19246
19247         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19248         refers to more than one method.
19249
19250         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19251         and accordingly flag errors.
19252
19253 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19254
19255         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19256
19257 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19258
19259         * location.cs (ToString): Provide useful rutine.
19260
19261 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19264         objects, return the actual integral boxed.
19265
19266         * statement.cs (SwitchLabel): define an ILLabel for each
19267         SwitchLabel. 
19268
19269         (Switch.CheckSwitch): If the value is a Literal, extract
19270         the underlying literal.
19271
19272         Also in the unused hashtable we had, add the SwitchLabel so we can
19273         quickly look this value up.
19274
19275         * constant.cs: Implement a bunch of new constants.  Rewrite
19276         Literal based on this.  Made changes everywhere to adapt to this.
19277
19278         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19279         dereferencing array only once, and also copes with enumrations.
19280
19281         bytes are two bytes wide, not one.
19282
19283         (Cast): Perform constant conversions.
19284
19285         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19286         wrappers to the literals here.
19287
19288         * expression.cs (DoNumericPromotions): long literals can converted
19289         to ulong implicity (this is taken care of elsewhere, but I was
19290         missing this spot).
19291
19292         * ecore.cs (Expression.Literalize): Make the return type Literal,
19293         to improve type checking.
19294
19295         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19296
19297 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19298
19299         * literal.cs: Revert code from ravi that checked the bounds.  The
19300         bounds are sane by the definition of the type itself. 
19301
19302         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19303         need to actually look up in our parent hierarchy for interfaces
19304         implemented. 
19305
19306         * const.cs: Use the underlying type for enumerations
19307
19308         * delegate.cs: Compute the basename for the delegate creation,
19309         that should fix the delegate test case, and restore the correct
19310         Type Lookup semantics in rootcontext
19311
19312         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19313         referencing a nested type with the Reflection API is using the "+"
19314         sign. 
19315
19316         * cs-parser.jay: Do not require EOF token at the end.
19317
19318 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19319
19320         * rootcontext.cs (LookupType): Concatenate type names with
19321         a '.' instead of a '+' The test suite passes again.
19322
19323         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19324         field of the enumeration.
19325
19326         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19327         the case when the member is an EventExpr.
19328
19329         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19330         static has an associated instance expression.
19331
19332         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19333
19334         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19335
19336         * class.cs (Event.Define): Register event and perform appropriate checks
19337         for error #111.
19338
19339         We define the Add and Remove methods even if the use provides none because
19340         in that case, we provide default implementations ourselves.
19341
19342         Define a private field of the type of the event. This is done by the CSC compiler
19343         and we should be doing it too ;-)
19344
19345         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19346         More methods we use in code we generate.
19347
19348         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19349         is important.
19350
19351         (InitCoreTypes): Update accordingly for the above.
19352
19353         * class.cs (Event.Emit): Generate code for default accessors that we provide
19354
19355         (EmitDefaultMethod): Do the job in the above.
19356
19357         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19358         appropriate place.
19359
19360 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19363         builders even if we were missing one.
19364
19365         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19366         pass the Basename as our class name instead of the Name.  The
19367         basename will be correctly composed for us.
19368
19369         * parameter.cs (Paramters): Now takes a Location argument.
19370
19371         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19372         make all the code call directly LookupType in RootContext and take
19373         this chance to pass the Location information everywhere.
19374
19375         * Everywhere: pass Location information.
19376
19377 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * class.cs (Constructor.Define): Updated way of detecting the
19380         length of the parameters.
19381
19382         (TypeContainer.DefineType): Use basename as the type name for
19383         nested types.
19384
19385         (TypeContainer.Define): Do not recursively define types here, as
19386         definition is taken care in order by the RootContext.
19387
19388         * tree.cs: Keep track of namespaces in a per-file basis.
19389
19390         * parameter.cs (Parameter.ComputeSignature): Update to use
19391         DeclSpace. 
19392
19393         (Parameters.GetSignature): ditto.
19394
19395         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19396         instead of a TypeContainer.
19397
19398         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19399         resolve names.  Because we need to be resolve in our context, not
19400         our parents.
19401
19402         * driver.cs: Implement response files.
19403
19404         * class.cs (TypeContainer.DefineType): If we are defined, do not
19405         redefine ourselves.
19406
19407         (Event.Emit): Emit the code for add/remove handlers.
19408         (Event.Define): Save the MethodBuilders for add/remove.
19409
19410         * typemanager.cs: Use pair here too.
19411
19412         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19413         DictionaryEntry requires the first argument to be non-null.  
19414
19415         (enum_declaration): Compute full name for registering the
19416         enumeration.
19417
19418         (delegate_declaration): Instead of using
19419         formal_parameter_list, use opt_formal_parameter_list as the list
19420         can be empty.
19421
19422         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19423         (EventParsing): New property that controls whether `add' and
19424         `remove' are returned as tokens or identifiers (for events);
19425
19426 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19427
19428         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19429         use MyEventBuilder only and let it wrap the real builder for us.
19430
19431         (MyEventBuilder): Revamp constructor etc.
19432
19433         Implement all operations that we perform on EventBuilder in precisely the same
19434         way here too.
19435
19436         (FindMembers): Update to use the EventBuilder member.
19437
19438         (Event.Emit): Update accordingly.
19439
19440 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19441
19442         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19443         by calling the appropriate methods.
19444
19445         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19446         useful.
19447
19448         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19449
19450 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19451
19452         * delegate.cs (Delegate.Populate): Check that the return type
19453         and various parameters types are indeed accessible.
19454
19455         * class.cs (Constructor.Define): Same here.
19456
19457         (Field.Define): Ditto.
19458
19459         (Event.Define): Ditto.
19460
19461         (Operator.Define): Check that the underlying Method defined itself
19462         correctly - so it's MethodBuilder should not be null.
19463
19464         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19465         expression happens to be null.
19466
19467         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19468         members but as of now we don't seem to be able to do anything really useful with it.
19469
19470         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19471         not the EventBuilder.
19472
19473 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * cs-tokenizer.cs: Add support for defines.
19476         Add support for #if, #elif, #else, #endif
19477
19478         (eval_var): evaluates a variable.
19479         (eval): stubbed for evaluating functions.
19480
19481         * cs-parser.jay: Pass the defines information
19482
19483         * driver.cs: Add --define command line option.
19484
19485         * decl.cs: Move MemberCore here.
19486
19487         Make it the base class for DeclSpace.  This allows us to catch and
19488         report 108 and 109 for everything now.
19489
19490         * class.cs (TypeContainer.Define): Extract all the members
19491         before populating and emit the warning 108 (new keyword required
19492         to override) instead of having each member implement this.
19493
19494         (MemberCore.Define): New abstract method, we will be using this in
19495         the warning reporting engine in Populate.
19496
19497         (Operator.Define): Adjust to new MemberCore protocol. 
19498
19499         * const.cs (Const): This does not derive from Expression, it is a
19500         temporary object we use to create fields, it is a MemberCore. 
19501
19502         * class.cs (Method.Define): Allow the entry point to be in a
19503         specific class.
19504
19505         * driver.cs: Rewrite the argument handler to clean it up a bit.
19506
19507         * rootcontext.cs: Made it just an auxiliary namespace feature by
19508         making everything static.
19509
19510         * driver.cs: Adapt code to use RootContext type name instead of
19511         instance variable.
19512
19513         * delegate.cs: Remove RootContext argument.
19514
19515         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19516         argument. 
19517
19518         * class.cs (Event.Define): The lookup can fail.
19519
19520         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19521
19522         * expression.cs: Resolve the this instance before invoking the code.
19523
19524 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19525
19526         * cs-parser.jay: Add a production in element_access that allows
19527         the thing to become a "type" reference.  This way we can parse
19528         things like "(string [])" as a type.
19529
19530         Note that this still does not handle the more complex rules of
19531         casts. 
19532
19533
19534         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19535
19536         * ecore.cs: (CopyNewMethods): new utility function used to
19537         assemble the list of methods from running FindMembers.
19538
19539         (MemberLookup): Rework FindMembers so that 
19540
19541 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19542
19543         * class.cs (TypeContainer): Remove Delegates who fail to be
19544         defined.
19545
19546         * delegate.cs (Populate): Verify that we dont get null return
19547         values.   TODO: Check for AsAccessible.
19548
19549         * cs-parser.jay: Use basename to emit error 574 (destructor should
19550         have the same name as container class), not the full name.
19551
19552         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19553         possible representation.  
19554
19555         Also implements integer type suffixes U and L.
19556
19557 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19558
19559         * expression.cs (ArrayCreation.DoResolve): We need to do the
19560         argument resolution *always*.
19561
19562         * decl.cs: Make this hold the namespace.  Hold the root context as
19563         well.
19564         (LookupType): Move here.
19565
19566         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19567
19568         * location.cs (Row, Name): Fixed the code, it was always returning
19569         references to the first file.
19570
19571         * interface.cs: Register properties defined through interfaces.
19572
19573         * driver.cs: Add support for globbing on the command line
19574
19575         * class.cs (Field): Make it derive from MemberCore as well.
19576         (Event): ditto.
19577
19578 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19579
19580         * class.cs (Event::Define): Check that the type of the event is a delegate
19581         type else flag error #66.
19582
19583         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19584         same.
19585
19586         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19587         values of EntryPoint, CharSet etc etc.
19588
19589         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19590
19591         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19592         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19593         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19594         which needs this to do its work.
19595
19596         * ../errors/cs0066.cs : Add.
19597
19598 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19601         helper functions.
19602
19603         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19604         clears out the parameters field.
19605         (MemberSignatureCompare): Cleanup
19606
19607         (MemberCore): New base class used to share code between MethodCore
19608         and Property.
19609
19610         (RegisterRequiredImplementations) BindingFlags.Public requires
19611         either BindingFlags.Instace or Static.  Use instance here.
19612
19613         (Property): Refactored code to cope better with the full spec.
19614
19615         * parameter.cs (GetParameterInfo): Return an empty array instead
19616         of null on error.
19617
19618         * class.cs (Property): Abstract or extern properties have no bodies.
19619
19620         * parameter.cs (GetParameterInfo): return a zero-sized array.
19621
19622         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19623         method modifier validation to the typecontainer so we can reuse
19624         this on properties.
19625
19626         (MethodCore.ParameterTypes): return an empty sized array of types.
19627
19628         (Property.Define): Test property modifier validity.
19629
19630         Add tests for sealed/override too.
19631
19632         (Method.Emit): abstract or extern methods have no bodies.
19633
19634 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19635
19636         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19637         thing.
19638
19639         (Method::Define, ::Emit): Modify accordingly.
19640
19641         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19642
19643         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19644
19645         * makefile: Pass in /unsafe.
19646
19647 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19648
19649         * class.cs (MakeKey): Kill routine.
19650
19651         * class.cs (TypeContainer.Define): Correctly define explicit
19652         method implementations (they require the full interface name plus
19653         the method name).
19654
19655         * typemanager.cs: Deply the PtrHashtable here and stop using the
19656         lame keys.  Things work so much better.
19657
19658         This of course broke everyone who depended on `RegisterMethod' to
19659         do the `test for existance' test.  This has to be done elsewhere.
19660
19661         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19662         the object stupid Equals method (because, that like fails all over
19663         the place).  We still do not use it.
19664
19665         * class.cs (TypeContainer.SetRequiredInterface,
19666         TypeContainer.RequireMethods): Killed these two routines and moved
19667         all the functionality to RegisterRequiredImplementations.
19668
19669         (TypeContainer.RegisterRequiredImplementations): This routine now
19670         registers all the implementations required in an array for the
19671         interfaces and abstract methods.  We use an array of structures
19672         which can be computed ahead of time to reduce memory usage and we
19673         also assume that lookups are cheap as most classes will not
19674         implement too many interfaces.
19675
19676         We also avoid creating too many MethodSignatures.
19677
19678         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19679         clear the "pending" bit if we find that there are problems with
19680         the declaration.
19681
19682         (TypeContainer.VerifyPendingMethods): Update to report errors of
19683         methods that look like implementations but are not.
19684
19685         (TypeContainer.Define): Add support for explicit interface method
19686         implementation. 
19687
19688 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * typemanager.cs: Keep track of the parameters here instead of
19691         being a feature of the TypeContainer.
19692
19693         * class.cs: Drop the registration of parameters here, as
19694         InterfaceMethods are also interface declarations.
19695
19696         * delegate.cs: Register methods with the TypeManager not only with
19697         the TypeContainer.  This code was buggy.
19698
19699         * interface.cs: Full registation here.
19700
19701 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19702
19703         * expression.cs: Remove reducer for binary expressions, it can not
19704         be done this way.
19705
19706         * const.cs: Put here the code that used to go into constant.cs
19707
19708         * constant.cs: Put here the code for constants, this is a new base
19709         class for Literals.
19710
19711         * literal.cs: Make Literal derive from Constant.
19712
19713 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * statement.cs (Return.Emit): Report error 157 if the user
19716         attempts to return from a finally block.
19717
19718         (Return.Emit): Instead of emitting a return, jump to the end of
19719         the function.
19720
19721         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19722         LocalBuilder to store the result of the function.  ReturnLabel is
19723         the target where we jump.
19724
19725
19726 2001-12-09  Radek Doulik  <rodo@ximian.com>
19727
19728         * cs-parser.jay: remember alias in current namespace
19729
19730         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19731         namespaces
19732
19733         * class.cs (LookupAlias): lookup alias in my_namespace
19734
19735         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19736         aliases hashtable
19737         (LookupAlias): lookup alias in this and if needed in parent
19738         namespaces
19739
19740 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19741
19742         * support.cs: 
19743
19744         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19745         making things static.  I need this to avoid passing the
19746         TypeContainer when calling ParameterType.
19747
19748         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19749         that did string manipulation to compute the type and then call
19750         GetType.  Use Parameter.ParameterType instead.
19751
19752         * cs-tokenizer.cs: Consume the suffix for floating values.
19753
19754         * expression.cs (ParameterReference): figure out whether this is a
19755         reference parameter or not.  Kill an extra variable by computing
19756         the arg_idx during emission.
19757
19758         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19759         function that returns whether a parameter is an out/ref value or not.
19760
19761         (Parameter.ParameterType): The type of the parameter (base,
19762         without ref/out applied).
19763
19764         (Parameter.Resolve): Perform resolution here.
19765         (Parameter.ExternalType): The full type (with ref/out applied).
19766
19767         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19768         support for expressions on the using statement.
19769
19770 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19771
19772         * statement.cs (Using.EmitLocalVariableDecls): Split the
19773         localvariable handling of the using statement.
19774
19775         (Block.EmitMeta): Keep track of variable count across blocks.  We
19776         were reusing slots on separate branches of blocks.
19777
19778         (Try.Emit): Emit the general code block, we were not emitting it. 
19779
19780         Check the type of the declaration to be an IDisposable or
19781         something that can be implicity converted to it. 
19782
19783         Emit conversions if required.
19784
19785         * ecore.cs (EmptyExpression): New utility class.
19786         (Expression.ImplicitConversionExists): New utility function.
19787
19788 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * statement.cs (Using): Implement.
19791
19792         * expression.cs (LocalVariableReference): Support read only variables.
19793
19794         * statement.cs: Remove the explicit emit for the Leave opcode.
19795         (VariableInfo): Add a readonly field.
19796
19797 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * ecore.cs (ConvCast): new class used to encapsulate the various
19800         explicit integer conversions that works in both checked and
19801         unchecked contexts.
19802
19803         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19804         properly generate the overflow opcodes.
19805
19806 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * statement.cs: The correct type for the EmptyExpression is the
19809         element_type, not the variable type.  Ravi pointed this out.
19810
19811 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19812
19813         * class.cs (Method::Define): Handle PInvoke methods specially
19814         by using DefinePInvokeMethod instead of the usual one.
19815
19816         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19817         above to do the task of extracting information and defining the method.
19818
19819 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19820
19821         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19822         of the condition for string type.
19823
19824         (Emit): Move that here. 
19825
19826         (ArrayCreation::CheckIndices): Keep string literals in their expression
19827         form.
19828
19829         (EmitDynamicInitializers): Handle strings appropriately.
19830
19831 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19832
19833         * codegen.cs (EmitContext): Replace multiple variables with a
19834         single pointer to the current Switch statement.
19835
19836         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19837         EmitContext.
19838
19839 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * statement.cs 
19842
19843         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19844         default'.
19845
19846         (Foreach.Emit): Foreach on arrays was not setting
19847         up the loop variables (for break/continue).
19848
19849         (GotoCase): Semi-implented.
19850
19851 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19852
19853         * attribute.cs (CheckAttribute): Handle system attributes by using
19854         Attribute.GetAttributes to examine information we need.
19855
19856         (GetValidPlaces): Same here.
19857
19858         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19859
19860         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19861
19862         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19863
19864         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19865
19866         (Method::Emit): Handle the case when we are a PInvoke method.
19867
19868 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19869
19870         * expression.cs: Use ResolveWithSimpleName on compound names.
19871
19872 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19873
19874         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19875         before trying to reduce it.
19876
19877         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19878
19879         * constant.cs (LookupConstantValue): Implement.
19880
19881         (EmitConstant): Use the above in emitting the constant.
19882
19883         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19884         that are user-defined by doing a LookupConstantValue on them.
19885
19886         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19887         too, like above.
19888
19889 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19890
19891         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19892
19893         (BaseAccess.DoResolve): Implement.
19894
19895         (MemberAccess.DoResolve): Split this routine into a
19896         ResolveMemberAccess routine that can be used independently
19897
19898 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19899
19900         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19901         As that share bits of the implementation.  Is returns a boolean,
19902         while As returns the Type that is being probed.
19903
19904 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19905
19906         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19907         instead of a Literal - much easier.
19908
19909         (EnumInTransit): Remove - utterly useless :-)
19910
19911         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19912
19913         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19914
19915         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19916         chain when we have no associated expression.
19917
19918 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19919
19920         * constant.cs (Define): Use Location while reporting the errror.
19921
19922         Also emit a warning when 'new' is used and there is no inherited
19923         member to hide.
19924
19925         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19926         populated.
19927
19928         (LookupEnumValue): Implement to lookup an enum member's value and define it
19929         if necessary.
19930
19931         (Populate): Re-write accordingly to use the above routine.
19932
19933 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19934
19935         * expression.cs (This): Fix prototype for DoResolveLValue to
19936         override the base class DoResolveLValue.
19937
19938         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19939         declarations) 
19940
19941         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19942         (we need to load the address of the field here).  This fixes
19943         test-22. 
19944
19945         (FieldExpr.DoResolveLValue): Call the DoResolve
19946         function to initialize the Instance expression.
19947
19948         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19949         correctly the GetEnumerator operation on a value type.
19950
19951         * cs-parser.jay: Add more simple parsing error catches.
19952
19953         * statement.cs (Switch): Add support for string switches.
19954         Handle null specially.
19955
19956         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19957
19958 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19959
19960         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19961
19962         (declare_local_constant): New helper function.
19963
19964         * statement.cs (AddConstant): Keep a separate record of constants
19965
19966         (IsConstant): Implement to determine if a variable is a constant.
19967
19968         (GetConstantExpression): Implement.
19969
19970         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19971
19972         * statement.cs (IsVariableDefined): Re-write.
19973
19974 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19975
19976         * class.cs (TypeContainer::FindMembers): Look for constants
19977         in the case when we are looking for MemberTypes.Field
19978
19979         * expression.cs (MemberAccess::DoResolve): Check that in the
19980         case we are a FieldExpr and a Literal, we are not being accessed
19981         by an instance reference.
19982
19983         * cs-parser.jay (local_constant_declaration): Implement.
19984
19985         (declaration_statement): Implement for constant declarations.
19986
19987 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * statement.cs (Switch): Catch double defaults.
19990
19991         (Switch): More work on the switch() statement
19992         implementation.  It works for integral values now, need to finish
19993         string support.
19994
19995
19996 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19997
19998         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19999         integer literals into other integer literals.  To be used by
20000         switch. 
20001
20002 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20003
20004         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20005         some memory.
20006
20007         (EmitDynamicInitializers): Cope with the above since we extract data
20008         directly from ArrayData now.
20009
20010         (ExpectInitializers): Keep track of whether initializers are mandatory
20011         or not.
20012
20013         (Bounds): Make it a hashtable to prevent the same dimension being 
20014         recorded for every element in that dimension.
20015
20016         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20017         from being found.
20018
20019         Also fix bug which was causing the indices to be emitted in the reverse
20020         order.
20021
20022 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20023
20024         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20025         unfinished.  They do not work, because the underlying code is
20026         sloppy.
20027
20028 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * cs-parser.jay: Remove bogus fixme.
20031
20032         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20033         on Switch statement.
20034
20035 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20036
20037         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20038         the same. 
20039
20040         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20041         parameter. Apparently, any expression is allowed. 
20042
20043         (ValidateInitializers): Update accordingly.
20044
20045         (CheckIndices): Fix some tricky bugs thanks to recursion.
20046
20047         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20048         I was being completely brain-dead.
20049
20050         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20051         and re-write acordingly.
20052
20053         (DelegateInvocation): Re-write accordingly.
20054
20055         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20056
20057         (MakeByteBlob): Handle types more correctly.
20058
20059         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20060         initialization from expressions but it is incomplete because I am a complete
20061         Dodo :-|
20062
20063 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20064
20065         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20066         on If.  Basically, we have to return `true' (ie, we do return to
20067         our caller) only if both branches of the if return.
20068
20069         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20070         short-circuit operators, handle them as short circuit operators. 
20071
20072         (Cast.DoResolve): Resolve type.
20073         (Cast.Cast): Take an expression as the target type.
20074
20075         * cs-parser.jay (cast_expression): Remove old hack that only
20076         allowed a limited set of types to be handled.  Now we take a
20077         unary_expression and we resolve to a type during semantic
20078         analysis.
20079
20080         Use the grammar productions from Rhys to handle casts (this is
20081         not complete like Rhys syntax yet, we fail to handle that corner
20082         case that C# has regarding (-x), but we will get there.
20083
20084 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20085
20086         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20087         field which is an array type.
20088
20089         * cs-parser.jay (declare_local_variables): Support array initialization too.
20090
20091         * typemanager.cs (MakeKey): Implement.
20092
20093         (everywhere): Use the above appropriately.
20094
20095         * cs-parser.jay (for_statement): Update for array initialization while
20096         declaring variables.
20097
20098         * ecore.cs : The error message was correct, it's the variable's names that
20099         were misleading ;-) Make the code more readable.
20100
20101         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20102         the correct type etc.
20103
20104         (ConvertExplicit): Handle Enum types by examining the underlying type.
20105
20106 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20107
20108         * parameter.cs (GetCallingConvention): Always return
20109         CallingConventions.Standard for now.
20110
20111 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20114         and `r' after calling DoNumericPromotions.
20115
20116         * ecore.cs: Fix error message (the types were in the wrong order).
20117
20118         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20119         BindingFlags.Instance as well 
20120
20121         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20122         implicit int literal conversion in an empty cast so that we
20123         propagate the right type upstream.
20124
20125         (UnboxCast): new class used to unbox value types.
20126         (Expression.ConvertExplicit): Add explicit type conversions done
20127         by unboxing.
20128
20129         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20130         the target type before applying the implicit LongLiterals to ULong
20131         literal cast.
20132
20133 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20134
20135         * cs-parser.jay (for_statement): Reworked the way For works: now
20136         we declare manually any variables that are introduced in
20137         for_initializer to solve the problem of having out-of-band code
20138         emition (that is what got for broken).
20139
20140         (declaration_statement): Perform the actual variable declaration
20141         that used to be done in local_variable_declaration here.
20142
20143         (local_variable_declaration): Do not declare anything, just pass
20144         the information on a DictionaryEntry
20145
20146 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20147
20148         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20149         re-write of the logic to now make it recursive.
20150
20151         (UpdateIndices): Re-write accordingly.
20152
20153         Store element data in a separate ArrayData list in the above methods.
20154
20155         (MakeByteBlob): Implement to dump the array data into a byte array.
20156
20157 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20158
20159         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20160         into CheckIndices.
20161
20162         * constant.cs (Define): Implement.
20163
20164         (EmitConstant): Re-write fully.
20165
20166         Pass in location info.
20167
20168         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20169         respectively.
20170
20171         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20172         DictionaryEntry since we need location info too.
20173
20174         (constant_declaration): Update accordingly.
20175
20176         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20177         code into another method : UpdateIndices.
20178
20179 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20180
20181         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20182         some type checking etc.
20183
20184 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20185
20186         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20187         bits to provide dimension info if the user skips doing that.
20188
20189         Update second constructor to store the rank correctly.
20190
20191 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20192
20193         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20194         and try to implement.
20195
20196         * ../errors/cs0150.cs : Add.
20197
20198         * ../errors/cs0178.cs : Add.
20199
20200 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20201
20202         * statement.cs: Implement foreach on multi-dimensional arrays. 
20203
20204         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20205         name of the params argument.
20206
20207         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20208         initializing the array.
20209
20210         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20211         we can use this elsewhere.
20212
20213         * statement.cs: Finish implementation of foreach for single
20214         dimension arrays.
20215
20216         * cs-parser.jay: Use an out-of-band stack to pass information
20217         around, I wonder why I need this.
20218
20219         foreach_block: Make the new foreach_block the current_block.
20220
20221         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20222         function used to return a static Parameters structure.  Used for
20223         empty parameters, as those are created very frequently.
20224
20225         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20226
20227 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20228
20229         * interface.cs : Default modifier is private, not public. The
20230         make verify test passes again.
20231
20232 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20233
20234         * support.cs (ReflectionParameters): Fix logic to determine
20235         whether the last parameter is a params one. Test 9 passes again.
20236
20237         * delegate.cs (Populate): Register the builders we define with
20238         RegisterParameterForBuilder. Test 19 passes again.
20239
20240         * cs-parser.jay (property_declaration): Reference $6 instead
20241         of $$ to get at the location.
20242
20243         (indexer_declaration): Similar stuff.
20244
20245         (attribute): Ditto.
20246
20247         * class.cs (Property): Register parameters for the Get and Set methods
20248         if they exist. Test 23 passes again.
20249
20250         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20251         call to EmitArguments as we are sure there aren't any params arguments. 
20252         Test 32 passes again.
20253
20254         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20255         IndexOutOfRangeException. 
20256
20257         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20258         Test 33 now passes again.
20259
20260 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20263         broke a bunch of things.  Will have to come up with a better way
20264         of tracking locations.
20265
20266         * statement.cs: Implemented foreach for single dimension arrays.
20267
20268 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20269
20270         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20271         an error.  This removes the lookup from the critical path.
20272
20273         * cs-parser.jay: Removed use of temporary_loc, which is completely
20274         broken. 
20275
20276 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20277
20278         * support.cs (ReflectionParameters.ParameterModifier): Report
20279         whether the argument is a PARAMS argument or not.
20280
20281         * class.cs: Set the attribute `ParamArrayAttribute' on the
20282         parameter argument.
20283
20284         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20285         and cons_param_array_attribute (ConstructorInfo for
20286         ParamArrayAttribute)., 
20287
20288         * codegen.cs: Emit the return using the `Return' statement, that
20289         way we can report the error correctly for missing return values. 
20290
20291         * class.cs (Method.Emit): Clean up.
20292
20293         * expression.cs (Argument.Resolve): Take another argument: the
20294         location where this argument is used.  Notice that this is not
20295         part of the "Argument" class as to reduce the size of the
20296         structure (we know the approximate location anyways).
20297
20298         Test if the argument is a variable-reference, if not, then
20299         complain with a 206.
20300
20301         (Argument.Emit): Emit addresses of variables.
20302
20303         (Argument.FullDesc): Simplify.
20304
20305         (Invocation.DoResolve): Update for Argument.Resolve.
20306
20307         (ElementAccess.DoResolve): ditto.
20308
20309         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20310         method should be virtual, as this method is always virtual.
20311
20312         (NewDelegate.DoResolve): Update for Argument.Resolve.
20313
20314         * class.cs (ConstructorInitializer.DoResolve): ditto.
20315
20316         * attribute.cs (Attribute.Resolve): ditto.
20317
20318 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20321
20322         * expression.cs (ParameterReference): Drop IStackStorage and implement
20323         IAssignMethod instead. 
20324
20325         (LocalVariableReference): ditto.
20326
20327         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20328         IAssignMethod instead. 
20329
20330 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20331
20332         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20333         enumerations that are used in heavily used structures derive from
20334         byte in a laughable and pathetic attempt to reduce memory usage.
20335         This is the kind of pre-optimzations that you should not do at
20336         home without adult supervision.
20337
20338         * expression.cs (UnaryMutator): New class, used to handle ++ and
20339         -- separatedly from the other unary operators.  Cleans up the
20340         code, and kills the ExpressionStatement dependency in Unary.
20341
20342         (Unary): Removed `method' and `Arguments' from this class, making
20343         it smaller, and moving it all to SimpleCall, so I can reuse this
20344         code in other locations and avoid creating a lot of transient data
20345         strucutres when not required.
20346
20347         * cs-parser.jay: Adjust for new changes.
20348
20349 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * enum.cs (Enum.Populate): If there is a failure during
20352         definition, return
20353
20354         * cs-parser.jay (opt_enum_base): we used to catch type errors
20355         here, but this is really incorrect.  The type error should be
20356         catched during semantic analysis.
20357
20358 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20359
20360         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20361         current_local_parameters as expected since I, in my stupidity, had forgotten
20362         to do this :-)
20363
20364         * attribute.cs (GetValidPlaces): Fix stupid bug.
20365
20366         * class.cs (Method::Emit): Perform check on applicability of attributes.
20367
20368         (Constructor::Emit): Ditto.
20369
20370         (Field::Emit): Ditto.
20371
20372         (Field.Location): Store location information.
20373
20374         (Property, Event, Indexer, Operator): Ditto.
20375
20376         * cs-parser.jay (field_declaration): Pass in location for each field.
20377
20378         * ../errors/cs0592.cs : Add.
20379
20380 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20381
20382         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20383
20384         (InitCoreTypes): Update accordingly.
20385
20386         (RegisterAttrType, LookupAttr): Implement.
20387
20388         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20389         info about the same.
20390
20391         (Resolve): Update to populate the above as necessary.
20392
20393         (Error592): Helper.
20394
20395         (GetValidPlaces): Helper to the above.
20396
20397         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20398
20399         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20400
20401 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20402
20403         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20404
20405         * ../errors/cs0617.cs : Add.
20406
20407 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20408
20409         * enum.cs (Emit): Rename to Populate to be more consistent with what
20410         we expect it to do and when exactly it is called.
20411
20412         * class.cs, rootcontext.cs : Update accordingly.
20413
20414         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20415         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20416
20417         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20418
20419         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20420         of a fieldinfo using the above, when dealing with a FieldBuilder.
20421
20422 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20423
20424         * ../errors/cs0031.cs : Add.
20425
20426         * ../errors/cs1008.cs : Add.
20427
20428         * ../errrors/cs0543.cs : Add.
20429
20430         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20431         enum type.
20432
20433         (FindMembers): Implement.
20434
20435         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20436         enums and delegates too.
20437
20438         (enum_types): Rename to builder_to_enum.
20439
20440         (delegate_types): Rename to builder_to_delegate.
20441
20442         * delegate.cs (FindMembers): Implement.
20443
20444 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20445
20446         * typemanager.cs (IsEnumType): Implement.
20447
20448         * enum.cs (Emit): Re-write parts to account for the underlying type
20449         better and perform checking etc.
20450
20451         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20452         of the underlying type.
20453
20454         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20455         value
20456
20457         * enum.cs (error31): Helper to report error #31.
20458
20459         * cs-parser.jay (enum_declaration): Store location of each member too.
20460
20461         * enum.cs (member_to_location): New hashtable. 
20462
20463         (AddEnumMember): Update location hashtable.
20464
20465         (Emit): Use the location of each member while reporting errors.
20466
20467 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * cs-parser.jay: A for_initializer if is a
20470         local_variable_declaration really ammount to have an implicit
20471         block with the variable declaration and no initializer for for.
20472
20473         * statement.cs (For.Emit): Cope with null initializers.
20474
20475         This fixes the infinite loop on for initializers.
20476
20477 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * enum.cs: More cleanup.
20480
20481         * ecore.cs: Remove dead code.
20482
20483         * class.cs (Property.Emit): More simplification.
20484         (Event.Emit): ditto.
20485
20486         Reworked to have less levels of indentation.
20487
20488 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20489
20490         * class.cs (Property): Emit attributes.
20491
20492         (Field): Ditto.
20493
20494         (Event): Ditto.
20495
20496         (Indexer): Ditto.
20497
20498         (Operator): Ditto.
20499
20500         * enum.cs (Emit): Ditto.
20501
20502         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20503         Enums too.
20504
20505         * class.cs (Field, Event, etc.): Move attribute generation into the
20506         Emit method everywhere.
20507
20508         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20509         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20510         as we had no way of defining nested enums !
20511
20512         * rootcontext.cs : Adjust code accordingly.
20513
20514         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20515
20516 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20517
20518         * expression.cs (EvalConstantExpression): Move into ecore.cs
20519
20520         * enum.cs (Enum): Rename some members and make them public and readonly
20521         according to our convention.
20522
20523         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20524         nothing else.
20525
20526         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20527
20528         (Enum::Emit): Write a simple version for now which doesn't try to compute
20529         expressions. I shall modify this to be more robust in just a while.
20530
20531         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20532
20533         (TypeContainer::CloseType): Create the Enum types too.
20534
20535         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20536
20537         * expression.cs (EvalConstantExpression): Get rid of completely.
20538
20539         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20540         user-defined values and other cases.
20541
20542         (IsValidEnumLiteral): Helper function.
20543
20544         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20545         out there in the case we had a literal FieldExpr.
20546
20547         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20548
20549         (Literalize): Revamp a bit to take two arguments.
20550
20551         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20552
20553 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20554
20555         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20556
20557         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20558
20559         (Resolve): Use the above to ensure we have proper initializers.
20560
20561 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20562
20563         * expression.cs (Expression::EvalConstantExpression): New method to 
20564         evaluate constant expressions.
20565
20566         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20567
20568 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20569
20570         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20571         in an array.
20572
20573         (Binary.ResolveOperator): Handle operator != (object a, object b)
20574         and operator == (object a, object b);
20575
20576         (Binary.DoNumericPromotions): Indicate whether the numeric
20577         promotion was possible.
20578
20579         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20580         Implement.  
20581
20582         Made the ArrayAccess implement interface IAssignMethod instead of
20583         IStackStore as the order in which arguments are passed reflects
20584         this.
20585
20586         * assign.cs: Instead of using expr.ExprClass to select the way of
20587         assinging, probe for the IStackStore/IAssignMethod interfaces.
20588
20589         * typemanager.cs: Load InitializeArray definition.
20590
20591         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20592         static data that can be used to initialize arrays. 
20593
20594 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20595
20596         * expression.cs: Handle operator== and operator!= for booleans.
20597
20598         (Conditioal.Reduce): Implement reducer for the ?: operator.
20599
20600         (Conditional.Resolve): Implement dead code elimination.
20601
20602         (Binary.Resolve): Catch string literals and return a new
20603         concatenated string.
20604
20605         (Unary.Reduce): Implement reduction of unary expressions.
20606
20607         * ecore.cs: Split out the expression core handling here.
20608
20609         (Expression.Reduce): New method used to perform constant folding
20610         and CSE.  This is needed to support constant-expressions. 
20611
20612         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20613         targets, and optimize for !x.
20614
20615 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20616
20617         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20618         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20619         set custom atttributes.
20620
20621         * literal.cs (Literal::GetValue): New abstract method to return the actual
20622         value of the literal, cast as an object.
20623
20624         (*Literal): Implement GetValue method.
20625
20626         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20627         expressions to the arraylist but objects of type Argument.
20628
20629         * class.cs (TypeContainer::Emit): Emit our attributes too.
20630
20631         (Method::Emit, Constructor::Emit): Ditto.
20632
20633         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20634         to be ignoring earlier.
20635
20636 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20637
20638         * attribute.cs (AttributeSection::Define): Implement to do the business
20639         of constructing a CustomAttributeBuilder.
20640
20641         (Attribute): New trivial class. Increases readability of code.  
20642
20643         * cs-parser.jay : Update accordingly.
20644
20645         (positional_argument_list, named_argument_list, named_argument): New rules
20646
20647         (attribute_arguments): Use the above so that we are more correct.
20648
20649 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20650
20651         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20652         to perform all checks for a method with a params parameter.
20653
20654         (Invocation::OverloadResolve): Update to use the above method and therefore
20655         cope correctly with params method invocations.
20656
20657         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20658         params too.
20659
20660         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20661         constructors in our parent too because we can't afford to miss out on 
20662         protected ones ;-)
20663
20664         * attribute.cs (AttributeSection): New name for the class Attribute
20665
20666         Other trivial changes to improve readability.
20667
20668         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20669         use the new class names.
20670
20671 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20672
20673         * class.cs (Method::Define): Complete definition for params types too
20674
20675         (Indexer::Define): Ditto.
20676
20677         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20678         Cope everywhere with a request for info about the array parameter.
20679
20680 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20681
20682         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20683
20684         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20685         local_variable_type to extract the string corresponding to the type.
20686
20687         (local_variable_type): Fixup the action to use the new helper method.
20688
20689         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20690         go.
20691
20692         * expression.cs : Clean out code which uses the above.
20693
20694 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20695
20696         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20697         and bale out if necessary by returning a false.
20698
20699         (RegisterProperty): Ditto.
20700
20701         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20702         and print out appropriate error messages.
20703
20704         * interface.cs (everywhere): Ditto.
20705
20706         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20707         location to constructor.
20708
20709         * class.cs (Property, Event, Indexer): Update accordingly.
20710
20711         * ../errors/cs111.cs : Added.
20712
20713         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20714         of a method, as laid down by the spec.
20715
20716         (Invocation::OverloadResolve): Use the above method.
20717
20718 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20719
20720         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20721         now take a TypeContainer and a Parameters object.
20722
20723         (ParameterData): Modify return type of ParameterModifier method to be 
20724         Parameter.Modifier and not a string.
20725
20726         (ReflectionParameters, InternalParameters): Update accordingly.
20727
20728         * expression.cs (Argument::GetParameterModifier): Same here.
20729
20730         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20731         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20732         symbol in it at all so maybe this is only for now.
20733
20734 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20735
20736         * support.cs (InternalParameters): Constructor now takes an extra argument 
20737         which is the actual Parameters class.
20738
20739         (ParameterDesc): Update to provide info on ref/out modifiers.
20740
20741         * class.cs (everywhere): Update call to InternalParameters to pass in
20742         the second argument too.
20743
20744         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20745         to return the modifier info [ref/out etc]
20746
20747         (InternalParameters, ReflectionParameters): Implement the above.
20748
20749         * expression.cs (Argument::ParameterModifier): Similar function to return
20750         info about the argument's modifiers.
20751
20752         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20753         too.
20754
20755         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20756         a new SetFormalParameters object which we pass to InternalParameters.
20757
20758 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20759
20760         * expression.cs (NewArray): Merge into the ArrayCreation class.
20761
20762 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20763
20764         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20765         NewUserdefinedArray into one as there wasn't much of a use in having
20766         two separate ones.
20767
20768         * expression.cs (Argument): Change field's name to ArgType from Type.
20769
20770         (Type): New readonly property which returns the proper type, taking into 
20771         account ref/out modifiers.
20772
20773         (everywhere): Adjust code accordingly for the above.
20774
20775         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20776         whether we are emitting for a ref or out parameter.
20777
20778         * expression.cs (Argument::Emit): Use the above field to set the state.
20779
20780         (LocalVariableReference::Emit): Update to honour the flag and emit the
20781         right stuff.
20782
20783         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20784
20785         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20786
20787         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20788
20789         (ReflectionParameters, InternalParameters): Implement the above method.
20790
20791         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20792         reporting errors.
20793
20794         (Invocation::FullMethodDesc): Ditto. 
20795
20796 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * cs-parser.jay: Add extra production for the second form of array
20799         creation. 
20800
20801         * expression.cs (ArrayCreation): Update to reflect the above
20802         change. 
20803
20804         * Small changes to prepare for Array initialization.
20805
20806 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20807
20808         * typemanager.cs (ImplementsInterface): interface might be null;
20809         Deal with this problem;
20810
20811         Also, we do store negative hits on the cache (null values), so use
20812         this instead of calling t.GetInterfaces on the type everytime.
20813
20814 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20815
20816         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20817
20818         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20819         split functionality out into different classes.
20820
20821         (New::FormArrayType): Move into NewBuiltinArray.
20822
20823         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20824         quite useless.
20825
20826         (NewBuiltinArray): New class to handle creation of built-in arrays.
20827
20828         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20829         account creation of one-dimensional arrays.
20830
20831         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20832
20833         (NewUserdefinedArray::DoResolve): Implement.
20834
20835         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20836
20837         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20838         we maintain inside the TypeManager. This is necessary to perform lookups on the
20839         module builder.
20840
20841         (LookupType): Update to perform GetType on the module builders too.     
20842
20843         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20844
20845         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20846
20847 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20848
20849         * expression.cs (New::DoResolve): Implement guts of array creation.
20850
20851         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20852
20853 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20854
20855         * expression.cs: Fix bug I introduced lsat night that broke
20856         Delegates. 
20857
20858         (Expression.Resolve): Report a 246 error (can not resolve name)
20859         if we find a SimpleName in the stream.
20860
20861         (Expression.ResolveLValue): Ditto.
20862
20863         (Expression.ResolveWithSimpleName): This function is a variant of
20864         ResolveName, this one allows SimpleNames to be returned without a
20865         warning.  The only consumer of SimpleNames is MemberAccess
20866
20867 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20868
20869         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20870         might arrive here.  I have my doubts that this is correct.
20871
20872         * statement.cs (Lock): Implement lock statement.
20873
20874         * cs-parser.jay: Small fixes to support `lock' and `using'
20875
20876         * cs-tokenizer.cs: Remove extra space
20877
20878         * driver.cs: New flag --checked, allows to turn on integer math
20879         checking. 
20880
20881         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20882         Threading.Monitor.Exit 
20883
20884 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20885
20886         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20887         Expression Class to be IndexerAccess.
20888
20889         Notice that Indexer::DoResolve sets the eclass to Value.
20890
20891 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20892
20893         * class.cs (TypeContainer::Emit): Emit code for indexers.
20894
20895         * assign.cs (IAssignMethod): New interface implemented by Indexers
20896         and Properties for handling assignment.
20897
20898         (Assign::Emit): Simplify and reuse code. 
20899
20900         * expression.cs (IndexerAccess, PropertyExpr): Implement
20901         IAssignMethod, clean up old code. 
20902
20903 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20904
20905         * typemanager.cs (ImplementsInterface): New method to determine if a type
20906         implements a given interface. Provides a nice cache too.
20907
20908         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20909         method.
20910
20911         (ConvertReferenceExplicit): Ditto.
20912
20913         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20914         various methods, with correct names etc.
20915
20916         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20917         Operator.UnaryNegation.
20918
20919         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20920         we have a unary plus or minus operator.
20921
20922         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20923         UnaryMinus.
20924
20925         * everywhere : update accordingly.
20926
20927         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20928         respectively.
20929
20930         * class.cs (Method::Define): For the case where we are implementing a method
20931         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20932         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20933
20934 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20935
20936         * interface.cs (FindMembers): Implement to work around S.R.E
20937         lameness.
20938
20939         * typemanager.cs (IsInterfaceType): Implement.
20940
20941         (FindMembers): Update to handle interface types too.
20942
20943         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20944         use IsAssignableFrom as that is not correct - it doesn't work.
20945
20946         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20947         and accordingly override EmitStatement.
20948
20949         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20950         using the correct logic :-)
20951
20952 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20953
20954         * ../errors/cs-11.cs : Add to demonstrate error -11 
20955
20956 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20957
20958         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20959         then pass this as a hint to ResolveLValue.
20960
20961         * expression.cs (FieldExpr): Add Location information
20962
20963         (FieldExpr::LValueResolve): Report assignment to readonly
20964         variable. 
20965
20966         (Expression::ExprClassFromMemberInfo): Pass location information.
20967
20968         (Expression::ResolveLValue): Add new method that resolves an
20969         LValue. 
20970
20971         (Expression::DoResolveLValue): Default invocation calls
20972         DoResolve. 
20973
20974         (Indexers): New class used to keep track of indexers in a given
20975         Type. 
20976
20977         (IStackStore): Renamed from LValue, as it did not really describe
20978         what this did.  Also ResolveLValue is gone from this interface and
20979         now is part of Expression.
20980
20981         (ElementAccess): Depending on the element access type
20982
20983         * typemanager.cs: Add `indexer_name_type' as a Core type
20984         (System.Runtime.CompilerServices.IndexerNameAttribute)
20985
20986         * statement.cs (Goto): Take a location.
20987
20988 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20989
20990         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20991         if two delegates are compatible.
20992
20993         (NewDelegate::DoResolve): Update to take care of the case when
20994         we instantiate a delegate from another delegate.
20995
20996         * typemanager.cs (FindMembers): Don't even try to look up members
20997         of Delegate types for now.
20998
20999 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21000
21001         * delegate.cs (NewDelegate): New class to take care of delegate
21002         instantiation.
21003
21004         * expression.cs (New): Split the delegate related code out into 
21005         the NewDelegate class.
21006
21007         * delegate.cs (DelegateInvocation): New class to handle delegate 
21008         invocation.
21009
21010         * expression.cs (Invocation): Split out delegate related code into
21011         the DelegateInvocation class.
21012
21013 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21014
21015         * expression.cs (New::DoResolve): Implement delegate creation fully
21016         and according to the spec.
21017
21018         (New::DoEmit): Update to handle delegates differently.
21019
21020         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21021         because of which we were printing out arguments in reverse order !
21022
21023         * delegate.cs (VerifyMethod): Implement to check if the given method
21024         matches the delegate.
21025
21026         (FullDelegateDesc): Implement.
21027
21028         (VerifyApplicability): Implement.
21029
21030         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21031         delegate invocations too.
21032
21033         (Invocation::Emit): Ditto.
21034
21035         * ../errors/cs1593.cs : Added.
21036
21037         * ../errors/cs1594.cs : Added.
21038
21039         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21040
21041 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21042
21043         * typemanager.cs (intptr_type): Core type for System.IntPtr
21044
21045         (InitCoreTypes): Update for the same.
21046
21047         (iasyncresult_type, asynccallback_type): Ditto.
21048
21049         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21050         correct.
21051
21052         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21053         too.
21054
21055         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21056         the builders for the 4 members of a delegate type :-)
21057
21058         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21059         type.
21060
21061         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21062
21063         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21064
21065 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21066
21067         * statement.cs (Break::Emit): Implement.   
21068         (Continue::Emit): Implement.
21069
21070         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21071         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21072         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21073         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21074         end loop
21075
21076         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21077         properties that track the label for the current loop (begin of the
21078         loop and end of the loop).
21079
21080 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21081
21082         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21083         use of emitting anything at all.
21084
21085         * class.cs, rootcontext.cs : Get rid of calls to the same.
21086
21087         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21088
21089         (Populate): Define the constructor correctly and set the implementation
21090         attributes.
21091
21092         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21093         have been defined.
21094
21095         (AddDelegateType): Implement.
21096
21097         (IsDelegateType): Implement helper method.
21098
21099         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21100
21101         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21102         and accordingly handle it.
21103
21104         * delegate.cs (Populate): Take TypeContainer argument.
21105         Implement bits to define the Invoke method. However, I still haven't figured out
21106         how to take care of the native int bit :-(
21107
21108         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21109         Qualify the name of the delegate, not its return type !
21110
21111         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21112         conversion.
21113
21114         (StandardConversionExists): Checking for array types turns out to be recursive.
21115
21116         (ConvertReferenceExplicit): Implement array conversion.
21117
21118         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21119
21120 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21121
21122         * cs-parser.jay (delegate_declaration): Store the fully qualified
21123         name as it is a type declaration.
21124
21125         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21126         readonly.
21127
21128         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21129         as TypeContainer::DefineType.
21130
21131         (Populate): Method in which all the definition of the various methods (Invoke)
21132         etc is done.
21133
21134         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21135         see.
21136
21137         (CloseDelegate): Finally creates the delegate.
21138
21139         * class.cs (TypeContainer::DefineType): Update to define delegates.
21140         (Populate, Emit and CloseType): Do the same thing here too.
21141
21142         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21143         delegates in all these operations.
21144
21145 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21146
21147         * expression.cs: LocalTemporary: a new expression used to
21148         reference a temporary that has been created.
21149
21150         * assign.cs: Handle PropertyAccess back here, so that we can
21151         provide the proper semantic access to properties.
21152
21153         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21154         a few more explicit conversions. 
21155
21156         * modifiers.cs: `NEW' modifier maps to HideBySig.
21157
21158         * expression.cs (PropertyExpr): Make this into an
21159         ExpressionStatement, and support the EmitStatement code path. 
21160
21161         Perform get/set error checking, clean up the interface.
21162
21163         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21164         them into toplevel access objects.
21165
21166 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21167
21168         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21169         SRE.
21170
21171         * typemanager.cs: Keep track here of our PropertyBuilders again to
21172         work around lameness in SRE.
21173
21174 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21175
21176         * expression.cs (LValue::LValueResolve): New method in the
21177         interface, used to perform a second resolution pass for LValues. 
21178
21179         (This::DoResolve): Catch the use of this in static methods.
21180
21181         (This::LValueResolve): Implement.
21182
21183         (This::Store): Remove warning, assigning to `this' in structures
21184         is 
21185
21186         (Invocation::Emit): Deal with invocation of
21187         methods on value types.  We need to pass the address to structure
21188         methods rather than the object itself.  (The equivalent code to
21189         emit "this" for structures leaves the entire structure on the
21190         stack instead of a pointer to it). 
21191
21192         (ParameterReference::DoResolve): Compute the real index for the
21193         argument based on whether the method takes or not a `this' pointer
21194         (ie, the method is static).
21195
21196         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21197         value types returned from functions when we need to invoke a
21198         method on the sturcture.
21199
21200
21201 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21202
21203         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21204         defining the type in the Modulebuilder or Typebuilder. This is to take
21205         care of nested types which need to be defined on the TypeBuilder using
21206         DefineNestedMethod.
21207
21208         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21209         methods in RootContext, only ported to be part of TypeContainer.
21210
21211         (TypeContainer::GetInterfaceOrClass): Ditto.
21212
21213         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21214
21215         * interface.cs (Interface::DefineInterface): New method. Does exactly
21216         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21217         too.
21218
21219         (Interface::GetInterfaces): Move from RootContext here and port.
21220
21221         (Interface::GetInterfaceByName): Same here.
21222
21223         * rootcontext.cs (ResolveTree): Re-write.
21224
21225         (PopulateTypes): Re-write.
21226
21227         * class.cs (TypeContainer::Populate): Populate nested types too.
21228         (TypeContainer::Emit): Emit nested members too.
21229
21230         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21231         instead just use the name argument passed in as it is already fully
21232         qualified.
21233
21234         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21235         to TypeContainer mapping to see if a type is user-defined.
21236
21237         * class.cs (TypeContainer::CloseType): Implement. 
21238
21239         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21240         the default constructor.
21241
21242         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21243         twice.
21244
21245         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21246
21247         * interface.cs (CloseType): Create the type here.
21248
21249         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21250         the hierarchy.
21251
21252         Remove all the methods which are now in TypeContainer.
21253
21254 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21255
21256         * delegate.cs (Define): Re-write bits to define the delegate
21257         correctly.
21258
21259 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21262
21263         * expression.cs (ImplicitReferenceConversion): handle null as well
21264         as a source to convert to any reference type.
21265
21266         * statement.cs (Return): Perform any implicit conversions to
21267         expected return type.  
21268
21269         Validate use of return statement.  
21270
21271         * codegen.cs (EmitContext): Pass the expected return type here.
21272
21273         * class.cs (Method, Constructor, Property): Pass expected return
21274         type to EmitContext.
21275
21276 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21277
21278         * expression.cs: Make DoResolve take an EmitContext instead of a
21279         TypeContainer.
21280
21281         Replaced `l' and `location' for `loc', for consistency.
21282
21283         (Error, Warning): Remove unneeded Tc argument.
21284
21285         * assign.cs, literal.cs, constant.cs: Update to new calling
21286         convention. 
21287
21288         * codegen.cs: EmitContext now contains a flag indicating whether
21289         code is being generated in a static method or not.
21290
21291         * cs-parser.jay: DecomposeQI, new function that replaces the old
21292         QualifiedIdentifier.  Now we always decompose the assembled
21293         strings from qualified_identifier productions into a group of
21294         memberaccesses.
21295
21296 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21297
21298         * rootcontext.cs: Deal with field-less struct types correctly now
21299         by passing the size option to Define Type.
21300
21301         * class.cs: Removed hack that created one static field. 
21302
21303 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21304
21305         * statement.cs: Moved most of the code generation here. 
21306
21307 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21308
21309         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21310         seem very right.
21311
21312         (ElementAccess): Remove useless bits for now - keep checks as the spec
21313         says.
21314
21315 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21316
21317         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21318         and start performing checks according to the spec.
21319
21320 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21321
21322         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21323         rank_specifiers instead.
21324
21325         (rank_specifiers): Change the order in which the rank specifiers are stored
21326
21327         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21328
21329         * expression.cs (ElementAccess): Implement the LValue interface too.
21330
21331 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21332
21333         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21334         except that user defined conversions are not included.
21335
21336         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21337         perform the conversion of the return type, if necessary.
21338
21339         (New::DoResolve): Check whether we are creating an array or an object
21340         and accordingly do the needful.
21341
21342         (New::Emit): Same here.
21343
21344         (New::DoResolve): Implement guts of array creation.
21345
21346         (New::FormLookupType): Helper function.
21347
21348 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21349
21350         * codegen.cs: Removed most of the code generation here, and move the
21351         corresponding code generation bits to the statement classes. 
21352
21353         Added support for try/catch/finalize and throw.
21354
21355         * cs-parser.jay: Added support for try/catch/finalize.
21356
21357         * class.cs: Catch static methods having the flags override,
21358         virtual or abstract.
21359
21360         * expression.cs (UserCast): This user cast was not really doing
21361         what it was supposed to do.  Which is to be born in fully resolved
21362         state.  Parts of the resolution were being performed at Emit time! 
21363
21364         Fixed this code.
21365
21366 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21367
21368         * expression.cs: Implicity convert the result from UserCast.
21369
21370 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21371
21372         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21373         prevented it from working correctly. 
21374
21375         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21376         merely ConvertImplicit.
21377
21378 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21379
21380         * typemanager.cs: Make the LookupTypeContainer function static,
21381         and not per-instance.  
21382
21383         * class.cs: Make static FindMembers (the one that takes a Type
21384         argument). 
21385
21386         * codegen.cs: Add EmitForeach here.
21387
21388         * cs-parser.jay: Make foreach a toplevel object instead of the
21389         inline expansion, as we need to perform semantic analysis on it. 
21390
21391 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21392
21393         * expression.cs (Expression::ImplicitUserConversion): Rename to
21394         UserDefinedConversion.
21395
21396         (Expression::UserDefinedConversion): Take an extra argument specifying 
21397         whether we look for explicit user conversions too.
21398
21399         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21400
21401         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21402
21403         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21404         with the appropriate arguments.
21405
21406         * cs-parser.jay (cast_expression): Record location too.
21407
21408         * expression.cs (Cast): Record location info.
21409
21410         (Expression::ConvertExplicit): Take location argument.
21411
21412         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21413         to determine if we are doing explicit conversions.
21414
21415         (UserCast::Emit): Update accordingly.
21416
21417         (Expression::ConvertExplicit): Report an error if everything fails.
21418
21419         * ../errors/cs0030.cs : Add.
21420
21421 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21422
21423         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21424         virtual and newslot bits. 
21425
21426         * class.cs (TypeContainer::RegisterRequiredImplementations):
21427         Record methods we need.
21428
21429         (TypeContainer::MakeKey): Helper function to make keys for
21430         MethodBases, since the Methodbase key is useless.
21431
21432         (TypeContainer::Populate): Call RegisterRequiredImplementations
21433         before defining the methods.   
21434
21435         Create a mapping for method_builders_to_methods ahead of time
21436         instead of inside a tight loop.
21437
21438         (::RequireMethods):  Accept an object as the data to set into the
21439         hashtable so we can report interface vs abstract method mismatch.
21440
21441 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21442
21443         * report.cs: Make all of it static.
21444
21445         * rootcontext.cs: Drop object_type and value_type computations, as
21446         we have those in the TypeManager anyways.
21447
21448         Drop report instance variable too, now it is a global.
21449
21450         * driver.cs: Use try/catch on command line handling.
21451
21452         Add --probe option to debug the error reporting system with a test
21453         suite. 
21454
21455         * report.cs: Add support for exiting program when a probe
21456         condition is reached.
21457
21458 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21459
21460         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21461         we do a forcible conversion regardless of type, to check if 
21462         ForceConversion returns a null.
21463
21464         (Binary::error19): Use location to report error.
21465
21466         (Unary::error23): Use location here too.
21467
21468         * ../errors/cs0019.cs : Check in.
21469
21470         * ../errors/cs0023.cs : Check in.
21471
21472         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21473         case of a non-null MethodInfo object with a length of 0 !
21474
21475         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21476         an applicable member - according to the spec :-)
21477         Also fix logic to find members in base types.
21478
21479         (Unary::ResolveOperator): Same here.
21480
21481         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21482         as I was getting thoroughly confused between this and error19 :-)
21483
21484         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21485         (::FindMostEncompassedType): Implement.
21486         (::FindMostEncompassingType): Implement.
21487         (::StandardConversionExists): Implement.
21488
21489         (UserImplicitCast): Re-vamp. We now need info about most specific
21490         source and target types so that we can do the necessary conversions.
21491
21492         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21493         mathematical union with no duplicates.
21494
21495 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21496
21497         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21498         in order from base classes to child classes, so that we can in
21499         child classes look up in our parent for method names and
21500         attributes (required for handling abstract, virtual, new, override
21501         constructs: we need to instrospect our base class, and if we dont
21502         populate the classes in order, the introspection might be
21503         incorrect.  For example, a method could query its parent before
21504         the parent has any methods and would determine that the parent has
21505         no abstract methods (while it could have had them)).
21506
21507         (RootContext::CreateType): Record the order in which we define the
21508         classes.
21509
21510 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21511
21512         * class.cs (TypeContainer::Populate): Also method definitions can
21513         fail now, keep track of this.
21514
21515         (TypeContainer::FindMembers): Implement support for
21516         DeclaredOnly/noDeclaredOnly flag.
21517
21518         (Constructor::Emit) Return the ConstructorBuilder.
21519
21520         (Method::Emit) Return the MethodBuilder. 
21521         Check for abstract or virtual methods to be public.
21522
21523         * rootcontext.cs (RootContext::CreateType): Register all the
21524         abstract methods required for the class to be complete and the
21525         interface methods that must be implemented. 
21526
21527         * cs-parser.jay: Report error 501 (method requires body if it is
21528         not marked abstract or extern).
21529
21530         * expression.cs (TypeOf::Emit): Implement.
21531
21532         * typemanager.cs: runtime_handle_type, new global type.
21533
21534         * class.cs (Property::Emit): Generate code for properties.
21535
21536 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21537
21538         * expression.cs (Unary::ResolveOperator): Find operators on base type
21539         too - we now conform exactly to the spec.
21540
21541         (Binary::ResolveOperator): Same here.
21542
21543         * class.cs (Operator::Define): Fix minor quirk in the tests.
21544
21545         * ../errors/cs0215.cs : Added.
21546
21547         * ../errors/cs0556.cs : Added.
21548
21549         * ../errors/cs0555.cs : Added.
21550
21551 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21552
21553         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21554         single integer which is really efficient
21555
21556 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21557
21558         *  expression.cs (Expression::ImplicitUserConversion): Use location
21559         even in the case when we are examining True operators.
21560  
21561         * class.cs (Operator::Define): Perform extensive checks to conform
21562         with the rules for operator overloading in the spec.
21563
21564         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21565         some of the other conversions mentioned in the spec.
21566
21567         * typemanager.cs (array_type): New static member for the System.Array built-in
21568         type.
21569
21570         (cloneable_interface): For System.ICloneable interface.
21571
21572         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21573         we start resolving the tree and populating types.
21574
21575         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21576  
21577 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * expression.cs (Expression::ExprClassFromMemberInfo,
21580         Expression::Literalize): Create literal expressions from
21581         FieldInfos which are literals.
21582
21583         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21584         type casts, because they were wrong.  The test suite in tests
21585         caught these ones.
21586
21587         (ImplicitNumericConversion): ushort to ulong requires a widening
21588         cast. 
21589
21590         Int32 constant to long requires widening cast as well.
21591
21592         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21593         for integers because the type on the stack is not i4.
21594
21595 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21596
21597         * expression.cs (report118): require location argument. 
21598
21599         * parameter.cs: Do not dereference potential null value.
21600
21601         * class.cs: Catch methods that lack the `new' keyword when
21602         overriding a name.  Report warnings when `new' is used without
21603         anything being there to override.
21604
21605         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21606
21607         * class.cs: Only add constructor to hashtable if it is non-null
21608         (as now constructors can fail on define).
21609
21610         (TypeManager, Class, Struct): Take location arguments.
21611
21612         Catch field instance initialization in structs as errors.
21613
21614         accepting_filter: a new filter for FindMembers that is static so
21615         that we dont create an instance per invocation.
21616
21617         (Constructor::Define): Catch errors where a struct constructor is
21618         parameterless 
21619
21620         * cs-parser.jay: Pass location information for various new
21621         constructs. 
21622
21623         * delegate.cs (Delegate): take a location argument.
21624
21625         * driver.cs: Do not call EmitCode if there were problesm in the
21626         Definition of the types, as many Builders wont be there. 
21627
21628         * decl.cs (Decl::Decl): Require a location argument.
21629
21630         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21631         into integers, and find the most appropiate integer for it.
21632
21633         * literal.cs: Implement ULongLiteral.
21634
21635         * rootcontext.cs: Provide better information about the location of
21636         failure when CreateType fails.
21637
21638 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21641         as well.
21642
21643         * expression.cs (Binary::CheckShiftArguments): Add missing type
21644         computation.
21645         (Binary::ResolveOperator): Add type to the logical and and logical
21646         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21647         before.
21648
21649         (Binary::DoNumericPromotions): In the case where either argument
21650         is ulong (and most signed types combined with ulong cause an
21651         error) perform implicit integer constant conversions as well.
21652
21653 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * expression.cs (UserImplicitCast): Method should always be
21656         non-null. 
21657         (Invocation::BetterConversion): Simplified test for IntLiteral.
21658
21659         (Expression::ImplicitNumericConversion): Split this routine out.
21660         Put the code that performs implicit constant integer conversions
21661         here. 
21662
21663         (Expression::Resolve): Become a wrapper around DoResolve so we can
21664         check eclass and type being set after resolve.
21665
21666         (Invocation::Badness): Remove this dead function
21667
21668         (Binary::ResolveOperator): Do not compute the expensive argumnets
21669         unless we have a union for it.
21670
21671         (Probe::Emit): Is needs to do an isinst and then
21672         compare against null.
21673
21674         (::CanConvert): Added Location argument.  If the Location argument
21675         is null (Location.Null), then we do not report errors.  This is
21676         used by the `probe' mechanism of the Explicit conversion.  We do
21677         not want to generate an error for something that the user
21678         explicitly requested to be casted.  But the pipeline for an
21679         explicit cast first tests for potential implicit casts.
21680
21681         So for now, if the Location is null, it means `Probe only' to
21682         avoid adding another argument.   Might have to revise this
21683         strategy later.
21684
21685         (ClassCast): New class used to type cast objects into arbitrary
21686         classes (used in Explicit Reference Conversions).
21687
21688         Implement `as' as well.
21689
21690         Reverted all the patches from Ravi below: they were broken:
21691
21692                 * The use of `level' as a mechanism to stop recursive
21693                   invocations is wrong.  That was there just to catch the
21694                   bug with a strack trace but not as a way of addressing
21695                   the problem.
21696
21697                   To fix the problem we have to *understand* what is going
21698                   on and the interactions and come up with a plan, not
21699                   just get things going.
21700
21701                 * The use of the type conversion cache that I proposed
21702                   last night had an open topic: How does this work across
21703                   protection domains.  A user defined conversion might not
21704                   be public in the location where we are applying the
21705                   conversion, a different conversion might be selected
21706                   (ie, private A->B (better) but public B->A (worse),
21707                   inside A, A->B applies, but outside it, B->A will
21708                   apply).
21709
21710                 * On top of that (ie, even if the above is solved),
21711                   conversions in a cache need to be abstract.  Ie, `To
21712                   convert from an Int to a Short use an OpcodeCast', not
21713                   `To convert from an Int to a Short use the OpcodeCast on
21714                   the variable 5' (which is what this patch was doing).
21715
21716 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21717
21718         * expression.cs (Invocation::ConversionExists): Re-write to use
21719         the conversion cache
21720
21721         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21722         cache all conversions done, not just user-defined ones.
21723
21724         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21725         to determine if a conversion exists instead of acutually trying to 
21726         perform the conversion. It's faster too.
21727
21728         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21729         and only then attempt the implicit conversion.
21730
21731 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21732
21733         * expression.cs (ConvertImplicit): Use a cache for conversions
21734         already found. Check level of recursion and bail out if necessary.
21735
21736 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21737
21738         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21739         Export standard methods that we expect for string operations.
21740
21741         * statement.cs (Block::UsageWarning): Track usage of variables and
21742         report the errors for not used variables.
21743
21744         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21745         operator. 
21746
21747 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * codegen.cs: remove unnneded code 
21750
21751         * expression.cs: Removed BuiltinTypeAccess class
21752
21753         Fix the order in which implicit conversions are
21754         done.  
21755
21756         The previous fixed dropped support for boxed conversions (adding a
21757         test to the test suite now)
21758
21759         (UserImplicitCast::CanConvert): Remove test for source being null,
21760         that code is broken.  We should not feed a null to begin with, if
21761         we do, then we should track the bug where the problem originates
21762         and not try to cover it up here.
21763
21764         Return a resolved expression of type UserImplicitCast on success
21765         rather than true/false.  Ravi: this is what I was talking about,
21766         the pattern is to use a static method as a "constructor" for
21767         objects. 
21768
21769         Also, do not create arguments until the very last minute,
21770         otherwise we always create the arguments even for lookups that
21771         will never be performed. 
21772
21773         (UserImplicitCast::Resolve): Eliminate, objects of type
21774         UserImplicitCast are born in a fully resolved state. 
21775
21776         * typemanager.cs (InitCoreTypes): Init also value_type
21777         (System.ValueType). 
21778
21779         * expression.cs (Cast::Resolve): First resolve the child expression.
21780
21781         (LValue): Add new method AddressOf to be used by
21782         the `&' operator.  
21783
21784         Change the argument of Store to take an EmitContext instead of an
21785         ILGenerator, because things like FieldExpr need to be able to call
21786         their children expression to generate the instance code. 
21787
21788         (Expression::Error, Expression::Warning): Sugar functions for
21789         reporting errors.
21790
21791         (Expression::MemberLookup): Accept a TypeContainer instead of a
21792         Report as the first argument.
21793
21794         (Expression::ResolvePrimary): Killed.  I still want to improve
21795         this as currently the code is just not right.
21796
21797         (Expression::ResolveMemberAccess): Simplify, but it is still
21798         wrong. 
21799
21800         (Unary::Resolve): Catch errors in AddressOf operators.
21801
21802         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21803         index to a byte for the short-version, or the compiler will choose
21804         the wrong Emit call, which generates the wrong data.
21805
21806         (ParameterReference::Emit, ::Store): same.
21807
21808         (FieldExpr::AddressOf): Implement.
21809
21810         * typemanager.cs: TypeManager: made public variable instead of
21811         property.
21812
21813         * driver.cs: document --fatal.
21814
21815         * report.cs (ErrorMessage, WarningMessage): new names for the old
21816         Error and Warning classes.
21817
21818         * cs-parser.jay (member_access): Turn built-in access to types
21819         into a normal simplename
21820
21821 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21822
21823         * expression.cs (Invocation::BetterConversion): Fix to cope
21824         with q being null, since this was introducing a bug.
21825
21826         * expression.cs (ConvertImplicit): Do built-in conversions first.
21827
21828 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21829
21830         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21831
21832 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21833
21834         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21835         I had introduced long ago (what's new ?).
21836
21837         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21838         the work of all the checking. 
21839         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21840         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21841
21842         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21843         that is the right way. 
21844
21845         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21846         overloading resolution. Use everywhere instead of cutting and pasting code.
21847
21848         (Binary::ResolveOperator): Use MakeUnionSet.
21849
21850         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21851         we have to convert to bool types. Not complete yet.
21852
21853 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21854
21855         * typemanager.cs (TypeManager::CSharpName): support ushort.
21856
21857         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21858         to provide an expression that performsn an implicit constant int
21859         conversion (section 6.1.6).
21860         (Expression::ConvertImplicitRequired): Reworked to include
21861         implicit constant expression conversions.
21862
21863         (Expression::ConvertNumericExplicit): Finished.
21864
21865         (Invocation::Emit): If InstanceExpression is null, then it means
21866         that we perform a call on this.
21867
21868 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * expression.cs (Unary::Emit): Remove some dead code.
21871         (Probe): Implement Resolve and Emit for `is'.
21872         (Expression::ConvertImplicitRequired): Attempt to do constant
21873         expression conversions here.  Maybe should be moved to
21874         ConvertImplicit, but I am not sure.
21875         (Expression::ImplicitLongConstantConversionPossible,
21876         Expression::ImplicitIntConstantConversionPossible): New functions
21877         that tell whether is it possible to apply an implicit constant
21878         expression conversion.
21879
21880         (ConvertNumericExplicit): Started work on explicit numeric
21881         conversions.
21882
21883         * cs-parser.jay: Update operator constants.
21884
21885         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21886         (Parameters::GetSignature): Hook up VerifyArgs here.
21887         (Parameters::VerifyArgs): Verifies that no two arguments have the
21888         same name. 
21889
21890         * class.cs (Operator): Update the operator names to reflect the
21891         ones that the spec expects (as we are just stringizing the
21892         operator names).
21893
21894         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21895         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21896         previous usage did only work for our methods.
21897         (Expression::ConvertImplicit): Handle decimal implicit numeric
21898         conversions as well.
21899         (Expression::InternalTypeConstructor): Used to invoke constructors
21900         on internal types for default promotions.
21901
21902         (Unary::Emit): Implement special handling for the pre/post
21903         increment/decrement for overloaded operators, as they need to have
21904         the same semantics as the other operators.
21905
21906         (Binary::ResolveOperator): ditto.
21907         (Invocation::ConversionExists): ditto.
21908         (UserImplicitCast::Resolve): ditto.
21909
21910 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21911
21912         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21913         operator, return after emitting body. Regression tests pass again !
21914
21915         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21916         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21917         (Invocation::OverloadResolve): Ditto.
21918         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21919
21920         * everywhere : update calls to the above methods accordingly.
21921
21922 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21923
21924         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21925
21926         * expression.cs (ExpressionStatement): New base class used for
21927         expressions that can appear in statements, so that we can provide
21928         an alternate path to generate expression that do not leave a value
21929         on the stack.
21930
21931         (Expression::Emit, and all the derivatives): We no longer return
21932         whether a value is left on the stack or not.  Every expression
21933         after being emitted leaves a single value on the stack.
21934
21935         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21936         facilties of ExpressionStatement if possible.
21937
21938         * cs-parser.jay: Update statement_expression.
21939
21940 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21941
21942         * driver.cs: Change the wording of message
21943
21944 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21945
21946         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21947         the type of the expression to the return type of the method if
21948         we have an overloaded operator match ! The regression tests pass again !
21949         (Unary::ResolveOperator): Ditto.
21950
21951         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21952         to find "op_Implicit", not "implicit" ;-)
21953         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21954         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21955
21956         * everywhere : Correct calls to the above accordingly.
21957
21958         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21959         (ConvertImplicit): Do user-defined conversion if it exists.
21960
21961 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21962
21963         * assign.cs: track location.
21964         (Resolve): Use implicit conversions on assignment.
21965
21966         * literal.cs: Oops.  Not good, Emit of short access values should
21967         pass (Bytes) or the wrong argument will be selected.
21968
21969         * expression.cs (Unary::Emit): Emit code for -expr.
21970
21971         (Unary::ResolveOperator): Handle `Substract' for non-constants
21972         (substract from zero from the non-constants).
21973         Deal with Doubles as well. 
21974
21975         (Expression::ConvertImplicitRequired): New routine that reports an
21976         error if no implicit conversion exists. 
21977
21978         (Invocation::OverloadResolve): Store the converted implicit
21979         expressions if we make them
21980
21981 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21982
21983         * class.cs (ConstructorInitializer): Take a Location argument.
21984         (ConstructorBaseInitializer): Same here.
21985         (ConstructorThisInitializer): Same here.
21986
21987         * cs-parser.jay : Update all calls accordingly.
21988
21989         * expression.cs (Unary, Binary, New): Take location argument.
21990         Update accordingly everywhere.
21991
21992         * cs-parser.jay : Update all calls to the above to take a location
21993         argument.
21994
21995         * class.cs : Ditto.
21996
21997 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21998
21999         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22000         (Invocation::BetterConversion): Same here
22001         (Invocation::ConversionExists): Ditto.
22002
22003         (Invocation::ConversionExists): Implement.
22004
22005 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22006
22007         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22008         Also take an additional TypeContainer argument.
22009
22010         * All over : Pass in TypeContainer as argument to OverloadResolve.
22011
22012         * typemanager.cs (CSharpName): Update to check for the string type and return
22013         that too.
22014
22015         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22016         a given method.
22017
22018 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22019
22020         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22021         (Invocation::BetterFunction): Implement.
22022         (Invocation::BetterConversion): Implement.
22023         (Invocation::ConversionExists): Skeleton, no implementation yet.
22024
22025         Okay, things work fine !
22026
22027 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * typemanager.cs: declare and load enum_type, delegate_type and
22030         void_type. 
22031
22032         * expression.cs (Expression::Emit): Now emit returns a value that
22033         tells whether a value is left on the stack or not.  This strategy
22034         might be reveted tomorrow with a mechanism that would address
22035         multiple assignments.
22036         (Expression::report118): Utility routine to report mismatches on
22037         the ExprClass.
22038
22039         (Unary::Report23): Report impossible type/operator combination
22040         utility function.
22041
22042         (Unary::IsIncrementableNumber): Whether the type can be
22043         incremented or decremented with add.
22044         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22045         complemented. 
22046         (Unary::ResolveOperator): Implement ++, !, ~,
22047
22048         (Invocation::Emit): Deal with new Emit convetion.
22049
22050         * All Expression derivatives: Updated their Emit method to return
22051         whether they leave values on the stack or not.
22052
22053         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22054         stack for expressions that are statements. 
22055
22056 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * expression.cs (LValue): New interface.  Must be implemented by
22059         LValue objects.
22060         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22061         LValue interface.
22062
22063         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22064         interface for generating code, simplifies the code.
22065
22066 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22067
22068         * expression.cs (everywhere): Comment out return statements in ::Resolve
22069         methods to avoid the warnings.
22070
22071 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22072
22073         * driver.cs (parse): Report error 2001 if we can not open the
22074         source file.
22075
22076         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22077         not resolve it.
22078
22079         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22080         object. 
22081
22082         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22083         otherwise nested blocks end up with the same index.
22084
22085         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22086
22087         * expression.cs:  Instead of having FIXMEs in the Resolve
22088         functions, throw exceptions so it is obvious that we are facing a
22089         bug. 
22090
22091         * cs-parser.jay (invocation_expression): Pass Location information.
22092
22093         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22094         Use a basename for those routines because .NET does not like paths
22095         on them. 
22096
22097         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22098         already defined.
22099
22100 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22101
22102         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22103         are loading the correct data types (throws an exception if not).
22104         (TypeManager::InitCoreTypes): Use CoreLookupType
22105
22106         * expression.cs (Unary::ResolveOperator): return the child
22107         expression for expressions which are just +expr.
22108         (Unary::ResolveOperator): Return negative literals for -LITERAL
22109         expressions (otherwise they are Unary {Literal}).
22110         (Invocation::Badness): Take into account `Implicit constant
22111         expression conversions'.
22112
22113         * literal.cs (LongLiteral): Implement long literal class.
22114         (IntLiteral): export the `Value' of the intliteral. 
22115
22116 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22117
22118         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22119
22120         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22121         instead of 'Operator'
22122
22123         * expression.cs (Binary::ResolveOperator): Update accordingly.
22124         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22125         and 'Minus'
22126
22127         * cs-parser.jay (unary_expression): Update to use the new names.
22128
22129         * gen-treedump.cs (GetUnary): Same here.
22130
22131         * expression.cs (Unary::Resolve): Implement.
22132         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22133         operators are found instead of making noise ;-)
22134         (Unary::ResolveOperator): New method to do precisely the same thing which
22135         Binary::ResolveOperator does for Binary expressions.
22136         (Unary.method, .Arguments): Add.
22137         (Unary::OperName): Implement.   
22138         (Unary::ForceConversion): Copy and Paste !
22139
22140         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22141         a unary operator.
22142
22143         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22144         for the inbuilt operators. Only overloading works for now ;-)
22145
22146 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22147
22148         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22149         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22150
22151         * expression.cs (This::Emit): Implement. 
22152         (This::Resolve): Implement.
22153         (TypeOf:Resolve): Implement.
22154         (Expression::ResolveSimpleName): Add an implicit this to instance
22155         field references. 
22156         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22157         Bind instance variable to Field expressions.
22158         (FieldExpr::Instance): New field used to track the expression that
22159         represents the object instance.
22160         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22161         binding 
22162         (FieldExpr::Emit): Implement.
22163
22164         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22165         the last instruction contains a return opcode to avoid generating
22166         the last `ret' instruction (this generates correct code, and it is
22167         nice to pass the peverify output).
22168
22169         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22170         initializer for static and instance variables.
22171         (Constructor::Emit): Allow initializer to be null in the case of
22172         static constructors.  Only emit initializer for instance
22173         constructors. 
22174
22175         (TypeContainer::FindMembers): Return a null array if there are no
22176         matches.
22177
22178         Also fix the code for the MemberTypes.Method branch, as it was not
22179         scanning that for operators (or tried to access null variables before).
22180
22181         * assign.cs (Assign::Emit): Handle instance and static fields. 
22182
22183         * TODO: Updated.
22184
22185         * driver.cs: Stop compilation if there are parse errors.
22186
22187         * cs-parser.jay (constructor_declaration): Provide default base
22188         initializer for non-static constructors.
22189         (constructor_declarator): Do not provide a default base
22190         initializers if none was specified.
22191         Catch the fact that constructors should not have parameters.
22192
22193         * class.cs: Do not emit parent class initializers for static
22194         constructors, that should be flagged as an error.
22195
22196 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22197
22198         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22199         Move back code into TypeContainer::Populate.
22200
22201 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22202
22203         * class.cs (TypeContainer::AddConstructor): Fix the check to
22204         compare against Name, not Basename. 
22205         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22206
22207         * cs-parser.jay : Update accordingly.
22208
22209         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22210         for methods, don't forget to look into the operators too.
22211         (RegisterMethodBuilder): Helper method to take care of this for
22212         methods, constructors and operators.
22213         (Operator::Define): Completely revamp.
22214         (Operator.OperatorMethod, MethodName): New fields.
22215         (TypeContainer::Populate): Move the registering of builders into
22216         RegisterMethodBuilder.
22217         (Operator::Emit): Re-write.
22218
22219         * expression.cs (Binary::Emit): Comment out code path to emit method
22220         invocation stuff for the case when we have a user defined operator. I am
22221         just not able to get it right !
22222
22223 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22224
22225         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22226         argument. 
22227
22228         (Expression::MemberLookup): Provide a version that allows to
22229         specify the MemberTypes and BindingFlags. 
22230
22231         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22232         so it was not fetching variable information from outer blocks.
22233
22234         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22235         Beforefieldinit as it was buggy.
22236
22237         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22238         that Ravi put here.  
22239
22240         * class.cs (Constructor::Emit): Only emit if block is not null.
22241         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22242         deal with this by semantically definining it as if the user had
22243         done it.
22244
22245         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22246         constructors as we now "emit" them at a higher level.
22247
22248         (TypeContainer::DefineDefaultConstructor): Used to define the
22249         default constructors if none was provided.
22250
22251         (ConstructorInitializer): Add methods Resolve and Emit. 
22252
22253         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22254
22255 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22256
22257         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22258         the default constructor builder with our hashtable for methodbuilders
22259         to methodcores.
22260
22261         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22262         and argument_count is 0 in which case we have a match.
22263         (Binary::ResolveOperator): More null checking and miscellaneous coding
22264         style cleanup.
22265
22266 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22267
22268         * rootcontext.cs (IsNameSpace): Compare against null.
22269
22270         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22271
22272         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22273         and Unary::Operator.
22274
22275         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22276         accordingly.
22277
22278         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22279         we have overloaded operators.
22280         (Binary::ResolveOperator): Implement the part which does the operator overload
22281         resolution.
22282
22283         * class.cs (Operator::Emit): Implement.
22284         (TypeContainer::Emit): Emit the operators we have too.
22285
22286         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22287         the case when we have a user-defined operator.
22288
22289 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22290
22291         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22292
22293 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22294
22295         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22296         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22297         (Constructor::Emit): Implement.
22298         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22299         if we have no work to do. 
22300         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22301         Emit method.
22302
22303         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22304         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22305
22306         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22307         of parent.parent.
22308
22309 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22310
22311         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22312         in the source.
22313         (Tree::RecordNamespace): Method to do what the name says ;-)
22314         (Tree::Namespaces): Property to get at the namespaces hashtable.
22315
22316         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22317         keep track.
22318
22319         * rootcontext.cs (IsNamespace): Fixed it :-)
22320
22321 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22322
22323         * class.cs (TypeContainer::FindMembers): Add support for
22324         constructors. 
22325         (MethodCore): New class that encapsulates both the shared aspects
22326         of a Constructor and a Method.  
22327         (Method, Constructor): Factored pieces into MethodCore.
22328
22329         * driver.cs: Added --fatal which makes errors throw exceptions.
22330         Load System assembly as well as part of the standard library.
22331
22332         * report.cs: Allow throwing exceptions on errors for debugging.
22333
22334         * modifiers.cs: Do not use `parent', instead use the real type
22335         container to evaluate permission settings.
22336
22337         * class.cs: Put Ravi's patch back in.  He is right, and we will
22338         have to cope with the
22339
22340 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22341
22342         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22343         FamORAssem, not FamANDAssem.
22344
22345 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22346
22347         * driver.cs: Added --parse option that only parses its input files
22348         and terminates.
22349
22350         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22351         incorrect.  IsTopLevel is not used to tell whether an object is
22352         root_types or not (that can be achieved by testing this ==
22353         root_types).  But to see if this is a top-level *class* (not
22354         necessarly our "toplevel" container). 
22355
22356 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22357
22358         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22359         parent instead of a direct call to GetType.
22360
22361 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22362
22363         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22364         Modifiers.TypeAttr. This should just be a call to that method.
22365
22366         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22367         object so that we can determine if we are top-level or not.
22368
22369         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22370         TypeContainer too.
22371
22372         * enum.cs (Enum::Define): Ditto.
22373
22374         * modifiers.cs (FieldAttr): Re-write.
22375
22376         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22377         (TypeContainer::HaveStaticConstructor): New property to provide access
22378         to precisely that info.
22379
22380         * modifiers.cs (MethodAttr): Re-write.
22381         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22382
22383         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22384         of top-level types as claimed.
22385
22386 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22387
22388         * expression.cs (MemberLookup): Fruitless attempt to lookup
22389         constructors.  Maybe I need to emit default constructors?  That
22390         might be it (currently .NET emits this for me automatically).
22391         (Invocation::OverloadResolve): Cope with Arguments == null.
22392         (Invocation::EmitArguments): new function, shared by the new
22393         constructor and us.
22394         (Invocation::Emit): Handle static and instance methods.  Emit
22395         proper call instruction for virtual or non-virtual invocations.
22396         (New::Emit): Implement.
22397         (New::Resolve): Implement.
22398         (MemberAccess:Resolve): Implement.
22399         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22400         to track instances.
22401         (FieldExpr::Resolve): Set type.
22402
22403         * support.cs: Handle empty arguments.
22404                 
22405         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22406         SimpleLookup): Auxiliary routines to help parse a qualifier
22407         identifier.  
22408
22409         Update qualifier_identifier rule.
22410
22411         * codegen.cs: Removed debugging messages.
22412
22413         * class.cs: Make this a global thing, this acts just as a "key" to
22414         objects that we might have around.
22415
22416         (Populate): Only initialize method_builders_to_methods once.
22417
22418         * expression.cs (PropertyExpr): Initialize type from the
22419         PropertyType. 
22420
22421         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22422         Resolve pattern.  Attempt to implicitly convert value to boolean.
22423         Emit code.
22424
22425         * expression.cs: Set the type for the int32/int32 argument case.
22426         (Binary::ResolveOperator): Set the return type to boolean for
22427         comparission operators
22428
22429         * typemanager.cs: Remove debugging print code.
22430
22431         (Invocation::Resolve): resolve type.
22432
22433         * class.cs: Allocate a MemberInfo of the correct size, as the code
22434         elsewhere depends on the test to reflect the correct contents.
22435
22436         (Method::) Keep track of parameters, due to System.Reflection holes
22437
22438         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22439         mapping here.
22440
22441         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22442         of the exact size and return that.
22443
22444         (Class::LookupMethodByBuilder): New function that maps
22445         MethodBuilders to its methods.  Required to locate the information
22446         on methods because System.Reflection bit us again.
22447
22448         * support.cs: New file, contains an interface ParameterData and
22449         two implementations: ReflectionParameters and InternalParameters
22450         used to access Parameter information.  We will need to grow this
22451         as required.
22452
22453         * expression.cs (Invocation::GetParameterData): implement a cache
22454         and a wrapper around the ParameterData creation for methods. 
22455         (Invocation::OverloadResolve): Use new code.
22456
22457 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22458
22459         * class.cs (TypeContainer::EmitField): Remove and move into 
22460         (Field::Define): here and modify accordingly.
22461         (Field.FieldBuilder): New member.
22462         (TypeContainer::Populate): Update accordingly.
22463         (TypeContainer::FindMembers): Implement.
22464
22465 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * statement.cs: (VariableInfo::VariableType): New field to be
22468         initialized with the full type once it is resolved. 
22469
22470 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22471
22472         * parameter.cs (GetParameterInfo): Use a type cache to compute
22473         things only once, and to reuse this information
22474
22475         * expression.cs (LocalVariableReference::Emit): Implement.
22476         (OpcodeCast::Emit): fix.
22477
22478         (ParameterReference::Resolve): Implement.
22479         (ParameterReference::Emit): Implement.
22480
22481         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22482         that are expressions need to stay as Expressions.
22483
22484         * typemanager.cs (CSharpName): Returns the C# name of a type if
22485         possible. 
22486
22487         * expression.cs (Expression::ConvertImplicit): New function that
22488         implements implicit type conversions.
22489
22490         (Expression::ImplicitReferenceConversion): Implements implicit
22491         reference conversions.
22492
22493         (EmptyCast): New type for transparent casts.
22494
22495         (OpcodeCast): New type for casts of types that are performed with
22496         a sequence of bytecodes.
22497
22498         (BoxedCast): New type used for casting value types into reference
22499         types.  Emits a box opcode.
22500
22501         (Binary::DoNumericPromotions): Implements numeric promotions of
22502         and computation of the Binary::Type.
22503
22504         (Binary::EmitBranchable): Optimization.
22505
22506         (Binary::Emit): Implement code emission for expressions.
22507
22508         * typemanager.cs (TypeManager): Added two new core types: sbyte
22509         and byte.
22510
22511 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22512
22513         * class.cs (TypeContainer::FindMembers): Method which does exactly
22514         what Type.FindMembers does, only we don't have to use reflection. No
22515         implementation yet.
22516
22517         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22518         typecontainer objects as we need to get at them.
22519         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22520
22521         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22522         typecontainer object.
22523
22524         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22525         of just a Report object.
22526
22527 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22528
22529         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22530         "remove_"
22531         (TypeContainer::Populate): Now define the delegates of the type too.
22532         (TypeContainer.Delegates): Property to access the list of delegates defined
22533         in the type.
22534
22535         * delegates.cs (Delegate::Define): Implement partially.
22536
22537         * modifiers.cs (TypeAttr): Handle more flags.
22538
22539 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22540
22541         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22542         and not <=
22543         (Operator::Define): Re-write logic to get types by using the LookupType method
22544         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22545         (Indexer::Define): Ditto.
22546         (Event::Define): Ditto.
22547         (Property::Define): Ditto.
22548
22549 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22550
22551         * class.cs (TypeContainer::Populate): Now define operators too. 
22552         (TypeContainer.Operators): New property to access the list of operators
22553         in a type.
22554         (Operator.OperatorMethodBuilder): New member to hold the method builder
22555         for the operator we are defining.
22556         (Operator::Define): Implement.
22557
22558 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22559
22560         * class.cs (Event::Define): Make the prefixes of the accessor methods
22561         addOn_ and removeOn_ 
22562
22563         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22564         of the location being passed in too. Ideally, this should go later since all
22565         error reporting should be done through the Report object.
22566
22567         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22568         (Populate): Iterate thru the indexers we have and define them too.
22569         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22570         for the get and set accessors.
22571         (Indexer::Define): Implement.
22572
22573 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22576         my previous implementation, did not work.
22577
22578         * typemanager.cs: Add a couple of missing types (the longs).
22579
22580         * literal.cs: Use TypeManager.bool_type instead of getting it.
22581
22582         * expression.cs (EventExpr): New kind of expressions.
22583         (Expressio::ExprClassFromMemberInfo): finish
22584
22585 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22586
22587         * assign.cs: Emit stores to static fields differently.
22588
22589 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22590
22591         * Merge in changes and adjust code to tackle conflicts. Backed out my
22592         code in Assign::Resolve ;-) 
22593
22594 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22595
22596         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22597         instead Report.Error and also pass in the location.
22598         (CSharpParser::Lexer): New readonly property to return the reference
22599         to the Tokenizer object.
22600         (declare_local_variables): Use Report.Error with location instead of plain 
22601         old error.
22602         (CheckDef): Ditto.
22603
22604         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22605         (Operator.CheckBinaryOperator): Ditto.
22606
22607         * cs-parser.jay (operator_declarator): Update accordingly.
22608
22609         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22610         (CheckBinaryOperator): Same here.
22611
22612         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22613         on the name without any prefixes of namespace names etc. This is because we
22614         already might have something already fully qualified like 
22615         'System.Console.WriteLine'
22616
22617         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22618
22619 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22620
22621         * cs-tokenizer.cs (location): Return a string which also contains
22622         the file name.
22623
22624         * expression.cs (ElementAccess): New class for expressions of the
22625         type 'element access.'
22626         (BaseAccess): New class for expressions of the type 'base access.'
22627         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22628         respectively.
22629
22630         * cs-parser.jay (element_access): Implement action.
22631         (base_access): Implement actions.
22632         (checked_expression, unchecked_expression): Implement.
22633
22634         * cs-parser.jay (local_variable_type): Correct and implement.
22635         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22636
22637         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22638
22639         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22640         name and the specifiers.
22641
22642         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22643
22644         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22645         making them all public ;-)
22646
22647         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22648         class anyways.
22649
22650 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22651
22652         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22653         PropertyExprs.
22654         (FieldExpr, PropertyExprs): New resolved expressions.
22655         (SimpleName::MemberStaticCheck): Perform static checks for access
22656         to non-static fields on static methods. Maybe this should be
22657         generalized for MemberAccesses. 
22658         (SimpleName::ResolveSimpleName): More work on simple name
22659         resolution. 
22660
22661         * cs-parser.jay (primary_expression/qualified_identifier): track
22662         the parameter index.
22663
22664         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22665         (EmitContext::EmitBoolExpression): Chain to expression generation
22666         instead of temporary hack.
22667         (::EmitStatementExpression): Put generic expression code generation.
22668
22669         * assign.cs (Assign::Emit): Implement variable assignments to
22670         local variables, parameters and fields.
22671
22672 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22673
22674         * statement.cs (Block::GetVariableInfo): New method, returns the
22675         VariableInfo for a variable name in a block.
22676         (Block::GetVariableType): Implement in terms of GetVariableInfo
22677
22678         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22679         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22680
22681 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22682
22683         * cs-parser.jay (operator_declaration): Continue on my quest : update
22684         to take attributes argument.
22685         (event_declaration): Ditto.
22686         (enum_declaration): Ditto.
22687         (indexer_declaration): Ditto.
22688
22689         * class.cs (Operator::Operator): Update constructor accordingly.
22690         (Event::Event): Ditto.
22691
22692         * delegate.cs (Delegate::Delegate): Same here.
22693
22694         * enum.cs (Enum::Enum): Same here.
22695
22696 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22697
22698         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22699
22700         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22701
22702         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22703         being passed around as an arraylist.
22704         (Attributes::AddAttribute): Method to add attribute sections.
22705
22706         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22707         (struct_declaration): Update accordingly.
22708         (constant_declaration): Update.
22709         (field_declaration): Update.
22710         (method_header): Update.
22711         (fixed_parameter): Update.
22712         (parameter_array): Ditto.
22713         (property_declaration): Ditto.
22714         (destructor_declaration): Ditto.
22715
22716         * class.cs (Struct::Struct): Update constructors accordingly.
22717         (Class::Class): Ditto.
22718         (Field::Field): Ditto.
22719         (Method::Method): Ditto.
22720         (Property::Property): Ditto.
22721         (TypeContainer::OptAttribute): update property's return type.
22722
22723         * interface.cs (Interface.opt_attributes): New member.
22724         (Interface::Interface): Update to take the extra Attributes argument.
22725
22726         * parameter.cs (Parameter::Parameter): Ditto.
22727
22728         * constant.cs (Constant::Constant): Ditto.
22729
22730         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22731         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22732         the attributes as a parameter.
22733         (InterfaceProperty): Update constructor call.
22734         (InterfaceEvent): Ditto.
22735         (InterfaceMethod): Ditto.
22736         (InterfaceIndexer): Ditto.
22737
22738         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22739         pass the attributes too.
22740         (interface_event_declaration): Ditto.
22741         (interface_property_declaration): Ditto.
22742         (interface_method_declaration): Ditto.
22743         (interface_declaration): Ditto.
22744
22745 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22746
22747         * class.cs (Method::Define): Track the "static Main" definition to
22748         create an entry point. 
22749
22750         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22751         EntryPoint if we find it. 
22752
22753         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22754         (EmitContext::ig): Make this variable public.
22755
22756         * driver.cs: Make the default output file be the first file name
22757         with the .exe extension.  
22758
22759         Detect empty compilations
22760
22761         Handle various kinds of output targets.  Handle --target and
22762         rename -t to --dumper.
22763
22764         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22765         methods inherited from Expression return now an Expression.  This
22766         will is used during the tree rewriting as we resolve them during
22767         semantic analysis.
22768
22769         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22770         the spec.  Missing entirely is the information about
22771         accessability of elements of it.
22772
22773         (Expression::ExprClassFromMemberInfo): New constructor for
22774         Expressions that creates a fully initialized Expression based on
22775         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22776         a Type.
22777
22778         (Invocation::Resolve): Begin implementing resolution of invocations.
22779
22780         * literal.cs (StringLiteral):  Implement Emit.
22781
22782 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22783
22784         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22785         member.
22786
22787 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22788
22789         * cs-parser.jay (attribute_arguments): Implement actions.
22790         (attribute): Fix bug in production. Implement action.
22791         (attribute_list): Implement.
22792         (attribute_target): Implement.
22793         (attribute_target_specifier, opt_target_specifier): Implement
22794         (CheckAttributeTarget): New method to check if the attribute target
22795         is valid.
22796         (attribute_section): Implement.
22797         (opt_attributes): Implement.
22798
22799         * attribute.cs : New file to handle attributes.
22800         (Attribute): Class to hold attribute info.
22801
22802         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22803         (attribute_section): Modify production to use 2 different rules to 
22804         achieve the same thing. 1 s/r conflict down !
22805         Clean out commented, useless, non-reducing dimension_separator rules.
22806
22807         * class.cs (TypeContainer.attributes): New member to hold list
22808         of attributes for a type.
22809         (Struct::Struct): Modify to take one more argument, the attribute list.
22810         (Class::Class): Ditto.
22811         (Field::Field): Ditto.
22812         (Method::Method): Ditto.
22813         (Property::Property): Ditto.
22814
22815         * cs-parser.jay (struct_declaration): Update constructor call to
22816         pass in the attributes too.
22817         (class_declaration): Ditto.
22818         (constant_declaration): Ditto.
22819         (field_declaration): Ditto.
22820         (method_header): Ditto.
22821         (fixed_parameter): Ditto.
22822         (parameter_array): Ditto.
22823         (property_declaration): Ditto.
22824
22825         * constant.cs (Constant::Constant): Update constructor similarly.
22826         Use System.Collections.
22827
22828         * parameter.cs (Parameter::Parameter): Update as above.
22829
22830 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22831
22832         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22833         (TypeContainer.delegates): New member to hold list of delegates.
22834
22835         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22836         this time as I seem to be on crack ;-)
22837
22838 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22841         tell whether an identifier represents a namespace.
22842
22843         * expression.cs (NamespaceExpr): A namespace expression, used only
22844         temporarly during expression resolution.
22845         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22846         utility functions to resolve names on expressions.
22847
22848 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22849
22850         * codegen.cs: Add hook for StatementExpressions. 
22851
22852         * class.cs: Fix inverted test for static flag in methods.
22853
22854 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22855
22856         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22857         to make it coincide with MS' number.
22858         (Operator::CheckBinaryOperator): Ditto.
22859
22860         * ../errors/errors.txt : Remove error numbers added earlier.
22861
22862         * ../errors/cs1019.cs : Test case for error # 1019
22863
22864         * ../errros/cs1020.cs : Test case for error # 1020
22865
22866         * cs-parser.jay : Clean out commented cruft.
22867         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22868         used anywhere - non-reducing rule.
22869         (namespace_declarations): Non-reducing rule - comment out.
22870
22871         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22872         with TypeContainer::AddEnum.
22873
22874         * delegate.cs : New file for delegate handling classes.
22875         (Delegate): Class for declaring delegates.
22876
22877         * makefile : Update.
22878
22879         * cs-parser.jay (delegate_declaration): Implement.
22880
22881 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22882
22883         * class.cs (Event::Define): Implement.
22884         (Event.EventBuilder): New member.
22885
22886         * class.cs (TypeContainer::Populate): Update to define all enums and events
22887         we have.
22888         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22889         readonly fields for all these cases ?
22890
22891 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22892
22893         * class.cs (Property): Revamp to use the convention of making fields readonly.
22894         Accordingly modify code elsewhere.
22895
22896         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22897         the Define method of the Property class.
22898
22899         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22900         trivial bug.
22901         (TypeContainer::Populate): Update to define all the properties we have. Also
22902         define all enumerations.
22903
22904         * enum.cs (Define): Implement.
22905
22906 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22907
22908         * cs-parser.jay (overloadable_operator): The semantic value is an
22909         enum of the Operator class.
22910         (operator_declarator): Implement actions.
22911         (operator_declaration): Implement.
22912
22913         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22914         validity of definitions.
22915         (Operator::CheckBinaryOperator): Static method to check for binary operators
22916         (TypeContainer::AddOperator): New method to add an operator to a type.
22917
22918         * cs-parser.jay (indexer_declaration): Added line to actually call the
22919         AddIndexer method so it gets added ;-)
22920
22921         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22922         already taken care of by the MS compiler ?  
22923
22924 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22925
22926         * class.cs (Operator): New class for operator declarations.
22927         (Operator::OpType): Enum for the various operators.
22928
22929 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22930
22931         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22932         ostensibly handle this in semantic analysis.
22933
22934         * cs-parser.jay (general_catch_clause): Comment out
22935         (specific_catch_clauses, specific_catch_clause): Ditto.
22936         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22937         (catch_args, opt_catch_args): New productions.
22938         (catch_clause): Rewrite to use the new productions above
22939         (catch_clauses): Modify accordingly.
22940         (opt_catch_clauses): New production to use in try_statement
22941         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22942         and re-write the code in the actions to extract the specific and
22943         general catch clauses by being a little smart ;-)
22944
22945         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22946         Hooray, try and catch statements parse fine !
22947
22948 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22949
22950         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22951         string from the hashtable of variables.
22952
22953         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22954         I end up making that mistake ;-)
22955         (catch_clauses): Fixed gross error which made Key and Value of the 
22956         DictionaryEntry the same : $1 !!
22957
22958 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22959
22960         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22961
22962         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22963         when the add and remove accessors are specified. 
22964
22965 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22966
22967         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22968         information about indexer_declarator.
22969         (indexer_declarator): Implement actions.
22970         (parsing_indexer): New local boolean used to keep track of whether
22971         we are parsing indexers or properties. This is necessary because 
22972         implicit_parameters come into picture even for the get accessor in the 
22973         case of an indexer.
22974         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22975
22976         * class.cs (Indexer): New class for indexer declarations.
22977         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22978         (TypeContainer::indexers): New member to hold list of indexers for the
22979         type.
22980
22981 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22982
22983         * cs-parser.jay (add_accessor_declaration): Implement action.
22984         (remove_accessor_declaration): Implement action.
22985         (event_accessors_declaration): Implement
22986         (variable_declarators): swap statements for first rule - trivial.
22987
22988         * class.cs (Event): New class to hold information about event
22989         declarations.
22990         (TypeContainer::AddEvent): New method to add an event to a type
22991         (TypeContainer::events): New member to hold list of events.
22992
22993         * cs-parser.jay (event_declaration): Implement actions.
22994
22995 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22996
22997         * cs-parser.jay (dim_separators): Implement. Make it a string
22998         concatenating all the commas together, just as they appear.
22999         (opt_dim_separators): Modify accordingly
23000         (rank_specifiers): Update accordingly. Basically do the same
23001         thing - instead, collect the brackets here.
23002         (opt_rank_sepcifiers): Modify accordingly.
23003         (array_type): Modify to actually return the complete type string
23004         instead of ignoring the rank_specifiers.
23005         (expression_list): Implement to collect the expressions
23006         (variable_initializer): Implement. We make it a list of expressions
23007         essentially so that we can handle the array_initializer case neatly too.
23008         (variable_initializer_list): Implement.
23009         (array_initializer): Make it a list of variable_initializers
23010         (opt_array_initializer): Modify accordingly.
23011
23012         * expression.cs (New::NType): Add enumeration to help us
23013         keep track of whether we have an object/delegate creation
23014         or an array creation.
23015         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23016         members to hold data about array creation.
23017         (New:New): Modify to update NewType
23018         (New:New): New Overloaded contructor for the array creation
23019         case.
23020
23021         * cs-parser.jay (array_creation_expression): Implement to call
23022         the overloaded New constructor.
23023
23024 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23025
23026         * class.cs (TypeContainer::Constructors): Return member
23027         constructors instead of returning null.
23028
23029 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23030
23031         * typemanager.cs (InitCoreTypes): Initialize the various core
23032         types after we have populated the type manager with the user
23033         defined types (this distinction will be important later while
23034         compiling corlib.dll)
23035
23036         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23037         on Expression Classification.  Now all expressions have a method
23038         `Resolve' and a method `Emit'.
23039
23040         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23041         generation from working.     Also add some temporary debugging
23042         code. 
23043
23044 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23045
23046         * codegen.cs: Lots of code generation pieces.  This is only the
23047         beginning, will continue tomorrow with more touches of polish.  We
23048         handle the fundamentals of if, while, do, for, return.  Others are
23049         trickier and I need to start working on invocations soon.
23050
23051         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23052         s.InitStatement. 
23053
23054         * codegen.cs (EmitContext): New struct, used during code
23055         emission to keep a context.   Most of the code generation will be
23056         here. 
23057
23058         * cs-parser.jay: Add embedded blocks to the list of statements of
23059         this block.  So code generation proceeds in a top down fashion.
23060
23061 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23062
23063         * statement.cs: Add support for multiple child blocks.
23064
23065 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23066
23067         * codegen.cs (EmitCode): New function, will emit the code for a
23068         Block of code given a TypeContainer and its ILGenerator. 
23069
23070         * statement.cs (Block): Standard public readonly optimization.
23071         (Block::Block constructors): Link children. 
23072         (Block::Child): Child Linker.
23073         (Block::EmitVariables): Emits IL variable declarations.
23074
23075         * class.cs: Drop support for MethodGroups here, delay until
23076         Semantic Analysis.
23077         (Method::): Applied the same simplification that I did before, and
23078         move from Properties to public readonly fields.
23079         (Method::ParameterTypes): Returns the parameter types for the
23080         function, and implements a cache that will be useful later when I
23081         do error checking and the semantic analysis on the methods is
23082         performed.
23083         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23084         and made a method, optional argument tells whether this is a class
23085         or a structure to apply the `has-this' bit.
23086         (Method::GetCallingConvention): Implement, returns the calling
23087         convention. 
23088         (Method::Define): Defines the type, a second pass is performed
23089         later to populate the methods.
23090
23091         (Constructor::ParameterTypes): implement a cache similar to the
23092         one on Method::ParameterTypes, useful later when we do semantic
23093         analysis. 
23094
23095         (TypeContainer::EmitMethod):  New method.  Emits methods.
23096
23097         * expression.cs: Removed MethodGroup class from here.
23098
23099         * parameter.cs (Parameters::GetCallingConvention): new method.
23100
23101 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * class.cs (TypeContainer::Populate): Drop RootContext from the
23104         argument. 
23105
23106         (Constructor::CallingConvention): Returns the calling convention.
23107         (Constructor::ParameterTypes): Returns the constructor parameter
23108         types. 
23109
23110         (TypeContainer::AddConstructor): Keep track of default constructor
23111         and the default static constructor.
23112
23113         (Constructor::) Another class that starts using `public readonly'
23114         instead of properties. 
23115
23116         (Constructor::IsDefault): Whether this is a default constructor. 
23117
23118         (Field::) use readonly public fields instead of properties also.
23119
23120         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23121         track of static constructors;  If none is used, turn on
23122         BeforeFieldInit in the TypeAttributes. 
23123
23124         * cs-parser.jay (opt_argument_list): now the return can be null
23125         for the cases where there are no arguments. 
23126
23127         (constructor_declarator): If there is no implicit `base' or
23128         `this', then invoke the default parent constructor. 
23129
23130         * modifiers.cs (MethodAttr): New static function maps a set of
23131         modifiers flags into a MethodAttributes enum
23132         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23133         MethodAttr, TypeAttr to represent the various mappings where the
23134         modifiers are used.
23135         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23136
23137 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23138
23139         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23140         method arguments.
23141
23142         * interface.cs (PopulateIndexer): Implemented the code generator
23143         for interface indexers.
23144
23145 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23146
23147         * interface.cs (InterfaceMemberBase): Now we track the new status
23148         here.  
23149
23150         (PopulateProperty): Implement property population.  Woohoo!  Got
23151         Methods and Properties going today. 
23152
23153         Removed all the properties for interfaces, and replaced them with
23154         `public readonly' fields. 
23155
23156 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23159         initialize their hashtables/arraylists only when they are needed
23160         instead of doing this always.
23161
23162         * parameter.cs: Handle refs and out parameters.
23163
23164         * cs-parser.jay: Use an ArrayList to construct the arguments
23165         instead of the ParameterCollection, and then cast that to a
23166         Parameter[] array.
23167
23168         * parameter.cs: Drop the use of ParameterCollection and use
23169         instead arrays of Parameters.
23170
23171         (GetParameterInfo): Use the Type, not the Name when resolving
23172         types. 
23173
23174 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23175
23176         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23177         and instead use public readonly fields.
23178
23179         * class.cs: Put back walking code for type containers.
23180
23181 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23182
23183         * class.cs (MakeConstant): Code to define constants.
23184
23185         * rootcontext.cs (LookupType): New function.  Used to locate types 
23186
23187
23188 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23189
23190         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23191         this System.Reflection code is.  Kudos to Microsoft
23192
23193         * typemanager.cs: Implement a type cache and avoid loading all
23194         types at boot time.  Wrap in LookupType the internals.  This made
23195         the compiler so much faster.  Wow.  I rule!
23196
23197         * driver.cs: Make sure we always load mscorlib first (for
23198         debugging purposes, nothing really important).
23199
23200         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23201         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23202
23203         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23204         on namespaces that have been imported using the `using' keyword.
23205
23206         * class.cs (TypeContainer::TypeAttr): Virtualize.
23207         (Class::TypeAttr): Return attributes suitable for this bad boy.
23208         (Struct::TypeAttr): ditto.
23209         Handle nested classes.
23210         (TypeContainer::) Remove all the type visiting code, it is now
23211         replaced with the rootcontext.cs code
23212
23213         * rootcontext.cs (GetClassBases): Added support for structs. 
23214
23215 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23216
23217         * interface.cs, statement.cs, class.cs, parameter.cs,
23218         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23219         Drop use of TypeRefs, and use strings instead.
23220
23221 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23222
23223         * rootcontext.cs: 
23224
23225         * class.cs (Struct::Struct): set the SEALED flags after
23226         checking the modifiers.
23227         (TypeContainer::TypeAttr): new property, returns the
23228         TypeAttributes for a class.  
23229
23230         * cs-parser.jay (type_list): Oops, list production was creating a
23231         new list of base types.
23232
23233         * rootcontext.cs (StdLib): New property.
23234         (GetInterfaceTypeByName): returns an interface by type name, and
23235         encapsulates error handling here.
23236         (GetInterfaces): simplified.
23237         (ResolveTree): Encapsulated all the tree resolution here.
23238         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23239         types. 
23240
23241         * driver.cs: Add support for --nostdlib, to avoid loading the
23242         default assemblies.
23243         (Main): Do not put tree resolution here. 
23244
23245         * rootcontext.cs: Beginning of the class resolution.
23246
23247 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23248
23249         * rootcontext.cs: Provide better error reporting. 
23250
23251         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23252
23253         * rootcontext.cs (CreateInterface): Handle the case where there
23254         are no parent interfaces.
23255
23256         (CloseTypes): Routine to flush types at the end.
23257         (CreateInterface): Track types.
23258         (GetInterfaces): Returns an array of Types from the list of
23259         defined interfaces.
23260
23261         * typemanager.c (AddUserType): Mechanism to track user types (puts
23262         the type on the global type hash, and allows us to close it at the
23263         end). 
23264
23265 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23266
23267         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23268         RecordInterface instead.
23269
23270         * cs-parser.jay: Updated to reflect changes above.
23271
23272         * decl.cs (Definition): Keep track of the TypeBuilder type that
23273         represents this type here.  Not sure we will use it in the long
23274         run, but wont hurt for now.
23275
23276         * driver.cs: Smaller changes to accomodate the new code.
23277
23278         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23279         when done. 
23280
23281         * rootcontext.cs (CreateInterface):  New method, used to create
23282         the System.TypeBuilder type for interfaces.
23283         (ResolveInterfaces): new entry point to resolve the interface
23284         hierarchy. 
23285         (CodeGen): Property, used to keep track of the code generator.
23286
23287 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23288
23289         * cs-parser.jay: Add a second production for delegate_declaration
23290         with `VOID'.
23291
23292         (enum_body): Put an opt_comma here instead of putting it on
23293         enum_body or enum_member_declarations so we can handle trailing
23294         commas on enumeration members.  Gets rid of a shift/reduce.
23295
23296         (type_list): Need a COMMA in the middle.
23297
23298         (indexer_declaration): Tell tokenizer to recognize get/set
23299
23300         * Remove old targets.
23301
23302         * Re-add the parser target.
23303
23304 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23305
23306         * cs-parser.jay: Add precendence rules for a number of operators
23307         ot reduce the number of shift/reduce conflicts in the grammar.
23308
23309 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23312         and put it here.
23313
23314         Get rid of old crufty code.
23315
23316         * rootcontext.cs: Use this to keep track of the parsed
23317         representation and the defined types available to the program. 
23318
23319         * gen-treedump.cs: adjust for new convention.
23320
23321         * type.cs: Split out the type manager, and the assembly builder
23322         from here. 
23323
23324         * typemanager.cs: the type manager will live here now.
23325
23326         * cil-codegen.cs: And the code generator here. 
23327
23328 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23329
23330         * makefile: Fixed up for easy making.
23331
23332 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23333
23334         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23335         the 
23336
23337         (unary_expression): Expand pre_increment_expression and
23338         post_decrement_expression to reduce a shift/reduce.
23339
23340 2001-07-11  Simon Cozens
23341
23342         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23343
23344         Improve allow_keyword_as_indent name.
23345
23346 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23347
23348         * Adjustments for Beta2. 
23349
23350 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23351
23352         * decl.cs: Added `Define' abstract method.
23353         (InTransit): new property, used to catch recursive definitions. 
23354
23355         * interface.cs: Implement `Define'. 
23356
23357         * modifiers.cs: Map Modifiers.constants to
23358         System.Reflection.TypeAttribute flags.
23359
23360         * class.cs: Keep track of types and user-defined types.
23361         (BuilderInit): New method for creating an assembly
23362         (ResolveType): New function to launch the resolution process, only
23363         used by interfaces for now.
23364
23365         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23366         that are inserted into the name space. 
23367
23368 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23369
23370         * ARGH.  I have screwed up my tree so many times due to the use of
23371         rsync rather than using CVS.  Going to fix this at once. 
23372
23373         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23374         load types.
23375
23376 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * Experiment successful: Use System.Type rather that our own
23379         version of Type.  
23380
23381 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23382
23383         * cs-parser.jay: Removed nsAliases from here.
23384
23385         Use new namespaces, handle `using XXX;' 
23386
23387         * namespace.cs: Reimplemented namespace handling, use a recursive
23388         definition of the class.  Now we can keep track of using clauses
23389         and catch invalid using clauses.
23390
23391 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23392
23393         * gen-treedump.cs: Adapted for all the renaming.
23394
23395         * expression.cs (Expression): this class now has a Type property
23396         which returns an expression Type.
23397
23398         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23399         `Type', as this has a different meaning now in the base
23400
23401 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23402
23403         * interface.cs, class.cs: Removed from all the sources the
23404         references to signature computation, as we can not do method
23405         signature computation during the parsing time, as we are not
23406         trying to solve at that point distinguishing:
23407
23408         class X {
23409                 void a (Blah x) {}
23410                 void a (NS.Blah x) {}
23411         }
23412
23413         Which depending on the context might be valid or not, as we do not
23414         know if Blah is the same thing as NS.Blah at that point.
23415
23416         * Redid everything so the code uses TypeRefs now instead of
23417         Types.  TypeRefs are just temporary type placeholders, that need
23418         to be resolved.  They initially have a pointer to a string and the
23419         current scope in which they are used.  This is used later by the
23420         compiler to resolve the reference to an actual Type. 
23421
23422         * DeclSpace is no longer a CIR.Type, and neither are
23423         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23424         are all DeclSpaces, but no Types. 
23425
23426         * type.cs (TypeRefManager): This implements the TypeRef manager,
23427         which keeps track of all the types that need to be resolved after
23428         the parsing has finished. 
23429
23430 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23431
23432         * ARGH.  We are going to have to store `foreach' as a class rather
23433         than resolving it, as we need to verify error 1579 after name
23434         resolution.   *OR* we could keep a flag that says `This request to
23435         IEnumerator comes from a foreach statement' which we can then use
23436         to generate the error.
23437
23438 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23439
23440         * class.cs (TypeContainer.AddMethod): we now add methods to the
23441         MethodGroup instead of the method hashtable.  
23442
23443         * expression.cs: Add MethodGroup abstraction, which gets us one
23444         step closer to the specification in the way we handle method
23445         declarations.  
23446
23447         * cs-parser.jay (primary_expression): qualified_identifier now
23448         tried to match up an identifier to a local variable reference or
23449         to a parameter reference.
23450
23451         current_local_parameters is now a parser global variable that
23452         points to the current parameters for the block, used during name
23453         lookup.
23454
23455         (property_declaration): Now creates an implicit `value' argument to
23456         the set accessor.
23457
23458 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23459
23460         * parameter.cs: Do not use `param' arguments as part of the
23461         signature, per the spec.
23462
23463 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23464
23465         * decl.cs: Base class for classes, structs and interfaces.  This
23466         is the "Declaration Space" 
23467
23468         * cs-parser.jay: Use CheckDef for checking declaration errors
23469         instead of having one on each function.
23470
23471         * class.cs: Factor out some code for handling error handling in
23472         accordance to the "Declarations" section in the "Basic Concepts"
23473         chapter in the ECMA C# spec.
23474
23475         * interface.cs: Make all interface member classes derive from
23476         InterfaceMemberBase.
23477
23478 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23479
23480         * Many things: all interfaces are parsed and generated in
23481         gen-treedump.  Support for member variables, constructors,
23482         destructors, properties, constants is there.
23483
23484         Beginning of the IL backend, but very little done, just there for
23485         testing purposes. 
23486
23487 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23488
23489         * cs-parser.jay: Fix labeled statement.
23490
23491         * cs-tokenizer.cs (escape): Escape " and ' always.
23492         ref_line, ref_name: keep track of the line/filename as instructed
23493         by #line by the compiler.
23494         Parse #line.
23495
23496 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23497
23498         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23499         to match the values in System.CodeDOM.
23500
23501         Divid renamed to Divide.
23502
23503         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23504         statements. 
23505         (Statements.set): remove.
23506
23507         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23508         statements. 
23509
23510         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23511         falseStatements always have valid values. 
23512
23513         * cs-parser.jay: Use System.CodeDOM now.
23514