2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2
3         * anonymous.cs: Implemented ExprClassName.
4         
5         * assign.cs (Assign.DoResolve): Don't chrash when type is not
6         delegate.
7         
8         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9         check.
10         
11         * class.cs (StaticClass.DefineContainerMembers): Report protected
12         members as error.
13         
14         * codegen.cs: if(ed) PRODUCTION.
15         
16         * convert.cs (Error_CannotImplicitConversion): Better error
17         distinction.
18         
19         * cs-parser.jay: More error checks.
20         
21         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
22         
23         * driver.cs (CSCParseOption): Enabled wrong option check.
24         
25         * ecore.cs (Expression.ExprClassName): Turned to property.
26         (MemberExpr.CheckIntermediateModification): For checking boxed
27         value types     modification.
28         
29         * statement.cs (Fixed.Resolve): Expression type must be
30         convertible to fixed type.
31         (CollectionForeach.GetEnumeratorFilter,TryType):
32         Small refactoring for easier error checking.
33
34 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
35
36         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
37         attributes.
38         
39         * class.cs (GeneratedBaseInitializer): New class for customization
40         compiler generated initializers.
41         (MemberBase.DoDefine): Check Obsolete attribute here.
42         (FieldMember.DoDefine): Ditto.
43         
44         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
45         constants.
46         
47         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
48         (MemberCore.GetObsoleteAttribute): Removed argument.
49         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
50         (MemberCore.CheckObsoleteType): New helper.
51         
52         * delegate.cs,
53         * enum.cs,
54         * statement.cs: Updates after MemberCore changes.
55         
56         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
57         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
58         
59         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
60         obsolete attribute for compiler construct.
61         (As.DoResolve): Cache result.
62         
63         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
64
65 2005-10-01  Miguel de Icaza  <miguel@novell.com>
66
67         * expression.cs (Probe): instead of having a "Type probe_type"
68         keep the extra information as a TypeExpr probe_type_expr since the
69         "As" operator needs to perform some type checks.
70
71         * (As.DoResolve): If the type is a type parameter, ensure that it
72         is constrained by a class.
73
74 2005-09-22  Miguel de Icaza  <miguel@novell.com>
75
76         * statement.cs (Lock): Use the TemporaryVariable class instead of
77         manually using local variables as those do not work when variables
78         are captured.
79
80         * ecore.cs: Moved the TemporaryVariable class from being a nested
81         class inside Foreach to be a public class that can be employed in
82         other places. 
83
84 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
85
86         * cs-parser.jay: interface_accessors replaced by
87         accessor_declarations.
88
89         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
90         location.
91         
92         * statement.cs (GotoCase.Resolve): Convert null constant to
93         null case.
94         (SwitchLabel.ResolveAndReduce): Ditto.
95         (SwitchLabel.NullStringCase): Custom null stamp.
96         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
97         
98         typemanager.cs (CSharpSignature): Don't skip first argument
99         for full names.
100
101 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
102
103         * cfold.cs, constant.cs, convert.cs, ecore.cs,
104         expression.cs, iterators.cs, literal.cs: Store constants and
105         literals location.
106         
107         * class.cs (MemberBase.ShortName): Pass location.
108         
109         * cs-parser.jay: Some location fixes.
110         
111         * ecore.cs (Expression.Location): Made virtual.
112
113 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
114
115         Fix #72930.
116         * const.cs (Const.ResolveValue): Check for assigning non-null
117         value to reference type.
118
119 2005-09-26  Raja R Harinath  <rharinath@novell.com>
120
121         Fix #76133.
122         * expression.cs (This.VerifyFixed): In a value type T, the type of
123         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
124         value type R, 'this' is treated as a value parameter.
125
126 2005-09-05  Miguel de Icaza  <miguel@novell.com>
127
128         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
129         if the underlying types are the same, otherwise we need to produce
130         code that will do the proper cast.
131
132         This was exposed by Marek's constant rewrite which produced
133         invalid code for the call site:
134
135         enum X : long { a }
136         void Method (X v) {}
137
138         Method ((X) 5)
139
140         This fixes test-49.cs
141
142 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
143
144         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
145           Type/Object should be allowed as well. Fixed bug #75968.
146
147 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
148
149         * expression.cs : (Binary.DoResolve): when one is enum constant and
150           another is constant 0, then return enum one *as enum type*.
151           Fixed bug 74846.
152
153 2005-10-04  Martin Baulig  <martin@ximian.com>
154
155         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
156         `SetMemberIsUsed()' work for generics, too.
157
158 2005-10-04  Martin Baulig  <martin@ximian.com>
159
160         * expression.cs (DelegateInvocation.EmitStatement): Make this work
161         for corlib.  Fixes #75691.
162
163 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
164
165         Fix #76255.
166         * driver.cs: Fix compilation files with full root path.
167
168 2005-09-25  Miguel de Icaza  <miguel@novell.com>
169
170         * report.cs (SymbolRelatedToPreviousError): Format the output so
171         it does not use an open parenthesis that is never closed. 
172
173         * driver.cs: Follow coding guidelines
174
175 2005-09-18  Miguel de Icaza  <miguel@novell.com>
176
177         * driver.cs: Set InEmacs based on the environment variable EMACS. 
178
179         * location.cs (InEmacs): in this mode, do not report column
180         location as it confuses Emacs.
181
182 2005-10-03  Raja R Harinath  <rharinath@novell.com>
183
184         * support.cs (SeekableStreamReader.Position): Don't error out when
185         the requested position is just beyond the end of the current
186         buffered data.
187
188 2005-09-28  Raja R Harinath  <rharinath@novell.com>
189
190         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
191         try to keep in sync with the byte count of the underlying Stream.
192         However, this limits us to a window size of 2048 characters: i.e.,
193         the maximum lookahead of our lexer/parser can be 2048 characters.
194
195 2005-09-22  Martin Baulig  <martin@ximian.com>
196
197         * driver.cs: Removed a debugging FIXME.
198
199 2005-09-21  Raja R Harinath  <rharinath@novell.com>
200
201         * cs-parser.jay (type_arguments): Add CS1644 check.
202         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
203
204 2005-09-15  Raja R Harinath  <rharinath@novell.com>
205
206         * Makefile (PROGRAM): Make profile specific.
207         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
208         the current directory.
209
210         Fix test-455.cs.
211         * expression.cs (Invocation.EmitCall): Remove optimization on
212         this_call since it doesn't handle 'this' being a value type.
213
214 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
215
216         * driver.cs: Ensure file handles are closed after parsing
217
218 2005-09-05  Miguel de Icaza  <miguel@novell.com>
219
220         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
221         if the underlying types are the same, otherwise we need to produce
222         code that will do the proper cast.
223
224         This was exposed by Marek's constant rewrite which produced
225         invalid code for the call site:
226
227         enum X : long { a }
228         void Method (X v) {}
229
230         Method ((X) 5)
231
232         This fixes test-49.cs
233
234 2005-09-05  Martin Baulig  <martin@ximian.com>
235
236         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
237         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
238
239         * cs-parser.jay (delegate_declaration): Small fix for #75852.
240
241 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
242
243         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
244           to be a pointer type due to the spec 25.2, so check if declaring
245           type is generic type definition. Fixed bug #75772.
246
247 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
248
249         Fixed bug #75957.
250         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
251           both types are not defined by methods.
252         * expression.cs : (Invocation.IsApplicable): it should work when
253           the argument type is equal to the parameter type, not only when
254           ImplicitConversionExists() returns true.
255
256 2005-09-02  Raja R Harinath  <rharinath@novell.com>
257
258         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
259         internal.
260
261         Fix #75941.
262         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
263         flow-branching for LocalVariableReferences in case we were invoked
264         from a MemberAccess.
265         * expression.cs (LocalVariableReference.VerifyAssigned): New.
266         Carved out of ...
267         (LocalVariableReference.DoResolveBase): ... this.
268         (MemberAccess.Resolve): Do the check that was disabled during
269         SimpleNameResolve.
270
271 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
272
273         * class.cs :
274           (PartialContainer.Create): check abstract/sealed/static strictly
275           but abstract/sealed can exist only at one side. Fixed bug #75883.
276
277 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
278
279         Fix #75945.
280         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
281         specified, don't default to UnmanagedType.I4.
282
283 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
284
285         * expression.cs : conditional operator should check possibly
286           incorrect assign expression. Fixed bug #75946.
287
288 2005-08-30  Raja R Harinath  <rharinath@novell.com>
289
290         Fix #75934.
291         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
292         (ScopeInfo.EmitScopeType): Use it to construct field names from
293         names of captured locals.
294
295         Fix #75929.
296         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
297         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
298         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
299         (ExplicitConversion): Remove enum cases already handled by
300         implicit conversion.  Move implicit conversion check to the beginning.
301         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
302         * expression.cs (ArrayCreation.EmitDynamicInitializers):
303         Don't treat System.Enum as a struct.
304
305 2005-08-30  Jb Evain  <jbevain@gmail.com>
306
307         * attribute.cs: handles as expression in parameters.
308
309 2005-08-30  Raja R Harinath  <rharinath@novell.com>
310
311         Fix #75802.
312         * class.cs (TypeContainer.VerifyClsName): Don't use a
313         PartialContainer when verifying CLS compliance.
314         (AbstractPropertyEventMethod): Set Parent here, ...
315         (PropertyMethod): ... not here.
316
317 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
318
319         * attribute.cs : escaped attribute name should not be allowed to be
320           resolved (e.g. @class as classAttribute). Fixed bug #75930.
321
322 2005-08-29  Raja R Harinath  <rharinath@novell.com>
323
324         Fix #75927.
325         * convert.cs (ImplicitStandardConversionExists): Allow zero also
326         when converting a long constant to unsigned long.
327         * expression.cs (Invocation.OverloadResolve): Add sanity check to
328         detect where IsApplicable and VerifyArgumentsCompat disagree.
329
330 2005-08-29  Raja R Harinath  <rharinath@novell.com>
331         and Carlos Alberto Cortez  <carlos@unixmexico.org>
332
333         Fix #75848.
334         * class.cs (TypeContainer.CanElideInitializer): New helper.
335         (TypeContainer.EmitFieldInitializers): Use it to determine if we
336         can safely emitting the initializer of a field.
337
338 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
339
340         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
341           allowed inside a switch (without loop). Fixed bug #75433.
342
343 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
344
345         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
346         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
347
348 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
349
350         * driver.cs : kinda reverting the default encoding changes (not exact 
351           revert since I noticed that "codepage:reset" might not work fine).
352
353 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
354
355         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
356           Location. Now getter and setter store location correctly.
357           (errors/cs0111-12.cs now reports the expected location.)
358
359 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
360
361         * driver.cs : Use default encoding on the environment.
362           Removed (now that) extra parameter for SeekableStreamReader.
363         * support.cs : (SeekableStreamReader) third .ctor() argument for
364           StreamReader is not required (always true). preamble size could
365           be acquired in simpler and safe way.
366
367 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
368
369         * cs-parser.jay: report CS0642 at warning level 3
370           and report CS0642 for an if else statement also
371           fixes bug #74745. Patch by John Luke (and a bit
372           modified by me).
373           Removed extra CS0642 warning check for "while",
374           "for" and "fixed".
375         * statement.cs: In Block.Resolve(), CS0642 check
376           is reimplemented to check a sequence of an empty
377           statement and a block.
378
379           Both fix bug #66777.
380
381 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
382
383         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
384         detection until I fix it.
385         
386         * cs-tokenizer.cs: Changed error message.
387         
388         * cs-parser.jay: Fixed 2 error locations.
389         
390         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
391         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
392         properties.
393         
394         * enum.cs (GetSignatureForError): Fixed.
395         
396         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
397         method detection.
398         
399         * class.cs,
400         * typemanager.cs (RegisterProperty): Removed.
401         
402         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
403
404 2005-08-24  Raja R Harinath  <rharinath@novell.com>
405
406         Fix #75874.
407         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
408         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
409
410 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
411
412         * expression.cs : tiny fix is required for not warning positive ulong.
413           See test-441.cs.
414
415 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
416
417         * expression.cs : add CS0652 check for constant and integral
418           expression. Fixed bug #53974.
419
420 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
421
422         * expression.cs : in DoNumericPromotions(), check if there is implicit
423           conversion overload for string (to check CS0034). Fixed bug #52492.
424
425 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
426
427         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
428
429 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
430
431         * ecore.cs : report location when it is *not* Null.
432
433 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
434
435         * codegen.cs,
436           ecore.cs,
437           flowanalysis.cs,
438           expression.cs:
439           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
440           correctly. Fixed bug #75721.
441
442 2005-08-23  Raja R Harinath  <rharinath@novell.com>
443
444         * support.cs (SeekableStreamReader.Position): Avoid an expensive
445         loop that performs 'min (pos, char_count)'.
446
447         Fix #75862.
448         * expression.cs (Unary.ResolveOperator): Don't discard implicit
449         converted value in Operator.OnesComplement.
450
451 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
452
453         * anonymous.cs: If the anon method is pulled into a helper class,
454         it needs to be `internal' not `private'. Fixes runtime behavior on
455         msft. bug #75704
456
457 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
458
459         Fix #75803
460         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
461         is a partial class.
462
463 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
464
465         The big constants rewrite
466         Fix #75746, #75685 and more
467         As a side effect saved 1MB for MWF ;-)
468         
469         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
470         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
471         enum based for corlib compilation.
472         
473         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
474         subtractions.
475         
476         * class.cs (FixedField.Define): Use ResolveAsConstant.
477         
478         * const.cs (IConstant): Interface constants and enums.
479         (Const.ResolveValue): New method for constant resolvning.
480         (ExternalConstant): Constants from imported assemblies.
481         
482         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
483         conversion; like enums.
484         (Constant.ToType): Converts this constant to different type.
485         (Constant.Increment): Adds 1.
486         
487         * convert.cs (ImplicitConversionRequired): Simplified.
488         
489         * cs-parser.jay: Create EnumMember directly.
490         
491         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
492         
493         * doc.cs (GenerateEnumDocComment): Removed.
494         
495         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
496         (ConvertIntLiteral): Removed.
497         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
498         
499         * enum.cs (EnumMember): Implement IConstant.
500         (Enum.IsValidEnumConstant): Removed.
501         (Enum.GetNextDefaultValue): Removed.
502         (Enum.FindMembers): Updated.
503         (Enum.GenerateDocComment): Iterate enum members.
504         
505         * expression.cs (Cast.TryReduce): Handle enums correctly.
506         (New.Constantify): Made public.
507         (MemberAccess.DoResolve): Removed contant specific if(s).
508         
509         * literal.cs (NullLiteral): Implement new abstract methods.
510         
511         * statement.cs (GotoCase.Resolve): Use new constant methods.
512         (SwitchLabel.ResolveAndReduce): Use new constant methods.
513         
514         * typemanager.cs (LookupEnum): Removed.
515         (IsEnumType): Fixed to work with corlib.
516         (RegisterConstant): Removed.
517         (LookupConstant): Removed.
518         (GetConstant): Changed to work with IConstant.
519
520 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
521
522         * location.cs : Fixed overflown (>255) column number.
523
524 2005-08-03  Raja R Harinath  <rharinath@novell.com>
525
526         First cut of the qualified-alias-member feature.
527         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
528         token.
529         * cs-parser.jay (DOUBLE_COLON): New token.
530         (namespace_or_type_name): Add rule for recognizing
531         qualified-alias-members.
532         (primary_expression): Likewise.
533         (element_access): Allow QualifiedAliasMember as a possible
534         type-bearing expression.
535         (local_variable_type, local_variable_pointer_type): Likewise.
536         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
537         aliases in the current and enclosing namespace declarations.
538         (NamespaceEntry.UsingAlias): Add CS0440 warning.
539         * decl.cs (MemberName.is_double_colon): New.
540         (MemberName.MemberName): Add new constructor for alias-member.
541         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
542         * expression.cs (QualifiedAliasMember): New expression type.
543
544 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
545
546         * location.cs : it borked when no argument was specified.
547
548 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
549
550         * location.cs : tiny ToString() format fix.
551
552 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
553
554         * statement.cs : oops, it was missing.
555
556 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
557
558         A set of fixes for precise line/column location.
559
560         * location.cs :
561           "token" field now holds a file/line "delta", a line number offset 
562           from the segment, and a column number. See also:
563           http://lists.ximian.com/pipermail/mono-devel-list/2004-
564           December/009508.html
565           Removed static IsNull. Use instance IsNull property instead.
566         * cs-tokenizer.cs :
567           For some tokens it stores Location. For Identifier it stores
568           LocatedToken which is a pair of string name and location.
569           Column numbers are adjusted only at getChar().
570         * report.cs :
571           Use Location.ToString() for reporting (it now contains column).
572         * cs-parser.jay :
573           Largely modified to use LocatedToken instead of
574           string (IDENTIFIER), and to acquire Location from some tokens.
575         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
576           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
577           codegen.cs :
578           Now MemberName holds Location. DeclSpace.ctor() receives Location
579           as a parameter. Removed extra parameters to all derived classes.
580           Replaced Location.IsNull() with instance property.
581         * assign.cs, expression.cs :
582           Added .ctor() overload that omits Location.
583         * attribute.cs :
584           Added "nameEscaped" flag that indicates the identifier was escaped
585           in the source file. This fixes bug #57047.
586
587 2005-09-02  Martin Baulig  <martin@ximian.com>
588
589         * class.cs: Make CS3005 a warning, not an error.
590
591 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
592
593         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
594         New method, looking for lo-case imported cls type.
595
596         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
597         here.
598
599         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
600
601         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
602
603         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
604         all_imported_types.
605         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
606
607         Optimized to save 3.5 MB for SWF compilation.
608
609 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
610
611         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
612         (PartialContainer.Create): Moved logic AddToContainer.
613         (PartialContainer.MarkForDuplicationCheck): Shares name.
614         
615         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
616         place.
617         
618         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
619         initialization.
620         (Namespace.GetSignatureForError): New method.
621         
622         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
623         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
624
625 2005-08-01  Raja R Harinath  <rharinath@novell.com>
626
627         Fix #75669.
628         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
629         member lookup rather than qualifier_type, since qualifier_type can
630         be null.
631
632 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
633
634         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
635         enum member.
636
637 2005-07-31  Miguel de Icaza  <miguel@novell.com>
638
639         * statement.cs: Copy the local exception into the exception
640         captured local.  Fixes 75674
641
642 2005-07-31  Raja R Harinath  <harinath@gmail.com>
643
644         Fix #75658.
645         * expression.cs (Invocation.OverloadResolve): Don't report error
646         CS1501 if error CS1502 has been reported.
647         (New.DoResolve): Delegate CS1501 reporting to
648         Invocation.OverloadResolve.
649
650         Fix #75656.
651         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
652         invariant-meaning-in-block property in an enclosing block if
653         necessary.
654
655 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
656
657         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
658         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
659         (Switch.CheckSwitch): Just save 50kb for SWF.
660
661 2005-07-27  Martin Baulig  <martin@ximian.com>
662
663         * anonymous.cs (CaptureContext.AddField): Added
664         `AnonymousContainer am' argument; compute its toplevel scope if
665         it's not already computed.  Fixes #75649.
666
667 2005-07-26  Raja R Harinath  <rharinath@novell.com>
668
669         Fix #75628.
670         * class.cs (Constructor.Emit): Reset block to null if the block
671         resolve fails.
672
673 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
674
675         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
676
677 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
678
679         * class.cs (MethodData.Define): Check whether accessor implementing
680         interface is public.
681
682         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
683
684 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
685
686         Fix #57245
687         * namespace.cs (LookupType): Moved same type check to...
688         
689         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
690         with the same name.
691
692 2005-07-21  Raja R Harinath  <rharinath@novell.com>
693
694         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
695         already found a typebuilder.
696         * class.cs (MethodCore.IsDuplicateImplementation): Compare
697         MemberNames, not strings.
698
699         * const.cs (Error_ExpressionMustBeConst): 
700         Rename from Error_EpressionMustBeConst.
701         * const.cs, class.cs, statement.cd: Update.
702
703 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
704
705         Fix #65573
706
707         * const.cs (Const.LookupConstantValue): Report missing contant expression
708         everytime.
709         (Error_EpressionMustBeConstant): Only one error method.
710
711         * class.cs, statement.c: Updated.
712
713 2005-07-20  Raja R Harinath  <rharinath@novell.com>
714
715         * statement.cs (Block.Flags): Add back HasVarargs.
716         (Block.flags): Make protected.
717         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
718
719         * typemanager.cs (types, typecontainers, user_types): Remove.
720         (UserTypes, TypeContainers): Likewise.
721         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
722         (CleanUp, Reset): Update.
723         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
724         (GetNestedType): Use Type.GetNestedType.
725         (CoreLookupType): Take two arguments, the namespace and the
726         basename of the type.  Update to use the Namespace.Lookup
727         mechanism.
728         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
729         (RealMemberLookup): Use IsNestedChildOf instead of playing with
730         string concatenation and substring matches.
731         * class.cs, enum.cs, delegate.cs: Update to changes.
732
733 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
734
735         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
736         Expression and made virtual.
737
738         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
739         (ImplicitStandardConversionExists): Fixed `byte' typo ?
740
741         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
742
743         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
744         error message.
745
746         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
747         change.
748
749 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
750
751         Fix #57707
752         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
753         AssemblyCultureAttribute is not used on executable.
754
755         * rootcontext.cs,
756         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
757
758 2005-07-16  Raja R Harinath  <rharinath@novell.com>
759
760         Fix #60638.
761         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
762         New.  Reports CS0252/CS0253.
763         Mostly taken from preliminary patch by Duncak Mak.
764         (Binary.DoResolveOperator): Store results of operator lookup.
765         Use them to detect if we need to warn about unintended reference
766         comparisons.
767
768 2005-07-15  Raja R Harinath  <rharinath@novell.com>
769
770         Fix #72969.
771         * namespace.cs (Namespace.Lookup): Add back location parameter.
772         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
773         * delegate.cs, ecore.cs, expression.cs: Update to changes.
774
775         * codegen.cs (EmitContext.DeclSpace): Make readonly.
776         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
777         (Namespace.LookupType): ... this.
778         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
779         of namespaces.
780         * typemanager.cs (LookupTypeReflection): Remove buggy code that
781         purported to handle pointers.
782         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
783         CoreLookupType.
784
785 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
786
787         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
788         type as namespace.
789
790 2005-07-15  Raja R Harinath  <rharinath@novell.com>
791
792         * namespace.cs (Namespace.Lookup): Drop location parameter.
793         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
794         (NamespaceEntry.Lookup): ... this.
795         (NamespaceEntry.Error_AmbiguousTypeReference):
796         Move here from DeclSpace.
797         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
798         names ...
799         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
800         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
801         Move to NamespaceEntry.
802         * delegate.cs, expression.cs: Update to changes.
803
804 2005-08-31  Martin Baulig  <martin@ximian.com>
805
806         Committing a patch from Atsushi Enomoto for #75850.
807
808         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
809         Prefer a generic enumerator over a non-generic one.
810
811 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
812
813         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
814         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
815
816 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
817
818         * driver.cs : reverting default encoding change as well as mcs.
819
820 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
821
822         * driver.cs, support.cs : merged r48826.
823           Marek Safer wrote:
824           > could you integrate your mcs changes to gmcs otherwise
825           > gmcs cannot compile some files.
826
827 2005-08-20  Martin Baulig  <martin@ximian.com>
828
829         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
830         scope if we don't already have it.
831
832         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
833         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
834         fixes #75867.
835
836 2005-07-31  Miguel de Icaza  <miguel@novell.com>
837
838         * statement.cs: Copy the local exception into the exception
839         captured local.  Fixes 75674
840
841 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
842
843         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
844         type as namespace.
845
846 2005-08-12  Martin Baulig  <martin@ximian.com>
847
848         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
849         for nested types here to avoid hitting the cache too early.
850
851 2005-08-09  Miguel de Icaza  <miguel@novell.com>
852
853         * enum.cs: On the new compiler CLS error 3005 is now a warning not
854         an error. 
855
856 2005-08-03  Martin Baulig  <martin@ximian.com>
857
858         Make iterators in generic methods work; see gtest-191.cs.
859
860         * generic.cs
861         (Constraints.Resolve): Protect against being called twice.
862
863         * class.cs
864         (TypeContainer.GetClassBases): Make this `protected virtual'.
865
866         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
867         (Iterator.GetClassBases): Override this and compute the base
868         classes here.
869         (Iterator.DefineNestedTypes): If we're a generic method, all our
870         method type parameters become class type parameters on the proxy
871         class.
872
873         * statement.cs
874         (ToplevelBlock.Parameters): Make this a property, not a field.
875         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
876
877 2005-08-03  Martin Baulig  <martin@ximian.com>
878
879         * typemanager.cs (TypeManager.IsSubclassOf): Use
880         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
881         (TypeManager.GetFullName_recursed): Improved.
882
883 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
884
885         Fix #75417
886         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
887         Private accessor case, using TypeManager.IsPrivateAccessible instead of
888         invocation_type == mi.DeclaringType, since the first one also checks
889         other condition used by generic instances.
890         
891 2005-07-27  Martin Baulig  <martin@ximian.com>
892
893         * anonymous.cs (CaptureContext.AddField): Added
894         `AnonymousContainer am' argument; compute its toplevel scope if
895         it's not already computed.  Fixes #75649.
896
897 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
898
899         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
900         CheckAttributeType and refactored.
901         (Attribute.ResolvePossibleAttributeType): Changed to reuse
902         ResolveAsTypeTerminal error handling.
903         (ResolveAsTypeTerminal): Introduced because of global attributes extra
904         handling.
905         (GetSignatureForError): Print errors in same way.
906
907         * class.cs,
908         * codegen.cs: Reflect attribute GetSignatureForError change.
909
910         * ecore.cs,
911         * expression.cs: Add silent parameter to ResolveAsTypeStep.
912
913         * namespace.cs (UsingEntry): Refactored to make fields private.
914
915         * assign.cs,
916         statement.cs: Error_UnexpectedKind has extra parameter.
917
918 2005-07-14  Raja R Harinath  <rharinath@novell.com>
919
920         * ecore.cs (IAlias): Remove.
921         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
922         that implement the interface.
923         * namespace.cs (Namespace): Likewise.
924         (Namespace.declspaces): Renamed from 'defined_names'.
925         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
926         DeclSpace instead of an IAlias.
927         * tree.cs (Tree.AddDecl): Update.
928
929 2005-07-12  Raja R Harinath  <rharinath@novell.com>
930
931         * statement.cs (Block.Flags); Remove HasVarargs.
932         (Block.HasVarargs): Move to ToplevelBlock.
933         (Block.ThisVariable, Block.AddThisVariable): Likewise.
934         (Block.Variables): Make protected.  Initialize variable hashtable
935         if necessary.
936         (Block.AddVariable): Update.
937         (Block.Resolve): Update to changes.
938         (ToplevelBlock.HasVarargs): New boolean.
939         (ToplevelBlock.ThisVariable): Move here from Block.
940         (ToplevelBlock.AddThisVariable): Likewise.
941         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
942         * expression.cs (This.ResolveBase): Update to changes.
943         (ArglistAccess.DoResolve): Likewise.
944
945 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
946
947         Fix #75321
948         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
949
950         * class.cs (TypeContainer.VerifyMembers): Distinguish between
951         not used and not used & assigned.
952         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
953
954 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
955
956         Fix #75053
957         * expression.cs (Is.DoResolve): null is never provided type.
958
959 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
960
961         Fix #52496
962         * cs-parser.jay: Less strict event error rule to catch more errors.
963
964 2005-07-11  Martin Baulig  <martin@ximian.com>
965
966         * generic.cs (ConstructedType.CheckConstraints): Improve the check
967         for the constructor constraint: we do not only have to check
968         whether the class has a public constructor, but also ensure that
969         it's parameterless.  Fixes #75492.
970
971 2005-07-11  Martin Baulig  <martin@ximian.com>
972
973         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
974         between type parameters if they either have the reference type
975         constraint or the class constraint.
976
977 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
978
979         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
980
981 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
982
983         Fix #74975
984         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
985         (ExtractSecurityPermissionSet): Cope with self referencing security
986         attributes properly.
987
988         * driver.cs (SetOutputFile): Made public property OutputFile.
989
990 2005-07-07  Raja R Harinath  <rharinath@novell.com>
991
992         Fix #75486.
993         * class.cs (TypeContainer.first_nonstatic_field): Rename from
994         has_nonstatic_fields.  Make into a FieldBase pointer.
995         (TypeContainer.AddField): Add CS0282 check.
996         (TypeContainer.EmitType): Update.
997
998 2005-07-06  Miguel de Icaza  <miguel@novell.com>
999
1000         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1001         compare if they start with __.
1002
1003 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1004
1005         * statement.cs (Switch.SwitchGoverningType): Only look at
1006         UserCasts that don't need implicit standard conversions to one of
1007         the allowed switch types (Fixes test-322.cs).
1008         (LocalInfo.Resolve): Re-enable sanity-test.
1009
1010 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1011
1012         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1013         
1014         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1015         
1016         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1017
1018 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1019
1020         Fix #75472.
1021         * ecore.cs (SimpleName.GetSignatureForError): Add.
1022         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1023         (MemberAccess.GetSignatureForError): Add.
1024
1025 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1026  
1027         The big error and warning messages review.
1028         
1029         * anonymous.cs,
1030         * assign.cs,
1031         * attribute.cs,
1032         * class.cs,
1033         * codegen.cs,
1034         * convert.cs,
1035         * cs-parser.jay,
1036         * cs-tokenizer.cs,
1037         * decl.cs,
1038         * delegate.cs,
1039         * doc.cs,
1040         * driver.cs,
1041         * ecore.cs,
1042         * enum.cs,
1043         * expression.cs,
1044         * flowanalysis.cs,
1045         * iterators.cs,
1046         * literal.cs,
1047         * location.cs,
1048         * modifiers.cs,
1049         * namespace.cs,
1050         * parameter.cs,
1051         * pending.cs,
1052         * report.cs,
1053         * rootcontext.cs,
1054         * statement.cs,
1055         * support.cs,
1056         * tree.cs,
1057         * typemanager.cs: Updated.
1058         
1059         * class.cs: (MethodCore.SetYields): Moved here to share.
1060         (PropertyMethod.Define): Moved iterator setup here.
1061         
1062         * iterators.cs: Add orig_method to have full access to parent
1063         container.
1064
1065 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1066
1067         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1068         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1069         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1070         variable of struct type.
1071         * expression.cs (Unary.ResolveOperator): Update to change.
1072         (Indirection.VerifyFixed): Likewise.
1073         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1074         (ParameterReference.VerifyFixed): Value parameters are fixed.
1075         (This.VerifyFixed): Treat 'this' as a value parameter.
1076         * statement.cs (LocalInfo.IsFixed): Remove.
1077
1078 2005-07-01  Martin Baulig  <martin@ximian.com>
1079
1080         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1081         `ec.EmitThis ()' to get the correct scope.
1082
1083 2005-07-01  Martin Baulig  <martin@ximian.com>
1084
1085         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1086         instance is a ParameterReference; fixes #75299.
1087
1088 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1089
1090         Fix #75412.
1091         * expression.cs (Indexers.map): Remove.
1092         (Indexers.Append): Filter out inaccessible setters and getters.
1093         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1094
1095         Fix #75283.
1096         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1097         Refactored from ...
1098         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1099         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1100         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1101         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1102
1103 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1104
1105         Fix #75322
1106         * class.cs (FieldBase.GetInitializerExpression): One more field
1107         for backup.
1108
1109 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1110
1111         * pending.cs: Do not define a proxy if the base method is virtual,
1112         it will be picked up by the runtime (bug 75270).
1113
1114 2005-07-08  Martin Baulig  <martin@ximian.com>
1115
1116         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1117         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1118
1119 2005-07-07  Martin Baulig  <martin@ximian.com>
1120
1121         * generic.cs (ConstructedType.CheckConstraint): Use
1122         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1123         called recursively; fixes #75329.
1124
1125 2005-07-06  Martin Baulig  <martin@ximian.com>
1126
1127         * generic.cs (TypeManager.InferTypeArguments): Added support for
1128         anonymous methods; fixes #75461.
1129
1130 2005-07-01  Martin Baulig  <martin@ximian.com>
1131
1132         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1133         `ec.EmitThis ()' to get the correct scope.
1134
1135 2005-07-01  Martin Baulig  <martin@ximian.com>
1136
1137         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1138         instance is `This'; fixes #75299.
1139
1140 2005-06-30  Martin Baulig  <martin@ximian.com>
1141
1142         * class.cs (Indexer): Implement IIteratorContainer; added support
1143         for iterators in indexers.
1144
1145         * codegen.cs
1146         (EmitContext.CurrentIterator): Make this a property, not a field.
1147
1148         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1149
1150 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1151
1152         * pending.cs: Do not define a proxy if the base method is virtual,
1153         it will be picked up by the runtime (bug 75270).
1154
1155 2005-06-28  Martin Baulig  <martin@ximian.com>
1156
1157         * cs-parser.jay (interface_method_declaration): Avoid a
1158         reduce/reduce conflict by moving some of the code into a separate
1159         `interface_method_declaration_body' rule; fixes #75368.
1160
1161 2005-06-28  Martin Baulig  <martin@ximian.com>
1162
1163         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1164         array check after the check for TypeBuilder's.
1165
1166 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1167
1168         * convert.cs (FindMostEncompassedType): Add two trivial special
1169         cases (number_of_types == 0 || number_of_types == 1).
1170         (FindMostEncompasingType): Likewise.
1171
1172 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1173
1174         Some cleanups preparing for the fix of #75283.
1175         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1176         error testing.
1177         (EventExpr.InstanceResolve): Likewise.
1178         (EventExpr.DoResolve): Remove redundant checks.
1179
1180 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1181
1182         * class.cs: Small fix.
1183
1184 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1185
1186         Fix #75160.
1187         * class.cs (GetPartialBases): Fix return value check of
1188         part.GetClassBases.
1189
1190 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1191
1192         Ensure that partial classes are registered in their enclosing
1193         namespace.  Initial part of fix of #75160.
1194         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1195         Register declspace with namespace here, not in
1196         DeclSpace.RecordDecl.
1197         * cs-parser.jay: Pass namespace to RecordDecl.
1198         * class.cs (PartialContainer.Create): Likewise.
1199         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1200         called.
1201         * decl.cs (Declspace.RecordDecl): Remove.
1202         * namespace.cs (NamespaceEntry.DefineName): Remove.
1203
1204 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1205
1206         * rootcontext.cs: Reset TargetExt as well.
1207
1208 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1209
1210         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1211         -langversion:ISO-1.
1212
1213 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1214
1215         Fix #75080, cs0119.cs.
1216         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1217         of ...
1218         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1219         allowing ExprClass.Type and ExprClass.Namespace for
1220         ResolveFlags.VariableOrValue.
1221         (Expression.Resolve) [1-argument variant]: Change default resolve
1222         flags based on language version.
1223         (Expression.Error_UnexpectedKind): Use a simple string array
1224         rather than an ArrayList.
1225         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1226         not ExprClass.Type.
1227         (TypeOfVoid.DoResolve): Likewise.
1228         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1229         flags argument -- it always has the same value.
1230
1231 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1232
1233         Fix #75081.
1234         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1235         Use it in the error message.
1236         * assign.cs, expression.cs, statement.cs: Update.
1237
1238 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1239
1240         Fix #75088.
1241         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1242         the "almostMatchedMember" case too.
1243         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1244         that failed the accessibility checks to 'almost_match'.
1245
1246 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1247
1248         * attribute.cs: Use internal MethodBuilder methods to set
1249         ExactSpelling and SetLastError on PInvoke methods, instead
1250         of passing them via charset.  Fixes #75060.
1251
1252 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1253
1254         * parameter.cs (Parameter): Remove TODO comment.
1255         (Parameter.DefineParameter): Remove Location parameter.
1256         (Parameters.LabelParameters): Likewise.
1257         * class.cs (Constructor.Emit): Update to change.
1258         (MethodData.Emit): Likewise.
1259         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1260         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1261
1262 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1263
1264         * parameter.cs,
1265           Removed Parameters.Location and added Parameter.Location instead.
1266           Removed Location parameter from Emit() and GetSignature().
1267         * anonymous.cs,
1268           class.cs,
1269           cs-parser.jay,
1270           delegate.cs,
1271           iterators.cs,
1272           statement.cs :
1273           Modified all related calls.
1274
1275 2005-06-21  Martin Baulig  <martin@ximian.com>
1276
1277         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1278         left-hand side is not a nullable type; fixes #75328.
1279
1280 2005-06-21  Martin Baulig  <martin@ximian.com>
1281
1282         * typemanager.cs
1283         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1284         (TypeManager.GetFullNameSignature): Likewise.
1285
1286         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1287         `source.FullName' and `target.FullName' to check whether there are
1288         two conflicting definitions.
1289
1290 2005-06-21  Martin Baulig  <martin@ximian.com>
1291
1292         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1293         a BoxedCast - also for reference types - to be compatible with csc.
1294
1295 2005-06-21  Martin Baulig  <martin@ximian.com>
1296
1297         * expression.cs (MemberAccess.DoResolve): Add support for nested
1298         types in a generic instance; fixes #75320.
1299
1300 2005-06-20  Martin Baulig  <martin@ximian.com>
1301
1302         * generic.cs (TypeManager.InferType): Also walk the class
1303         hierarchy for generic instances; fixes #75261.
1304
1305 2005-06-17  Martin Baulig  <martin@ximian.com>
1306
1307         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1308         to make things work for corlib.
1309
1310 2005-06-15  Martin Baulig  <martin@ximian.com>
1311
1312         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1313         obsolete `SecurityAction' values.
1314
1315 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1316
1317         * rootcontext.cs: Reset TargetExt as well.
1318         
1319 2005-06-09  Martin Baulig  <martin@ximian.com>
1320
1321         * delegate.cs (Delegate.VerifyMethod): Added
1322         `MethodGroupExpr old_mg' argument; inherit its
1323         `HasTypeParameters'; fix #75085.
1324
1325 2005-06-09  Martin Baulig  <martin@ximian.com>
1326
1327         * expression.cs (Invocation.OverloadResolve): Correctly handle
1328         generic methods for the SetMemberIsUsed(); fix #75064.
1329
1330 2005-06-09  Martin Baulig  <martin@ximian.com>
1331
1332         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1333         fixes #75062.
1334
1335 2005-06-08  Martin Baulig  <martin@ximian.com>
1336
1337         * cs-parser.jay (nullable_type_or_conditional): If we put the
1338         nullable back and our `type' is a `ComposedCast', remove the
1339         nullable from it.  Fixes #75156.
1340
1341         * expression.cs (ComposedCast.RemoveNullable): New public method.
1342
1343 2005-06-08  Martin Baulig  <martin@ximian.com>
1344
1345         The big Iterators rewrite :-)
1346
1347         * iterators.cs: Rewrite this to use the anonymous methods framework.
1348
1349         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1350         before the TypeContainers; see 2test-21.cs.
1351
1352         * class.cs
1353         (TypeContainer.DefineType): Don't create a new EmitContext if we
1354         already have one (this only happens if we're an Iterator).
1355         (TypeContainer.Define): Also call Define() on all our iterators.
1356         (Method.CreateEmitContext): Added support for iterators.
1357
1358         * anonymous.cs
1359         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1360         (AnonymousContainer.CreateMethodHost): Moved here from
1361         AnonymousMethod and made abstract.
1362         (AnonymousContainer.CreateScopeType): New abstract method.
1363         (AnonymousContainer.IsIterator): New public property.
1364         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1365         get the ScopeTypeBuilder rather than manually defining it here. 
1366         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1367         iterators here.
1368
1369         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1370         before RootContext.DefineTypes().
1371
1372         * codegen.cs (EmitContext.RemapToProxy): Removed.
1373         (EmitContext.CurrentAnonymousMethod): Changed type from
1374         AnonymousMethod -> AnonymousContainer.
1375         (EmitContext.ResolveTopBlock): Protect from being called twice.
1376         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1377         (EmitContext.EmitThis): Removed the iterators hacks; use the
1378         anonymous methods framework for that.
1379
1380         * statement.cs
1381         (ToplevelBlock.Container): Make this a property, not a field.
1382         (ToplevelBlock.ReParent): New public method; move the
1383         ToplevelBlock into a new container.
1384         (Foreach.TemporaryVariable): Simplify.
1385
1386 2005-06-05  Martin Baulig  <martin@ximian.com>
1387
1388         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1389         (Block.AddTemporaryVariable): New public method; creates a new
1390         `LocalInfo' for a temporary variable.
1391         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1392         variables here.
1393         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1394         non-iterator variables.
1395
1396 2005-06-05  Martin Baulig  <martin@ximian.com>
1397
1398         * statement.cs (Foreach.TemporaryVariable): Create the
1399         LocalBuilder in the Emit phase and not in Resolve since in some
1400         situations, we don't have an ILGenerator during Resolve; see
1401         2test-19.cs for an example.
1402
1403 2005-06-04  Martin Baulig  <martin@ximian.com>
1404
1405         The big Foreach rewrite - Part II.
1406
1407         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1408         with `PropertyInfo ienumerator_getcurrent'.
1409
1410         * codegen.cs (VariableStorage): Removed.
1411
1412         * statement.cs
1413         (Foreach): Derive from Statement, not ExceptionStatement.
1414         (Foreach.CollectionForeach): New nested class.  Moved all the code
1415         dealing with collection foreach here.
1416         (Foreach.ForeachHelperMethods): Removed.
1417         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1418
1419 2005-05-23  Martin Baulig  <martin@ximian.com>
1420
1421         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1422         don't need to.  Fix #75014.
1423
1424 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1425
1426         Improve user-defined conversion handling.
1427         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1428         applicable operators.
1429         (AddConversionOperators): New.  Helper for GetConversionOperators.
1430         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1431         there is only one most encompassed/encompassing type.
1432         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1433         "applicable operator" handling.
1434         (UserConversion): Move cache here from GetConversionOperators.
1435         Directly cache the chosen operator, rather than the whole
1436         MethodGroup.
1437         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1438         case.  Allow conversion of decimal to sbyte and byte too.
1439         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1440         New static methods.  Used to avoid allocating EmptyExpressions in
1441         convert.cs.
1442
1443 2005-05-24  Duncan Mak  <duncan@novell.com>
1444
1445         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1446         another class, used in Convert.ExplicitNumericConversion.
1447         (CastToDecimal): New class, similar to above, but casts to
1448         System.Decimal, used in Convert.ImplicitNumericConversion and also
1449         in explicit convesion from double/float to decimal.
1450
1451         * convert.cs (ImplicitNumericConversion): Handle implicit
1452         conversions to System.Decimal.
1453         (ExplicitNumericConversion): handle explicit conversions to
1454         System.Decimal.
1455
1456         This fixes #68711.
1457         
1458 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1459
1460         * typemanager.cs: Do not throw an exception in the TypeBuilder
1461         case, we take care of it on the TypeCode.
1462
1463 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1464         
1465         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1466         is back.
1467         
1468         * cs-parser.jay: Catch more lexical errors.
1469         
1470         * report.cs: Add one more Error method.
1471         
1472         * rootcontext.cs,
1473         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1474
1475 2005-05-20  Martin Baulig  <martin@ximian.com>
1476
1477         * class.cs (TypeContainer.CircularDepException): Removed.
1478         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1479         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1480         (CS0146) and interface (CS0529) dependencies here.
1481
1482 2005-05-20  Martin Baulig  <martin@ximian.com>
1483
1484         * expression.cs (New.DoResolve): Move the CS0712 check above the
1485         CS0144 check; otherwise it can never be reached.
1486
1487 2005-05-20  Martin Baulig  <martin@ximian.com>
1488
1489         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1490
1491 2005-05-20  Martin Baulig  <martin@ximian.com>
1492
1493         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1494
1495         * typemanager.cs (TypeManager.IsAttributeType): New public method.
1496
1497 2005-05-19  Martin Baulig  <martin@ximian.com>
1498
1499         * delegate.cs
1500         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1501         to disable error reporting.
1502
1503         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1504         here since we don't want to report an error; see the new test-336.cs.
1505
1506 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1507
1508         * statement.cs (ToplevelBlock.GetParameterReference)
1509         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1510         Move here from class Block.
1511         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1512         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1513
1514 2005-05-18  Martin Baulig  <martin@ximian.com>
1515
1516         Fix #74978.
1517
1518         * flowanalysis.cs
1519         (FlowBranching.Reachability): Add non-static public And() and Or()
1520         methods.
1521         (FlowBranchingSwitch): New class; do the `break_origins' thing
1522         like in FlowBranchingLoop.
1523         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1524         reachability, not just locals and parameters.
1525         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1526         switch; MergeBreakOrigins() now takes care of that.
1527
1528 2005-05-18  Martin Baulig  <martin@ximian.com>
1529
1530         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1531         a loop and may leave it, reset the barrier; fixes #74974.
1532
1533 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1534
1535         Fix test-382.cs.  Emit values of decimal constants.
1536         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1537         Carved out of ...
1538         (TypeContainer.AddField): ... this.
1539         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1540         with initializers to include 'Const's.
1541         (ClassPart.RegisterFieldForInitialization): Forward to
1542         PartialContainer.
1543         * const.cs (Const.Const): Pass initializer to base class.
1544         (Const.Define): In case of decimal constants, register them for
1545         initialization in a static constructor.
1546
1547 2005-05-14  Martin Baulig  <martin@ximian.com>
1548
1549         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1550         do not call ResolveUnreachable() on unreachable statements in
1551         here, see the comment in the source code.
1552
1553 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1554
1555         Fix #74934.
1556         * expression.cs (BinaryResolveOperator): If one of the operands of
1557         an equality comparison is 'null' and the other is a pointer type,
1558         convert the null to a NullPointer.
1559         * convert.cs (ImplicitReferenceConversion): If the expression is a
1560         NullLiteral and the target type is a pointer type, return a
1561         NullPointer instead.
1562         (ImplicitConversionStandard): Likewise.
1563
1564 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1565         
1566         * cs-parser.jay: Set readonly context based on special constructs.
1567         
1568         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1569         readonly variable error handling.
1570         
1571         * rootcontext.cs (EmitCode): Don't verify members when error
1572         occurred.
1573         
1574         * statement.cs (LocalInfo): Add reaodnly context information.
1575         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1576
1577 2005-05-17  Martin Baulig  <martin@ximian.com>
1578
1579         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1580         #70970. 
1581
1582 2005-05-13  Martin Baulig  <martin@ximian.com>
1583
1584         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1585         handle unreachable blocks.
1586
1587 2005-05-13  Martin Baulig  <martin@ximian.com>
1588
1589         * class.cs
1590         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1591         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1592         #74905. 
1593
1594 2005-05-13  Martin Baulig  <martin@ximian.com>
1595
1596         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1597         instance variable, not a local.  Fix #74873.
1598         (Block.ResolveUnreachable): Set it to true here.
1599
1600 2005-05-12  Martin Baulig  <martin@ximian.com>
1601
1602         * cs-parser.jay (property_declaration): Pass the `current_class',
1603         not the `current_container' to Property's .ctor.  Fixes #74912.
1604
1605 2005-05-11  Martin Baulig  <martin@ximian.com>
1606
1607         * typemanager.cs (Closure): Copy this from MCS and merge all the
1608         GMCS-specific changes into it.
1609
1610 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1611
1612         Fix #74920.
1613         * typemanager.cs (unmanaged_enclosing_types): New.
1614         (IsUnmanagedType): Avoid infloops by using
1615         'unmanaged_enclosing_types' to talk with recursive invocations.
1616
1617 2005-05-11  Duncan Mak  <duncan@novell.com>
1618
1619         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1620         continuing to process for 'arg'.
1621         (handle_preprocessing_directive): Check the argument of the #endif
1622         directive and report error CS1025 if there are any trailing
1623         characters.
1624
1625         According to the C# spec, having even whitespace after the #endif
1626         directive is illegal; however, because we call arg.TrimEnd ()
1627         beforehand, we have the same behavior as csc, allowing whitespace
1628         after the directive.
1629
1630         Fixes #74892.
1631
1632 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1633
1634         Fix #74863.
1635         
1636         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1637         (Constructor.GetObsoleteAttribute): Implemented correctly.
1638
1639 2005-05-10  Martin Baulig  <martin@ximian.com>
1640
1641         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1642         resolve the type; fixes #74864.
1643         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1644         in DoResolve(); fixes #74862.
1645
1646 2005-05-10  Martin Baulig  <martin@ximian.com>
1647
1648         * support.cs (ReflectionParameters.ParameterModifier): Use
1649         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1650         and `ParameterAttributes.In'.  Fixes #74884.
1651
1652 2005-05-10  Martin Baulig  <martin@ximian.com>
1653
1654         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1655         the cache if we're just looking for `MemberTypes.NestedType' in a
1656         generic instance.
1657
1658         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1659         constraints if we're still resolving the type tree.
1660         (Expression.MemberLookup): If we're resolving the type tree, only
1661         look for `MemberTypes.NestedType' since we're only interested in
1662         getting types.
1663
1664         * class.cs (TypeContainer.DefineType): Don't resolve the type
1665         parameters here; do this later in ResolveType() after the type
1666         tree has been resolved.
1667         (TypeContainer.ResolveType): New public method; this is called
1668         after the type tree is resolved and before the types are being
1669         populated.  We resolve the generic constraints here.
1670         (TypeContainer.DoDefineMember): Check the constraints on our base
1671         class and interfaces.
1672
1673         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1674         set the `ResolvingTypeTree' flag on the EmitContext.
1675
1676         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1677
1678 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1679
1680         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1681         
1682         * expression.cs (Argument.GetParameterModifier): Turned to property.
1683         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1684         
1685         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1686         its C# equivalent.
1687         
1688 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1689
1690         Fix #74852.
1691         * decl.cs (MemberCache.AddMethods): Register override methods,
1692         rather than non-override methods.
1693         * typemanager.cs (RegisterOverride): New.
1694         (IsOverride): Update.
1695
1696 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1697
1698         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1699
1700 2005-05-06  Martin Baulig  <martin@ximian.com>
1701
1702         * attribute.cs
1703         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1704         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1705
1706 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1707
1708         Fix #73105.
1709         
1710         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1711         recursive declaration.
1712         
1713         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1714         
1715 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1716
1717         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1718         
1719         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1720
1721 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1722
1723         Fix #74797.
1724         * decl.cs (DeclSpace.FamilyAccessible): 
1725         Use TypeManager.IsNestedFamilyAccessible.
1726
1727         Fix reopened #64812.
1728         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1729         internal'.
1730
1731 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1732             Abin Thomas  <projectmonokochi@rediffmail.com>
1733             Anoob V E  <projectmonokochi@rediffmail.com>
1734             Harilal P R  <projectmonokochi@rediffmail.com>
1735
1736         Fix #64812.
1737         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1738         allow access to all static members.
1739
1740 2005-05-04  Martin Baulig  <martin@ximian.com>
1741
1742         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1743
1744 2005-05-04  Martin Baulig  <martin@ximian.com>
1745
1746         Fix #74655.
1747
1748         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1749         section at the end; make things work if `default' is not the last
1750         section.        
1751
1752 2005-05-04  Martin Baulig  <martin@ximian.com>
1753
1754         Fix #70400.
1755
1756         * statement.cs (Switch): Replaced the `got_default' field with a
1757         `default_section' one.
1758         (Switch.CheckSwitch): Set `default_section' here.
1759         (Switch.Resolve): If we're a constant switch and the constant is
1760         not found, use the default section.
1761
1762 2005-05-03  Martin Baulig  <martin@ximian.com>
1763
1764         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1765
1766         * statement.cs (Foreach.ArrayForeach): New nested class.
1767         (Foreach.TemporaryVariable): New nested class.
1768         (Foreach.EmitArrayForeach): Removed; this is now in the new
1769         ArrayForeach class.
1770
1771 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1772
1773         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1774         more conservative.
1775         (VerifyPendingMethods): Revert change below.
1776
1777         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1778         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1779         that used to trigger warning -28.  Remove warning -28.
1780         * expression.cs (Invocation.OverloadResolve): Use
1781         TypeManager.IsOverride to distinguish override methods.
1782
1783         Fix #74773.
1784         * pending.cs (VerifyPendingMethods): If a base type implements the
1785         requested interface, don't bother checking individual methods of
1786         the base type.  As a side-effect, this prevents the creation of
1787         unnecessary proxies.
1788
1789 2005-05-02  Martin Baulig  <martin@ximian.com>
1790
1791         Fix #70182.
1792
1793         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1794         Also `And' the locals if the old vector is null.
1795         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1796         null; in this case we basically reset all the variables.        
1797
1798 2005-05-02  Martin Baulig  <martin@ximian.com>
1799
1800         Fix #74529.
1801
1802         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1803         Added `FlowBranching branching' argument; always `and' the
1804         variables instead of `or'ing them unless we're an infinite loop.
1805
1806         * statement.cs (While.Resolve): Create a new sibling unless we're
1807         infinite.       
1808
1809 2005-05-02  Martin Baulig  <martin@ximian.com>
1810
1811         Fix #70140.
1812
1813         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1814         arguments; use it instead of creating a new TopLevelBlock.
1815         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1816         our ConstructorInitializer.
1817
1818         * statement.cs
1819         (TopLevelBlock.TopLevelBranching): New public property.
1820         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1821         and create our `TopLevelBranching'.
1822
1823         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1824         anonymous method host, use `block.TopLevelBranching' rather than
1825         creating a new branching.
1826
1827 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1828
1829         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1830         a ScopeInfo, if any of the current children is a child of the new
1831         entry, move those children there.
1832
1833 2005-04-30  Martin Baulig  <martin@ximian.com>
1834
1835         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1836         at the beginning of a SwitchSection.  Fix #73335.
1837
1838 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1839
1840         Fix #74378
1841         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1842         
1843         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1844         (FieldExpr.DoResolve): Obsolete members are ignored for field
1845         initializers.
1846         
1847 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1848
1849         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1850         of arrays detection.
1851
1852         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1853         verification.
1854         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1855
1856         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1857         arrays report.
1858
1859 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1860
1861         * cs-parser.jay: Use the prefered version of -unsafe in error
1862         message.
1863
1864 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1865
1866         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1867         circumstances.
1868
1869 2005-04-20  John Luke  <john.luke@gmail.com>
1870
1871         * driver.cs: fix typo in error message, --outout to --output
1872
1873 2005-04-30  Martin Baulig  <martin@ximian.com>
1874
1875         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1876         handle the .NET 2.x security attributes.
1877
1878 2005-04-30  Martin Baulig  <martin@ximian.com>
1879
1880         * typemanager.cs
1881         (TypeManager.ExpandInterfaces): Don't add things twice.
1882
1883         * class.cs
1884         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1885
1886 2005-04-29  Martin Baulig  <martin@ximian.com>
1887
1888         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1889
1890         * anonymous.cs: Added support for anonymous generic methods.
1891
1892 2005-04-29  Martin Baulig  <martin@ximian.com>
1893
1894         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1895         generic instances.
1896
1897 2005-04-29  Martin Baulig  <martin@ximian.com>
1898
1899         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1900
1901         * expression.cs (New.DoResolve): Fix the CS0304 check.
1902
1903 2005-04-29  Martin Baulig  <martin@ximian.com>
1904
1905         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1906         naming schema.
1907
1908         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1909         explicit interface implementation, compare the interface types.
1910         (MethodData.Define): Use the new naming scheme from the latest
1911         .NET 2.x beta2.
1912         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1913
1914         * decl.cs (MemberName.GetMemberName): Removed.
1915         (MemberName.MethodName, FullName): New properties.
1916
1917 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1918
1919         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1920
1921 2005-04-22  Martin Baulig  <martin@ximian.com>
1922
1923         * generic.cs (GenericMethod): Create the EmitContext in the
1924         `Define()'; in `Define(MethodBuilder)', create the type parameters
1925         before calling `Define()'.  Fixes #73933.
1926
1927 2005-04-22  Martin Baulig  <martin@ximian.com>
1928
1929         * generic.cs
1930         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1931         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1932
1933         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1934         ConstructedType, check its constraints.
1935
1936 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1937
1938         * codegen.cs (InRefOutArgumentResolving): New field.
1939         
1940         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1941         fields outside contructor.
1942         
1943         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1944         
1945 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1946
1947         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1948         parameter code was not completed ever, so it was not as up-to-date
1949         as local variables.  Must finish it.
1950
1951         The bug fix was to compare the Toplevel of the block, not the
1952         current block.  Thanks for Ben for pointing this out. 
1953
1954 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1955
1956         * decl.cs (AddMethods): Use the declaring type of the problem
1957         method to determine if we want to squash a warning.
1958
1959 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1960
1961         * attribute.cs: Removed debug output.
1962
1963         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1964         
1965         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1966         Report.Stderr.
1967         
1968 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1969
1970         Fix #74481.
1971         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1972         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1973         all null comparisons against reference types.
1974
1975 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1976
1977         Fix# 74565
1978         * class.cs (TypeContainer.CircularDepException) New nested
1979         exception class.
1980         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1981         (TypeContainer.DefineType): Removed error, reset InTransit before
1982         exit.
1983         (Class.DefineType): Throw exception when is in Transit.
1984         Catch exception and report error.
1985         (Struct.DefineType): Throw exception when is in Transit.
1986         Catch exception and report error.
1987         (Interface.DefineType): Throw exception when is in Transit.
1988         Catch exception and report error.
1989
1990         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1991         handle nested exception handlers.
1992
1993         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1994         a catch.
1995
1996         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1997         InFinally and InCatch storage.
1998
1999         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2000         (Catch.Resolve): Set and Restore ec.InCatch.
2001         (Try.Resolve): Set and Restore ec.InFinally.
2002         (Try.HasCatch): True when try has catch.
2003
2004 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2005
2006         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2007           for the same event member, so exclude such cases from warning 419.
2008           Fixed bug #74633.
2009
2010 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2011
2012         * expression.cs (Binary.ResolveOperator): Apply patch from John
2013         Luke to fix bug 59864: operators &, | and ^ on enumerations
2014         require that the same enum type on both sides.
2015
2016         * driver.cs: Add warnings to old flag usage, this is to assist
2017         people who produce Makefiles and hope that the Makefiles will be
2018         used on Windows.
2019
2020         * class.cs (TypeContainer.EmitType): Moved the definition of the
2021         special $PRIVATE$ field from the resolve phase to the Emit phase.
2022         During resolve we do not know if we are a struct with
2023         HasExplicitLayout, we know this only after the attributes for the
2024         type are emitted.
2025
2026         Set the FieldOffset to zero on the dummy field that we create for
2027         the class.   Fixes 74590.
2028
2029 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2030
2031         Fix #73834.
2032         * ecore.cs (PropertyExpr.resolved): New.
2033         (DoResolve): Use it to handle a case of double resolution here.
2034         Handle a case of identical-name-and-type-name.
2035         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2036         resolution by storing the results of expression resolution back
2037         into the "probes" array.
2038
2039 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2040
2041         Fix cs0208-7.cs and cs0208-8.cs.
2042         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2043         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2044         error reporting to point out the reason a struct is not unmanaged.
2045
2046 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2047
2048         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2049           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2050
2051 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2052
2053         Fix #74528.
2054         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2055         IdenticalNameAndTypeName here.
2056         (EventExpr.InstanceResolve): Likewise.
2057
2058 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2059
2060         C# 2.0 DefaultCharSetAttribute implementation
2061         
2062         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2063         which allows us to set GlobalNamespace for every resolve.
2064         (Attribute.ResolveArguments): Cut from Resolve.
2065         (Attribute.GetCharSetValue): Returns CharSet named argument.
2066         (Attribute.DefinePInvokeMethod): Gets default charset from
2067         module settings.
2068         (GlobalAttribute.ResolveAsTypeStep): Override.
2069         (GlobalAttribute.ResolveArguments): Override.
2070         
2071         * class.cs (TypeAttr): Is protected.
2072         
2073         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2074         (ModuleClass.DefaultCharSetType): New memeber.
2075         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2076         
2077         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2078         charset from module.
2079         
2080         * delegate.cs (TypeAttr): Override.
2081         (Delegate.DefineType): Use this TypeAttr.
2082         
2083         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2084         at very early stage (before types are defined) to resolve model
2085         module attributes. It will probably not work with corlib but it
2086         should be ok.
2087         
2088         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2089         charset from module.
2090         
2091         * typemanager.cs (default_charset_type): New type.
2092
2093 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2094
2095         * decl.cs (MemberCache.AddMethods): Don't warn if
2096         System.Object.Finalize has buggy MethodAttributes.
2097
2098         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2099         removed below.
2100
2101 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2102
2103         * doc.cs : detect ambiguous reference to overloaded members.
2104           Fixed bug #71603. MS 1.1 csc does not detect it.
2105
2106 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2107
2108         * doc.cs : delegates must not be referenced with parameters.
2109           Fixed bug #71605.
2110
2111 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2112
2113         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2114
2115 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2116
2117         * driver.cs (MainDriver): Stop processing if the CLS stage found
2118         errors. 
2119
2120         (CompilerCallableEntryPoint.InvokeCompiler): Always
2121         reset after execution;   Take a TextWriter argument for the
2122         output.
2123
2124         * report.cs: Use the error stream instead of hardcoding stderr. 
2125
2126 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2127
2128         * class.cs: Reduce code paths to test, too small of an
2129         optimization to make it worth the extra testing.  Always perform
2130         it. 
2131
2132 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2133
2134         Fix #74510.
2135         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2136         operators that had errors reported on them.
2137
2138 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2139
2140         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2141         argument types.
2142         (Attribute.Resolve): Add named argument type checking.
2143         
2144         * class.cs (FixedField.Define): Use IsPrimitiveType
2145         
2146         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2147         
2148         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2149         unsafe parameter types.
2150         
2151         * statement.cs (Using.ResolveExpression): Add better error description.
2152         
2153         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2154         
2155 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2156
2157         Fix #74484.
2158         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2159         AttributeUsageAttribute in the emitcontext of the attribute class,
2160         not in the emitcontext of the attributable entity it was attached to.
2161         * cs-parser.jay: Use 'current_class', not 'current_container',
2162         when creating a GlobalAttribute.
2163
2164 2005-04-08  Alp Toker  <alp@atoker.com>
2165
2166         * pending.cs: The fix to #58413 failed to compile methods implementing
2167         interfaces with/without params modifiers and vice versa, even though
2168         params modifiers aren't part of the signature. Make the modifier check
2169         less strict as in csc.
2170
2171 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2172             Anoob V E  <projectmonokochi@rediffmail.com>
2173             Harilal P R  <projectmonokochi@rediffmail.com>
2174
2175         Fix #58413.
2176         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2177         modifiers of pending methods.
2178         (PendingImplementation.PendingImplementation): Initialize it.
2179         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2180         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2181         with ParameterData.  Add check for modifiers.
2182         * class.cs (MethodData.Define): Update to changes.
2183
2184 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2185
2186         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2187
2188 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2191         property.
2192         
2193         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2194         
2195         * rootcontext.cs,
2196         * typemanager.cs: Registered RequiredAttributeAttribute.
2197         
2198 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2199
2200         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2201         Warning CS0169 is back at level 3.
2202         (IMethodData.SetMemberIsUsed): New method.
2203         
2204         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2205         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2206         
2207         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2208
2209         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2210         contants.
2211         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2212         is used.
2213         
2214         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2215         is used.
2216         
2217         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2218         to avoid the problems with nested types.
2219
2220 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2221             Anoob V.E  <projectmonokochi@rediffmail.com>
2222             Harilal P.R  <projectmonokochi@rediffmail.com>
2223             Raja R Harinath  <rharinath@novell.com>
2224
2225         Fix #73820.
2226         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2227         attribute.
2228         * typemanager (GetConstructor): Make public.
2229
2230 2005-04-05  John Luke  <john.luke@gmail.com>
2231             Raja R Harinath  <rharinath@novell.com>
2232
2233         Fix #62232.
2234         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2235         struct too.  Return false quicker in a few cases.
2236         (VerifyUnManaged): Use it.
2237
2238 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2239
2240         Fix #74041.
2241         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2242         not 'unreachable_seen'.
2243
2244 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2245
2246         * attribute.cs (Attribute.GetValue): Removed unused.
2247         
2248         * codegen.cs (CodeGen.TrimExt): Removed unused.
2249         
2250         * cs-parser.jay (output): Removed unused.
2251         
2252         * cs-tokenizer.cs (hex_digits): Removed unused.
2253         
2254         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2255         
2256         * expression.cs (Indirection.LoadExprValue): Removed unused.
2257         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2258         
2259         * iterators.cs (Iterator.param_types): Removed unused.
2260         
2261         * statement.cs (Goto.block): Removed unused.
2262         (ToplevelBlock.did): Removed unused.
2263         (Switch.ResolveConstantSwitch): Removed unused.
2264
2265 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2266
2267         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2268         resetting thingy.
2269
2270 2005-04-19  Martin Baulig  <martin@ximian.com>
2271
2272         Merged r42462 from MCS and made it work for GMCS.
2273
2274         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2275
2276         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2277
2278 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2279
2280         Fix #74232 and cs0208-3.cs.
2281         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2282         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2283         unmanaged type.  Don't use FieldBuilders when 't' is a
2284         TypeBuilder.  Use ModFlags and MemberType fields.
2285         * class.cs (MemberBase.member_type): Rename from MemberType.
2286         (MemberBase.MemberType): New property.  Determines member_type on
2287         demand.
2288         (MemberBase.DoDefine): Don't initialize MemberType here.
2289         (FieldMember.Define): Likewise.
2290
2291 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2292
2293         Fix #74241
2294         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2295         Attributes are emitted there.
2296         
2297 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2298
2299         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2300         keyword in 'partial enum' too.
2301         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2302         is not allowed).
2303         Report from Kamil Skalski <nazgul@omega.pl>.
2304
2305         Fix #74309.
2306         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2307         have partial containers too.
2308
2309         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2310         in block' checks to Block.CheckInvariantMeaningInBlock.
2311         * statement.cs (Block.GetKnownVariableInfo): Make private.
2312         (Block.IsVariableUsedInChildBlock): Remove.
2313         (Block.IsVariableUsedInBlock): Likewise.
2314         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2315         conflicting declaration.
2316         (Block.AddVariable): Make error messages less long-winded and more
2317         specific.  Show location of conflicting declaration.
2318         * parameter.cs (Parameters.Location): New readonly property.
2319
2320 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2321
2322         Clean up semantics of invoking ResolveMemberAccess.
2323         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2324         can have an instance, ensure that we pass in a non-TypeExpression
2325         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2326         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2327         argument.  Update to changes and simplify.
2328         (FieldExpr.Emitinstance): Remove CS0120 check.
2329         (PropertyExpr.EmitInstance): Likewise.
2330         * expression.cs (Argument.Resolve): Likewise.
2331         (Invocation.DoResolve): Update to changes in semantics of
2332         InstanceExpression.
2333
2334 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2335
2336         Fix #74241
2337         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2338         customization.
2339         
2340         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2341
2342 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2343
2344         Fix difference in behaviour with commandline invocation.
2345         * driver.cs (Driver.Reset): New.
2346         (CompilerCallableEntryPoint): Call it.
2347
2348         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2349         variable" warnings if the boolean expression failed to resolve.
2350
2351 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2352
2353         * attribute.cs: Fix the union of several permissions when some of them
2354         are unrestricted (so the result isn't an unrestricted permission set).
2355         Fix #74036.
2356
2357 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2358
2359         * ecore.cs (MemberExpr): New class.  Convert from interface
2360         IMemberExpr.
2361         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2362         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2363         error checks.
2364         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2365         (MethodGroupExpr.IsExplicitImpl): Remove.
2366         (Expression.GetFieldFromEvent): Remove.
2367         (SimpleName.MemberStaticCheck): Remove.
2368         (SimpleName.DoSimpleNameResolve): Update to changes.
2369         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2370         (MemberAccess.IdenticalNameAndTypeName): Remove.
2371         (MemberAccess.error176): Move to MemberExpr.
2372         (MemberAccess.DoResolve): Update to changes.
2373         (BaseAccess.DoResolve): Likewise.
2374
2375 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2376
2377         C# 2.0 Conditional attribute class implementation
2378         
2379         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2380         Analyzes class whether it has attribute which has ConditionalAttribute
2381         and its condition is not defined.
2382         
2383         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2384         (Class.IsExcluded): New method. Search for at least one defined
2385         condition in ConditionalAttribute of attribute class.
2386
2387 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2388
2389         * ecore.cs (PropertyExpr): Derive from Expression, not
2390         ExpressionStatement.
2391         (PropertyExpr.EmitStatement): Remove.
2392
2393 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2394
2395         Fix #74060.
2396         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2397         internal field "value__" of an enum be private.  The examples for
2398         "value__" that I found on MSDN all used FieldAttributes.Private.
2399
2400         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2401         Don't mention IL method attribute names.
2402
2403         Fix #47991.  Remove a TODO.
2404         * statement.cs (Block.Toplevel): Make into a field.
2405         (Block.Parameters): Move into ToplevelBlock.
2406         (Block.known_variables): Rename from child_variable_names.
2407         (Block.Block): Remove variants that take Parameters.  Initialize
2408         'Toplevel' with the immediately surrounding toplevel block.
2409         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2410         LocalInfo parameter.
2411         (Block.GetKnownVariableInfo): New.
2412         (Block.IsVariableNameUsedInChildBlock): Update.
2413         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2414         the block, even though it may not be in scope.
2415         (Block.AddVariable): Remove Parameters parameter.  Use
2416         Toplevel.Parameters instead.
2417         (Block.AddConstant): Remove Parameters parameter.
2418         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2419         (Block.IsParamaterReference): Likewise.
2420         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2421         (ToplevelBlock.Parameters): New.  Moved from Block.
2422         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2423         initialize Parameters to a non-null value.
2424         * cs-parser.jay: Update to changes.
2425         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2426         simple names that mean different things in the same block.  Use
2427         Block.IsVariableNameUsedInBlock.
2428
2429 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2430
2431         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2432
2433 2005-03-26  Raja R Harinath  <harinath@acm.org>
2434
2435         Fix #73038.
2436         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2437         fails to resolve, ensure that the LHS is still resolved as an
2438         lvalue.
2439
2440 2005-03-25  Raja R Harinath  <harinath@acm.org>
2441
2442         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2443         ec.ContainerType.
2444         (Enum.current_ec): Remove.
2445         (Enum.LookupEnumValue): Remove EmitContext argument.
2446         Just uses the one created during DefineType.
2447         (Enum.FindMembers): Update.
2448         * expression.cs (MemberAccess.DoResolve): Update.
2449
2450 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2451
2452         * assign.cs (Assign.DoResolve): Check for CS1717 when
2453         source and target are same (uses Equals).
2454
2455         * expression.cs (LocalVariableReference, ParameterReference,
2456         This): Implemented Equals, GetHashCode.
2457
2458         * statement.cs (Block.GetParameterReference): Removed useless
2459         local variable.
2460
2461 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2462
2463         Fix cs0128.cs
2464         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2465         blocks before deciding whether the error is cs0136 or cs0128.
2466
2467         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2468         (using_alias_directive, using_namespace_directive): Pass
2469         MemberName, not an expression to Namespace.UsingAlias and
2470         Namespace.Using.
2471         (MakeName): Use the MemberName of the namespace.
2472         * namespace.cs (Namespace.MemberName): New.
2473         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2474         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2475         Likewise.
2476         * decl.cs (MemberName.Name): Make readonly.
2477         (MemberName.FromDotted): New "constructor".
2478         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2479         (MemberCore.Name): Compute from MemberName on demand.
2480         (MemberCore.SetMemberName): Provide a way to change the
2481         MemberName.
2482         (MemberCore.AddToContainer): Don't take a fullname parameter.
2483         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2484         fully qualified name of the container to the member name.
2485         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2486         only if the type is a member of the root container.
2487         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2488         MemberName.Left rather than searching for an embedded ".".
2489         (PartialContainer.CreatePart): Update to changes in RootContext.
2490         (MemberBase.ShortName): Turn into a property.  Use
2491         MemberCore.SetMemberName.
2492         (MemberBase.ExplicitInterfaceName): Remove.
2493         (MemberBase.UpdateMemberName): Remove.
2494         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2495         (PropertyBase.SetMemberName): New override.
2496         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2497         (Tree.GetDecl): New.
2498         (Tree.AllDecls): Rename from Decls.
2499         * attribute.cs, enum.cs, report.cs: Update to changes.
2500         * driver.cs (MainDriver): Use MemberName.FromDotted on
2501         RootContext.MainClass.
2502
2503 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2504
2505         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2506         checks.
2507
2508         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2509
2510 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2511
2512         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2513         property accessor modifiers.
2514
2515         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2516         fixed buffer attribute (CS1716).
2517         (PropertyMethod.HasCustomAccessModifier): When property accessor
2518         has custom modifier.
2519
2520         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2521         modifiers.
2522         (PropertyExpr.DoResolveLValue): Add CS0272.
2523
2524 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2525
2526         * convert.cs: When converting to a pointer, use the proper Conv.U
2527         or Conv.I depending on the source data type.
2528
2529         * cs-tokenizer.cs: Make the size for large decimal constants,
2530         fixes #72957.
2531
2532 2005-03-17  Martin Baulig  <martin@ximian.com>
2533
2534         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2535         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2536
2537 2005-03-17  Martin Baulig  <martin@ximian.com>
2538
2539         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2540         to bool so we can return an error condition.
2541         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2542         returned an error.
2543
2544 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2545
2546         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2547         attributes.
2548
2549 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2550
2551         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2552         Refactor to avoid traversing the list of assemblies, and to avoid
2553         string concatenation.
2554         * typemanager.cs (guid_attr_type): Remove.
2555         (negative_hits, pointers, references): Remove hashes.
2556         (type_hash): New.
2557         (GetConstructedType): New.  Uses type_hash to handle constructed
2558         types (arrays, references, pointers).
2559         (GetReferenceType, GetPointerType): Use it.
2560         (GetNestedType): New.  Uses type_hash to handle nested types of
2561         reflected types.
2562         (LookupType, LookupTypeDirect): Remove.
2563         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2564         'types' hash and LookupTypeReflection directly.
2565         (params_string, params_object): Use GetConstructedType.
2566         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2567         top-level types.
2568         (Namespace.Lookup): Use cached_types.
2569         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2570         provided by old TypeManager.LookupType.
2571         * rootcontext.cs (MakeFQN): Remove.
2572         * decl.cs (DeclSpace.MakeFQN): Likewise.
2573         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2574         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2575         TypeManager.GetConstructedType.
2576         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2577
2578 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
2579
2580         * cs-parser.jay: Fix build.
2581
2582 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2583
2584         * class.cs (TypeContainer.CircularDepException) New nested
2585         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2586
2587         * cs-parser.jay: Reports CS1527 for any namespace element.
2588
2589         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2590         Added CS0407.
2591
2592         * expression.cs (ParameterReference.IsAssigned): Changed error to
2593         CS0269.
2594         (Error_WrongNumArguments): Moved CS0245 detection here.
2595
2596         * statement.cs (Return.Resolve): Add CS1622 report.
2597
2598 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2601
2602 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2603
2604         * attribute.cs expression.cs: Get rid of some allocations.
2605
2606 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2607
2608         * doc.cs : just eliminate the latest change.
2609
2610 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2611
2612         * doc.cs : commented out the latest change. It breaks xml-030.cs
2613
2614 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2615
2616         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2617           fail. So invoke CreateType() in FindDocumentedType().
2618
2619 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2620
2621         * cs-tokenizer.cs : added IsKeyword().
2622         * doc.cs : Detect keyword incorrectly used as identifier.
2623           Allow identifiers prefixed by @.
2624
2625 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2626
2627         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2628         It caused exception in namespace resolving (again!).
2629         
2630         * class.cs (Class.ctor): Removed exit.
2631         (PropertyMethod.ctor): ditto.
2632         
2633         * codegen.cs (Codegen.Reset): Reset static data.
2634         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2635         
2636         * cs-tokenizer.cs (Cleanup): Removed.
2637         
2638         * driver.cs (GetSystemDir): Rewrote to one line command.
2639         It caused problem with unloaded dynamic modules.
2640         (UnixParseOption): Removed Exit.
2641         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2642         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2643         Now can be mcs used as library.
2644         
2645         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2646         empty location.
2647         
2648         * location.cs (Reset): Reset static data.
2649         
2650         * namespace.cs (Reset): Reset static data.
2651         
2652         * report.cs (Report.Reset): Reset static data.
2653         
2654         * rootcontext.cs (RootContext.Reset): Reset static data.
2655         
2656         * tree.cs (RootTypes.ctor): Use Location.Null
2657         
2658         * typemanager.cs (TypeManager.Reset): Reset static data.
2659         (CoreLookupType): Removed Exit.
2660         (TypeHandle.Reset): Reset static data.
2661         
2662 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2663
2664         Fix #73516.
2665         * typemanager.cs (ComputeNamespaces): Import namespaces from
2666         referenced modules too.
2667
2668 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2669
2670         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2671         than '.'.
2672
2673 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2674
2675         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2676         enclosing DeclSpace.  This ensures that a name-lookup populates
2677         more caches and there are fewer 'TypeExpression's.  Carve out
2678         nested type lookup into ...
2679         (LookupNestedTypeInHierarchy): ... this.
2680
2681 2005-04-15  Martin Baulig  <martin@ximian.com>
2682
2683         Merged r41590 from MCS and make it work in the generics land.
2684
2685         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2686         `check' argument.
2687
2688         * class.cs (PartialContainer.UpdateConstraints): Removed.
2689         (PartialContainer.CheckConstraints): Removed.
2690         (PartialContainer.SetParameterInfo): Store the constraints here.
2691         (PartialContainer.DefineTypeParameters): New public method;
2692         resolve the type parameter's constraints here.  Note that the
2693         PartialContainer doesn't have an EmitContext anymore, so we must
2694         do this in the ClassPart.
2695
2696 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2697
2698         Clean up a few partial-class semantics.  
2699         Fixes test-357.cs and cs1618-2.cs.
2700         * cs-parser.jay (struct_declaration): Use 'current_class' as
2701         parent of newly-created struct.  Remove call to Register ().
2702         Use 'pop_current_class' to complete handing the current struct.
2703         (interface_declaration): Likewise.
2704         (class_declaration): Likewise.
2705         (enum_declaration): Use 'current_class' as parent of newly created
2706         enum.
2707         (delegate_declaration): Likewise.
2708         (pop_current_class): New function.  This is used to handle closing
2709         up the 'current_class' and 'current_container', and pointing them
2710         to the enclosing class/container.
2711         (CSharpParser): Initialize 'current_class' too.
2712         * decl.cs (MemberCore): Add check for invariant: a partial
2713         container is not a parsed entity, and thus does not enclose any
2714         parsed members.
2715         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2716         (DeclSpace.BaseTypeExpr): Use it.
2717         (DeclSpace.LookupType): Add check for invariant.
2718         * class.cs (TypeContainer): Add check for invariant: a nested
2719         class should have the same NamespaceEntry as its enclosing class.
2720         (TypeContainer.EmitFieldInitializers): Make virtual.
2721         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2722         MemberCore.
2723         (TypeContainer.Register): Remove.
2724         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2725         null.  Use TypeResolveEmitContext for resolving base types and
2726         interfaces.  Move initialization of Parts.TypeBuilder here from
2727         ...
2728         (TypeContainer.DefineNestedTypes): ... here.
2729         (PartialContainer): Take a Namespace not a NamespaceEntry.
2730         (PartialContainer.Create): Don't use Register.  Call the
2731         appropriate Add... function directly.
2732         (ClassPart): Take both the PartialContainer and the enclosing
2733         class as constructor arguments.
2734         (ClassPart.EmitFieldInitializers): Override.
2735         (ClassPart.PartFindNestedTypes): Remove.
2736         (FieldBase.GetInitializerExpression): Resolve the initializer
2737         expression in the emit context of the enclosing class.
2738         * tree.cs (RootTypes): Remove Register ().
2739         
2740 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2741
2742         * cs-parser.jay: Removed CS0134.
2743         
2744         * driver.cs: Removed CS1901.
2745         
2746         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2747         for predefined types.
2748
2749 2005-03-07  Duncan Mak  <duncan@novell.com>
2750
2751         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2752         well. Fixes bug #73454.
2753
2754 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2755
2756         * cs-tokenizer.cs (xtoken): Add CS1035.
2757         
2758         * class.cs (MethodData.Define): Add CS0683.
2759         (FieldMember.ctor): Add CS0681.
2760
2761 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2762
2763         * ecore.cs (SimpleName.DoResolve): Rename from
2764         SimpleName.DoResolveAllowStatic.
2765         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2766         Pass 'intermediate' flag to MemberStaticCheck.
2767         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2768         of "intermediate" lookups via MemberAccess.
2769         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2770         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2771
2772 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2773
2774         Fix #73394.
2775         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2776         slipped in because of variable names that are identical to a
2777         builtin type's BCL equivalent ('string String;', 'int Int32;').
2778         (PropertyExpr.EmitInstance): Likewise.
2779
2780 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2781
2782         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2783         
2784         * report.cs (warning_ignore_table): Made public.
2785
2786 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2787
2788         Fix #73282.
2789         * class.cs (MethodData.Emit): Pass 'container' to
2790         container.GetObsoleteAttribute instead of 'container.Parent'.
2791
2792 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2793
2794         * cs-parser.jay: Add 1534 error test.
2795
2796         * iterators.cs (Yield.CheckContext): Add error 1629.
2797         (Iterator.ctor): Save unsafe modifier.
2798         (MoveNextMethod.DoEmit): Restore unsafe context.
2799
2800         * namespace.cs (UsingAlias): Better error message.
2801
2802 2005-03-03  Dan Winship  <danw@novell.com>
2803
2804         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2805         the warning message [#73219]
2806
2807 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2808
2809         Fix compile with MCS 1.0.0.0.
2810         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2811         w_restore to not depend on string constant folding.
2812
2813 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2814
2815         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2816         CS0246 check to users who passed 'silent = false'.
2817         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2818         check.
2819         (SimpleName.SimpleNameResolve): Update.
2820         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2821         (MemberAccess.IdenticalNameAndTypeName): Update.
2822         * doc.cs (FindDocumentedTypeNonArray): Update.
2823
2824 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2825
2826         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2827         * parameters.cs (ComputeAndDefineParameters): Remove.
2828         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2829         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2830         Use GetParameterInfo.
2831
2832 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2835
2836 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2837
2838         Unify DeclSpace.LookupType and DeclSpace.FindType.
2839         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2840         is in charge of defining nested types on demand.
2841         (DeclSpace.LookupType): Use it when the current_type is a
2842         TypeBuilder.  Use LookupTypeDirect for reflected types.
2843         (DeclSpace.FindType): Remove.
2844         (DeclSpace.LookupInterfaceOrClass): Likewise.
2845         (DeclSpace.DefineTypeAndParents): Likewise.
2846         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2847         DeclSpace.LookupType.
2848         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2849         * typemanager.cs (LookupType): Simplify.
2850         (AddUserType): Remove type from negative_hits.
2851         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2852         * class.cs (TypeContainer.FindMembers): Move handling of nested
2853         types ...
2854         (TypeContainer.FindMembers_NestedTypes): ... here.
2855         (TypeContainer.FindNestedType): Implement override.
2856         (ClassPart.FindNestedType): Delegate to PartialContainer.
2857         (ClassPart.PartFindNestedType): Looks up the nested types of the
2858         part alone.
2859
2860 2005-04-14  Martin Baulig  <martin@ximian.com>
2861
2862         * generic.cs (ConstructedType): Moved all the type lookup and
2863         nested class logic into SimpleName.
2864         (ConstructedType.ResolveConstructedType): Our underlying type is
2865         already fully resolved; all the type lookup stuff is in
2866         SimpleName.
2867
2868         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2869         constructed types here instead of in ConstructedType.
2870
2871         * decl.cs (MemberName.GetTypeExpression): Always create a
2872         SimpleName, not a ConstructedType.
2873         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2874
2875 2005-03-02  Martin Baulig  <martin@ximian.com>
2876
2877         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2878         static constructor in static classes.
2879
2880 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2881
2882         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2883         sizeParamIndex is not specified.
2884
2885 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2886
2887         Fix #73117
2888         * report.cs (WarningMessage.IsEnabled): Missing null check.
2889
2890 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2891
2892         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2893         in the fields and not in the properties.
2894
2895 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2896
2897         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2898         fields as well.
2899
2900 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2901
2902         * attribute.cs: Small refactoring (improved robustness).
2903         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2904         (ValidateGuid): Removed.
2905         (Resolve): Removed referenced to above mentioned.
2906         (GetAttributeUsage): Made private and changed to work without
2907         class assistance.
2908         (GetIndexerAttributeValue): Don't crash.
2909         (GetConditionalAttributeValue): Ditto.
2910         (GetClsCompliantAttributeValue): Ditto.
2911         (ExtractSecurityPermissionSet): All attributes exceptions are
2912         error 648.
2913         (GetPropertyValue): New helper.
2914         (GetMethodImplOptions): New method.
2915         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2916         some missing properties.
2917         
2918         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2919         (Method.ApplyAttributeBuilder): Updated.
2920         
2921         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2922         exception.
2923
2924 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2925
2926         Fix #73052.
2927         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2928         non-simple types (array, pointer, reference).
2929
2930 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2931
2932         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2933
2934         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2935         for operators.
2936         (Method.CheckBase): Catch wrong destructor here.
2937         (MethodData.Define): Add errors 550, 668.
2938
2939         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2940
2941         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2942
2943         * pending.cs (VerifyPendingMethods): Add error 551.
2944
2945         * typemanager.cs (CSharpName): Next error report helper.
2946
2947 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2948
2949         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2950         attributes. Removed useless attribute double check.
2951         It saves almost 2MBs for corlib.
2952
2953 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2954
2955         Fix #72924.
2956         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2957         called twice in case of error.
2958
2959 2005-02-23  Chris Toshok  <toshok@ximian.com>
2960
2961         Fix compiler portions of #72827.
2962         * statement.cs (Block.Emit): call Begin/EndScope on the
2963         EmitContext instead of the ILGenerator.
2964
2965         * codegen.cs (EmitContext.BeginScope): new method, call
2966         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2967         we have one.)
2968         (EmitContext.BeginScope): same, but EndScope and CloseScope
2969
2970         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2971         offset and call the superclass's OpenScope(int) with it.
2972         (SymbolWriter.CloseScope): get the current il
2973         offset and call superclass's CloseScope(int) with it.
2974
2975 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2976
2977         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2978         CS1677 for out and ref as well.
2979
2980         * class.cs (Method.Define): Add error CS1599 detection.
2981         
2982         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2983         
2984         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2985         
2986         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2987         
2988         * support.cs.cs (ModifierDesc): New helper method.
2989
2990 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2991             Abin Thomas  <projectmonokochi@rediffmail.com>
2992             Anoob V E  <projectmonokochi@rediffmail.com>
2993             Harilal P R  <projectmonokochi@rediffmail.com>
2994
2995         Fix #57851, #72718.
2996         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2997         MemberLookup (used for error reporting) actually returns a result.
2998         Fix error report number (122, not 112).
2999
3000 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3001             Anoob V E  <projectmonokochi@rediffmail.com>
3002             Harilal P R  <projectmonokochi@rediffmail.com>
3003
3004         Fix #71134.
3005         * pending.cs (PendingImplementation.GetAbstractMethods):
3006         Find NonPublic members too.
3007
3008 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3009
3010         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3011         Fixed error 217.
3012         
3013         * class.cs (MethodCore.CheckMethodAgainstBase):
3014         Add error 239 report.
3015
3016 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3019         
3020         * class.cs (Operator.Define): Add error 217 report.
3021         
3022 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3023
3024         Fix #68955.
3025         * expression.cs (Invocation.IsApplicable): Make public.
3026         (Invocation.IsParamsMethodApplicable): Likewise.
3027         * delegate.cs (Delegate.VerifyApplicability): Don't use
3028         Invocation.VerifyArgumentCompat for parameter applicability
3029         testing.  Use Invocation.IsApplicable and
3030         Invocation.IsParamsMethodApplicable.
3031
3032 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3033
3034         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3035         
3036         * class.cs (Operator.Define): Add error 217 report.
3037         
3038 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3039
3040         * namespace.cs (UsingEntry.Resolve): Undo change below.
3041
3042 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3043
3044         Fix #72756.
3045         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3046         disable the error message when the extended MemberLookup also
3047         fails.
3048         (Expression.MemberLookupFinal): Update.
3049         (SimpleName.DoSimpleNameResolve): Update.
3050         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3051         Don't use MemberLookupFinal.
3052         (New.DoResolve): Update.
3053         (BaseAccess.CommonResolve): Update.
3054
3055 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3056
3057         Fix #72732.
3058         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3059         occured previously, don't resolve again.
3060
3061 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3062
3063         Fix #69949
3064         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3065         argument. Call ResolveAttributeUsage for unresolved.
3066         when types doesn't match ctor arguments.
3067         
3068         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3069         for nested attribute classes.
3070         (Class.attribute_usage): Removed.
3071         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3072         for attribute class.
3073         
3074         * ecore.cs (IsAttribute): Removed.
3075         
3076         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3077         
3078         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3079         now normal types.
3080         (attribute_types): Removed.
3081         (EmitCode): Global attributes are emited as the latest.
3082
3083 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * class.cs (EmitFieldInitializers): Don't emit field initializer
3086         for default values when optimilization is on.
3087         
3088         * constant.cs (Constant.IsDefaultValue): New property.
3089         
3090         * driver.cs: Add /optimize handling.
3091         
3092         * constant.cs,
3093         * ecore.cs,
3094         * literal.cs: Implement new IsDefaultValue property.
3095         
3096         * rootcontext.cs (Optimize): New field, holds /optimize option.
3097
3098 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3099
3100         Fix crasher in re-opened #72347.
3101         * namespace.cs (Namespace.Lookup): Return null if
3102         DeclSpace.DefineType returns null.
3103
3104         Fix #72678.
3105         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3106
3107 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3108
3109         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3110         now returns null if it cannot resolve to an lvalue.
3111         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3112         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3113         returned null.  Remove check for SimpleName.
3114         (EventExpr.DoResolveLValue): New.
3115         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3116         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3117         error from ...
3118         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3119         avoid CS0131 error.
3120         (Unary.ResolveOperator): Move CS0211 check ...
3121         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3122         CS0131 error.
3123         (Unary.DoResolveLValue): Simplify.
3124         (AddressOf.DoResolveLValue): New.
3125         (ArrayAccess.DoResolveLValue): New.
3126
3127 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3128
3129         * attribute.cs (Attribute.Resolve): Add arguments casting for
3130         when types doesn't match ctor arguments.
3131
3132 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3133
3134         Fix parts of #63202.
3135         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3136         lookup of operator in base type.  Ensure that all checks happen
3137         when the operator resolves to an "op_..." method.
3138
3139 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix #71992.
3142         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3143         'ignore_cs0104' parameter.  Pass it to ...
3144         (NamespaceEntry.Lookup): ... this.
3145         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3146         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3147         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3148         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3149         Update.  Request that cs0104 errors be ignored.
3150         (ComposedCast.ResolveAsTypeStep): Update.
3151
3152 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3153
3154         Fix #59209.
3155         * expression.cs (Invocation.BetterFunction): Remove support for
3156         comparing virtual functions and their overrides.
3157         (Invocation.IsOverride): New.
3158         (Invocation.OverloadResolve): Don't consider 'override' functions
3159         during candidate selection.  Store them in a lookaside list.
3160         If the selected method is a 'virtual' function, use the list to
3161         find any overrides that are closer to the LHS type.
3162
3163 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3164
3165         * expression.cs (New.DoResolve): Add complex core type reduction.
3166         (New.Constantify): Converts complex core type syntax like 'new int ()'
3167         to simple constant.
3168         
3169 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3170
3171         * decl.cs (EntryType.EntryType): New constructor to create an
3172         updated copy of a cache entry.
3173         (MemberCache.AddMethods): Use it.
3174         (MemberCache.ClearDeclaredOnly): Remove.
3175         (MemberCache.MemberCache): Update.
3176
3177 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3178
3179         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3180         variable.  This one is represents the actual low-level declaration
3181         of the method, as opposed to the semantic level `IsStatic'.   
3182
3183         An anonymous method which is hosted into a static method might be
3184         actually an instance method.  IsStatic would reflect the
3185         container, while MethodIsStatic represents the actual code
3186         generated.
3187
3188         * expression.cs (ParameterReference): Use the new MethodIsStatic
3189         instead of IsStatic.
3190
3191         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3192         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3193         set on the current EmitContext. 
3194
3195         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3196         resolve our casted expression as an LValue.  This triggers the
3197         proper LValue processing that is later required by Assign.
3198
3199         This fixes 72347.
3200
3201         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3202
3203 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3204
3205         C# 2.0 Fixed buffer implementation
3206
3207         * anonymous.cs: Update after RegisterHelperClass renaming.
3208
3209         * attribute.cs (AttributeTester.fixed_buffer_cache):
3210         Cache of external fixed buffers.
3211         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3212         implementation if field is fixed buffer else null.
3213
3214         * class.cs
3215         (TypeContainer.AddField): Accept FieldMember instead of Field.
3216         (FieldBase.IsFieldClsCompliant): Extracted code from
3217         VerifyClsCompliance descendant customization.
3218         (FixedField): New class handles fixed buffer fields.
3219         (FixedFieldExternal): Keeps information about imported fixed
3220         buffer.
3221         (IFixedField): Make access to internal or external fixed buffer
3222         same.
3223
3224         * cs-parser.jay: Add fixed buffer parsing.
3225
3226         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3227         buffer.
3228
3229         * expression.cs (Indirection): Extended implementation to accept
3230         fixed buffer field.
3231         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3232         (ElementAccess.MakePointerAccess): Get type as parameter.
3233         (DoResolve): Add fixed buffer field expression conversion.
3234         (DoResolveLValue): Ditto.
3235         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3236         (ArrayPtr): Derives from FixedBufferPtr.
3237         (ArrayPtr.Emit): Add extra emit for array elements.
3238
3239         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3240
3241         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3242         for compiler generated types.
3243         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3244
3245         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3246         and consume less memory.
3247         (Fixed.Resolve): Add fixed buffer case.
3248
3249         * typemanager.cs (compiler_generated_attr_ctor,
3250         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3251         (HasElementType): Add our own implementation to work on every
3252         runtime.
3253
3254 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3255
3256         * anonymous.cs (CaptureContext): Track whether `this' has been
3257         referenced.   
3258
3259         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3260         only captured `this' if it was implicitly done (instance
3261         methods/variables were used). 
3262
3263         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3264         `this' must be captured.
3265
3266 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3267  
3268         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3269         is null it means that there has been no need to capture anything,
3270         so we just create a sibling.
3271
3272         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3273
3274         Just a partial fix.  The other half is fairly elusive.
3275         
3276 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3277
3278         Fix #52586, cs0121-4.cs.
3279         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3280         and return a hashtable.
3281         (MemberCache.ClearDeclaredOnly): New.
3282         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3283         the method_hash of a base type too.
3284         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3285         type methods.  Overwrite entries with the same MethodHandle so
3286         that the ReflectedType is correct.  The process leaves in base
3287         virtual functions and their overrides as distinct entries.
3288         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3289         matters since it was boxed in a ArrayList before.
3290         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3291         modifier.
3292         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3293         case of a virtual function and its override (choose the overload
3294         as better).
3295         (Invocation.OverloadResolve): Avoid 'override' members during
3296         'applicable_type' calculation.
3297
3298 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3299
3300         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3301         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3302         GetTypeHandle.  It is possible for a reflected type to derive from
3303         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3304         System.Array during mscorlib compilation).
3305         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3306         contain a method_hash, don't create one either.  Don't create a
3307         deep copy of the base cache's method_hash.
3308         (MemberCache.SetupCache): Rename back from DeepCopy.
3309         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3310         already initialized.  If we see an override function, add its
3311         underlying base virtual function to the member_hash too.
3312
3313 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3314
3315         Combine two near-redundant caches.
3316         * typemanager.cs (method_params): Rename from method_internal_params.
3317         (TypeManager.GetParameterData): New.  Replace
3318         Invocation.GetParameterData.
3319         (TypeManager.LookupParametersByBuilder): Remove.
3320         * expression.cs (Invocation.method_parameter_cache): Remove.
3321         (Invocation.GetParameterData): Remove.
3322         Update to changes.
3323         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3324         Update to changes.
3325
3326 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3327
3328         Fix #72015.
3329         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3330         TypeManager.multicast_delegate_type is null, resolve it by looking
3331         up "System.MulticastDelegate".
3332         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3333
3334 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3335             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3336             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3337
3338         Fix cs0164.cs.
3339         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3340         (LabeledStatement.AddReference): New.  Set 'referenced'.
3341         (Goto.Resolve): Use it.
3342
3343 2005-02-05  John Luke  <john.luke@gmail.com>
3344
3345         * driver.cs: remove duplicate -doc line in Usage ()
3346
3347 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3348
3349         * location.cs (Location.AddFile): Fix CS2002 error report.
3350
3351 2005-02-02  Martin Baulig  <martin@ximian.com>
3352
3353         * delegate.cs (Delegate.DefineType): Report an internal error if
3354         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3355         details.        
3356
3357 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3358
3359         Fix a crasher in a variant of #31984.
3360         * const.cs (Constant.CheckBase): New override that defers the
3361         new-or-override check in case the base type hasn't been populated
3362         yet.
3363         (Constant.Define): Ensure the new-or-override check is performed.
3364
3365 2005-02-01  Duncan Mak  <duncan@ximian.com>
3366
3367         * const.cs (LookupConstantValue): Check that `ce' is not null
3368         before calling GetValue ().
3369
3370 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3371
3372         Fix test-334.cs (#69519).
3373         * cs-parser.jay (using_alias_directive): Pass in an expression to
3374         NamespaceEntry.UsingAlias.
3375         (using_namespace_directive): Pass in an expression to
3376         NamespaceEntry.Using.
3377         (namespace_name): Don't flatten to a string.
3378         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3379         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3380         ResolveAsTypeStep.
3381         (NamespaceEntry.UsingEntry): Likewise.
3382         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3383         changes.
3384         (NamespaceEntry.LookupForUsing): Remove.
3385         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3386         names.
3387         (NamespaceEntry.Lookup): Remove support for dotted names.
3388
3389 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3390
3391         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3392         split into two.
3393         (NamespaceEntry.ImplicitParent): Compute on demand.
3394         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3395         parallels the current.
3396         (NamespaceEntry.LookupForUsing): Use it.
3397         (NamespaceEntry.Lookup): If the current namespace-entry is
3398         implicit, don't search aliases and using tables.
3399
3400 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3401
3402         Fix #31984.
3403         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3404         BaseCache here.
3405         (TypeContainer.BaseCache): Compute on demand.
3406         (TypeContainer.FindMembers): Define constants and types if they're
3407         not already created.
3408         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3409         check.
3410         * const.cs (Constant.Define): Make idempotent.
3411
3412 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3413
3414         * pending.cs: Produce better code (no nops produced by using Ldarg
3415         + value).
3416         
3417         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3418         i - 1' it should be arg + 1.
3419
3420         Fixes bug #71819.
3421
3422 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3423
3424         * attribute.cs (Attribute.CheckAttributeType): Make private
3425         non-virtual.
3426         (Attribute.ResolveType): Make virtual.
3427         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3428         handling of RootContext.Tree.Types.
3429
3430 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3431
3432         Update attribute-handling to use the SimpleName/MemberAccess
3433         mechanisms.
3434         * cs-parser.jay (attribute): Pass in an expression to the
3435         constructors of Attribute and GlobalAttribute.
3436         * attribute.cs (Attribute): Take an expression for the name.
3437         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3438         passed in attribute name expression.
3439         (Attribute.CheckAttributeType): Use it.
3440         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3441         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3442         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3443         argument to prevent error messages if the lookup fails.
3444
3445 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3446
3447         * expression.cs (Indirection): Implemented IVariable interface
3448         to support indirection in AddressOf operator.
3449         (PointerArithmetic.Emit): Add optimalization for case where
3450         result can be precomputed.
3451
3452 2005-01-26  Martin Baulig  <martin@ximian.com>
3453
3454         * class.cs (TypeContainer.AttributeTargets): Return the correct
3455         AttributeTargets depending on our `Kind' instead of throwing an
3456         exception; fixes #71632.
3457
3458 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3459
3460         Fix #71257
3461         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3462         constant members.
3463
3464 2005-03-17  Martin Baulig  <martin@ximian.com>
3465
3466         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3467         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3468
3469 2005-03-17  Martin Baulig  <martin@ximian.com>
3470
3471         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3472         to bool so we can return an error condition.
3473         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3474         returned an error.
3475
3476 2005-03-17  Martin Baulig  <martin@ximian.com>
3477
3478         * generic.cs (TypeMananager.IsIEnumerable): New public method.
3479
3480         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3481         converting from an array-type of T to `IEnumerable<T>'.
3482
3483 2005-03-16  Martin Baulig  <martin@ximian.com>
3484
3485         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3486         (Nullable.LiftedUnaryMutator): New public class.
3487
3488         * expression.cs (UnaryMutator.DoResolve): Added support for
3489         Nullable Types.
3490
3491 2005-03-14  Martin Baulig  <martin@ximian.com>
3492
3493         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3494
3495 2005-03-14  Martin Baulig  <martin@ximian.com>
3496
3497         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3498         the comparision operators `<', `>', `<=' and `>='.
3499
3500 2005-03-13  Martin Baulig  <martin@ximian.com>
3501
3502         * generic.cs
3503         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3504         avoid confusion with the `NullLiteral'.
3505         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3506
3507 2005-03-13  Martin Baulig  <martin@ximian.com>
3508
3509         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3510         comparing arbitrary types with the null literal.
3511
3512 2005-03-13  Martin Baulig  <martin@ximian.com>
3513
3514         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3515         boolean operators '&&', '||', '&' and '|'.
3516         (Nullable.OperatorTrueOrFalse): New public class.
3517
3518         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3519         instead of a `StaticCallExpr'; added support for nullables.
3520
3521 2005-03-10  Martin Baulig  <martin@ximian.com>
3522
3523         * expression.cs
3524         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3525         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
3526
3527 2005-03-07  Martin Baulig  <martin@ximian.com>
3528
3529         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3530         it work if `expr' is not an IMemoryLocation.
3531         (Nullable.Lifted): Implement IMemoryLocation.
3532         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3533         target type.
3534
3535 2005-03-05  Martin Baulig  <martin@ximian.com>
3536
3537         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3538         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3539         (Nullable): Added support for lifted unary and binary operators.
3540
3541         * expression.cs (Unary.DoResolve): Added support for nullable types.
3542         (Binary.DoResolve): Likewise.
3543         (Conditional.DoResolve): Likewise.
3544
3545 2005-03-02  Martin Baulig  <martin@ximian.com>
3546
3547         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3548
3549         * class.cs (ClassPart.SetParameterInfo): Override this.
3550         (PartialContainer.SetParameterInfo): Override this.
3551         (TypeContainer.CheckConstraints): New protected method.
3552         (PartialContainer.CheckConstraints): Override this and check
3553         whether the same contraints were specified in all parts of a
3554         partial generic type definition.
3555         (PartialContainer.UpdateConstraints): New public method.
3556
3557         * generic.cs (TypeParameter.UpdateConstraints): New public method.
3558
3559 2005-03-02  Martin Baulig  <martin@ximian.com>
3560
3561         Committing a patch from Carlos Alberto Cortez to fix #72887.
3562
3563         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3564         casts from `T []' to `int []'.
3565
3566 2005-03-02  Martin Baulig  <martin@ximian.com>
3567
3568         * generic.cs (TypeManager.IsEqual): Make this symmetric.
3569
3570         * expression.cs (Binary.ResolveOperator): When resolving a
3571         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3572         `=='.  Fixes #71866.  See gen-127.cs.
3573
3574 2005-03-02  Martin Baulig  <martin@ximian.com>
3575
3576         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3577         static constructor in static classes.
3578
3579 2005-03-02  Martin Baulig  <martin@ximian.com>
3580
3581         * generic.cs
3582         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3583         (Nullable.LiftedConversion): Added support for user-defined
3584         conversions.
3585
3586         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3587
3588         * cs-parser.jay: Use ComposedCast everywhere instead of
3589         NullableType, so we don't need to check for NullableType
3590         everywhere.
3591         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3592         case where we'll be resolved into a `parenthesized_expression_0'
3593         afterwards.
3594
3595         * convert.cs
3596         (Convert.UserDefinedConversion): Added nullable conversions.
3597
3598 2005-02-28  Martin Baulig  <martin@ximian.com>
3599
3600         * generic.cs (TypeManager.IsNullableType): New static method.
3601         (Nullable): New abstract class.
3602         (Nullable.NullLiteral): New public class.
3603         (Nullable.LiftedConversion): New public class.
3604
3605         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3606         `builtin_types opt_nullable'.
3607
3608         * convert.cs
3609         (Convert.ImplicitConversionStandard): Added nullable conversions.
3610         (Convert.ExplicitConversionStandard): Likewise.
3611         (Convert.ExplicitConversion): Likewise.
3612
3613 2005-02-26  Martin Baulig  <martin@ximian.com>
3614
3615         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3616         begin with a "?", for instance "?[]".  Don't do a type lookup if
3617         `dim' is empty.
3618
3619 2005-02-25  Martin Baulig  <martin@ximian.com>
3620
3621         The first part of Nullable Types :-)
3622
3623         * generic.cs (NullableType): New public class.
3624         (NullCoalescingOperator): New public class.
3625         (TypeArguments.Resolve): Add a CS0306 check.
3626
3627         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3628         (opt_nullable): New rule.
3629         (type): Added `opt_nullable' to `namespace_or_type_name',
3630         `builtin_types' and `pointer_type'.
3631         (array_type): Added `opt_nullable'.
3632         (opt_rank_specifier_or_nullable): New rule; this is the
3633         combination of `opt_rank_specifier' and `opt_nullable'.
3634         (opt_error): New rule; catch errors here.
3635         (nullable_type_or_conditional): New rule; we use this to check for
3636         nullable and still detect the conditional operator.
3637         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3638         instead `opt_rank_specifier'.
3639
3640         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3641         for nullables.
3642
3643 2005-02-24  Martin Baulig  <martin@ximian.com>
3644
3645         * README, README.Changes: Removed; they're old and obsolete.
3646
3647 2005-02-22  Martin Baulig  <martin@ximian.com>
3648
3649         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3650         returned an error, set `constraints' to null to avoid a crash
3651         later on.
3652         (TypeParameter.ResolveType): Likewise.
3653
3654 2005-02-22  Martin Baulig  <martin@ximian.com>
3655
3656         * generic.cs
3657         (Constraints.ResolveTypes): Protect against being called twice.
3658         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3659         (TypeParameter.ResolveType): New public method; calls
3660         constraints.ResolveTypes().
3661         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3662         into the new ResolveType().
3663         (GenericMethod.Define): Call ResolveType() on all our
3664         TypeParameter's.        
3665
3666 2005-02-21  Martin Baulig  <martin@ximian.com>
3667
3668         * generic.cs
3669         (TypeManager.generic_nullable_type): New static public field.
3670         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3671
3672         * rootcontext.cs
3673         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3674
3675 2005-02-15  Martin Baulig  <martin@ximian.com>
3676
3677         * generic.cs (ConstructedType.Constraints): Correctly check
3678         constraints if the argument type is a type parameter; fixes
3679         #72326. 
3680
3681 2005-02-02  Martin Baulig  <martin@ximian.com>
3682
3683         * delegate.cs (Delegate.DefineType): Report an internal error if
3684         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3685         details.        
3686
3687 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3688
3689         * pending.cs: Produce better code (no nops produced by using Ldarg
3690         + value).
3691         
3692         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3693         i - 1' it should be arg + 1.
3694
3695         Fixes bug #71819.
3696         
3697 2005-01-26  Martin Baulig  <martin@ximian.com>
3698
3699         * cs-parser.jay (indexer_declarator): Don't report an error if we
3700         have type parameters since we can be an explicit interface
3701         implementation; fixes #71449.
3702
3703 2005-01-26  Martin Baulig  <martin@ximian.com>
3704
3705         * class.cs (TypeContainer.AttributeTargets): Return the correct
3706         AttributeTargets depending on our `Kind' instead of throwing an
3707         exception; fixes #71632.
3708
3709 2005-01-26  Martin Baulig  <martin@ximian.com>
3710
3711         * delegate.cs (Delegate.DefineType): Correctly define our type
3712         parameters.  Fixes #71483.
3713
3714 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3715
3716         Fix #71602.
3717         * expression.cs (MemberAccess.DoResolve): Don't complain with
3718         cs0572 when the LHS of a member access has identical name and type
3719         name.
3720
3721 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3722
3723         Fix #71651, #71675
3724         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3725         CreatePermission.
3726         Create custom PermissionSet only for PermissionSetAttribute.
3727
3728 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3729
3730         Fix #71649
3731         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3732         delegates in static class.
3733
3734 2005-01-24  Martin Baulig  <martin@ximian.com>
3735
3736         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3737         merging an implicit block, just use its reachability.
3738
3739         * statement.cs (Block.Resolve): Make the unreachable code check
3740         work wrt. implicit blocks; see test-337 from #63842.
3741
3742 2005-01-21  Alp Toker  <alp@atoker.com>
3743  
3744         * cs-parser.jay: destructor_declaration's container is PartialContainer
3745         not Class when partial types are used, so use Kind prop instead of
3746         'is'.
3747         
3748 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3749
3750         * cs-parser.jay: Improve error reporting when an interface
3751         declares new types.
3752
3753 2005-01-20  Dick Porter  <dick@ximian.com>
3754
3755         * support.cs: SeekableStreamReader fix from Sandor Dobos
3756         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3757         chars are read.  Fixes bug 70369.
3758
3759 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3760
3761         * cs-parser.jay (catch_clause): Simplify current_block handling
3762         somewhat.
3763
3764 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3765
3766         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3767         code with ImplicitStandardConversion to handle the implicit
3768         conversion of method groups into valid delegate invocations. 
3769
3770         The problem is that in parameter handling we were using this code
3771         path.  Fixes bug #64698
3772
3773 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3774
3775         * cs-parser.jay: Fix several infelicities.
3776         - Avoid assigning to the parser value stack.  Code like 
3777           '$3 = null' is unclean.  Synthesize a value for the code block
3778           instead. 
3779         - Avoid using oob_stack for storing location information.  Use ...
3780         (_mark_): ... this.  New (empty) rule.  Saves the current location
3781         in $$.
3782         (foreach_statement): Avoid using oob_stack for current_block
3783         handling.  Use technique used in for_statement and
3784         using_statement.  Synthesize a value for the code block to store
3785         additional intermediate information.
3786
3787 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3788
3789         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3790         of a different type is only allowed to private fields of a
3791         containing type, not on fields of a base class.
3792
3793         See test-174.cs and error cs0122-9.cs
3794
3795 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3796
3797         Fix test-335.cs (bug #58126).
3798         * cs-parser.jay (argument): Split out non-expression parts of the
3799         rule into 'non_simple_argument'.
3800         (invocation_expression): Support parenthesized invocations with
3801         multiple arguments, and with single non-simple arguments.
3802
3803 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3804
3805         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3806         places.
3807
3808 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3809
3810         Fix cs0038-1.cs, cs1640-6.cs.
3811         * ecore.cs (Expression.Resolve): Remove special-case for
3812         SimpleName in error-handling.
3813         (Expression.almostMatchedMembers): Relax access permission to
3814         protected.
3815         (Expression.MemberLookupFailed): Handle duplicates in
3816         almostMatchedMembers list.
3817         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3818         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3819         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3820         overload if the passed in MemberInfo is a MethodBase.
3821
3822 2005-01-25  Martin Baulig  <martin@ximian.com>
3823
3824         * doc.cs
3825         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3826
3827 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3828
3829         Fix #70749
3830         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3831         for non-CAS & merge permission sets properly.
3832
3833 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3834
3835         Improve standard-compliance of simple name and member access 
3836         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3837         * ecore.cs (FullNamedExpression): New abstract base class 
3838         for Namespaces and TypeExpressions.
3839         (ResolveFlags.SimpleName): Remove.
3840         (SimpleName): Remove support for dotted names.
3841         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3842         DeclSpace.FindType and DeclSpace.LookupType.
3843         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3844         (Expression.ExprClassName): Make member function.
3845         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3846         a namespace.  Remove creation of dotted "SimpleName"s.
3847         (MemberAccess.DoResolve): Likewise.
3848         * decl.cs (DeclSpace.Cache): Make private.
3849         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3850         (DeclSpace.FindType): Update.
3851         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3852         FullNamedExpression.
3853         * namespace.cs (Namespace): Derive from FullNamedExpression
3854         so that it can be part of expression resolution.
3855         (Namespace.Lookup): Return an FullNamedExpression.
3856         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3857         namespace.
3858         * rootcontext.cs (NamespaceLookup): Remove.
3859         (LookupType): Move to DeclSpace.
3860         * attribute.cs (CheckAttributeType): Update.
3861         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3862         (FindDocumentedTypeNonArray): Likewise.
3863
3864 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3865
3866         Fix cs0509.cs, cs1632.cs.
3867         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3868         is the same as IsInterface.
3869         (TypeContainer.GetClassBases): Likewise.
3870         * statement.cs (LabeledStatement.ig): New field.
3871         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3872         label.
3873         (LabeledStatement.DoEmit): Check that the label was created with
3874         the same ILGenerator.
3875
3876 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3877
3878         Fix #71058
3879         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3880         accessors to its properties.
3881
3882         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3883         from accessors to property.
3884         
3885 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3886
3887         Fix #70722
3888         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3889         only for overrides.
3890         
3891 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3892
3893         * attribute.cs: Check for null and empty strings.  
3894
3895         I have lost another battle to Paolo.
3896
3897 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3898
3899         Fix #70942
3900         * class.cs (PropertyMethod): Set Parent field in ctors.
3901         (SetMethod.InternalParameters): Add unsafe switch hack.
3902         Override MarkForDuplicationCheck where it is appropriate.
3903
3904         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3905         It says whether container allows members with the same name.
3906         Base default is no.
3907         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3908         Removed is_method parameter.
3909
3910 2005-01-06  Duncan Mak  <duncan@ximian.com>
3911
3912         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3913         because the previous change led to incorrect reporting of CS1032
3914         ("Cannot define/undefine preprocessor symbols after first token in
3915         file"). Instead of using `tokens_seen' as the only flag that
3916         triggers CS1040, introduce `comments_seen'. This new flag is used
3917         to signify having seen comments on the current line, so it is
3918         unset after a newline.
3919
3920 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3921
3922         * doc.cs : When searching for a type, find nested type too.
3923           This fixes bug #71040.
3924
3925 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3926
3927         * doc.cs :
3928           - Warn missing member comment on those classes which also does not
3929             have doc comments. Fixed bug #71041.
3930           - Don't warn missing doc comment on default constructor.
3931             Fixed bug #71042.
3932
3933 2005-01-06  Duncan Mak  <duncan@ximian.com>
3934
3935         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3936         comments, set `tokens_seen' to true. This allows us to detect
3937         misplaced preprocessor directives (i.e. not at the beginning of
3938         the a line, nor after whitespaces). In that case, report error
3939         CS1040. This fixes bug #56460.
3940
3941         * cs-parser.jay (interface_member_declaration): Add checks for
3942         IsExplicitImpl, and report CS0541 error if an interface member is
3943         defined as an explicit interface declaration.
3944
3945 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3946
3947         Fix #70817
3948         * class.cs (PropertyMethod): Set Parent field in ctors.
3949         (SetMethod.InternalParameters): Add unsafe switch hack.
3950         
3951         * decl.cs (MemberCore.Parent): Cannot be readonly.
3952
3953 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3954
3955         * decl.cs (DeclSpace.ResolveType): Remove.
3956         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3957         Merge in code from ...
3958         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3959         * class.cs, enum.cs: Update to changes.
3960
3961 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3962
3963         * anonymous.cs: Ensure that we init the scope of our parent if it
3964         has not been initialized yet.
3965
3966 2004-12-30  Duncan Mak  <duncan@ximian.com>
3967
3968         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3969         if field.FieldBuilder is null. Fixes #70758.
3970
3971         * convert.cs: Fixed some typos and updated some of the comments.
3972         (ImplicitStandardConversionExists):
3973         (TryImplicitIntConversion): If `target_type' is an interface and
3974         the type of `ic' implements this interface, return true or a new
3975         BoxedCast instead of null. This fixes #70468.
3976
3977 2004-12-29  Duncan Mak  <duncan@ximian.com>
3978
3979         * expression.cs (Argument.Emit): Check that Expr is
3980         IMemoryLocation before casting to it, and report CS1510 otherwise.
3981
3982         This fixes #70402.
3983
3984 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3985
3986         * statement.cs (Block.ThisVariable): remove the recursion here, to
3987         make the --profile more sane.
3988
3989 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3990
3991         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3992         assembly, by JB Evain.
3993
3994 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3995
3996         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3997           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3998         "parent" refers to enclosing type/class.  "base" refers to superclass.
3999
4000 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4001
4002         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4003         Ensure that we only have GlobalAttributes.
4004         * attribute.cs (Attribute.Emit): Make non-virtual.
4005         (GlobalAttribute.Emit): Remove.
4006         (Attribute.Resolve): Make virtual.
4007         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4008         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4009         the argument. Don't create one.
4010         (Attribute.GetObsoleteAttribute): Likewise.
4011         (Attribute.GetClsCompliantAttributeValue): Likewise.
4012         * class.cs, decl.cs: Update to changes.
4013
4014 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4015
4016         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4017         
4018         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4019         
4020         * statement.cs (Foreach.Resolve): Add error 186 report.
4021
4022 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4023
4024         * expression.cs (Conditional.DoResolve): Add warning 429.
4025         
4026         * statement.cs (If.Resolve): Add warning 665.
4027
4028 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4029
4030         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4031         except when in the parser, and in GlobalAttribute.
4032         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4033         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4034         RootContext.Tree.Types.NamespaceEntry once work is done.
4035         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4036         and resets RootContext.Tree.Types.NamespaceEntry.
4037
4038 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4039
4040         * cs-parser.jay: Don't create a block for every variable.
4041
4042 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4043
4044         * location.cs: Provide extra information.
4045
4046         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4047         variables from the captured environment, it is the ldarg_0.
4048
4049 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4050
4051         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4052         find a conclusion.
4053         
4054         * class.cs: Changed warning level for 169 to avoid developer
4055         displeasure from warning flooding. It will be changed back when they
4056         fix most of current BCL warnings.
4057         
4058         * RootContext.cs: Pushed default WarningLevel to 3.
4059         
4060         * statement.cs: Removed unused variable.
4061
4062 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4063
4064         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4065         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4066         Add error 502 report.
4067         (StaticClass.DefineType): Add error 441 report.
4068         (Class.AllowedModifiersProp): New virtual property as temporary
4069         extension to AllowedModifiers.
4070         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4071         to share implementation with StaticClass and don't call virtual
4072         methods from ctor.
4073         
4074         * driver.cs (MainDriver): Add error 1558 test.
4075
4076         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4077         report. Moved error 36 test here.
4078
4079         * statement.cs (Throw.Resolve): Add error 724 report.
4080
4081         * typemanager.cs: Add out_attribute_type core type.
4082         
4083 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4084
4085         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4086         3018 report.
4087         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4088
4089         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4090         3017 report.
4091         
4092         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4093
4094         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4095         Add error 3023 report.
4096         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4097
4098         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4099         implementation.
4100
4101 2004-12-12  John Luke  <john.luke@gmail.com>
4102
4103         * driver.cs (AddArgs): take -- into account when
4104         adding arguments, fixes bug 65710 
4105
4106 2004-12-12  Martin Baulig  <martin@ximian.com>
4107
4108         * expression.cs (Unary.TryReduceNegative): Added support for
4109         SByteConstant and ByteConstant.
4110         (Unary.Reduce): Check error values from TryReduceNegative().
4111
4112 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4113
4114         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4115         and report exception as error 182.
4116
4117 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4118
4119         * driver.cs (Main): Fix message when there are warnings.
4120
4121 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4122
4123         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4124
4125 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4126
4127         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4128         Reduced number of warnings.
4129         
4130         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4131
4132 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4133
4134         * driver.cs: Removed message.
4135
4136         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4137
4138 2004-12-08    <vargaz@freemail.hu>
4139
4140         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4141
4142 2004-12-08  Martin Baulig  <martin@ximian.com>
4143
4144         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4145         instead of a CS3002 for properties and indexer.
4146
4147 2004-12-08  Martin Baulig  <martin@ximian.com>
4148
4149         * decl.cs (MemberName.ToString): Make this work again.
4150
4151 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4152
4153         * attribute.cs (Resolve): Add error 591 detection.
4154
4155         * class.cs (FieldMember.Define): Add error 1547 detection.
4156         (Indexer.Define): Add error 620 detection.
4157         (Operator.Define): Add error 590 detection.
4158
4159         * ecore.cs: Missing argument for error 79.
4160
4161         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4162         detection.
4163
4164 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4165
4166         Fix #70106
4167         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4168         only.
4169
4170 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4171
4172         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4173           Some operator comments were suppressed.
4174         * doc.cs : Implicit/explicit operator name in doc comments are like
4175           "op_Explicit(type)~returnType", so added suffix handling.
4176
4177 2005-01-21  Alp Toker  <alp@atoker.com>
4178
4179         * cs-parser.jay: destructor_declaration's container is PartialContainer
4180         not Class when partial types are used, so use Kind prop instead of 'is'.
4181
4182 2004-12-12  Martin Baulig  <martin@ximian.com>
4183
4184         * expression.cs (Unary.TryReduceNegative): Added support for
4185         SByteConstant and ByteConstant.
4186         (Unary.Reduce): Check error values from TryReduceNegative().
4187
4188 2004-12-11  Martin Baulig  <martin@ximian.com>
4189
4190         * support.cs (ReflectionParameters.ParameterName): If we have a
4191         `gpd', call `ParameterName' on it.
4192
4193         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4194
4195         * pending.cs (PendingImplementation.DefineProxy): Call
4196         DefineParameter() for all of the MethodBuilder's arguments.
4197
4198 2004-12-09  Martin Baulig  <martin@ximian.com>
4199
4200         * doc.cs (DocUtil): Make this a static class.
4201
4202 2004-12-09  Martin Baulig  <martin@ximian.com>
4203
4204         * expression.cs (Invocation.InferType): Moved the type inference
4205         implementation into TypeManager.
4206
4207         * generics.cs (TypeManager): Moved the type inference
4208         implementation here.
4209
4210 2004-12-09  Martin Baulig  <martin@ximian.com>
4211
4212         * typemanager.cs (TypeManager): Make this a partial class.
4213
4214         * generics.cs
4215         (TypeManager): Move the generics part of `TypeManager' here.
4216
4217 2004-12-08  Martin Baulig  <martin@ximian.com>
4218
4219         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4220         instead of a CS3002 for properties and indexer.  Added CS3024
4221         check for generic interfaces.
4222
4223         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4224         instances are not CLS-compliant.
4225
4226 2004-12-08  Martin Baulig  <martin@ximian.com>
4227
4228         * cs-parser.jay
4229         (void_pointer_expression): New rule for `void*', `void**' etc.
4230         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4231
4232 2004-12-08  Martin Baulig  <martin@ximian.com>
4233
4234         * expression.cs (Invocation.InferType): Removed the hack for
4235         MethodCore.MayUnify().  
4236
4237         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4238         this actually work.
4239
4240         * class.cs (MethodCore.MayUnify): Use
4241         TypeManager.MayBecomeEqualGenericTypes().       
4242
4243 2004-12-08  Martin Baulig  <martin@ximian.com>
4244
4245         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4246         parameter, box it.  Fixes #69233.
4247
4248 2004-12-08  Martin Baulig  <martin@ximian.com>
4249
4250         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4251         have the ctor constraint.  Fixes #68326.
4252
4253 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4254
4255         * cs-parser.jay : interface comment was not consumed because of
4256           extra opt_semicolon before doc handling.
4257
4258 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4259
4260         Fix test-327.cs, test-328.cs, and put in early infrastructure
4261         for eventually fixing #52697.
4262         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4263         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4264         from other methods.
4265         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4266         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4267         (VerifyUsing, error246): Update.
4268         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4269         'NamespaceEntry.LookupNamespaceOrType'.
4270
4271 2004-12-07  Martin Baulig  <martin@ximian.com>
4272
4273         * driver.cs: Call it "BETA SOFTWARE" :-)
4274
4275 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4276
4277         Fix crash on cs0657-17.cs.
4278         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4279         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4280         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4281         the case where the NamespaceEntry gets overwritten.
4282
4283 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4284
4285         Fixed #69195, #56821
4286         * ecore.cs (ResolveBoolean): Tiny refactoring.
4287
4288         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4289         of right expression resolving when left is false constant and
4290         operator is LogicalAnd OR true constant and operator is LogicalOr.
4291
4292         * statement.cs (ResolveUnreachable): Always reports warning.
4293
4294 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4295
4296         * class.cs: Distinguish between 1721 and 1722 (just a little help
4297         for the programmer).
4298
4299 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4300
4301         * delegate.cs: Only allow this on new versions of the language. 
4302
4303 2004-12-02  Duncan Mak  <duncan@ximian.com>
4304
4305         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4306         Expression class.
4307         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4308         here as a static method. Take an additional bool out parameter
4309         `must_do_cs1540_check' for signaling to InstanceResolve.
4310         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4311         member field from PropertyExpr class and made it an argument of
4312         the method instead.
4313         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4314         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4315         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4316         and `remove_accessor' as well as InstanceResolve: report CS0122
4317         where applicable.
4318
4319         Fixes #70129.
4320
4321 2004-12-07  Martin Baulig  <martin@ximian.com>
4322
4323         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4324         and CS0692 where appropriate.
4325
4326 2004-12-06  Martin Baulig  <martin@ximian.com>
4327
4328         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4329         IsDuplicateImplementation() and improved it.
4330
4331         * expression.cs (Invocation.InferTypeArguments): Added
4332         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4333         and removed the "ref" modifier from `infered_types'.
4334
4335         * decl.cs (MemberName.ToString): Removed the exception.
4336
4337 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4338
4339         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4340           comments are allowed.
4341
4342 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4343
4344         * delegate.cs: Add checks for subtypes in paramaters and return values
4345         in VerifyMethod () to add support for Covariance/Contravariance
4346         in delegates.
4347         
4348 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4349
4350         * report.cs: Remove extra closing parenthesis.
4351
4352         * convert.cs (Error_CannotImplicitConversion): If the name of the
4353         types are the same, provide some extra information.
4354
4355 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4356
4357         Fix bug #70102
4358         * attribute.cs (Resolve): Improved implementation of params
4359         attribute arguments.
4360
4361         * support.cs (ParameterData): Add HasParams to be faster.
4362
4363 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4364
4365         all things are for /doc support:
4366
4367         * doc.cs: new file that supports XML documentation generation.
4368         * mcs.exe.sources: added doc.cs.
4369         * driver.cs:
4370           Handle /doc command line option.
4371           Report error 2006 instead of 5 for missing file name for /doc.
4372           Generate XML documentation when required, after type resolution.
4373         * cs-tokenizer.cs:
4374           Added support for picking up documentation (/// and /** ... */),
4375           including a new XmlCommentState enumeration.
4376         * cs-parser.jay:
4377           Added lines to fill Documentation element for field, constant,
4378           property, indexer, method, constructor, destructor, operator, event
4379           and class, struct, interface, delegate, enum.
4380           Added lines to warn incorrect comment.
4381         * rootcontext.cs :
4382           Added Documentation field (passed only when /doc was specified).
4383         * decl.cs:
4384           Added DocComment, DocCommentHeader, GenerateDocComment() and
4385           OnGenerateDocComment() and some supporting private members for
4386           /doc feature to MemberCore.
4387         * class.cs:
4388           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4389         * delegate.cs:
4390           Added overriden DocCommentHeader.
4391         * enum.cs:
4392           Added overriden DocCommentHeader and GenerateDocComment().
4393
4394 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4395
4396         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4397         unwrapping the enumeration values, chain to
4398         DoConstantNumericPromotions again, so we can promote things to the
4399         fundamental types (takes care of enums that are bytes, sbytes).
4400
4401         Fixes bug #62054.
4402
4403 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4404
4405         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4406         Fix long-standing bug in type-lookup.  Use FindType instead of
4407         LookupType when ec.ResolvingTypeTree.
4408         (Attribute.ResolveType, Attribute.Resolve)
4409         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4410         Update to changes.
4411         (Attributes.Search): Remove internal version.  Update.
4412         (Attributes.SearchMulti): Update.
4413         (Attributes.GetClsCompliantAttribute): Remove.
4414         (Attributes.GetIndexerNameAttribute): Remove.
4415         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4416         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4417         * class.cs (Indexer.Define): Likewise.
4418
4419 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4420
4421         Fix bug #68790
4422         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4423         MarshallByReference members access.
4424
4425         * expression.cs: Use CheckMarshallByRefAccess;
4426         Better error CS0197 message.
4427
4428         * report.cs: Print whole related error message.
4429
4430 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4431
4432         * class (GetClassBases): Better error 60 report.
4433         (EventProperty): Disabled warning 67 detection.
4434
4435 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4436
4437         Fix bug #60324
4438         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4439
4440         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4441         precise values.
4442
4443 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4444
4445         Fix bug #49488
4446         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4447
4448         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4449
4450 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4451
4452         * attribute.cs (Attribute.Resolve): Refine error reporting and
4453         report a cs0117 if the identifier does not exist, to distinguish
4454         from 0617 which is a miss-use of the actual identifier.
4455
4456         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4457         between cs0070 and cs0079.
4458
4459         * class.cs (MemberBase.DoDefine): When reporting a wrong
4460         accessibility level, we use MethodCore to compare instead of
4461         Method (this was a regression in some refactoring effort).
4462
4463         So now we correctly report cs0056 again.
4464
4465         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4466         testing the target_type (which was known to be object_type) and
4467         not the source type (which is anonymous_method).
4468
4469         Fixed reporting of error cs1660.
4470
4471         * expression.cs (UserCast.Source): Expose the underlying cast.
4472
4473         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4474         allowed types to find a match to int32 first (most common).
4475
4476         In addition, it ignores any ImplicitUserConversions that did an
4477         internal implicit conversion (as the switch statement allows only
4478         one integral conversion to exist).
4479
4480         * class.cs (PartialContainer.Create): rename `name' to
4481         `member_name' for clarity.  Then replace the string calls with a
4482         call to MemberName.GetPartialName, as now using
4483         MemberName.ToString is an error (this is due to the side effects
4484         it had, that were fixed in the past).
4485
4486         This will restore the error reporting on a number of partial class
4487         errors that were missusing this (and getting an exception as a
4488         results, which is now just a plain textual warning, because
4489         yyparse debug output would crash otherwise).
4490
4491 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4492
4493         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4494
4495 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4496
4497         * rootcontext.cs (LookupType): Make sure to cache lookups that
4498         don't give us a negative result. This saves about 5% of corlib
4499         compilation time.
4500
4501 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4502
4503         * report.cs (AbstractMessage.Print): messages are sent to stderr
4504
4505         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4506         non-interface in the list of interfaces (at this point, either
4507         parent was properly set, or a base class is being listed in the
4508         interfaces section).
4509
4510         This flags error 1722, and resolves the crash from bug 69259.
4511
4512 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4513
4514         * statement.cs (Using.EmitExpressionFinally): make this work right
4515         for valuetypes. Fixes 69926.
4516
4517 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4518
4519         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4520         converted to an enum" here, before we try to change the underlying
4521         type.  This code exists, but it is a different code path than the
4522         one used while encoding constants.
4523
4524         (ImplicitReferenceConversionExists): In addition, resynchronized
4525         the code here, so it matches the same code in
4526         ImplicitReferenceConversionExists for the `from any class-type S
4527         to any interface-type T'.       
4528
4529 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4530
4531         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4532
4533 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4534
4535         * cs-parser.jay: Use verbosity accordingly. 
4536
4537 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4538
4539         * expression.cs (Unary.ResolveOperator): Do not report warning;
4540         AddressOf reads from variable.
4541         
4542         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4543
4544 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4545
4546         Fix bug #69462
4547
4548         * attribute.cs (Attributable): Removed CheckTargets.
4549         (Attributes.Emit): Explicit attribute targets are tested here.
4550
4551         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4552         not enabled for interfaces.
4553
4554         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4555         (GetAssemblyName): Ouch next bug there.
4556
4557 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4558
4559         * expression.cs: Error 275 added.
4560         
4561 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4562
4563         Fix bug #69177 (Implemented decimal constant support)
4564
4565         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4566         (BinaryFold): Add DecimalConstant.
4567
4568         * const.cs (Define): Decimal constant 
4569         (is not constant.
4570         (ChangeType): Add decimal type handling.
4571         (LookupConstantValue): Don't set value for decimal type but
4572         emit DecimalConstantAttribute. Needed for constant optimization.
4573
4574         * constant.cs (ToDecimal): New method.
4575         (ConvertToDecimal): New method.
4576         (IntConstant): Implemented ConvertToDecimal.
4577         (DecimalConstant.Emit): Emit optimized version for decimals in
4578         int range.
4579
4580         * expression.cs (ResolveOperator): Changed order of constant
4581         reduction to work correctly with native types which have
4582         overloaded operators.
4583         (ResolveMemberAccess): Extract constant value from attribute
4584         for decimal type.
4585
4586         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4587
4588         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4589         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4590         (ChangeType): Decimal is special.
4591         (TypeToCoreType): Add decimal type.
4592
4593 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4594
4595         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4596         decimal types.
4597
4598 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4599
4600         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4601         test cs1667-5.cs.
4602
4603 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4604
4605         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4606
4607         * pending.cs (PendingImplementation): Grab only interfaces.
4608
4609 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4610
4611         * statement.cs (ForeachHelperMethods): Add location member and
4612         error 202 detection.
4613
4614 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4615
4616         * expression.cs (DoResolveBase): Fixed wrong warning for out
4617         variables.
4618
4619 2004-12-04  Martin Baulig  <martin@ximian.com>
4620
4621         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4622         to check whether the conversion is ok.
4623
4624         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4625         `Type.EmptyTypes' if we're not a generic TypeContainer.
4626
4627 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4628
4629         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4630         old bug: when converting from the null literal to a pointer,
4631         return an EmptyCast, not the NullLiteral.
4632
4633         This fixes #69921, the recent null_type changes probably made this
4634         bug more prominent.
4635
4636 2004-12-03  Martin Baulig  <martin@ximian.com>
4637
4638         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4639         method as our child, call AnonymousMethod.Compatible() on it.
4640
4641 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4642
4643         * class.cs (FieldBase): Use an unused bit field from the field to
4644         encode the `has_offset' property from the FieldMember.  This saves
4645         a couple of Ks on bootstrap compilation.
4646
4647         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4648         method as our child, return the AnonymousMethod resolved
4649         expression.
4650
4651         * expression.cs (New.DoResolve): Allow return values from
4652         NewDelegate to also include AnonymousMethods.
4653
4654         Fixes #70150.
4655
4656 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4657
4658         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4659         cs1648 report.
4660         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4661         System.Runtime.InteropServices._Exception, since it's a base
4662         interface of the core type System.Exception in the net_2_0 profile.
4663
4664 2004-11-27  Martin Baulig  <martin@ximian.com>
4665
4666         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4667
4668 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4669
4670         * Makefile: Convert to use executable.make.
4671         * gmcs.exe.sources: New.
4672
4673 2004-11-25  Martin Baulig  <martin@ximian.com>
4674
4675         * expression.cs (Invocation.InferType): Added support for byref types.
4676
4677 2004-11-25  Martin Baulig  <martin@ximian.com>
4678
4679         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4680         in TypeManager.TypeToCoreType().
4681
4682 2004-11-25  Martin Baulig  <martin@ximian.com>
4683
4684         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4685         "Dispose" method from the `current_type'.
4686         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4687         DoDefineMembers() instead of using the MethodBuilder; this is
4688         required for generic iterators.
4689
4690         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4691
4692 2004-11-24  Martin Baulig  <martin@ximian.com>
4693
4694         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4695
4696 2004-11-20  Martin Baulig  <martin@ximian.com>
4697
4698         * expression.cs (Invocation.InferType): Correctly infer generic
4699         instances; see gen-103.cs.
4700         (Invocation.InferTypeArguments): If a generic method doesn't have
4701         any unbound type parameters, we don't need to infer anything.
4702
4703 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4704
4705         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4706
4707 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4708
4709         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4710         (TypeHandle.GetMemberCache): New.
4711         (TypeHandle.TypeHandle): Update.
4712         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4713         (TypeManager.LookupParentInterfacesCache):
4714         Rename from LookupInterfaceCache.  Optimize slightly.
4715         (TypeManager.MemberLookup_FindMembers): Update.
4716         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4717         multi-type variant.
4718         (AddCacheContents): Rename from AddHashtable.
4719         * class.cs (TypeContainer.parent_container): Remove.
4720         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4721         (TypeContainer.DoDefineMembers): Don't initialize it.
4722         Update to name changes.
4723         
4724 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4725
4726         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4727         that factors the code to check access modifiers on override.  
4728
4729         (PropertyBase): Use the code here.
4730
4731         Patch from Lluis S'anchez, fixes bug #69361.
4732
4733 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4734
4735         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4736         routine that is used to report the use of a captured variable
4737         whose address has been taken.
4738
4739         There are two checks: one when variables are being captured and
4740         the other check is when the address of a variable is taken. 
4741         
4742         (because an anonymous methods might be resolved before *or* after
4743         the address has been taken) and 
4744
4745         * expression.cs (Conditional.DoResolve): Remove the special
4746         casing that Martin added to trueExpr and falseExpr being both
4747         NullLiteral.  We get the right behavior now just by introducing
4748         the null_type into the compiler. 
4749
4750         * convert.cs (ExplicitConversion): Change the code to use
4751         null_type instead of testing `expr is NullLiteral'.
4752         (ImplicitConversionStandard): use null_type too.
4753         (ImplicitReferenceConversionExists): use null_type too.
4754         (ImplicitReferenceConversion): use null_type too.
4755
4756         * literal.cs: The type of `NullLiteral' is now null_type instead
4757         of object_type. 
4758         (Resolve): Set the type here.
4759
4760         * typemanager.cs: Introduce null_type.
4761
4762 2004-11-18  Martin Baulig  <martin@ximian.com>
4763
4764         * rootcontext.cs
4765         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4766
4767 2004-11-18  Martin Baulig  <martin@ximian.com>
4768
4769         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4770
4771 2004-11-18  Martin Baulig  <martin@ximian.com>
4772
4773         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4774         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4775         call ResolveConstructedType() on it to resolve it without checking
4776         constraints.
4777         (Constraints.ResolveTypes): Check them here.
4778         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4779         but don't check constraints.
4780         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4781         check constraints here.
4782         (ConstructedType.ResolveConstructedType): New public method.  This
4783         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4784         resolve ourselves without checking constraints.
4785
4786         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4787
4788 2004-11-18  Martin Baulig  <martin@ximian.com>
4789
4790         * decl.cs
4791         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4792
4793         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4794
4795 2004-11-18  Martin Baulig  <martin@ximian.com>
4796
4797         * ecore.cs (TypeExpr.ResolveType): Removed.
4798         (Expression.ResolveAsTypeTerminal): We always return a fully
4799         resolved `TypeExpr', so we can just access its `Type'.
4800
4801         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4802
4803 2004-11-17  Martin Baulig  <martin@ximian.com>
4804
4805         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4806         sure we don't return any unresolved TypeExpr's.
4807         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4808         a `TypeExpr'.
4809         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4810
4811         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4812         unresolved `ConstructedType's.
4813
4814 2004-11-17  Martin Baulig  <martin@ximian.com>
4815
4816         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4817
4818 2004-11-17  Martin Baulig  <martin@ximian.com>
4819
4820         * ecore.cs
4821         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4822
4823         * decl.cs (DeclSpace.ResolveType): Removed.
4824         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4825
4826 2004-11-17  Martin Baulig  <martin@ximian.com>
4827
4828         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4829         direction, like FindMembers() does.  Fixes #69546, testcase is in
4830         test-315.cs.    
4831
4832 2004-11-16  Martin Baulig  <martin@ximian.com>
4833
4834         This is based on a patch from Marek Safar, see bug #69082.
4835         Fixes bugs #63705 and #67130.
4836
4837         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4838         method; create a MemberCache for an interface type and cache the
4839         result.
4840
4841         * decl.cs (IMemberContainer.ParentContainer): Removed.
4842         (IMemberContainer.ParentCache): New property.
4843         (MemberCache.SetupCacheForInterface): Removed.
4844         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4845         to create a cache for an interface's "parent".
4846
4847         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4848         interfaces too.
4849
4850 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4851
4852         * statement.cs: Avoid adding bools to a hashtable.
4853
4854 2004-11-15  Martin Baulig  <martin@ximian.com>
4855
4856         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4857
4858 2004-11-11  Martin Baulig  <martin@ximian.com>
4859
4860         * typemanager.cs (TypeManager.GetMethodName): New method.
4861
4862         * class.cs (MethodData.Define): Include the generic arity in the
4863         name of an explicit interface; also add it to the method name.
4864
4865         * pending.cs (PendingImplementation.InterfaceMethod): The method
4866         name now includes the generic arity.
4867
4868 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4869
4870         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4871         calling an unsafe method from a safe location.
4872
4873 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4874
4875         Fix #69167
4876         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4877
4878 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4879
4880         * namespace.cs (VerifyUsing): use GetPartialName instead of
4881         ToString. 
4882
4883 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4884
4885         * statement.cs (Return.Resolve): Fix regression in typo: if
4886         `in_exc', we have to request a NeedReturnLabel, this was a typo
4887         introduced in the anonymous method check-in.  Fixes #69131.
4888
4889         * Indexers were using the ShortName when defining themselves,
4890         causing a regression in the compiler bootstrap when applying the
4891         patch from 2004-11-02 (first part), now they use their full name
4892         and the bug is gone.
4893
4894 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4895
4896         * driver.cs: Strip the path from the names of embedded resources. Fixes
4897         #68519.
4898
4899 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4900
4901         Fix error message regression: cs0104-2.cs.
4902         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4903         (AliasEntry.Resolve): Update.
4904         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4905         'silent' flag.
4906         (RootContext.LookupType): Update.
4907
4908 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4909
4910         * cs-parser.jay: Add support for handling accessor modifiers
4911         * class: Add support port accessor modifiers and error checking,
4912         define PropertyMethod.Define as virtual (not abstract anymore)
4913         * ecore.cs: Add checking for proeprties access with access modifiers
4914         * iterators.cs: Modify Accessor constructor call based in the modified
4915         constructor
4916 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4917
4918         * expression.cs (StringConcat): Handle being called twice,
4919         as when we have a concat in a field init with more than two
4920         ctors in the class
4921
4922 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4923
4924         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4925         special case explicit implementations, we should always produce
4926         the .property or .event declaration.
4927         
4928         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4929         since it will not return correct data if people use this
4930         unresolved in the presence of using statements (see test-313).
4931
4932         * class.cs (MethodData.Define): If we are an explicit interface
4933         implementation, set the method name to the full name of the
4934         interface plus the name of the method.  
4935
4936         Notice that using the method.MethodName.GetFullName() does not
4937         work, as it will only contain the name as declared on the source
4938         file (it can be a shorthand in the presence of using statements)
4939         and not the fully qualifed type name, for example:
4940
4941         using System;
4942
4943         class D : ICloneable {
4944                 object ICloneable.Clone ()  {
4945                 }
4946         }
4947
4948         Would produce a method called `ICloneable.Clone' instead of
4949         `System.ICloneable.Clone'.
4950
4951         * namespace.cs (Alias.Resolve): Use GetPartialName.
4952         
4953 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4954
4955         * cs-parser.jay: Add error 1055 report.
4956
4957 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4958
4959         * assign.cs (Assign.DoResolve): Only do the transform of
4960         assignment into a New if the types are compatible, if not, fall
4961         through and let the implicit code deal with the errors and with
4962         the necessary conversions. 
4963
4964 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4965
4966         * cs-parser.jay: Add error 1031 report.
4967
4968         * cs-tokenizer.cs: Add location for error 1038.
4969
4970 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4971
4972         * cs-parser.jay: Add error 1016 report.
4973
4974 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4975
4976         * cs-parser.jay: Add errors 1575,1611 report.
4977
4978 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4979
4980         * cs-parser.jay: Add error 1001 report.
4981
4982 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4983
4984         Fix #68850
4985         * attribute.cs (GetMarshal): Add method argument for
4986         caller identification.
4987
4988         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4989         agument for GetMarshal and RuntimeMissingSupport.
4990
4991 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4992
4993         * attribute.cs (ExtractSecurityPermissionSet): Removed
4994         TypeManager.code_access_permission_type.
4995
4996         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4997
4998 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4999
5000         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5001         for obsolete use of a variable here.   Fixes regression on errors
5002         cs0619-25 and cs0619-26.
5003
5004 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5005
5006         Fix #62358, implemented security attribute encoding.
5007
5008         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5009         Tests permitted SecurityAction for assembly or other types.
5010         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5011         data from SecurityPermissionAttribute to PermisionSet class.
5012
5013         * class.cs (ApplyAttributeBuilder): Added special handling
5014         for System.Security.Permissions.SecurityAttribute based types.
5015
5016         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5017         special handling for System.Security.Permissions.SecurityAttribute
5018         based types.
5019
5020         * enum.cs (ApplyAttributeBuilder): Added special handling
5021         for System.Security.Permissions.SecurityAttribute based types.
5022
5023         * parameter.cs (ApplyAttributeBuilder): Added special handling
5024         for System.Security.Permissions.SecurityAttribute based types.
5025
5026         * rootcontext.cs: Next 2 core types.
5027
5028         * typemanager.cs (TypeManager.security_permission_attr_type):
5029         Built in type for the SecurityPermission Attribute.
5030         (code_access_permission_type): Build in type.
5031
5032 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5033
5034         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5035         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5036         all of this information into
5037         EmitContext.EmitCapturedVariableInstance.
5038         
5039         * codegen.cs (EmitCapturedVariableInstance): move here the
5040         funcionality of emitting an ldarg.0 in the presence of a
5041         remapping.   This centralizes the instance emit code.
5042
5043         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5044         then emit a load of this: it means that we have reached the
5045         topmost ScopeInfo: the one that contains the pointer to the
5046         instance of the class hosting the anonymous method.
5047
5048         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5049         captures to the topmost CaptureContext.
5050
5051 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5052
5053         * expression.cs (LocalVariableReference): Move the knowledge about
5054         the iterators into codegen's EmitCapturedVariableInstance.
5055
5056 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5057
5058         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5059         all code paths return a value from an anonymous method (it is the
5060         same as the 161 error, but for anonymous methods).
5061
5062 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5063
5064         The introduction of anonymous methods in the compiler changed
5065         various ways of doing things in the compiler.  The most
5066         significant one is the hard split between the resolution phase
5067         and the emission phases of the compiler.
5068
5069         For instance, routines that referenced local variables no
5070         longer can safely create temporary variables during the
5071         resolution phase: they must do so from the emission phase,
5072         since the variable might have been "captured", hence access to
5073         it can not be done with the local-variable operations from the runtime.
5074         
5075         * statement.cs 
5076
5077         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5078         is a toplevel block.
5079
5080         (ToplevelBlock): A new kind of Block, these are the blocks that
5081         are created by the parser for all toplevel method bodies.  These
5082         include methods, accessors and anonymous methods.
5083
5084         These contain some extra information not found in regular blocks:
5085         A pointer to an optional CaptureContext (for tracking captured
5086         local variables and parameters).  A pointer to the parent
5087         ToplevelBlock.
5088         
5089         (Return.Resolve): Catch missmatches when returning a value from an
5090         anonymous method (error 1662).
5091         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5092         phase.
5093
5094         (Break.Resolve): ditto.
5095
5096         (SwitchLabel): instead of defining the labels during the
5097         resolution phase, we now turned the public ILLabel and ILLabelCode
5098         labels into methods called GetILLabelCode() and GetILLabel() that
5099         only define the label during the Emit phase.
5100
5101         (GotoCase): Track the SwitchLabel instead of the computed label
5102         (its contained therein).  Emit the code by using
5103         SwitchLabel.GetILLabelCode ().
5104
5105         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5106         whether the Local has been captured or not.
5107
5108         (LocalInfo.IsCaptured): New property, used to tell whether the
5109         local has been captured.
5110         
5111         * anonymous.cs: Vastly updated to contain the anonymous method
5112         support.
5113
5114         The main classes here are: CaptureContext which tracks any
5115         captured information for a toplevel block and ScopeInfo used to
5116         track the activation frames for various local variables.   
5117
5118         Each toplevel block has an optional capture context associated
5119         with it.  When a method contains an anonymous method both the
5120         toplevel method and the anonymous method will create a capture
5121         context.   When variables or parameters are captured, they are
5122         recorded on the CaptureContext that owns them, for example:
5123
5124         void Demo () {
5125              int a;
5126              MyDelegate d = delegate {
5127                  a = 1;
5128              }
5129         }
5130
5131         Here `a' will be recorded as captured on the toplevel
5132         CapturedContext, the inner captured context will not have anything
5133         (it will only have data if local variables or parameters from it
5134         are captured in a nested anonymous method.
5135
5136         The ScopeInfo is used to track the activation frames for local
5137         variables, for example:
5138
5139         for (int i = 0; i < 10; i++)
5140                 for (int j = 0; j < 10; j++){
5141                    MyDelegate d = delegate {
5142                         call (i, j);
5143                    }
5144                 }
5145
5146         At runtime this captures a single captured variable `i', but it
5147         captures 10 different versions of the variable `j'.  The variable
5148         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5149         recorded on a child.  
5150
5151         The toplevel ScopeInfo will also track information like the `this'
5152         pointer if instance variables were referenced (this is necessary
5153         as the anonymous method lives inside a nested class in the host
5154         type of the method). 
5155
5156         (AnonymousMethod): Expanded to track the Toplevel, implement
5157         `AnonymousMethod.Compatible' to tell whether an anonymous method
5158         can be converted to a target delegate type. 
5159
5160         The routine now also produces the anonymous method content
5161
5162         (AnonymousDelegate): A helper class that derives from
5163         DelegateCreation, this is used to generate the code necessary to
5164         produce the delegate for the anonymous method that was created. 
5165
5166         * assign.cs: API adjustments for new changes in
5167         Convert.ImplicitStandardConversionExists.
5168
5169         * class.cs: Adjustments to cope with the fact that now toplevel
5170         blocks are of type `ToplevelBlock'. 
5171
5172         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5173         insteda of standard blocks.
5174
5175         Flag errors if params arguments are passed to anonymous methods.
5176
5177         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5178         `CurrentAnonymousMethod' which points to the current Anonymous
5179         Method.  The variable points to the AnonymousMethod class that
5180         holds the code being compiled.  It is set in the new EmitContext
5181         created for the anonymous method.
5182
5183         (EmitContext.Phase): Introduce a variable and an enumeration to
5184         assist in enforcing some rules about when and where we are allowed
5185         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5186         only one that enfonces this right now).
5187
5188         (EmitContext.HaveCaptureInfo): new helper method that returns
5189         whether we have a CapturedContext initialized.
5190
5191         (EmitContext.CaptureVariable): New method used to register that a
5192         LocalInfo must be flagged for capturing. 
5193
5194         (EmitContext.CapturedParameter): New method used to register that a
5195         parameters must be flagged for capturing. 
5196         
5197         (EmitContext.CapturedField): New method used to register that a
5198         field must be flagged for capturing. 
5199
5200         (EmitContext.HaveCapturedVariables,
5201         EmitContext.HaveCapturedFields): Return whether there are captured
5202         variables or fields. 
5203
5204         (EmitContext.EmitMethodHostInstance): This is used to emit the
5205         instance for the anonymous method.  The instance might be null
5206         (static methods), this (for anonymous methods that capture nothing
5207         and happen to live side-by-side with the current method body) or a
5208         more complicated expression if the method has a CaptureContext.
5209
5210         (EmitContext.EmitTopBlock): Routine that drives the emission of
5211         code: it will first resolve the top block, then emit any metadata
5212         and then emit the code.  The split is done so that we can extract
5213         any anonymous methods and flag any captured variables/parameters.
5214         
5215         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5216         during this phase, the ILGenerator should not be used as labels
5217         and local variables declared here might not be accessible to any
5218         code that is part of an anonymous method.  
5219
5220         Exceptions to this include the temporary variables that are
5221         created by some statements internally for holding temporary
5222         variables. 
5223         
5224         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5225         metadata for a cb
5226
5227         (EmitContext.TemporaryReturn): This method is typically called
5228         from the Emit phase, and its the only place where we allow the
5229         ReturnLabel to be defined other than the EmitMeta.  The reason is
5230         that otherwise we would have to duplicate a lot of logic in the
5231         Resolve phases of various methods that today is on the Emit
5232         phase. 
5233
5234         (EmitContext.NeedReturnLabel): This no longer creates the label,
5235         as the ILGenerator is not valid during the resolve phase.
5236
5237         (EmitContext.EmitThis): Extended the knowledge in this class to
5238         work in anonymous methods in addition to iterators. 
5239
5240         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5241         code is necessary on the stack to access the instance to a local
5242         variable (the variable will be accessed as a field).
5243
5244         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5245         EmitContext.EmitAddressOfParameter): Routines to support
5246         parameters (not completed at this point). 
5247         
5248         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5249         will also remove the parameters.
5250
5251         * convert.cs (Convert): Define a `ConstantEC' which points to a
5252         null.  This is just to prefity some code that uses
5253         ImplicitStandardConversion code and do not have an EmitContext
5254         handy.
5255
5256         The idea is to flag explicitly that at that point in time, it is
5257         known that the conversion will not trigger the delegate checking
5258         code in implicit conversions (which requires a valid
5259         EmitContext). 
5260
5261         Everywhere: pass new EmitContext parameter since
5262         ImplicitStandardConversionExists now requires it to check for
5263         anonymous method conversions. 
5264
5265         (Convert.ImplicitStandardConversionExists): If the type of an
5266         expression is the anonymous_method_type, and the type is a
5267         delegate, we invoke the AnonymousMethod.Compatible method to check
5268         whether an implicit conversion is possible. 
5269
5270         (Convert.ImplicitConversionStandard): Only do implicit method
5271         group conversions if the language level is not ISO_1.
5272
5273         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5274         MethodInfo for the Invoke method.  used by Delegate and
5275         AnonymousDelegate.
5276
5277         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5278         method conversions if the target type is a delegate.
5279
5280         Removed extra debugging nops.
5281
5282         (LocalVariableReference): Turn the `local_info' into a public
5283         field. 
5284
5285         Add `prepared' field, the same hack used for FieldExprs to cope
5286         with composed assignments, as Local variables do not necessarily
5287         operate purely on the stack as they used to: they can be captured
5288         fields. 
5289
5290         Add `temp' for a temporary result, like fields.
5291
5292         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5293
5294         It now copes with Local variables that are captured and emits the
5295         proper instance variable to load it from a field in the captured
5296         case. 
5297
5298         (ParameterReference.DoResolveBase): During the resolve phase,
5299         capture parameters if we are in an anonymous method.
5300
5301         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5302         anonymous method, use the EmitContext helper routines to emit the
5303         parameter reference.
5304
5305         * iterators.cs: Set RemapToProxy to true/false during the
5306         EmitDispose class.
5307
5308         * parameters.cs (GetParameterByName): New helper method. 
5309
5310         * typemanager.cs (anonymous_method_type) a new type that
5311         represents an anonyous method.  This is always an internal type,
5312         used as a fencepost to test against the anonymous-methodness of an
5313         expression. 
5314         
5315 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5318         561 report.
5319         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5320
5321 2004-11-10  Martin Baulig  <martin@ximian.com>
5322
5323         * expression.cs (Invocation.BetterFunction): If two methods have
5324         equal parameter types, but only one of them is generic, the
5325         non-generic one wins.
5326         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5327         instance; just use `Type.IsValueType' to determine whether
5328         something is a struct or not.
5329         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5330         so we can be called multiple times.
5331
5332 2004-11-10  Martin Baulig  <martin@ximian.com>
5333
5334         * generic.cs (TypeParameter.DefineConstraints): New public method.
5335         (TypeParameter.CheckAccessLevel): Override this and return true.
5336         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5337         override ResolveType() anymore.
5338         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5339
5340 2004-11-10  Martin Baulig  <martin@ximian.com>
5341
5342         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5343         call DeclSpace.ResolveNestedType() on it.
5344
5345 2004-11-10  Martin Baulig  <martin@ximian.com>
5346
5347         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5348         non-null, call ParameterModifier() on it.
5349
5350 2004-11-10  Martin Baulig  <martin@ximian.com>
5351
5352         * iterators.cs
5353         (Iterators): Added `current_type' and `this_type' fields.
5354         (Iterators.DefineIterator): Create a new EmitContext and store it
5355         in `ec'; compute `this_type'.
5356
5357 2004-11-10  Martin Baulig  <martin@ximian.com>
5358
5359         * typemanager.cs
5360         (TypeManager.IsPrivateAccessible): New public method.
5361         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5362
5363 2004-11-10  Martin Baulig  <martin@ximian.com>
5364
5365         * class.cs (TypeContainer.DefineType): Call
5366         TypeBuilder.DefineGenericParameters() before resolving the type
5367         parameters.
5368         (MethodData.parent_method): New protected field.
5369         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5370         (MethodData.Define): Compute `parent_method'.
5371
5372         * decl.cs
5373         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5374         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5375         (DeclSpace.ec): New protected field; store the EmitContext here.
5376         (DeclSpace.EmitContext): New public property.
5377         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5378         (DeclSpace.ResolveNestedType): New public method.
5379         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5380         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5381         (DeclSpace.FamilyAccessible): Likewise.
5382         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5383         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5384         EmitContext.
5385
5386         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5387         field.
5388
5389         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5390         (Enum.Emit): Don't create a new EmitContext.
5391
5392 2004-10-18  Martin Baulig  <martin@ximian.com>
5393
5394         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5395         `Type' directly, but call ResolveType() on it.
5396         (Catch.Resolve): Likewise.
5397         (Foreach.Resolve): Likewise.
5398
5399 2004-10-18  Martin Baulig  <martin@ximian.com>
5400
5401         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5402         `Type' directly, but call ResolveType() on it.
5403         (Probe.DoResolve): Likewise.
5404         (ArrayCreation.LookupType): Likewise.
5405         (TypeOf.DoResolve): Likewise.
5406         (SizeOf.DoResolve): Likewise.
5407
5408 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5409
5410         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5411         the ResolveType.
5412
5413 2004-10-17  John Luke  <john.luke@gmail.com>
5414
5415         * class.cs (Operator.GetSignatureForError): use CSharpName
5416
5417         * parameter.cs (Parameter.GetSignatureForError): Returns
5418         correct name even if was not defined.
5419
5420 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5421
5422         Fix #65816.
5423         * class.cs (TypeContainer.EmitContext): New property.
5424         (DefineNestedTypes): Create an emitcontext for each part.
5425         (MethodCore.DoDefineParameters): Use container's emitcontext.
5426         Pass type array to InternalParameters.
5427         (MemberBase.DoDefine): Use container's emitcontext.
5428         (FieldMember.Define): Likewise.
5429         (Event.Define): Likewise.
5430         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5431         Pass type array to InternalParameters.
5432         (SetIndexerMethod.GetParameterInfo): Likewise.
5433         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5434         * delegate.cs (Define): Pass emitcontext to
5435         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5436         array to InternalParameters.
5437         * expression.cs (ParameterReference.DoResolveBase): Pass
5438         emitcontext to GetParameterInfo.
5439         (ComposedCast.DoResolveAsTypeStep): Remove check on
5440         ec.ResolvingTypeTree.
5441         * parameter.cs (Parameter.Resolve): Change argument to
5442         EmitContext.  Use ResolveAsTypeTerminal.
5443         (Parameter.GetSignature): Change argument to EmitContext.
5444         (Parameters.ComputeSignature): Likewise.
5445         (Parameters.ComputeParameterTypes): Likewise.
5446         (Parameters.GetParameterInfo): Likewise.
5447         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5448         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5449         * support.cs (InternalParameters..ctor): Remove variant that takes
5450         a DeclSpace.
5451         * typemanager.cs (system_intptr_expr): New.
5452         (InitExpressionTypes): Initialize it.
5453
5454 2004-10-12  Chris Toshok  <toshok@ximian.com>
5455
5456         * cs-parser.jay: fix location for try_statement and catch_clause.
5457
5458 2004-10-18  Martin Baulig  <martin@ximian.com>
5459
5460         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5461         `Type' directly, but call ResolveType() on it.
5462         (MemberBase.DoDefine): Likewise.
5463
5464         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5465         `Type' directly, but call ResolveType() on it.
5466         (ComposedCast.DoResolveAsTypeStep): Likewise.
5467
5468         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5469         `Type' directly, but call ResolveType() on it.
5470
5471 2004-10-17  John Luke  <john.luke@gmail.com>
5472
5473         * class.cs (Operator.GetSignatureForError): use CSharpName
5474
5475         * parameter.cs (Parameter.GetSignatureForError): Returns
5476         correct name even if was not defined.
5477
5478 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5479
5480         Fix #65816.
5481         * class.cs (TypeContainer.EmitContext): New property.
5482         (DefineNestedTypes): Create an emitcontext for each part.
5483         (MethodCore.DoDefineParameters): Use container's emitcontext.
5484         Pass type array to InternalParameters.
5485         (MemberBase.DoDefine): Use container's emitcontext.
5486         (FieldMember.Define): Likewise.
5487         (Event.Define): Likewise.
5488         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5489         Pass type array to InternalParameters.
5490         (SetIndexerMethod.GetParameterInfo): Likewise.
5491         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5492         * delegate.cs (Define): Pass emitcontext to
5493         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5494         array to InternalParameters.
5495         * expression.cs (ParameterReference.DoResolveBase): Pass
5496         emitcontext to GetParameterInfo.
5497         (ComposedCast.DoResolveAsTypeStep): Remove check on
5498         ec.ResolvingTypeTree.
5499         * parameter.cs (Parameter.Resolve): Change argument to
5500         EmitContext.  Use ResolveAsTypeTerminal.
5501         (Parameter.GetSignature): Change argument to EmitContext.
5502         (Parameters.ComputeSignature): Likewise.
5503         (Parameters.ComputeParameterTypes): Likewise.
5504         (Parameters.GetParameterInfo): Likewise.
5505         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5506         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5507         * support.cs (InternalParameters..ctor): Remove variant that takes
5508         a DeclSpace.
5509         * typemanager.cs (system_intptr_expr): New.
5510         (InitExpressionTypes): Initialize it.
5511
5512 2004-10-12  Chris Toshok  <toshok@ximian.com>
5513
5514         * cs-parser.jay: fix location for try_statement and catch_clause.
5515
5516 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5517
5518         More DeclSpace.ResolveType avoidance.
5519         * decl.cs (MemberCore.InUnsafe): New property.
5520         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5521         with newly created EmitContext.
5522         (FieldMember.Define): Likewise.
5523         * delegate.cs (Delegate.Define): Likewise.
5524         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5525         only if normal name-lookup fails.
5526         (TypeExpr.DoResolve): Enable error-checking.
5527         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5528         (SizeOf.DoResolve): Likewise.
5529         (ComposedCast.DoResolveAsTypeStep): Likewise.
5530         (StackAlloc.DoResolve): Likewise.
5531         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5532         (Block.Unsafe): New property.
5533         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5534         (Unsafe): Set 'unsafe' flag of contained block.
5535         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5536         (Fixed.Resolve): Likewise.
5537         (Catch.Resolve): Likewise.
5538         (Using.ResolveLocalVariableDecls): Likewise.
5539         (Foreach.Resolve): Likewise.
5540
5541 2004-10-05  John Luke <john.luke@gmail.com>
5542
5543         * cs-parser.jay: add location to error CS0175
5544
5545 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5546
5547         * ecore.cs (Expression.Constantity): Add support for turning null
5548         into a constant.
5549
5550         * const.cs (Const.Define): Allow constants to be reference types
5551         as long as the value is Null.
5552
5553 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5554
5555         * namespace.cs (NamespaceEntry.Using): No matter which warning
5556         level is set, check if this namespace name has already been added.
5557
5558 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5559
5560         * expression.cs: reftype [!=]= null should always use br[true,false].
5561         # 67410
5562
5563 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5564
5565         Fix #67108
5566         * attribute.cs: Enum conversion moved to 
5567         GetAttributeArgumentExpression to be applied to the all
5568         expressions.
5569
5570 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5571
5572         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5573         * class.c (TypeContainer.DefineType): Flag error if
5574         base types aren't accessible due to access permissions.
5575         * decl.cs (DeclSpace.ResolveType): Move logic to
5576         Expression.ResolveAsTypeTerminal.
5577         (DeclSpace.ResolveTypeExpr): Thin layer over
5578         Expression.ResolveAsTypeTerminal.
5579         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5580         Refactor code into NestedAccess.  Use it.
5581         (DeclSpace.NestedAccess): New.
5582         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5583         argument to silence errors.  Check access permissions.
5584         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5585         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5586         (Cast.DoResolve): Likewise.
5587         (New.DoResolve): Likewise.
5588         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5589         (TypeOf.DoResolve): Likewise.
5590
5591         * expression.cs (Invocation.BetterConversion): Return the Type of
5592         the better conversion.  Implement section 14.4.2.3 more faithfully.
5593         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5594         section 14.4.2.2 explicit.
5595         (Invocation.OverloadResolve): Update.
5596         (Invocation): Remove is_base field.
5597         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5598         (Invocation.Emit): Likewise.
5599
5600 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5601
5602         * cs-parser.jay: Reverted 642 warning fix.
5603
5604 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5605
5606         Fix bug #66615
5607         * decl.cs (FindMemberWithSameName): Indexer can have more than
5608         1 argument.
5609
5610 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5611
5612         * expression.cs (LocalVariableReference.DoResolveLValue):
5613         Do not report warning 219 for out values.
5614         (EmptyExpression.Null): New member to avoid extra allocations.
5615
5616 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5617
5618         * cs-parser.jay: Fix wrong warning 642 report.
5619
5620         * cs-tokenizer.cs (CheckNextToken): New helper;
5621         Inspect next character if is same as expected.
5622
5623 2004-09-23  Martin Baulig  <martin@ximian.com>
5624
5625         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5626         (Convert.ImplicitReferenceConversionExists): Likewise.
5627
5628 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5629
5630         * Makefile (DISTFILES): Comment out a few missing files.
5631
5632 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5633
5634         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5635         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5636         (gmcs.exe): Invoke bootstrap-libs.
5637         (clean-local): Clean the net_2_0_bootstrap profile too.
5638         (PROGRAM_INSTALL_DIR): New.
5639         (install-local): Use it.
5640
5641 2004-10-13  Martin Baulig  <martin@ximian.com>
5642
5643         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5644         (TypeParameter.DefineType): If we're a method type parameter and
5645         that method is overriding something, "inflate" its constraints.
5646
5647 2004-10-12  Martin Baulig  <martin@ximian.com>
5648
5649         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5650         and have type arguments, create and resolve a ConstructedType.
5651
5652 2004-10-12  Martin Baulig  <martin@ximian.com>
5653
5654         * decl.cs (MemberCache.FindMemberToOverride): Use
5655         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5656         to compare the invocationType.
5657
5658         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5659         When comparing two type parameters, only do the signature-only
5660         comparision for method type parameters.
5661
5662 2004-10-11  Martin Baulig  <martin@ximian.com>
5663
5664         * report.cs: Don't make --fatal abort on warnings, we have
5665         -warnaserror for that.
5666
5667 2004-10-11  Martin Baulig  <martin@ximian.com>
5668
5669         * typemanager.cs
5670         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5671         (TypeManager.IsEqual): Call ourself recursively instead of using
5672         Type.IsEqual(). 
5673
5674 2004-10-11  Martin Baulig  <martin@ximian.com>
5675
5676         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5677         on our own type parameters, not on the ones we inherit from a containing
5678         class.
5679
5680         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5681         the comparision.
5682
5683         * generic.cs (TypeParameter.Define): We may only be called once.
5684
5685         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5686         instead of TypeManager.IsEqual().
5687
5688 2004-09-28  Martin Baulig  <martin@ximian.com>
5689
5690         * generic.cs
5691         (GenericConstraints.EffectiveBaseClass): New public property.
5692         (TypeParameter.GenericConstraints): New public property.
5693         (ConstructedType.CheckConstraints): Improved.
5694
5695         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5696         (Convert.TypeParameterConversion): New private method; use this in
5697         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5698         for all conversions related to type parameters.
5699
5700 2004-09-24  Martin Baulig  <martin@ximian.com>
5701
5702         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5703         type parameter conversions for type parameters which are known to
5704         be reference types.
5705
5706 2004-09-24  Martin Baulig  <martin@ximian.com>
5707
5708         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5709         `IsValueType' properties.
5710
5711         * support.cs (ReflectionConstraints): Use
5712         Type.GetGenericParameterConstraints() instead of the old hack.
5713
5714 2004-09-24  Martin Baulig  <martin@ximian.com>
5715
5716         * generic.cs (GenericConstraints): Moved here and made it an
5717         abstract class.
5718
5719         * support.cs (GenericConstraints): Moved to generic.cs.
5720
5721 2004-09-24  Martin Baulig  <martin@ximian.com>
5722
5723         * support.cs
5724         (ReflectionConstraints): Un-nested this class and made it public.
5725
5726         * typemanager.cs
5727         (TypeManager.GetTypeParameterConstraints): New public method.
5728         (TypeManager.HasConstructorConstraint): Use the attributes.
5729
5730 2004-09-24  Martin Baulig  <martin@ximian.com>
5731
5732         * support.cs (GenericConstraints): Replaced `HasConstructor',
5733         `IsReferenceType' and `IsValueType' with `Attributes'.
5734         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5735         method and made the .ctor public.
5736
5737         * generic.cs (Constraints.Attributes): New public property.
5738         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5739         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5740         `IsValueType' -> `HasValueTypeConstraint'.
5741
5742 2004-09-23  Martin Baulig  <martin@ximian.com>
5743
5744         * generic.cs (Constraints): Reflect latest runtime changes.
5745
5746 2004-09-23  Martin Baulig  <martin@ximian.com>
5747
5748         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5749         (Convert.ImplicitReferenceConversionExists): Likewise.
5750
5751 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5752
5753         * class.cs (Operator.Define): Add error 448 and 559 report.
5754         
5755 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5756
5757         * class.cs (MemberBase.IsTypePermitted): New protected
5758         method for checking error CS0610.
5759
5760 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5761
5762         * class.cs (TypeContainer.HasExplicitLayout): New property
5763         Returns whether container has StructLayout attribute set Explicit.
5764         (FieldMember): New abstract class for consts and fields.
5765         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5766         (Field): Reuse FieldMember.
5767
5768         * const.cs (Const): Reuse FieldMember.
5769
5770         * rootcontext.cs: EmitConstants call moved to class.
5771
5772 2004-09-22  Martin Baulig  <martin@ximian.com>
5773
5774         Marek and me just fixed one of our oldest bugs: #28562 :-)
5775
5776         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5777
5778         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5779         we're an EnumConstant, just return that.
5780         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5781         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5782         to get the value which'll actually be written into the attribute.
5783         However, we have to use GetValue() to access the attribute's value
5784         in the compiler.        
5785
5786 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * constant.cs (Constant.IsNegative): New abstract property
5789         IsNegative.
5790
5791         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5792         (StackAlloc.DoResolve): Reused IsNegative.
5793
5794 2004-09-22  Martin Baulig  <martin@ximian.com>
5795
5796         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5797         public method; like LookupTypeContainer, but also works for
5798         generic instances.
5799
5800         * report.cs (Report.SymbolRelatedToPreviousError): Use
5801         TypeManager.LookupGenericTypeContainer().       
5802
5803 2004-09-22  Martin Baulig  <martin@ximian.com>
5804
5805         Thanks to Peter Sestoft for this bug report.
5806
5807         * expression.cs (Conditional): If both the `trueExpr' and the
5808         `falseExpr' is a NullLiteral, return a NullLiteral.
5809
5810 2004-09-22  Martin Baulig  <martin@ximian.com>
5811
5812         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5813         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5814         for the "get_Current" call.
5815
5816 2004-09-21  Martin Baulig  <martin@ximian.com>
5817
5818         * convert.cs (Convert.ImplicitReferenceConversion): When
5819         converting to an interface type, first check whether we're
5820         converting from a reference type.
5821
5822 2004-09-14  Martin Baulig  <martin@ximian.com>
5823
5824         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5825
5826 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5827
5828         Fixed bug #61902
5829         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5830         called and is obsolete then this member suppress message
5831         when call is inside next [Obsolete] method or type.
5832
5833         * expression.cs: Use TestObsoleteMethodUsage member.
5834
5835 2004-09-14  Martin Baulig  <martin@ximian.com>
5836
5837         * genericparser.cs: Removed.
5838
5839 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5840
5841         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5842
5843 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5844
5845         * attribute.cs (Attribute.Resolve): Add error 653 report.
5846
5847         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5848         report.
5849         (Method.ApplyAttributeBuilder): Add error 685 report.
5850         (Operator.Define): Add error 564 report.
5851
5852         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5853
5854         * expression.cs (Invocation.DoResolve): Add error
5855         245 and 250 report.
5856
5857         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5858         error 674 report.
5859
5860 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5861
5862         * class.cs (ConstructorInitializer.Resolve):
5863         Wrong error number (515->516).
5864
5865 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5866
5867         * class.cs (Indexer.Define): Add error 631 report.
5868
5869 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5870
5871         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5872
5873 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5874
5875         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5876
5877 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5878
5879         * cs-parser.jay: Added error CS0241 report.
5880
5881 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5882
5883         * cs-parser.jay (fixed_statement): Introduce a scope for the
5884         declaration in the 'fixed' statement.
5885
5886 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5887
5888         * cs-parser.jay: Added CS0230 error report.
5889
5890 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5891
5892         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5893
5894 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5895
5896         * expression.cs (Argument.Resolve): Added error CS0192 and
5897         CS0199 report.
5898
5899 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5900
5901         C# 2.0 #pragma warning feature
5902
5903         * cs-tokenizer.cs (PreProcessPragma): New method; 
5904         Handles #pragma directive.
5905
5906         * report.cs (WarningRegions): New class; Support
5907         class for #pragma warning directive. It tests whether
5908         warning is enabled for a given line.
5909
5910 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5911
5912         * const.cs: Add more descriptive error report, tahnks to
5913         Sebastien. 
5914
5915 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5916
5917         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5918
5919 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5920
5921         * expression.cs: Apply patch from Ben: Remove dead code from
5922         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5923         as that code just threw an exception anwyays.
5924
5925         * const.cs: Remove the call to the turnintoconstant, for details
5926         see bug: #63144
5927         
5928         * literal.cs: The type of the null-literal is the null type;  So
5929         we use a placeholder type (literal.cs:System.Null, defined here)
5930         for it.
5931
5932         * expression.cs (Conditional.DoResolve): Remove some old code that
5933         is no longer needed, conversions have been fixed.
5934
5935         (ArrayCreationExpression.DoResolve): Return false if we fail to
5936         resolve the inner expression.
5937
5938 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5939
5940         Fix test-290.cs.
5941         * cs-parser.jay (delegate_declaration): Record a delegate
5942         declaration as a type declaration.
5943         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5944
5945 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5946
5947         * parameter.cs: Do not crash if the type can not be resolved. 
5948
5949         * expression.cs: Report errors with unsafe pointers, fixes #64896
5950
5951 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5952
5953         * expression.cs: Pointer arith always needs to do a conv.i
5954         if the operand is a long. fix 65320
5955
5956 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5957
5958         Fixed cs0619-37.cs, cs0619-38.cs
5959
5960         * enum.cs (GetObsoleteAttribute): Removed.
5961
5962         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5963         on Enum member is double staged. The first is tested member
5964         and then enum.
5965
5966 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5967
5968         Fixed #56986, #63631, #65231
5969
5970         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5971         adds member to name container.
5972         (TypeContainer.AddToTypeContainer): New method, adds type to
5973         name container.
5974         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5975         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5976         AddOperator): Simplified by reusing AddToMemberContainer.
5977         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5978         instead of field.
5979         (Method.CheckForDuplications): Fixed implementation to test all
5980         possibilities.
5981         (MemberBase): Detection whether member is explicit interface
5982         implementation is now in constructor.
5983         (MemberBase.UpdateMemberName): Handles IndexerName.
5984         (Accessor): Changed to keep also location information.
5985         (AbstractPropertyEventMethod): Is derived from MemberCore.
5986         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5987         will be emited or not.
5988         (PropertyBase.AreAccessorsDuplicateImplementation):
5989         Tests whether accessors are not in collision with some method.
5990         (Operator): Is derived from MethodCore to simplify common
5991         operations.
5992
5993         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5994         must be performed.
5995         (DeclSpace.AddToContainer): Adds the member to defined_names
5996         table. It tests for duplications and enclosing name conflicts.
5997
5998         * enum.cs (EnumMember): Clean up to reuse the base structures
5999
6000 2004-09-03  Martin Baulig  <martin@ximian.com>
6001
6002         Merged latest changes into gmcs.  Please keep this comment in
6003         here, it makes it easier for me to see what changed in MCS since
6004         the last time I merged.
6005
6006 2004-09-03  Martin Baulig  <martin@ximian.com>
6007
6008         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6009         into TypeContainer, to make partial classes work again.
6010
6011 2004-09-03  Martin Baulig  <martin@ximian.com>
6012
6013         * rootcontext.cs (RootContext.V2): Removed.
6014
6015 2004-03-23  Martin Baulig  <martin@ximian.com>
6016
6017         * expression.cs (Invocation.OverloadResolve): Added `bool
6018         may_fail' argument and use it instead of the Location.IsNull() hack.
6019
6020 2004-09-09  Martin Baulig  <martin@ximian.com>
6021
6022         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6023
6024 2004-09-09  Martin Baulig  <martin@ximian.com>
6025
6026         * generic.cs (TypeParameter.DefineType): Added support for
6027         explicit interface methods.
6028
6029 2004-09-09  Martin Baulig  <martin@ximian.com>
6030
6031         * README.Changes: New document.  Started to list important changes
6032         between MCS and GMCS here.
6033
6034 2004-09-08  Martin Baulig  <martin@ximian.com>
6035
6036         * class.cs
6037         (TypeContainer.CheckRecursiveDefinition): New protected method.
6038         (TypeContainer.DefineType): Move the CS0146 check into
6039         CheckRecursiveDefinition().     
6040
6041 2004-09-06  Martin Baulig  <martin@ximian.com>
6042
6043         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6044         types for the constructor constraint.
6045
6046 2004-09-03  Martin Baulig  <martin@ximian.com>
6047
6048         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6049         into TypeContainer, to make partial classes work again.
6050
6051 2004-09-03  Martin Baulig  <martin@ximian.com>
6052
6053         * rootcontext.cs (RootContext.V2): Removed.
6054
6055 2004-03-23  Martin Baulig  <martin@ximian.com>
6056
6057         * expression.cs (Invocation.OverloadResolve): Added `bool
6058         may_fail' argument and use it instead of the Location.IsNull() hack.
6059
6060 2004-09-03  Martin Baulig  <martin@ximian.com>
6061
6062         Merged latest changes into gmcs.  Please keep this comment in
6063         here, it makes it easier for me to see what changed in MCS since
6064         the last time I merged.
6065
6066 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6067
6068         Fix #61128.
6069         * expression.cs (BetterConversion): Don't allow either conversion 
6070         to be null.  Remove redundant implicit conversion test when 'q ==
6071         null' -- when this function is invoked, we already know that the
6072         implicit conversion exists.
6073         (BetterFunction): Assume that 'best' is non-null.  Remove
6074         redundant reimplementation of IsApplicable when 'best' is null.
6075         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6076         number of arguments.
6077         (IsAncestralType): Extract from OverloadResolve.
6078         (OverloadResolve): Make robust to the MethodGroupExpr being
6079         unsorted.  Implement all the logic of Section 14.5.5.1, and
6080         support overloading of methods from multiple applicable types.
6081         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6082
6083         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6084         (RealError, Warning): Append type of report to related symbol.
6085
6086 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6087
6088         * enum.cs: Fixed CLS-Compliance checks for enum members.
6089         Error tests cs3008-8.cs, cs3014-8.cs
6090
6091 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6092
6093         Fixed bug #62342, #63102
6094         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6095         like ImplementMethod.
6096
6097 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6098
6099         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6100         Fixed bug #65170.
6101
6102 2004-09-02  Martin Baulig  <martin@ximian.com>
6103
6104         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6105         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6106         on the MethodBase.
6107
6108 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6109
6110         C# 2.0 Static classes implemented
6111
6112         * class.cs (TypeContainer): instance_constructors,
6113         initialized_fields, initialized_static_fields,
6114         default_constructor, base_inteface_types are protected to be
6115         accessible from StaticClass.
6116         (TypeContainer.DefineDefaultConstructor): New virtual method
6117         for custom default constructor generating
6118         (StaticClass): New class to handle "Static classes" feature.
6119
6120         * cs-parser.jay: Handle static keyword on class like instance
6121         of StaticClass.
6122
6123         * driver.cs: Added "/langversion" command line switch with two
6124         options (iso-1, default).
6125
6126 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6127
6128         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6129
6130 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6131
6132         * delegate.cs: Style.
6133
6134 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6135
6136         * delegate.cs: Add seperate instance expr field for miguel.
6137
6138 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6139
6140         * PointerArithmetic (Resolve): make sure we are not doing
6141         pointer arith on void*. Also, make sure we are resolved
6142         by not setting eclass until resolve.
6143
6144         All callers: Make sure that PointerArithmetic gets resolved.
6145
6146 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6147
6148         * ArrayCreation (LookupType): If the type does not resolve 
6149         to an array, give an error.
6150
6151 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * statement.cs (Try.Resolve): Fixed bug #64222
6154
6155 2004-08-27  Martin Baulig  <martin@ximian.com>
6156
6157         * class.cs
6158         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6159         crash here.     
6160
6161 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6162
6163         * ecore.cs (Constantify): Get underlying type via
6164         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6165         Windows in special cases.
6166
6167 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6168
6169         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6170         for obtaining also private methods.
6171         (GetRemoveMethod): Used GetRemoveMethod (true)
6172         for obtaining also private methods.
6173
6174 2004-09-02  Martin Baulig  <martin@ximian.com>
6175
6176         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6177         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6178         on the MethodBase.
6179
6180 2004-08-27  Martin Baulig  <martin@ximian.com>
6181
6182         * class.cs
6183         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6184         crash here.     
6185
6186 2004-08-25  Martin Baulig  <martin@ximian.com>
6187
6188         * support.cs (ReflectionParameters..ctor): If this is a generic
6189         method, retrieve and store its type parameters.
6190         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6191         (ReflectionParameters.GenericConstraints): The argument specifies
6192         the type parameter, not the method parameter.
6193         (InternalParameters.GenericConstraints): Likewise.
6194
6195         * generic.cs (TypeParameter.DefineType): Correctly handle
6196         constraints wrt. generic methods in interfaces and their
6197         implementations.        
6198
6199 2004-08-24  Martin Baulig  <martin@ximian.com>
6200
6201         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6202         (Constraints.IsSubclassOf): New internal method.
6203
6204         * typemanager.cs (TypeManager.FindMembers): Added special support
6205         for GenericTypeParameterBuilder's.      
6206         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6207         type parameters.
6208
6209 2004-08-24  Martin Baulig  <martin@ximian.com>
6210
6211         * typemanager.cs
6212         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6213         this for accessibility checks.
6214         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6215         IsNestedFamilyAccessible.
6216         (TypeManager.IsSubclassOf): New method, do what the name actually
6217         says.   
6218
6219 2004-08-24  Martin Baulig  <martin@ximian.com>
6220
6221         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6222         as a SimpleName, include the generic arity.
6223
6224 2004-08-24  Martin Baulig  <martin@ximian.com>
6225
6226         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6227         MethodAttributes.HideBySig for operators.
6228
6229 2004-08-23  Martin Baulig  <martin@ximian.com>
6230
6231         Back to the old error reporting system :-)
6232
6233         * report.cs (Message): Removed.
6234         (Report.MessageData, ErrorData, WarningData): Removed.
6235         (Report.Error, Warning): Back to the old system.
6236
6237 2004-08-23  Martin Baulig  <martin@ximian.com>
6238
6239         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6240
6241         * class.cs (TypeContainer.ParentContainer): New public virtual
6242         method; replaces the explicit interface implementation.
6243         (ClassPart.ParentContainer): Override.
6244
6245 2004-08-23  Martin Baulig  <martin@ximian.com>
6246
6247         * statement.cs (Switch): Added support for constant switches; see
6248         #59428 or test-285.cs.
6249
6250 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6251
6252         Fixed bug #62740.
6253         * statement.cs (GetEnumeratorFilter): Removed useless
6254         logic because C# specs is strict. GetEnumerator must be
6255         public.
6256
6257 2004-08-22  Martin Baulig  <martin@ximian.com>
6258
6259         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6260         a switch and may break, reset the barrier.  Fixes #59867.
6261
6262 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6263
6264         CLS-Compliance speed up (~5% for corlib)
6265
6266         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6267         New method. Tests container for CLS-Compliant names
6268
6269         * class.cs (TypeContainer.VerifyClsName): New method.
6270         Checks whether container name is CLS Compliant.
6271         (Constructor): Implements IMethodData.
6272
6273         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6274         low-case table for CLS Compliance test.
6275         (MemberCache.VerifyClsParameterConflict): New method.
6276         Checks method parameters for CS3006 error.
6277
6278         * enum.cs (EnumMember): Is derived from MemberCore.
6279         (Enum.VerifyClsName): Optimized for better performance.
6280
6281 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6282
6283         * report.cs: Renamed Error_T to Error and changed all
6284         references.
6285
6286 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6287
6288         * class.cs (TypeContainer.IndexerArrayList): New inner class
6289         container for indexers.
6290         (TypeContainer.DefaultIndexerName): New constant for default
6291         indexer name. Replaced all "Item" with this constant.
6292         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6293
6294         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6295         DefaultMemberAttribute constructor.
6296
6297 2004-08-05  Martin Baulig  <martin@ximian.com>
6298
6299         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6300         Fix bug #59429.
6301
6302 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6303
6304         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6305         multi platforms problem.
6306
6307         * compiler.csproj: Included shared files.
6308
6309 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6310
6311         Fix bug 60333, 55971 in the more general way
6312         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6313         Added arg_type argument for constant conversion.
6314         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6315
6316 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6317
6318         Fix bug #59760
6319         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6320         OperatorArrayList, MethodCoreArrayList for typecontainer
6321         containers. Changed class member types to these new types.
6322         (MethodArrayList.DefineMembers): Added test for CS0659.
6323
6324 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6325
6326         * cfold.cs: Synchronize the folding with the code in expression.cs
6327         Binary.DoNumericPromotions for uint operands.
6328
6329         * attribute.cs: Revert patch from Raja, it introduced a regression
6330         while building Blam-1.2.1 (hard to isolate a test case).
6331
6332 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6333
6334         Fix for #55382
6335         * class.cs:
6336         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6337         name collision.
6338         (MethodCore.parent_method): New member. The method we're overriding
6339         if this is an override method.
6340         (MethodCore.CheckBase): Moved from Method class and made common.
6341         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6342         private.
6343         (MethodCore.CheckForDuplications): New abstract method. For custom
6344         member duplication search in a container
6345         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6346         method and its return type.
6347         (Event.conflict_symbol): New member. Symbol with same name in the
6348         parent class.
6349
6350         * decl.cs:
6351         (MemberCache.FindMemberWithSameName): New method. The method
6352         is looking for conflict with inherited symbols.
6353
6354 2004-08-04  Martin Baulig  <martin@ximian.com>
6355
6356         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6357
6358         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6359
6360 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6361
6362         * report.cs (Message): New enum for better error, warning reference in
6363         the code.
6364         (MessageData): New inner abstract class. It generally handles printing of
6365         error and warning messages.
6366         Removed unused Error, Warning, Message methods.
6367
6368 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6369
6370         Fix for cs0592-8.cs test
6371         * attribute.cs
6372         (Attributable.ValidAttributeTargets): Made public.
6373         (Attribute.ExplicitTarget): New member for explicit target value.
6374         (Attribute.CheckTargets): Now we translate explicit attribute
6375         target to Target here.
6376
6377 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6378
6379         * ecore.cs (MethodGroupExpr): new IsBase property.
6380
6381         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6382
6383         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6384         rather than an instance expr.
6385
6386         (DelegateCreation.Emit): Use the method group rather than
6387         the instance expression. Also, if you have base.Foo as the
6388         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6389
6390         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6391
6392         (NewDelegate.DoResolve): Only check for the existance of Invoke
6393         if the method is going to be needed. Use MethodGroupExpr.
6394
6395         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6396
6397         * expression.cs: For pointer arith., make sure to use
6398         the size of the type, not the size of the pointer to
6399         the type.
6400
6401 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6402
6403         Fix for #60722
6404         * class.cs (Class): Added error CS0502 test.
6405
6406 2004-08-03  John Luke  <jluke@cfl.rr.com>
6407             Raja R Harinath  <rharinath@novell.com>
6408
6409         Fix for #60997.
6410         * attribute.cs (Attribute.complained_before): New flag.
6411         (Attribute.ResolveType, Attribute.Resolve),
6412         (Attribute.DefinePInvokeMethod): Set it.
6413         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6414         
6415 2004-08-03  Martin Baulig  <martin@ximian.com>
6416
6417         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6418         use a user-defined operator; we still need to do numeric
6419         promotions in case one argument is a builtin type and the other
6420         one has an implicit conversion to that type.  Fixes #62322.
6421
6422 2004-08-18  Martin Baulig  <martin@ximian.com>
6423
6424         * class.cs (Method.Define): Use the correct method name when
6425         creating the MethodBuilder for a generic method.
6426
6427 2004-08-17  Martin Baulig  <martin@ximian.com>
6428
6429         * generic.cs (Constraints): Support type parameter constraints.
6430
6431 2004-08-16  Martin Baulig  <martin@ximian.com>
6432
6433         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6434         (Token.GENERIC_DIMENSION): New token; this is returned if we
6435         encounter an unbound generic type in a typeof() expression.
6436
6437         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6438         this token is only generated while parsing a typeof() expression.
6439         (typeof_expression): Removed the old unbound_type hack.
6440
6441         * generic.cs (TypeArguments.IsUnbound): New public property.
6442
6443         * decl.cs (MemberName): Added support for unbound types.
6444
6445 2004-08-14  Martin Baulig  <martin@ximian.com>
6446
6447         * typemanager.cs
6448         (TypeManager.IsEqualGenericInstance): New static method.
6449         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6450         just used to check accessibility, so follow the rules of 26.1.6.        
6451
6452         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6453         ConstructedType instead of a TypeExpression if we have type arguments.
6454
6455         * cs-parser.jay (typeof_expression): Support unbound generic types.
6456
6457         * ecore.cs (UnboundTypeExpression): New public class.
6458
6459 2004-08-12  Martin Baulig  <martin@ximian.com>
6460
6461         * typemanager.cs (TypeManager.IsNestedChildOf): Use
6462         TypeManager.IsEqual() rather than `=='.
6463
6464         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6465         generic instances as well.
6466
6467 2004-08-12  Martin Baulig  <martin@ximian.com>
6468
6469         * expression.cs (Invocation.InferType): We can only infer method
6470         type parameters.  Fixes #62647.
6471
6472 2004-08-11  Martin Baulig  <martin@ximian.com>
6473
6474         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6475         before resolving the base classes.
6476
6477 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6478
6479         * Makefile: install .mdb file too.
6480
6481 2004-08-05  Martin Baulig  <martin@ximian.com>
6482
6483         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6484         initializer, the current type is just the TypeBuilder, not the
6485         instantiated generic type.
6486         (FieldExpr.IsFieldInitializer): New public property.
6487
6488 2004-08-04  Martin Baulig  <martin@ximian.com>
6489
6490         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6491
6492         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6493
6494 2004-08-03  Martin Baulig  <martin@ximian.com>
6495
6496         * class.cs (MethodData.Define): If we're an explicit
6497         implementation, remove the generic arity from the type name.
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-02  Martin Baulig  <martin@ximian.com>
6507
6508         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6509         `TypeExpr[]' array.
6510         (TypeContainer.GetClassBases): Return the unexpanded list of
6511         interfaces; we expand them later.
6512         (TypeContainer.DefineType): After creating the TypeBuilder, call
6513         TypeManager.ExpandInterfaces() to get an expanded and resolved
6514         list of interfaces.
6515
6516         * ecore.cs (TypeExpr.GetInterfaces): Removed
6517
6518         * generics.cs (Constraints.InterfaceConstraints): Remove.
6519         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6520         register the interface constraints.
6521
6522         * typemanager.cs
6523         (TypeManager.AddUserType): Removed the `ifaces' argument.
6524         (TypeManager.AddTypeParameter): Likewise.
6525         (TypeManager.AddUserInterface): Removed, was unused.
6526         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6527         `TypeExpr[]' array for the interfaces.
6528         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6529         has been defined, returns a list of the resolved interfaces types.
6530         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6531         (TypeManager.GetExplicitInterfaces): Likewise.  
6532
6533 2004-08-02  Martin Baulig  <martin@ximian.com>
6534
6535         * expression.cs (Invocation.EmitCall): If we're invoking a method
6536         on a type parameter, use the new `Constrained' prefix opcode.
6537
6538 2004-08-02  Martin Baulig  <martin@ximian.com>
6539
6540         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6541         (LocalInfo.IsThis): New public property.
6542         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6543
6544 2004-08-01  Martin Baulig  <martin@ximian.com>
6545
6546         * class.cs (TypeContainer.GetClassBases): Don't set the default
6547         here since we may get called from GetPartialBases().
6548         (TypeContainer.DefineType): If GetClassBases() didn't return a
6549         parent, use the default one.
6550
6551 2004-07-30  Martin Baulig  <martin@ximian.com>
6552
6553         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6554
6555         * class.cs (SourceMethod): New public class, derive from the
6556         symbol writer's ISourceMethod.
6557         (Method): Use the new symbol writer API.
6558
6559         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6560         as argument and use the new symbol writer.
6561
6562         * location.cs
6563         (SourceFile): Implement the symbol writer's ISourceFile.
6564         (Location.SymbolDocument): Removed.
6565         (Location.SourceFile): New public property.
6566
6567         * symbolwriter.cs: Use the new symbol writer API.
6568
6569 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6570
6571         * Makefile (install-local): Remove.  Functionality moved to
6572         executable.make.
6573
6574 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6575
6576         * Makefile: Install mcs.exe.config file together with mcs.exe.
6577         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6578         correct runtime version.
6579         
6580 2004-07-25  Martin Baulig  <martin@ximian.com>
6581
6582         * class.cs
6583         (TypeContainer.RegisterOrder): Removed, this was unused.
6584         (TypeContainer, interface_order): Removed.
6585         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6586         TypeContainer as argument since we can also be called with a
6587         `PartialContainer' for a partial class/struct/interface.
6588         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6589         of checking whether we're an `Interface' - we could be a
6590         `PartialContainer'.
6591         (PartialContainer.Register): Override; call
6592         AddClass()/AddStruct()/AddInterface() on our parent.
6593
6594         * cs-parser.jay (interface_member_declaration): Add things to the
6595         `current_container', not the `current_class'.
6596
6597         * rootcontext.cs (RegisterOrder): The overloaded version which
6598         takes an `Interface' was unused, removed.
6599
6600         * typemanager.cs (TypeManager.LookupInterface): Return a
6601         `TypeContainer', not an `Interface'.
6602         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6603         contain a `PartialContainer' for an interface, so check it's
6604         `Kind' to figure out what it is.
6605
6606 2004-07-25  Martin Baulig  <martin@ximian.com>
6607
6608         * class.cs (Class.DefaultTypeAttributes): New public constant.
6609         (Struct.DefaultTypeAttributes): Likewise.
6610         (Interface.DefaultTypeAttributes): Likewise.
6611         (PartialContainer.TypeAttr): Override this and add the
6612         DefaultTypeAttributes.
6613
6614 2004-07-25  Martin Baulig  <martin@ximian.com>
6615
6616         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6617         we can just use the `Parent' field instead.
6618
6619 2004-07-25  Martin Baulig  <martin@ximian.com>
6620
6621         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6622
6623 2004-07-25  Martin Baulig  <martin@ximian.com>
6624
6625         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6626         our parts before defining any methods.
6627         (TypeContainer.VerifyImplements): Make this virtual.
6628         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6629         on our PartialContainer.
6630
6631 2004-07-25  Martin Baulig  <martin@ximian.com>
6632
6633         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6634
6635         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6636         argument, we can just use the `Parent' field instead.
6637
6638         * class.cs
6639         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6640         (MemberBase.DoDefine): Likewise.
6641
6642 2004-07-24  Martin Baulig  <martin@ximian.com>
6643
6644         * decl.cs (MemberCore.Parent): New public field.
6645         (DeclSpace.Parent): Moved to MemberCore.
6646
6647         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6648         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6649         parent's .ctor.
6650         (FieldBase, Field, Operator): Likewise.
6651         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6652         (EventField, Event): Likewise.
6653
6654 2004-07-23  Martin Baulig  <martin@ximian.com>
6655
6656         * class.cs (PartialContainer): New public class.
6657         (ClassPart): New public class.
6658         (TypeContainer): Added support for partial classes.
6659         (TypeContainer.GetClassBases): Splitted some of the functionality
6660         out into GetNormalBases() and GetPartialBases().
6661
6662         * cs-tokenizer.cs (Token.PARTIAL): New token.
6663         (Tokenizer.consume_identifier): Added some hacks to recognize
6664         `partial', but only if it's immediately followed by `class',
6665         `struct' or `interface'.
6666
6667         * cs-parser.jay: Added support for partial clases.
6668
6669 2004-07-23  Martin Baulig  <martin@ximian.com>
6670
6671         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6672         a `DeclSpace' and also made it readonly.
6673         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6674         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6675         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6676
6677         * cs-parser.jay: Pass the `current_class', not the
6678         `current_container' (at the moment, this is still the same thing)
6679         to a new Method, Property, Event, Indexer or Constructor.
6680
6681 2004-07-23  Martin Baulig  <martin@ximian.com>
6682
6683         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6684         and removed the `current_interface' one.
6685         (struct_declaration, class_declaration, interface_declaration):
6686         Set `current_class' to the newly created class/struct/interface;
6687         set their `Bases' and call Register() before parsing their body.
6688
6689 2004-07-23  Martin Baulig  <martin@ximian.com>
6690
6691         * class.cs (Kind): New public enum.
6692         (TypeContainer): Made this class abstract.
6693         (TypeContainer.Kind): New public readonly field.
6694         (TypeContainer.CheckDef): New public method; moved here from
6695         cs-parser.jay.
6696         (TypeContainer.Register): New public abstract method.
6697         (TypeContainer.GetPendingImplementations): New public abstract
6698         method.
6699         (TypeContainer.GetClassBases): Removed the `is_class' and
6700         `is_iface' parameters.
6701         (TypeContainer.DefineNestedTypes): Formerly known as
6702         DoDefineType().
6703         (ClassOrStruct): Made this class abstract.
6704
6705         * tree.cs (RootTypes): New public type. 
6706
6707 2004-07-20  Martin Baulig  <martin@ximian.com>
6708
6709         * tree.cs (Tree.RecordNamespace): Removed.
6710         (Tree.Namespaces): Removed.
6711
6712         * rootcontext.cs (RootContext.IsNamespace): Removed.
6713
6714         * cs-parser.jay (namespace_declaration): Just create a new
6715         NamespaceEntry here.
6716
6717 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6718
6719         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6720         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6721         entry to make sure it runs in the correct runtime version.
6722         
6723 2004-07-18  Martin Baulig  <martin@ximian.com>
6724
6725         * generic.cs (ConstructedType.CheckConstraints): Improved
6726         constraints checking.
6727
6728 2004-07-18  Martin Baulig  <martin@ximian.com>
6729
6730         * expression.cs (Invocation.BetterMethod): Call
6731         TypeManager.TypeToCoreType() on all types and removed my previous
6732         hack; we're already doig the right thing here.
6733
6734 2004-07-17  Martin Baulig  <martin@ximian.com>
6735
6736         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6737
6738 2004-07-16  Martin Baulig  <martin@ximian.com>
6739
6740         * iterators.cs: Added generics support.
6741
6742 2004-07-16  Martin Baulig  <martin@ximian.com>
6743
6744         * iterators.cs: Rewrote this.  We're now using one single Proxy
6745         class for both the IEnumerable and the IEnumerator interface and
6746         `Iterator' derives from Class so we can use the high-level API.
6747
6748         * class.cs (TypeContainer.AddIterator): New method.
6749         (TypeContainer.DoDefineType): New protected virtual method, which
6750         is called from DefineType().
6751         (TypeContainer.DoDefineMembers): Call DefineType() and
6752         DefineMembers() on all our iterators.
6753         (TypeContainer.Emit): Call Emit() on all our iterators.
6754         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6755
6756         * codegen.cs (EmitContext.CurrentIterator): New public field.
6757
6758 2004-07-15  Martin Baulig  <martin@ximian.com>
6759
6760         * typemanager.cs
6761         (TypeManager.not_supported_exception_type): New type.   
6762
6763 2004-07-14  Martin Baulig  <martin@ximian.com>
6764
6765         * typemanager.cs
6766         (TypeManager.generic_ienumerable_type): New type.
6767         (TypeManager.generic_ienumerator_type): New type.
6768
6769         * rootcontext.cs
6770         (RootContext.interfaces_first_stage): Added
6771         "System.Collections.Generic.IEnumerator`1" and
6772         "System.Collections.Generic.IEnumerable`1".     
6773
6774 2004-07-14  Martin Baulig  <martin@ximian.com>
6775
6776         * iterators.cs: Use real error numbers.
6777
6778 2004-07-14  Martin Baulig  <martin@ximian.com>
6779
6780         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6781         requires this to be a System.Collection.IEnumerable and not a
6782         class implementing that interface.
6783         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6784
6785 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6786
6787         * class.cs: Fixed previous fix, it broke some error tests.
6788
6789 2004-07-12  Martin Baulig  <martin@ximian.com>
6790
6791         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6792         Fixes #61293.
6793
6794 2004-07-14  Martin Baulig  <martin@ximian.com>
6795
6796         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6797         an exclamation mark (!) for the generic arity to reflect the
6798         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6799
6800 2004-07-13  Martin Baulig  <martin@ximian.com>
6801
6802         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6803         specifiers being part of a type argument.
6804
6805 2004-07-13  Martin Baulig  <martin@ximian.com>
6806
6807         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6808         name for generic types.
6809
6810 2004-07-13  Martin Baulig  <martin@ximian.com>
6811
6812         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6813         bit to fix #60119.
6814
6815 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6816
6817         * assign.cs (LocalTemporary): Add new argument: is_address,If
6818         `is_address' is true, then the value that we store is the address
6819         to the real value, and not the value itself.
6820         
6821         * ecore.cs (PropertyExpr): use the new local temporary
6822         stuff to allow us to handle X.Y += z (where X is a struct)
6823
6824 2004-07-08  Martin Baulig  <martin@ximian.com>
6825
6826         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6827         not always return, just like we're doing in Using.Resolve().
6828
6829 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6830
6831         * cs-parser.jay (fixed_statement): flag this as Pinned.
6832
6833 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6834
6835         * typemanager.cs (TypeManager): Removed MakePinned method, this
6836         mechanism is replaced with the .NET 2.x compatible mechanism of
6837         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6838
6839         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6840         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6841         `IsFixed' property which has a different meaning.
6842
6843 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6844
6845         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6846         visible from inside a nested class, not just the names of the
6847         immediately enclosing class.
6848         Fix for bug #60730.
6849
6850 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6851
6852         * expression.cs (BetterConversion): Remove buggy special-case
6853         handling of "implicit constant expression conversions".  At this
6854         point, we already know that the conversion is possible -- we're
6855         only checking to see which is better.
6856
6857 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6858
6859         * cs-parser.jay: Added error CS0210 test.
6860
6861 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6862
6863         * cs-parser.jay: Added error CS0134 test.
6864
6865 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6866
6867         Fix bug #52507
6868         * cs-parser.jay: Added error CS0145 test.
6869
6870 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6871
6872         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6873
6874 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6875         
6876         * expression.cs (StackAlloc.Resolve): The argument may not
6877         be a constant; deal with this case.
6878         
6879 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6880
6881         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6882         GetIndexerAttributeValue.
6883         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6884
6885         * class.cs (Indexer.Define): Added error tests for CS0415,
6886         CS0609.
6887
6888 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6889
6890         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6891         property code.
6892
6893 2004-06-23  Martin Baulig  <martin@ximian.com>
6894
6895         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6896         neither return nor throw, reset the barrier as well.  Fixes #60457.
6897
6898 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6899
6900         * class.cs : EventAttributes is now set to None by default.
6901           This fixes bug #60459.
6902
6903 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6904
6905         Fix bug #60219
6906         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6907         Don't throw exception but return null (it's sufficient now).
6908
6909 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6910
6911         * typemanager.cs (GetArgumentTypes): Faster implementation.
6912
6913 2004-06-18  Martin Baulig  <martin@ximian.com>
6914
6915         * attribute.cs (Attribute.Resolve): Check whether we're an
6916         EmptyCast which a Constant child.  Fixes #60333.
6917
6918 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6919
6920         * statement.cs (EmitCollectionForeach): Account for the fact that
6921         not all valuetypes are in areas which we can take the address of.
6922         For these variables, we store to a temporary variable. Also, make
6923         sure that we dont emit a `callvirt' on a valuetype method.
6924
6925 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6926
6927         * expression.cs (StackAlloc.DoReSolve): Added test for
6928         negative parameter (CS0247).
6929
6930 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6931
6932         Fix bug #59792
6933         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6934
6935 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6936
6937         Fix bug #59781
6938         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6939         ulong.
6940
6941 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6942
6943         Fix bug #58254 & cs1555.cs, cs1556.cs
6944         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6945
6946 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6947
6948         * cs-parser.jay: Added error CS1669 test for indexers.
6949
6950 2004-06-18  Martin Baulig  <martin@ximian.com>
6951
6952         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6953         argument.  Fixes #60441.
6954
6955 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6956         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6957         The name needs to have the actual name of the method in order
6958         for other tests (such as the one in OverloadResolve for Invoke
6959         on a delegate) to work. As well, it does not really help
6960         error reporting because the method group had multiple methods.
6961         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6962         Make profiling work.
6963         
6964 2004-06-13  Martin Baulig  <martin@ximian.com>
6965
6966         * cs-parser.jay: Don't allow generic attributes.
6967
6968 2004-06-13  Martin Baulig  <martin@ximian.com>
6969
6970         * class.cs (MemberBase.DoDefineBase): New protected method.
6971         (MemberBase.DoDefine): Compute the `flags' in the new
6972         DoDefineBase() which must be called first.
6973         (Method.Define): Call DoDefineBase() first so we have the flags
6974         when defining the generic method.
6975
6976         * cs-parser.jay (interface_method_declaration): Support generic methods.
6977
6978 2004-06-13  Martin Baulig  <martin@ximian.com>
6979
6980         * decl.cs (TypeName): Removed.
6981         (MemberName): Removed TypeName and MemberNow; now we just have
6982         MemberName.
6983
6984         * cs-parser.jay: Don't distinguish between type arguments and type
6985         parameters in the grammar and simplified the rules a bit.  The
6986         reduce/reduce conflicts are now gone (except the one we inherited
6987         from mcs).
6988
6989 2004-06-11  Martin Baulig  <martin@ximian.com>
6990
6991         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6992         call this twice: for params and varargs methods.
6993
6994 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6995
6996         * class.cs:
6997         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6998
6999 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7000
7001         * attribute.cs (Attribute.GetValidTargets): Made public.
7002
7003         * class.cs: 
7004         (AbstractPropertyEventMethod): New class for better code sharing.
7005         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7006         CS1667 report.
7007         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7008
7009 2004-06-09  Martin Baulig  <martin@ximian.com>
7010
7011         * cs-parser.jay: Removed a reduce/reduce conflict.
7012
7013 2004-06-03  Martin Baulig  <martin@ximian.com>
7014
7015         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7016         GetSimpleName() and return a SimpleName.
7017
7018         * ecore.cs (SimpleName.Arguments): New public field.
7019         (SimpleName): Added overloaded ctor which takes an additional
7020         TypeArguments argument.
7021         (SimpleName.SimpleNameResolve): Added support for generic methods.
7022         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7023         formerly in MemberAccess.DoResolve(), but we also need it in
7024         SimpleNameResolve().
7025
7026         * expression.cs (MemberAccess.DoResolve): Use the new
7027         MethodGroupExpr.ResolveGeneric().       
7028
7029 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7030
7031         * decl.cs: If possible, use lookuptypedirect here. We can only do
7032         this if there is no `.' after the namespace. Avoids using
7033         LookupType, which does lots of slow processing.
7034         (FindNestedType) New method, does what it says :-).
7035         * namespace.cs: use LookupTypeDirect.
7036         * rootcontext.cs: use membercache, if possible.
7037         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7038
7039 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7040
7041         * expression.cs:
7042         According to the spec, 
7043
7044         In a member access of the form E.I, if E is a single identifier,
7045         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7046         field, property, localvariable, or parameter with the same type as
7047         the meaning of E as a type-name (§3.8), then both possible
7048         meanings of E are permitted.
7049
7050         We did not check that E as a simple-name had the same type as E as
7051         a type name.
7052
7053         This trivial check gives us 5-7% on bootstrap time.
7054
7055 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7056
7057         * expression.cs (Invocation.OverloadResolve): Avoid the
7058         use of hashtables and boxing here by allocating on demand.
7059
7060 2004-05-30  Martin Baulig  <martin@ximian.com>
7061
7062         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7063         we're doing a silent lookup.  Don't try to lookup nested types in
7064         TypeManager.object_type (thanks to Ben Maurer).
7065
7066 2004-05-30  Martin Baulig  <martin@ximian.com>
7067
7068         Committing a patch from Ben Maurer.
7069
7070         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7071
7072 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7073
7074         * convert.cs: add a trivial cache for overload operator resolution.
7075
7076 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7077
7078         * attribute.cs
7079         (AttributeTester.GetObsoleteAttribute): Returns instance of
7080         ObsoleteAttribute when type is obsolete.
7081
7082         * class.cs
7083         (TypeContainer.VerifyObsoleteAttribute): Override.
7084         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7085         (MethodCode.VerifyObsoleteAttribute): Override.
7086         (MemberBase.VerifyObsoleteAttribute): Override.
7087
7088         * decl.cs
7089         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7090         and report proper error.
7091
7092         *delegate.cs
7093         (Delegate.VerifyObsoleteAttribute): Override.
7094
7095         * ecore.cs
7096         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7097         and report proper error.
7098         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7099
7100         * enum.cs
7101         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7102         and enum member.
7103
7104         * expression.cs
7105         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7106         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7107         Added test for ObsoleteAttribute.
7108
7109         * statement.cs
7110         (Catch): Derived from Statement.
7111
7112 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7113
7114         * decl.cs: If possible, use lookuptypedirect here. We can only do
7115         this if there is no `.' after the namespace. Avoids using
7116         LookupType, which does lots of slow processing.
7117         (FindNestedType) New method, does what it says :-).
7118         * namespace.cs: use LookupTypeDirect.
7119         * rootcontext.cs: use membercache, if possible.
7120         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7121
7122 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7123
7124         * expression.cs:
7125         According to the spec, 
7126
7127         In a member access of the form E.I, if E is a single identifier,
7128         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7129         field, property, localvariable, or parameter with the same type as
7130         the meaning of E as a type-name (§3.8), then both possible
7131         meanings of E are permitted.
7132
7133         We did not check that E as a simple-name had the same type as E as
7134         a type name.
7135
7136         This trivial check gives us 5-7% on bootstrap time.
7137
7138 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7139
7140         Fixed bug #59071 & cs0160.cs
7141         * statement.cs (Try.Resolve): Check here whether order of catch
7142         clauses matches their dependencies.
7143
7144 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7145
7146         Fixed bug #58624
7147         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7148         unsafe type.
7149
7150 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7151
7152         * expression.cs (Invocation.OverloadResolve): Avoid the
7153         use of hashtables and boxing here by allocating on demand.
7154
7155 2004-05-30  Martin Baulig  <martin@ximian.com>
7156
7157         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7158         we're doing a silent lookup.  Don't try to lookup nested types in
7159         TypeManager.object_type (thanks to Ben Maurer).
7160
7161 2004-05-30  Martin Baulig  <martin@ximian.com>
7162
7163         Committing a patch from Ben Maurer.
7164
7165         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7166
7167 2004-05-29  Martin Baulig  <martin@ximian.com>
7168
7169         * class.cs (IMethodData.ShouldIgnore): New method.
7170
7171         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7172         `Location' argument, we don't need it anywhere.  Use
7173         `IMethodData.ShouldIgnore ()' instead of
7174         `MethodData.GetMethodFlags ()'.
7175         (TypeManager.AddMethod): Removed.
7176         (TypeManager.AddMethod2): Renamed to AddMethod.
7177
7178 2004-05-29  Martin Baulig  <martin@ximian.com>
7179
7180         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7181
7182         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7183         converting from a class type S to an interface type and we already
7184         have an object on the stack, don't box it again.  Fixes #52578.
7185
7186 2004-05-29  Martin Baulig  <martin@ximian.com>
7187
7188         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7189         Added support for `params' parameters.  Fixes #59267.
7190
7191 2004-05-29  Martin Baulig  <martin@ximian.com>
7192
7193         * literal.cs (NullPointer): Provide a private .ctor which sets
7194         `type' to TypeManager.object_type.  Fixes #59048.
7195
7196 2004-05-29  Martin Baulig  <martin@ximian.com>
7197
7198         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7199         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7200
7201         * ecore.cs (EventExpr.instance_expr): Make the field private.
7202
7203 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7204
7205         Fixed bug #50080 & cs0214-2.cs
7206         * expression.cs (Cast.DoResolve): Check unsafe context here.
7207         
7208         * statement.cs (Resolve.DoResolve): Likewise.
7209
7210 2004-05-26  Martin Baulig  <martin@ximian.com>
7211
7212         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7213
7214         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7215         (RootContext.LookupType): Pass down the `silent' flag.
7216
7217 2004-05-25  Martin Baulig  <martin@ximian.com>
7218
7219         * expression.cs
7220         (MethodGroupExpr.IdenticalTypeName): New public property.
7221         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7222         expression actually refers to a type.
7223
7224 2004-05-25  Martin Baulig  <martin@ximian.com>
7225
7226         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7227         for #56176 and made it actually work.
7228
7229 2004-05-25  Martin Baulig  <martin@ximian.com>
7230
7231         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7232         (FieldExpr, PropertyExpr): Override and implement
7233         CacheTemporaries.  Fixes #52279.
7234
7235 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7236
7237         * location.cs: In the new compiler listing a file twice is a
7238         warning, not an error.
7239
7240 2004-05-24  Martin Baulig  <martin@ximian.com>
7241
7242         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7243         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7244
7245 2004-05-24  Martin Baulig  <martin@ximian.com>
7246
7247         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7248         walking the `using' list.  Fixes #53921.
7249
7250 2004-05-24  Martin Baulig  <martin@ximian.com>
7251
7252         * const.cs (Const.LookupConstantValue): Added support for
7253         EmptyCast's; fixes #55251.
7254
7255 2004-05-24  Martin Baulig  <martin@ximian.com>
7256
7257         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7258         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7259         which does the CS0135 check.  The reason is that we first need to
7260         check whether the variable actually exists.
7261
7262 2004-05-24  Martin Baulig  <martin@ximian.com>
7263
7264         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7265         than RootContext.LookupType() to find the explicit interface
7266         type.  Fixes #58584.
7267
7268 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7269
7270         * Makefile: Simplify.  Use executable.make.
7271         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7272
7273 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7274
7275         * decl.cs:
7276         * enum.cs:
7277         Use the invariant culture when doing String.Compare for CLS case
7278         sensitivity.
7279         
7280 2004-05-23  Martin Baulig  <martin@ximian.com>
7281
7282         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7283         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7284
7285         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7286
7287 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7288
7289         * class.cs (MemberBase.Define): Reuse MemberType member for 
7290         resolved type. Other methods can use it too.
7291
7292 2004-05-23  Martin Baulig  <martin@ximian.com>
7293
7294         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7295         the variable also exists in the current block (otherwise, we need
7296         to report a CS0103).  Fixes #58670.
7297
7298 2004-05-23  Martin Baulig  <martin@ximian.com>
7299
7300         * flowanalysis.cs (Reachability.Reachable): Compute this
7301         on-the-fly rather than storing it as a field.
7302
7303 2004-05-23  Martin Baulig  <martin@ximian.com>
7304
7305         * flowanalysis.cs (Reachability.And): Manually compute the
7306         resulting `barrier' from the reachability.      
7307        
7308 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7309
7310         Fix bug #57835
7311         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7312         instance of ObsoleteAttribute when symbol is obsolete.
7313
7314         * class.cs
7315         (IMethodData): Extended interface for ObsoleteAttribute support.
7316
7317 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7318
7319         * attribute.cs: Fix bug #55970
7320
7321 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7322
7323         Fix bug #52705
7324         * attribute.cs
7325         (GetObsoleteAttribute): New method. Creates the instance of
7326         ObsoleteAttribute.
7327         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7328         ObsoleteAttribute when member is obsolete.
7329         (AttributeTester.Report_ObsoleteMessage): Common method for
7330         Obsolete error/warning reporting.
7331
7332         * class.cs
7333         (TypeContainer.base_classs_type): New member for storing parent type.
7334
7335         * decl.cs
7336         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7337         for this MemberCore.
7338
7339 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7340
7341         * attribute.cs, const.cs: Fix bug #58590
7342
7343 2004-05-21  Martin Baulig  <martin@ximian.com>
7344
7345         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7346         out parameters if the end of the method is unreachable.  Fixes
7347         #58098. 
7348
7349 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7350
7351         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7352         Hari was right, why extra method.
7353
7354 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7355
7356         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7357
7358 2004-05-20  Martin Baulig  <martin@ximian.com>
7359
7360         * delegate.cs: Convert this file to Unix mode - like the original
7361         version in mcs is.
7362
7363 2004-05-20  Martin Baulig  <martin@ximian.com>
7364
7365         * attribute.cs: Convert this file to Unix mode - like the original
7366         version in mcs is.
7367
7368 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7369
7370        Fix bug #58688 (MCS does not report error when the same attribute
7371        is assigned twice)
7372
7373        * attribute.cs (Attribute.Emit): Distinction between null and default.
7374
7375 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7376
7377        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7378        of a top-level attribute without an attribute target.
7379        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7380        Make non-static.
7381        (Attribute.Conditional_GetConditionName), 
7382        (Attribute.Obsolete_GetObsoleteMessage): Update.
7383        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7384        part of ScanForIndexerName.
7385        (Attribute.CanIgnoreInvalidAttribute): New function.
7386        (Attribute.ScanForIndexerName): Move to ...
7387        (Attributes.ScanForIndexerName): ... here.
7388        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7389        (Attributes.Search): New internal variant that can choose not to
7390        complain if types aren't resolved.  The original signature now
7391        complains.
7392        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7393        complaints suppressed.
7394        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7395        only if it not useful.
7396        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7397        top-level for attributes that are shared between the assembly
7398        and a top-level class.
7399        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7400        * class.cs: Update to reflect changes.
7401        (DefineIndexers): Fuse loops.
7402        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7403        a couple more variants of attribute names.
7404
7405 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7406
7407         Fix bug #52585 (Implemented explicit attribute declaration)
7408
7409         * attribute.cs:
7410         (Attributable.ValidAttributeTargets): New abstract method. It gets
7411         list of valid attribute targets for explicit target declaration.
7412         (Attribute.Target): It holds target itself.
7413         (AttributeSection): Removed.
7414         (Attribute.CheckTargets): New method. It checks whether attribute
7415         target is valid for the current element.
7416
7417         * class.cs:
7418         (EventProperty): New class. For events that are declared like
7419         property (with add and remove accessors).
7420         (EventField): New class. For events that are declared like field.
7421         class.cs
7422
7423         * cs-parser.jay: Implemented explicit attribute target declaration.
7424
7425         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7426         Override ValidAttributeTargets.
7427
7428         * parameter.cs:
7429         (ReturnParameter): Class for applying custom attributes on 
7430         the return type.
7431         (ParameterAtribute): New class. Class for applying custom
7432         attributes on the parameter type.
7433
7434 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7435
7436         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7437         definitions. 
7438
7439         (Method): Allow UNSAFE here.
7440
7441         * modifiers.cs: Support unsafe reporting.
7442
7443 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7444
7445         * decl.cs: Fix bug #58478.
7446
7447 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7448
7449         * statement.cs: When checking for unreachable code on an EmptyStatement,
7450         set the location. Fixes bug #58488.
7451
7452 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7453
7454         * driver.cs: Add -pkg handling.
7455
7456         From Gonzalo: UseShelLExecute=false
7457
7458 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7459
7460         * attribute.cs:
7461         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7462         for attribute.
7463         (Attribute.IsClsCompliaceRequired): Moved to base for better
7464         accesibility.
7465         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7466         when attribute is AttributeUsageAttribute.
7467         (Attribute.GetValidTargets): Simplified.
7468         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7469         attribute for this type.
7470         (Attribute.ApplyAttributes): Method renamed to Emit and make
7471         non-static.
7472         (GlobalAttributeSection): New class for special handling of global
7473         attributes (assembly, module).
7474         (AttributeSection.Emit): New method.
7475
7476         * class.cs: Implemented Attributable abstract methods.
7477         (MethodCore.LabelParameters): Moved to Parameter class.
7478         (Accessor): Is back simple class.
7479         (PropertyMethod): Implemented Attributable abstract class.
7480         (DelegateMethod): Implemented Attributable abstract class.
7481         (Event): New constructor for disctintion between normal Event
7482         and Event with accessors.
7483
7484         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7485
7486         * codegen.cs, const.cs, decl.cs, delegate.cs:
7487         (CommonAssemblyModulClass): Implemented Attributable abstract class
7488         and simplified.
7489
7490         * enum.cs: Implement IAttributeSupport interface.
7491         (EnumMember): New class for emum members. Implemented Attributable
7492         abstract class
7493
7494         * parameter.cs:
7495         (ParameterBase): Is abstract.
7496         (ReturnParameter): New class for easier [return:] attribute handling.
7497
7498         * typemanager.cs: Removed builder_to_attr.
7499
7500 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7501
7502         Fix bug #57151.
7503         * attribute.cs (Attribute.GetPositionalValue): New function.
7504         * class.cs (TypeContainer.VerifyMembers): New function.
7505         (TypeContainer.Emit): Use it.
7506         (ClassOrStruct): New base class for Class and Struct.
7507         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7508         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7509         class.
7510         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7511         then each non-static field should have a FieldOffset attribute.
7512         Otherwise, none of the fields should have a FieldOffset attribute.
7513         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7514         and FieldOffset attributes.
7515         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7516         (TypeManager.field_offset_attribute_type): New core types.
7517         (TypeManager.InitCoreTypes): Initialize them.
7518
7519 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7520
7521         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7522         Return correct type.
7523         From bug #58270.
7524
7525 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7526
7527         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7528         be implicitly converted to ulong.
7529         
7530         * expression.cs: The logic for allowing operator &, | and ^ worked
7531         was wrong, it worked before because we did not report an error in
7532         an else branch.  Fixes 57895.
7533
7534         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7535         allow volatile fields to be reference types.
7536
7537 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7538
7539         * driver.cs: Add support for /debug-
7540
7541 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7542
7543         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7544         Add a 'complain' parameter to silence errors.
7545         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7546         silently overlooked type-resolutions.
7547         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7548         to reflect changes.
7549         (Attributes.Search): New function.
7550         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7551         (Attributes.GetAttributeFullName): Remove hack.
7552         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7553         Update to reflect changes.
7554         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7555         Use Attributes.Search instead of nested loops.
7556
7557 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7558
7559         * decl.cs:
7560         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7561         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7562         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7563
7564         * report.cs: (Report.Warning): Renamed to Warning_T because of
7565         parameter collision.
7566
7567 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7568
7569         * expression.cs (MemberAccess.ResolveMemberAccess):
7570         Exit with non-zero status after Report.Error.
7571         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7572         Likewise.
7573         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7574
7575 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7576
7577         * support.cs: Don't hang when the file is empty.
7578
7579 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7580
7581         * support.cs: In SeekableStreamReader, compute the preamble size of the
7582           underlying stream. Position changes should take into account that initial
7583           count of bytes.
7584
7585 2004-05-03  Todd Berman  <tberman@sevenl.net>
7586
7587         * driver.cs: remove unused GetSysVersion function.
7588
7589 2004-05-03  Todd Berman  <tberman@sevenl.net>
7590
7591         * driver.cs: Remove the hack from saturday, as well as the hack
7592         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7593         link_paths to get that bit proper.
7594
7595 2004-05-01  Todd Berman  <tberman@sevenl.net>
7596
7597         * driver.cs: Try a LoadFrom before a Load, this checks the current
7598         path. This is currently a bug in mono that is be fixed, however, this
7599         provides a workaround for now. This will be removed when the bug
7600         is fixed.
7601
7602 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7603
7604         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7605         incomplete key pairs (#57941).
7606
7607 2004-05-01  Todd Berman  <tberman@sevenl.net>
7608
7609         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7610         from the GAC
7611
7612 2004-04-30  Jackson Harper  <jackson@ximian.com>
7613
7614         * codegen.cs: Open keys readonly.
7615         
7616 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7617
7618         * typemanager.cs: don't report cyclic struct layout when a struct
7619         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7620         which has 2 Pango.Rectangle fields.
7621
7622 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7623
7624         * expression.cs: Handle IntPtr comparisons with IL code
7625         rather than a method call.
7626
7627 2004-04-29  Martin Baulig  <martin@ximian.com>
7628
7629         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7630         the list of PropertyInfo's in class hierarchy and find the
7631         accessor.  Fixes #56013.
7632
7633 2004-04-29  Martin Baulig  <martin@ximian.com>
7634
7635         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7636
7637 2004-04-29  Martin Baulig  <martin@ximian.com>
7638
7639         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7640
7641         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7642
7643 2004-04-29  Martin Baulig  <martin@ximian.com>
7644
7645         * class.cs (ConstructorInitializer.Resolve): Check whether the
7646         parent .ctor is accessible.  Fixes #52146.
7647
7648 2004-04-29  Martin Baulig  <martin@ximian.com>
7649
7650         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7651
7652         * statement.cs (Using.EmitLocalVariableDecls): Use
7653         TypeManager.idisposable_type, not typeof (IDisposable).
7654         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7655
7656 2004-04-29  Martin Baulig  <martin@ximian.com>
7657
7658         * class.cs (Event.Define): Don't emit the field and don't set
7659         RTSpecialName and SpecialName for events on interfaces.  Fixes
7660         #57703. 
7661
7662 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7663
7664         Refactor Attribute.ApplyAttributes.
7665         * attribute.cs (Attributable): New base class for objects that can
7666         have Attributes applied on them.
7667         (Attribute): Make AttributeUsage fields public.
7668         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7669         (Attribute.IsInternalCall): New property.
7670         (Attribute.UsageAttr): Convert to a public read-only property.
7671         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7672         (Attribute.ResolveType, Attribute.Resolve)
7673         (Attribute.ScanForIndexerName): Update to reflect changes.
7674         (Attribute.CheckAttributeTarget): Re-format.
7675         (Attribute.ApplyAttributes): Refactor, to various
7676         Attributable.ApplyAttributeBuilder methods.
7677         * decl.cs (MemberCore): Make Attributable.
7678         * class.cs (Accessor): Make Attributable.
7679         (MethodData.ApplyAttributes): Use proper attribute types, not
7680         attribute names.
7681         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7682         (TypeContainer.ApplyAttributeBuilder)
7683         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7684         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7685         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7686         (Operator.ApplyAttributeBuilder): New factored-out methods.
7687         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7688         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7689         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7690         * parameter.cs (ParameterBase): New Attributable base class
7691         that can also represent Return types.
7692         (Parameter): Update to the changes.
7693
7694 2004-04-29  Jackson Harper  <jackson@ximian.com>
7695
7696         * driver.cs: Prefer the corlib system version when looking for
7697         assemblies in the GAC. This is still a hack, but its a better hack
7698         now.
7699         
7700 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7701
7702         * decl.cs, enum.cs: Improved error 3005 reporting.
7703   
7704         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7705         (related_symbols): New private member for list of symbols
7706         related to reported error/warning.
7707         
7708         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7709
7710 2004-04-29  Martin Baulig  <martin@ximian.com>
7711
7712         * ecore.cs (Expression.Constantify): If we're an enum and
7713         TypeManager.TypeToCoreType() doesn't give us another type, use
7714         t.UnderlyingSystemType.  Fixes #56178.  
7715
7716 2004-04-29  Martin Baulig  <martin@ximian.com>
7717
7718         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7719         interfaces and for each interface, only add members directly
7720         declared in that interface.  Fixes #53255.
7721
7722 2004-04-28  Martin Baulig  <martin@ximian.com>
7723
7724         * expression.cs (ConditionalLogicalOperator): Use a temporary
7725         variable for `left' to avoid that we evaluate it more than once;
7726         bug #52588.
7727
7728 2004-04-28  Martin Baulig  <martin@ximian.com>
7729
7730         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7731         `void[]' (CS1547).
7732
7733 2004-04-28  Martin Baulig  <martin@ximian.com>
7734
7735         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7736         void (CS1547).
7737
7738         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7739         whether the type is not void (CS1547).
7740
7741 2004-04-28  Martin Baulig  <martin@ximian.com>
7742
7743         * expression.cs (Unary.DoResolveLValue): Override this and report
7744         CS0131 for anything but Operator.Indirection.
7745
7746 2004-04-28  Martin Baulig  <martin@ximian.com>
7747
7748         Committing a patch from Ben Maurer; see bug #50820.
7749
7750         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7751         check for classes.
7752
7753         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7754         classes.        
7755
7756 2004-04-28  Martin Baulig  <martin@ximian.com>
7757
7758         Committing a patch from Ben Maurer; see bug #50820.
7759
7760         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7761         check for classes.
7762
7763         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7764         classes.        
7765
7766 2004-04-28  Martin Baulig  <martin@ximian.com>
7767
7768         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7769         (Block.AddLabel): Call DoLookupLabel() to only search in the
7770         current block.
7771
7772 2004-04-28  Martin Baulig  <martin@ximian.com>
7773
7774         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7775         comparing StringConstants and NullLiterals in Equality and Inequality.
7776
7777 2004-04-28  Jackson Harper  <jackson@ximian.com>
7778
7779         * driver.cs: Attempt to load referenced assemblies from the
7780         GAC. This is the quick and dirty version of this method that
7781         doesnt take into account versions and just takes the first
7782         canidate found. Will be good enough for now as we will not have more
7783         then one version installed into the GAC until I update this method.
7784
7785 2004-04-28  Martin Baulig  <martin@ximian.com>
7786
7787         * typemanager.cs (TypeManager.CheckStructCycles): New public
7788         static method to check for cycles in the struct layout.
7789
7790         * rootcontext.cs (RootContext.PopulateTypes): Call
7791         TypeManager.CheckStructCycles() for each TypeContainer.
7792         [Note: We only need to visit each type once.]
7793
7794 2004-04-28  Martin Baulig  <martin@ximian.com>
7795
7796         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7797
7798         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7799         success and added `out object value'.  Use a `bool resolved' field
7800         to check whether we've already been called rather than
7801         `ConstantValue != null' since this breaks for NullLiterals.
7802
7803 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7804
7805         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7806         setting of this flag, since the 'set' method may be non-public.
7807
7808 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7809
7810         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7811         check on current_vector.Block.
7812
7813 2004-04-27  Martin Baulig  <martin@ximian.com>
7814
7815         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7816         a field initializer.  Fixes #56459.
7817
7818 2004-04-27  Martin Baulig  <martin@ximian.com>
7819
7820         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7821         we're not attempting to use an indexer.  Fixes #52154.
7822
7823 2004-04-27  Martin Baulig  <martin@ximian.com>
7824
7825         * statement.cs (Return): Don't create a return label if we don't
7826         need it; reverts my change from January 20th.  Thanks to Ben
7827         Maurer for this.
7828
7829 2004-04-27  Martin Baulig  <martin@ximian.com>
7830
7831         According to the spec, `goto' can only leave a nested scope, but
7832         never enter it.
7833
7834         * statement.cs (Block.LookupLabel): Only lookup in the current
7835         block, don't recurse into parent or child blocks.
7836         (Block.AddLabel): Check in parent and child blocks, report
7837         CS0140/CS0158 if we find a duplicate.
7838         (Block): Removed this indexer for label lookups.
7839         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7840         this already does the error reporting for us.
7841
7842         * flowanalysis.cs
7843         (FlowBranching.UsageVector.Block): New public variable; may be null.
7844         (FlowBranching.CreateSibling): Added `Block' argument.
7845         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7846         label for the target of a `goto' and check whether we're not
7847         leaving a `finally'.
7848
7849 2004-04-27  Martin Baulig  <martin@ximian.com>
7850
7851         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7852         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7853         just for returns).
7854
7855 2004-04-27  Martin Baulig  <martin@ximian.com>
7856
7857         * statement.cs (Block.AddLabel): Also check for implicit blocks
7858         and added a CS0158 check.
7859
7860 2004-04-27  Martin Baulig  <martin@ximian.com>
7861
7862         * flowanalysis.cs (FlowBranchingLoop): New class.
7863         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7864         UsageVector's instead of an ArrayList.
7865         (FlowBranching.Label): Likewise.
7866         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7867         (FlowBranching.AddBreakVector): New method.
7868
7869 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7870
7871         * attribute.cs: Small regression fix: only convert the type if we
7872         the type is different, fixes System.Drawing build.
7873
7874 2004-04-27  Martin Baulig  <martin@ximian.com>
7875
7876         * attribute.cs (Attribute.Resolve): If we have a constant value
7877         for a named field or property, implicity convert it to the correct
7878         type.
7879
7880 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7881
7882         * statement.cs (Block.Block): Implicit blocks share
7883         'child_variable_names' fields with parent blocks.
7884         (Block.AddChildVariableNames): Remove.
7885         (Block.AddVariable): Mark variable as "used by a child block" in
7886         every surrounding block.
7887         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7888         been used in a child block, complain about violation of "Invariant
7889         meaning in blocks" rule.
7890         * cs-parser.jay (declare_local_variables): Don't use
7891         AddChildVariableNames.
7892         (foreach_statement): Don't create an implicit block: 'foreach'
7893         introduces a scope.
7894
7895 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7896
7897         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7898         converting from 0L to ulong.  Fixes 57522.
7899
7900 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7901
7902         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7903         derived class hides via 'new' keyword field from base class (test-242.cs).
7904         TODO: Handle this in the more general way.
7905         
7906         * class.cs (CheckBase): Ditto.
7907
7908 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7909
7910         * decl.cs (caching_flags): New member for storing cached values
7911         as bit flags.
7912         (MemberCore.Flags): New enum where bit flags for caching_flags
7913         are defined.
7914         (MemberCore.cls_compliance): Moved to caching_flags.
7915         (DeclSpace.Created): Moved to caching_flags.
7916
7917         * class.cs: Use caching_flags instead of DeclSpace.Created
7918         
7919 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7920
7921         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7922         if we are only a derived class, not a nested class.
7923
7924         * typemanager.cs: Same as above, but do this at the MemberLookup
7925         level (used by field and methods, properties are handled in
7926         PropertyExpr).   Allow for the qualified access if we are a nested
7927         method. 
7928
7929 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7930
7931         * class.cs: Refactoring.
7932         (IMethodData): New inteface; Holds links to parent members
7933         to avoid member duplication (reduced memory allocation).
7934         (Method): Implemented IMethodData interface.
7935         (PropertyBase): New inner classes for get/set methods.
7936         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7937         (Event): New inner classes for add/remove methods.
7938         (Event.DelegateMethod): Implemented IMethodData interface.
7939
7940         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7941         EmitContext (related to class.cs refactoring).
7942
7943 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7944
7945         * delegate.cs (Delegate.VerifyApplicability): If the number of
7946         arguments are the same as the number of parameters, first try to
7947         verify applicability ignoring  any 'params' modifier on the last
7948         parameter.
7949         Fixes #56442.
7950
7951 2004-04-08  Martin Baulig  <martin@ximian.com>
7952
7953         Merged latest changes into gmcs.  Please keep this comment in
7954         here, it makes it easier for me to see what changed in MCS since
7955         the last time I merged.
7956
7957 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7958
7959         * class.cs (TypeContainer.AddIndexer): Use
7960         'ExplicitInterfaceName' to determine if interface name was
7961         explicitly specified.  'InterfaceType' is not initialized at this time.
7962         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7963         Indexers array is already in the required order.  Initialize
7964         'IndexerName' only if there are normal indexers.
7965         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7966         (TypeContainer.Emit): Emit DefaultMember attribute only if
7967         IndexerName is initialized.
7968         Fixes #56300.
7969
7970 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7971
7972         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7973         Fixes #57007
7974
7975 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7976
7977         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7978         attributes.
7979         Fix for #56456.
7980
7981         * attribute.cs (Attribute.Resolve): Check for duplicate named
7982         attributes.
7983         Fix for #56463.
7984
7985 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7986
7987         * iterators.cs (MarkYield): track whether we are in an exception,
7988         and generate code accordingly.  Use a temporary value to store the
7989         result for our state.
7990
7991         I had ignored a bit the interaction of try/catch with iterators
7992         since their behavior was not entirely obvious, but now it is
7993         possible to verify that our behavior is the same as MS .NET 2.0
7994
7995         Fixes 54814
7996
7997 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7998
7999         * iterators.cs: Avoid creating temporaries if there is no work to
8000         do. 
8001
8002         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8003         Enumerations, use TypeManager.EnumToUnderlying and call
8004         recursively. 
8005
8006         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8007         bug #57013
8008
8009         (This.Emit): Use EmitContext.EmitThis to emit our
8010         instance variable.
8011
8012         (This.EmitAssign): Ditto.
8013
8014         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8015         codepaths, we will move all the functionality into
8016         Mono.CSharp.This 
8017
8018         (FieldExpr.EmitAssign): Ditto.
8019
8020         This fixes several hidden bugs that I uncovered while doing a code
8021         review of this today.
8022
8023         * codegen.cs (EmitThis): reworked so the semantics are more clear
8024         and also support value types "this" instances.
8025
8026         * iterators.cs: Changed so that for iterators in value types, we
8027         do not pass the value type as a parameter.  
8028
8029         Initialization of the enumerator helpers is now done in the caller
8030         instead of passing the parameters to the constructors and having
8031         the constructor set the fields.
8032
8033         The fields have now `assembly' visibility instead of private.
8034
8035 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8036
8037         * expression.cs (Argument.Resolve): Check if fields passed as ref
8038         or out are contained in a MarshalByRefObject.
8039
8040         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8041         another compiler type.
8042
8043 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8044
8045         * class.cs (Indexer.Define): use the new name checking method.
8046         Also, return false on an error.
8047         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8048         (is_identifier_[start/part]_character): make static.
8049
8050 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8051
8052         * expression.cs (Binary.ResolveOperator): Do no append strings
8053         twice: since we can be invoked more than once (array evaluation)
8054         on the same concatenation, take care of this here.  Based on a fix
8055         from Ben (bug #56454)
8056
8057 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8058
8059         * codegen.cs: Fix another case where CS1548 must be reported (when 
8060         delay-sign isn't specified and no private is available #56564). Fix
8061         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8062         error when MCS is used on the MS runtime and we need to delay-sign 
8063         (which seems unsupported by AssemblyBuilder - see #56621).
8064
8065 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8068         (TypeManager.ComputeNamespaces): Faster implementation for
8069         Microsoft runtime.
8070
8071         * compiler.csproj: Updated AssemblyName to mcs.
8072
8073 2004-05-11  Jackson Harper  <jackson@ximian.com>
8074
8075         * Makefile: Preserve MONO_PATH
8076         
8077 2004-05-11  Jackson Harper  <jackson@ximian.com>
8078
8079         * Makefile: Use mono and mcs to build gmcs
8080         
8081 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8082
8083         * codegen.cs: Add patch from Robert Shade
8084         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8085         sync with mcs.
8086
8087 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8088
8089         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8090         incomplete key pairs (#57941).
8091
8092 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8093
8094         * codegen.cs: Fix another case where CS1548 must be reported (when 
8095         delay-sign isn't specified and no private is available #56564). Fix
8096         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8097         error when MCS is used on the MS runtime and we need to delay-sign 
8098         (which seems unsupported by AssemblyBuilder - see #56621).
8099
8100 2004-04-29  Jackson Harper  <jackson@ximian.com>
8101
8102         * Makefile: Set MONO_PATH to use the bootstrap corlib
8103         * driver.cs: Check the GAC for referenced assemblies.
8104                 
8105 2004-04-29  Martin Baulig  <martin@ximian.com>
8106
8107         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8108
8109 2004-04-07  Martin Baulig  <martin@ximian.com>
8110
8111         * expression.cs (Binary.ResolveOperator): Added special case for
8112         Equality/Inequality between a type parameter and a null literal.
8113
8114 2004-04-07  Martin Baulig  <martin@ximian.com>
8115
8116         * convert.cs: Check null literal -> type parameter conversions.
8117
8118 2004-04-07  Martin Baulig  <martin@ximian.com>
8119
8120         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8121         `class' and `struct' constraints.
8122
8123 2004-04-07  Martin Baulig  <martin@ximian.com>
8124
8125         * generic.cs (SpecialConstraint): New public enum.
8126         (Constraints.Resolve): Added support for the `class' and `struct'
8127         constraints.
8128
8129         * cs-parser.jay (type_parameter_constraint): Added support for the
8130         `class' and `struct' constraints.
8131
8132 2004-04-07  Martin Baulig  <martin@ximian.com>
8133
8134         * support.cs (GenericConstraints): Replaced `Types' by
8135         `ClassConstraint' and `InterfaceConstraints'; added
8136         `HasClassConstraint'.   
8137
8138 2004-04-07  Martin Baulig  <martin@ximian.com>
8139
8140         * generic.cs
8141         (Constraints.InterfaceConstraints): New public property.
8142         (Constraints.Types): Make this property public
8143         (TypeParameter): Implement IMemberContainer.
8144         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8145         instead of a TypeBuilder/MethodBuilder; pass the interface
8146         constraints to TypeManager.AddTypeParameter().
8147         (TypeParameter.DefineType): Just take an EmitContext and no
8148         TypeBuilder/MethodBuilder.  Use the new public API.
8149
8150         * typemanager.cs (TypeManager.AddTypeParameter): Added
8151         `TypeExpr[]' argument; add the interfaces to the
8152         `builder_to_ifaces' hash.
8153         (TypeManager.LookupMemberContainer): For
8154         GenericTypeParameterBuilders, get the TypeParameter from the
8155         `builder_to_type_param'.
8156         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8157         the TypeParameter and call FindMembers on it.
8158
8159 2004-04-07  Martin Baulig  <martin@ximian.com>
8160
8161         * class.cs
8162         (MethodCore.GenericMethod): Moved this field here from Method.
8163         (MethodCore.IsDuplicateImplementation): Take the number of type
8164         parameters into account if we're a generic method.
8165
8166         * expression.cs (Invocation.InferTypeArguments): Don't return true
8167         if `arguments' is null; we still need to check whether we actually
8168         don't need to infer anything in this case.
8169         (MemberAccess): Merged the functionality from GenericMemberAccess
8170         into this class.
8171
8172         * generic.cs (GenericMemberAccess): Removed.
8173
8174 2004-04-05  Martin Baulig  <martin@ximian.com>
8175
8176         * decl.cs (MemberCore): For generic classes, interfaces and
8177         structs, `Name' now includes the number of type parameters
8178         ("Stack!1.Node!1").
8179         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8180         encode the number of type arguments in the type name.
8181
8182         * expression.cs (Expression.MemberLookup): Removed the
8183         `num_type_args' argument; we now encode the number of type
8184         arguments in the type name.
8185
8186         * ecore.cs (SimpleName): Encode the number of type arguments in
8187         the type name itself.
8188
8189         * generic.cs (ConstructedType): Likewise.
8190
8191         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8192         `MemberName'; we now include the number of type parameters in the
8193         type name.
8194
8195         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8196         (TypeManager.MemberLookup): Removed the
8197         `num_type_args' argument; we now encode the number of type
8198         arguments in the type name.     
8199
8200 2004-04-03  Martin Baulig  <martin@ximian.com>
8201
8202         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8203         (MemberCore.MemberName): Moved here from MemberBase.
8204         (DeclSpace.SetParameterInfo): Just take the constraints as an
8205         ArrayList; we already have the type parameters in our
8206         `MemberName'; also do the CS0080 reporting here.
8207
8208         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8209         `IDENTIFIER opt_type_parameter_list'; when constructing our
8210         `MemberName', it'll already include our type parameters.
8211         (class_declaration, interface_declaration): Likewise.
8212         (delegate_declaration): Likewise.
8213         (MakeName): Take a MemberName and return a MemberName.
8214         The following two changes are required to avoid shift/reduce conflicts:
8215         (member_name): Don't include a TypeName anymore; ie. this is now
8216         just 'IDENTIFIER opt_type_parameter_list'.
8217         (property_declaration, event_declaration): Use a
8218         `namespace_or_type_name' instead of a `member_name'.            
8219
8220 2004-04-03  Martin Baulig  <martin@ximian.com>
8221
8222         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8223         `MemberName' class.
8224         (TypeName): Formerly known as MemberName.
8225
8226         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8227         instead of a `MemberName'.
8228
8229         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8230         (member_name): New rule; create a MemberName.
8231
8232 2004-04-02  Martin Baulig  <martin@ximian.com>
8233
8234         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8235         (CS0305 and CS0308).
8236
8237 2004-04-02  Martin Baulig  <martin@ximian.com>
8238
8239         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8240         support for nested types.
8241
8242 2004-04-02  Martin Baulig  <martin@ximian.com>
8243
8244         * ecore.cs (IAlias): New public interface.
8245         (TypeExpr, TypeExpression): Implement IAlias.
8246         (TypeAliasExpression): New public class.
8247
8248         * namespace.cs (Namespace): Implement IAlias.
8249         (Namespace.Lookup): Return an IAlias instead on an object.
8250         (Namespace.DefineName): Take an IAlias instead of an object.
8251         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8252         an object.
8253         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8254         Expression.
8255         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8256         object.
8257         (NamespaceEntry.Lookup): Likewise.
8258
8259         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8260         instead of a Type.      
8261
8262         * decl.cs (DeclSpace): Implement IAlias.
8263         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8264
8265         * generic.cs (ConstructedType): Improved error checking.
8266
8267 2004-04-02  Martin Baulig  <martin@ximian.com>
8268
8269         * convert.cs: Added type parameter conversions.
8270
8271         * ecore.cs
8272         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8273         (ClassCast.Emit): If the source type is a type parameter, box it.
8274         If the target type is a type parameter, emit an `unbox.any'
8275         instead of a `classcast'.1      
8276
8277 2004-04-01  Martin Baulig  <martin@ximian.com>
8278
8279         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8280
8281 2004-04-01  Martin Baulig  <martin@ximian.com>
8282
8283         * generic.cs (ConstructedType.CheckConstraints): Use
8284         Convert.ImplicitStandardConversionExists(); user-defined implicit
8285         conversions are not allowed according to the spec.
8286
8287 2004-03-30  Martin Baulig  <martin@ximian.com>
8288
8289         * expression.cs (New): Added support for type parameters.
8290
8291         * typemanager.cs
8292         (TypeManager.activator_type): New public static field.
8293         (TypeManager.activator_create_instance): Likewise.
8294
8295 2004-03-30  Martin Baulig  <martin@ximian.com>
8296
8297         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8298         public method.
8299
8300 2004-03-30  Martin Baulig  <martin@ximian.com>
8301
8302         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8303         the spec here: the argument type must be convertible to the
8304         constraints.
8305
8306 2004-03-30  Martin Baulig  <martin@ximian.com>
8307
8308         * generic.cs
8309         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8310         TypeManager.AddTypeParameter().
8311         (ConstructedType.CheckConstraints): Re-enable this and actually
8312         check whether we have a constructor constraint.
8313
8314         * typemanager.cs
8315         (TypeManager.builder_to_type_param): New static field.
8316         (TypeManager.AddTypeParameter): New static method.
8317         (TypeManager.LookupTypeParameter): New public method.
8318
8319 2004-03-30  Martin Baulig  <martin@ximian.com>
8320
8321         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8322         the new API to actually define the constructor constraint.
8323
8324         * typemanager.cs
8325         (TypeManager.new_constraint_attr_type): New static field.
8326         (TypeManager.InitCoreTypes): Initialize it.
8327
8328 2004-03-30  Martin Baulig  <martin@ximian.com>
8329
8330         * generic.cs (Constraints): Completed error checking, use correct
8331         error numbers.
8332
8333 2004-03-29  Martin Baulig  <martin@ximian.com>
8334
8335         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8336
8337         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8338         public version which takes a `ParameterData pd' instead of an
8339         `ArrayList args'.
8340
8341 2004-03-29  Martin Baulig  <martin@ximian.com>
8342
8343         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8344         not a MethodInfo.       
8345
8346 2004-03-29  Martin Baulig  <martin@ximian.com>
8347
8348         * expression.cs (Argument.ResolveMethodGroup): If we're a
8349         ConstructedType, call GetMemberAccess() on it.  
8350
8351 2004-03-29  Martin Baulig  <martin@ximian.com>
8352
8353         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8354         (MethodCore.CheckGenericOverride): When overriding a generic
8355         method, check whether the constraints match.
8356
8357         * support.cs (GenericConstraints): New public interface.
8358         (ParameterData.GenericConstraints): New public method.
8359
8360         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8361         method parameter and compute our constraints if appropriate.
8362         (Parameter.GenericConstraints): New public property.
8363
8364         * generic.cs (Constraints): Implement GenericConstraints.
8365
8366 2004-03-29  Martin Baulig  <martin@ximian.com>
8367
8368         * decl.cs (MemberCache.FindMemberToOverride): Use
8369         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8370
8371 2004-03-29  Martin Baulig  <martin@ximian.com>
8372
8373         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8374
8375 2004-03-29  Martin Baulig  <martin@ximian.com>
8376
8377         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8378         not allowed on non-generic declarations").
8379
8380 2004-03-29  Martin Baulig  <martin@ximian.com>
8381
8382         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8383         public version of this method.
8384
8385         * class.cs (MethodCore.IsDuplicateImplementation): Use
8386         Invocation.InferTypeArguments() to check this.
8387
8388 2004-03-29  Martin Baulig  <martin@ximian.com>
8389
8390         * convert.cs: Use TypeManager.IsDelegateType() instead of
8391         comparing types correctly.
8392
8393 2004-03-29  Martin Baulig  <martin@ximian.com>
8394
8395         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8396         types directly to make it work for generic instances.
8397
8398         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8399
8400 2004-03-29  Martin Baulig  <martin@ximian.com>
8401
8402         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8403         support for arrays.     
8404
8405 2004-03-24  Martin Baulig  <martin@ximian.com>
8406
8407         * decl.cs (DeclSpace.FindType): Also use
8408         TypeManager.CheckGeneric() for types from the using clauses.
8409
8410 2004-03-23  Martin Baulig  <martin@ximian.com>
8411
8412         * expression.cs (Invocation.OverloadResolve): Added `bool
8413         may_fail' argument and use it instead of the Location.IsNull() hack.
8414
8415 2004-03-23  Martin Baulig  <martin@ximian.com>
8416
8417         * expression.cs (Invocation.InferType): Use correct type inference
8418         rules here.     
8419
8420 2004-03-23  Martin Baulig  <martin@ximian.com>
8421
8422         * ecore.cs (MethodGroupExpr.Name): Use
8423         TypeManager.CSharpSignature() instead of just the name.
8424
8425         * expression.cs (Invocation.OverloadResolve): Provide better error
8426         reporting.
8427         (Invocation.DoResolve): OverloadResolve() never returns null
8428         without reporting an error, so removed the error -6 reporting here.
8429
8430 2004-03-23  Martin Baulig  <martin@ximian.com>
8431
8432         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8433         generic methods.
8434
8435         * cs-parser.jay (delegate_declaration): Support generic delegates.
8436
8437         * delegate.cs: Support generic delegates.
8438
8439 2004-03-22  Martin Baulig  <martin@ximian.com>
8440
8441         * expression.cs (Invocation.InferParamsTypeArguments): New static
8442         method; does type inference for params arguments.
8443
8444 2004-03-21  Martin Baulig  <martin@ximian.com>
8445
8446         * typemanager.cs (TypeManager.IsGenericMethod): New public static
8447         method; checks whether a method is a generic method.    
8448
8449         * expression.cs (Invocation.InferTypeArguments): New static method;
8450         infer type arguments for generic method invocation.
8451
8452         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8453         property; we set this to true if we're resolving a generic method
8454         invocation and the user specified type arguments, ie. we're not
8455         doing type inference.
8456
8457 2004-03-20  Martin Baulig  <martin@ximian.com>
8458
8459         * class.cs (MethodData.DeclaringType): New public property.
8460         (MethodData.Define): Set DeclaringType here.
8461         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8462         instead of OperatorMethodBuilder.DeclaringType.
8463
8464 2004-03-20  Martin Baulig  <martin@ximian.com>
8465
8466         * cs-tokenizer.cs (xtoken): Return a special
8467         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8468
8469         * cs-parser.jay (default_value_expression): Switch to the new
8470         syntax (14.5.13).
8471
8472 2004-03-19  Martin Baulig  <martin@ximian.com>
8473
8474         * decl.cs (MemberName): New class.  We use this to "construct"
8475         namespace_or_type_name's.
8476
8477         * generics.cs (TypeArguments.GetDeclarations): New public method;
8478         returns the type arguments as a string[] and reports a CS0081 if
8479         one of them is not an identifier.
8480
8481         * class.cs (MemberBase): The .ctor now takes the name as a
8482         MemberName instead of a string.
8483         (MemberBase.ExplicitInterfaceName): Changed type from string to
8484         Expression.
8485         (MemberBase.DoDefine): If we're an explicit implementation, the
8486         InterfaceType may be a generic instance.
8487
8488         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8489         (namespace_name): Call MemberName.GetName () to transform the
8490         MemberName into a string and ensure we don't have any type
8491         arguments.
8492         (type_name): Call MemberName.GetTypeExpression() to transfrom the
8493         MemberName into an expression.
8494         (method_header): Use namespace_or_type_name instead of member_name.     
8495
8496 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8497
8498         * rootcontext.cs: Add new types to the boot resolution.
8499
8500         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8501         MulticastDelegate is not allowed.
8502
8503         * typemanager.cs: Add new types to lookup: System.TypedReference
8504         and ArgIterator.
8505
8506         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8507         check for TypedReference or ArgIterator, they are not allowed. 
8508
8509         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8510         makes us properly catch 1510 in some conditions (see bug 56016 for
8511         details). 
8512
8513 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8514
8515         * CryptoConvert.cs: update from corlib version
8516         with endian fixes.
8517
8518 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8519
8520         * class.cs (Indexer.Define): Check indexername declaration
8521
8522 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8523
8524         * attribute.cs (IsClsCompliant): Fixed problem with handling
8525         all three states (compliant, not-compliant, undetected).
8526
8527 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8528
8529         * attribute.cs (Attribute): Location is now public.
8530         (Resolve): Store resolved arguments (pos_values) in attribute class.
8531         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8532         (GetClsCompliantAttributeValue): New method that gets
8533         CLSCompliantAttribute value.
8534         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8535         if exists else null.
8536         (AttributeTester): New class for CLS-Compliant verification routines.
8537
8538         * class.cs (Emit): Add CLS-Compliant verification.
8539         (Method.GetSignatureForError): Implemented.
8540         (Constructor.GetSignatureForError): Implemented
8541         (Constructor.HasCompliantArgs): Returns if constructor has
8542         CLS-Compliant arguments.
8543         (Constructor.Emit): Override.
8544         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8545         is needed to test only parameters.
8546         (FieldBase.GetSignatureForError): Implemented.
8547         (TypeContainer): New member for storing base interfaces.
8548         (TypeContainer.FindMembers): Search in base interfaces too.
8549
8550         * codegen.cs (GetClsComplianceAttribute): New method that gets
8551         assembly or module CLSCompliantAttribute value.
8552         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8553         for assembly.
8554         (ModuleClass.Emit): Add error 3012 test.
8555
8556         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8557
8558         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8559         state for all decl types.
8560         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8561         if CLS-Compliant tests are required.
8562         (IsClsCompliaceRequired): New method. Analyze whether code
8563         must be CLS-Compliant.
8564         (IsExposedFromAssembly): New method. Returns true when MemberCore
8565         is exposed from assembly.
8566         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8567         value or gets cached value.
8568         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8569         is explicitly marked with CLSCompliantAttribute.
8570         (IsIdentifierClsCompliant): New abstract method. This method is
8571         used to testing error 3005.
8572         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8573         for identifier and parameters CLS-Compliant testing.
8574         (VerifyClsCompliance): New method. The main virtual method for
8575         CLS-Compliant verifications.
8576         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8577         null. I don't know why is null (too many public members !).
8578         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8579         and get value of first CLSCompliantAttribute that found.
8580
8581         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8582         (VerifyClsCompliance): Override and add extra tests.
8583
8584         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8585         clscheck- disable CLS-Compliant verification event if assembly is has
8586         CLSCompliantAttribute(true).
8587
8588         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8589         ApllyAttribute is now called in emit section as in the other cases.
8590         Possible future Emit integration.
8591         (IsIdentifierClsCompliant): New override.
8592         (VerifyClsCompliance): New override.
8593         (GetEnumeratorName): Returns full enum name.
8594
8595         * parameter.cs (GetSignatureForError): Implemented.
8596
8597         * report.cs (WarningData): New struct for Warning message information.
8598         (LocationOfPreviousError): New method.
8599         (Warning): New method. Reports warning based on the warning table.
8600         (Error_T): New method. Reports error based on the error table.
8601
8602         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8603         verifications are done here.
8604
8605         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8606
8607         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8608         CLSCompliantAttribute.
8609         (all_imported_types): New member holds all imported types from other
8610         assemblies.
8611         (LoadAllImportedTypes): New method fills static table with exported types
8612         from all referenced assemblies.
8613         (Modules): New property returns all assembly modules.
8614
8615 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8616
8617         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8618         throwing a parser error.
8619
8620         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8621         which removes the hardcoded get_/set_ prefixes for properties, as
8622         IL allows for the properties to be named something else.  
8623
8624         Bug #56013
8625
8626         * expression.cs: Do not override operand before we know if it is
8627         non-null.  Fix 56207
8628
8629 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8630
8631         * typemanager.cs: support for pinned variables.
8632
8633 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8634
8635         * decl.cs, typemanager.cs: Avoid using an arraylist
8636         as a buffer if there is only one result set.
8637
8638 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8639
8640         * expression.cs: Make sure you cant call a static method
8641         with an instance expression, bug #56174.
8642
8643 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8644
8645         * class.cs (IsDuplicateImplementation): Improve error reporting to
8646         flag 663 (method only differs in parameter modifier).
8647
8648         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8649         in preprocessor directives.
8650
8651         * location.cs (LookupFile): Allow for the empty path.
8652
8653         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8654         better approach for some of that patch, but its failing with the
8655         CharSet enumeration.  For now try/catch will do.
8656
8657         * typemanager.cs: Do not crash if a struct does not have fields.
8658         Fixes 56150.
8659
8660 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8661
8662         * expression.cs: cs0213, cant fix a fixed expression.
8663         fixes 50231.
8664
8665 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8666
8667         * cs-parser.jay: detect invalid embeded statements gracefully.
8668         bug #51113.
8669
8670 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8671
8672         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8673         As a regex:
8674         s/
8675         the invocation type may not be a subclass of the tye of the item/
8676         The type of the item must be a subclass of the invocation item.
8677         /g
8678
8679         Fixes bug #50820.
8680
8681 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8682
8683         * attribute.cs: Added methods to get a string and a bool from an
8684         attribute. Required to information from AssemblyKeyFileAttribute,
8685         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8686         * codegen.cs: Modified AssemblyName creation to include support for
8687         strongnames. Catch additional exceptions to report them as CS1548.
8688         * compiler.csproj: Updated include CryptoConvert.cs.
8689         * compiler.csproj.user: Removed file - user specific configuration.
8690         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8691         Mono.Security assembly. The original class is maintained and tested in
8692         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8693         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8694         like CSC 8.0 (C# v2) supports.
8695         * Makefile: Added CryptoConvert.cs to mcs sources.
8696         * rootcontext.cs: Added new options for strongnames.
8697
8698 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8699
8700         * driver.cs: For --expect-error, report error code `2'
8701         if the program compiled with no errors, error code `1' if
8702         it compiled with an error other than the one expected.
8703
8704 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8705
8706         * compiler.csproj: Updated for Visual Studio .NET 2003.
8707         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8708         * compiler.sln: Updated for Visual Studio .NET 2003.
8709
8710 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8711
8712         * expression.cs: Fix bug #47234. We basically need to apply the
8713         rule that we prefer the conversion of null to a reference type
8714         when faced with a conversion to 'object' (csc behaviour).
8715
8716 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8717
8718         * statement.cs: Shorter form for foreach, eliminates
8719         a local variable. r=Martin.
8720
8721 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8722
8723         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8724         checks if we can use brtrue/brfalse to test for 0.
8725         * expression.cs: use the above in the test for using brtrue/brfalse.
8726         cleanup code a bit.
8727
8728 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8729
8730         * expression.cs: Rewrite string concat stuff. Benefits:
8731
8732         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8733         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8734         rather than a concat chain.
8735
8736         * typemanager.cs: Add lookups for more concat overloads.
8737
8738 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8739
8740         * expression.cs: Emit shorter il code for array init.
8741
8742         newarr
8743         dup
8744         // set 1
8745
8746         // set 2
8747
8748         newarr
8749         stloc.x
8750
8751         ldloc.x
8752         // set 1
8753
8754         ldloc.x
8755         // set 2
8756
8757 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8758
8759         * statement.cs: Before, two switch blocks would be merged if the
8760         total size of the blocks (end_item - begin_item + 1) was less than
8761         two times the combined sizes of the blocks.
8762
8763         Now, it will only merge if after the merge at least half of the
8764         slots are filled.
8765
8766         fixes 55885.
8767
8768 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8769
8770         * class.cs : csc build fix for GetMethods(). See bug #52503.
8771
8772 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8773
8774         * expression.cs: Make sure fp comparisons work with NaN.
8775         This fixes bug #54303. Mig approved this patch a long
8776         time ago, but we were not able to test b/c the runtime
8777         had a related bug.
8778
8779 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8782
8783 2004-03-19  Martin Baulig  <martin@ximian.com>
8784
8785         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8786         two overloads may unify for some type parameter substitutions and
8787         report a CS0408 if appropriate.
8788
8789 2004-03-19  Martin Baulig  <martin@ximian.com>
8790
8791         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8792         error here and not in our caller.
8793
8794 2004-03-19  Martin Baulig  <martin@ximian.com>
8795
8796         * interface.cs: Completely killed this file.
8797         (Interface): We're now a TypeContainer and live in class.cs.
8798
8799         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8800         argument; we're now also called for interfaces.
8801         (TypeContainer.DefineMembers): Allow this method being called
8802         multiple times.
8803         (TypeContainer.GetMethods): New public method; formerly known as
8804         Interface.GetMethod().  This is used by PendingImplementation.
8805         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8806         it's now private and non-static.
8807         (Interface): Moved this here; it's now implemented similar to
8808         Class and Struct.
8809         (Method, Property, Event, Indexer): Added `bool is_interface'
8810         argument to their .ctor's.
8811         (MemberBase.IsInterface): New public field.
8812
8813         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8814         instances instead of InterfaceMethod, InterfaceProperty, etc.
8815         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8816         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8817
8818 2004-03-19  Martin Baulig  <martin@ximian.com>
8819
8820         * class.cs (MethodCore.IsDuplicateImplementation): New private
8821         method which does the CS0111 checking.
8822         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8823         Use IsDuplicateImplementation().
8824
8825 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8826
8827         * decl.cs (FindMemberToOverride): New method to find the correct
8828         method or property to override in the base class.
8829         * class.cs
8830             - Make Method/Property use the above method to find the
8831               version in the base class.
8832             - Remove the InheritableMemberSignatureCompare as it is now
8833               dead code.
8834
8835         This patch makes large code bases much faster to compile, as it is
8836         O(n) rather than O(n^2) to do this validation.
8837
8838         Also, it fixes bug 52458 which is that nested classes are not
8839         taken into account when finding the base class member.
8840
8841         Reviewed/Approved by Martin.
8842
8843 2004-03-17  Martin Baulig  <martin@ximian.com>
8844
8845         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8846         of type arguments into account; use the `real_num_type_args'
8847         approach like in DoResolveAsTypeStep().
8848
8849         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8850         nested types.
8851
8852 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8853
8854         * interface.cs: In all interface classes removed redundant
8855         member initialization.
8856
8857 2004-03-16  Martin Baulig  <martin@ximian.com>
8858
8859         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8860
8861 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8862
8863         * decl.cs (DefineTypeAndParents): New helper method to define a
8864         type's containers before the type itself is defined;  This is a
8865         bug exposed by the recent changes to Windows.Forms when an
8866         implemented interface was defined inside a class that had not been
8867         built yet.   
8868
8869         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8870
8871         (Check): Loop correctly to report errors modifiers
8872         (UNSAFE was not in the loop, since it was the same as TOP).
8873
8874         * interface.cs: Every interface member now takes a ModFlags,
8875         instead of a "is_new" bool, which we set on the base MemberCore. 
8876
8877         Every place where we called "UnsafeOk" in the interface, now we
8878         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8879         the unsafe settings from the member declaration instead of the
8880         container interface. 
8881
8882         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8883
8884         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8885         `set_indexer_name' to the pending bits (one per type).
8886
8887         We fixed a bug today that was picking the wrong method to
8888         override, since for properties the existing InterfaceMethod code
8889         basically ignored the method name.  Now we make sure that the
8890         method name is one of the valid indexer names.
8891
8892 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8893  
8894         * support.cs (SeekableStreamReader): Keep track of stream byte
8895         positions and don't mix them with character offsets to the buffer.
8896
8897         Patch from Gustavo Giráldez
8898
8899 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8900
8901         * interface.cs (InterfaceSetGetBase): Removed double member
8902         initialization, base class does it as well.
8903
8904 2004-03-13  Martin Baulig  <martin@ximian.com>
8905
8906         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8907         when compiling corlib.
8908
8909 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8910
8911         * convert.cs (ExplicitConversion): We were reporting an error on
8912         certain conversions (object_type source to a value type, when the
8913         expression was `null') before we had a chance to pass it through
8914         the user defined conversions.
8915
8916         * driver.cs: Replace / and \ in resource specifications to dots.
8917         Fixes 50752
8918
8919         * class.cs: Add check for duplicate operators.  Fixes 52477
8920
8921 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8922
8923         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8924         that are in the middle of the statements, not only at the end.
8925         Fixes #54987
8926
8927         * class.cs (TypeContainer.AddField): No longer set the
8928         `HaveStaticConstructor' flag, now we call it
8929         `UserDefineStaticConstructor' to diferentiate the slightly
8930         semantic difference.
8931
8932         The situation is that we were not adding BeforeFieldInit (from
8933         Modifiers.TypeAttr) to classes that could have it.
8934         BeforeFieldInit should be set to classes that have no static
8935         constructor. 
8936
8937         See:
8938
8939         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8940
8941         And most importantly Zoltan's comment:
8942
8943         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8944
8945         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8946          before its static fields are used', i.e. initialization does not need
8947          to be triggered by the first access to the type. Setting this flag
8948          helps the JIT to compile better code, since it can run the static
8949          constructor at JIT time, and does not need to generate code to call it
8950          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8951          this flag for lots of classes like String. 
8952          
8953          csc sets this flag if the type does not have an explicit static 
8954          constructor. The reasoning seems to be that if there are only static
8955          initalizers for a type, and no static constructor, then the programmer
8956          does not care when this initialization happens, so beforefieldinit
8957          can be used.
8958          
8959          This bug prevents the AOT compiler from being usable, since it 
8960          generates so many calls to mono_runtime_class_init that the AOT code
8961          is much slower than the JITted code. The JITted code is faster, 
8962          because it does not generate these calls if the vtable is type is
8963          already initialized, which is true in the majority of cases. But the
8964          AOT compiler can't do this."
8965
8966 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8967
8968         * class.cs (MethodData.Emit): Refactor the code so symbolic
8969         information is generated for destructors;  For some reasons we
8970         were taking a code path that did not generate symbolic information
8971         before. 
8972
8973 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8974
8975         * class.cs: Create a Constructor.CheckBase method that
8976         takes care of all validation type code. The method
8977         contains some code that was moved from Define.
8978
8979         It also includes new code that checks for duplicate ctors.
8980         This fixes bug #55148.
8981
8982 2004-03-09  Joshua Tauberer <tauberer@for.net>
8983
8984         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8985         a { ... }-style array creation invokes EmitStaticInitializers
8986         which is not good for reference-type arrays.  String, decimal
8987         and now null constants (NullCast) are not counted toward
8988         static initializers.
8989
8990 2004-03-05  Martin Baulig  <martin@ximian.com>
8991
8992         * location.cs (SourceFile.HasLineDirective): New public field;
8993         specifies whether the file contains or is referenced by a "#line"
8994         directive.
8995         (Location.DefineSymbolDocuments): Ignore source files which
8996         either contain or are referenced by a "#line" directive.        
8997
8998 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8999
9000         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9001         direct access to our parent, so check the method inline there.
9002
9003 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9004
9005         * expression.cs (Invocation.EmitCall): Miguel's last commit
9006         caused a regression. If you had:
9007
9008             T t = null;
9009             t.Foo ();
9010
9011         In Foo the implict this would be null.
9012
9013 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9014
9015         * expression.cs (Invocation.EmitCall): If the method is not
9016         virtual, do not emit a CallVirt to it, use Call.
9017
9018         * typemanager.cs (GetFullNameSignature): Improve the method to
9019         cope with ".ctor" and replace it with the type name.
9020
9021         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9022         as an argument the ConstructorBuilder where it is being defined,
9023         to catch the recursive constructor invocations.
9024
9025 2004-03-16  Martin Baulig  <martin@ximian.com>
9026
9027         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9028         ConstructedType, call ResolveType() on it to get the type rather
9029         than just using `expr.Type'.
9030
9031 2004-03-16  Martin Baulig  <martin@ximian.com>
9032
9033         * generics.cs (ConstructedType.GetMemberAccess): Take the
9034         EmitContext instead on the TypeExpr and use
9035         ec.TypeContainer.CurrentType/ec.ContainerType.
9036
9037 2004-03-16  Martin Baulig  <martin@ximian.com>
9038
9039         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9040         parameters before aliases.
9041
9042 2004-03-16  Martin Baulig  <martin@ximian.com>
9043
9044         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9045         New oublic function; checks whether two generic instances may become
9046         equal under some instantiations (26.3.1).
9047
9048         * class.cs (TypeContainer.Define): Call
9049         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9050         error.
9051
9052 2004-03-16  Martin Baulig  <martin@ximian.com>
9053
9054         * class.cs (TypeContainer.GetClassBases): Moved
9055         Error_TypeParameterAsBase() here and also check whether the base
9056         class is not an attribute.
9057
9058 2004-03-16  Martin Baulig  <martin@ximian.com>
9059
9060         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9061
9062 2004-03-16  Martin Baulig  <martin@ximian.com>
9063
9064         * class.cs (Error_TypeParameterAsBase): Use correct error number
9065         here (CS0689).  
9066
9067 2004-03-16  Martin Baulig  <martin@ximian.com>
9068
9069         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9070         for generics.
9071
9072         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9073         error reporting.
9074
9075 2004-03-15  Martin Baulig  <martin@ximian.com>
9076
9077         * typemanager.cs (TypeManager.GetFullName): New public method.
9078         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9079         argument; only return members with the correct number of type
9080         arguments.
9081         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9082         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9083         whether the number of type arguments matches.
9084
9085         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9086         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9087
9088         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9089         field; it's set by the protected .ctor when we're actually a
9090         GenericMemberAccess.
9091         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9092         arguments and pass it to MemberLookupFinal ().
9093
9094         * ecore.cs (Expression.MemberLookup): Added `int
9095         num_type_arguments' argument; only return members with the correct
9096         number of type arguments.
9097         (Expression.MemberLookupFailed): Check whether the MemberLookup
9098         failed because we did not have the correct number of type
9099         arguments; report CS0305 in this case.
9100
9101         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9102         `e.ResolveAsTypeTerminal()' already did so.
9103
9104 2004-03-15  Martin Baulig  <martin@ximian.com>
9105
9106         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9107         we're a ConstructedType; in this case, the caller must report an
9108         error (for instance CS0131).
9109
9110         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9111         (TypeArguments.Resolve): Actually report errors here.
9112
9113 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9114
9115         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9116         `set_indexer_name' to the pending bits (one per type).
9117
9118         We fixed a bug today that was picking the wrong method to
9119         override, since for properties the existing InterfaceMethod code
9120         basically ignored the method name.  Now we make sure that the
9121         method name is one of the valid indexer names.
9122
9123 2004-03-15  Martin Baulig  <martin@ximian.com>
9124
9125         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9126         for generic instances.
9127
9128 2004-03-13  Martin Baulig  <martin@ximian.com>
9129
9130         * class.cs (TypeContainer.DefineType): Call
9131         TypeManager.AddUserType() immediately after creating the
9132         TypeBuilder; pass all type parameters when creating the
9133         CurrentType.
9134
9135         * decl.cs (DeclSpace.FindNestedType): New public method.
9136         (DeclSpace.FindType): Added `int num_type_args' argument; only
9137         return types with the correct number of type parameters.
9138         (DeclSpace.CountTypeParams): New public property.
9139
9140         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9141         the number of type parameters; defaults to zero.
9142
9143         * generic.cs (TypeArguments.Count): New public property.
9144         (ConstructedType.DoResolveAsTypeStep): First call
9145         ds.FindNestedType() to find out whether we're nested in the
9146         current generic type; in this case, we inherit all type parameters
9147         from the current class.
9148
9149         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9150         num_type_args' argument.
9151         (RootContext.LookupType): Added overloaded version which takes the
9152         number of type arguments; only return types with the correct
9153         number of type arguments.
9154
9155         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9156         checks whether `Type t' has `int num_type_args'.
9157
9158 2004-03-13  Martin Baulig  <martin@ximian.com>
9159
9160         * generic.cs (GenericMethod.DefineType): New method; calls
9161         DefineType() on all the type parameters.
9162
9163         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9164         (MethodData.Define): If we're a generic method, call
9165         GenericMethod.DefineType() to define the type parameters.       
9166
9167 2004-03-10  Martin Baulig  <martin@ximian.com>
9168
9169         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9170         instead of IsAssignableFrom.    
9171
9172 2004-03-10  Martin Baulig  <martin@ximian.com>
9173
9174         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9175
9176         * support.cs (ParameterData.HasArrayParameter): New property.
9177         (ReflectionParameters.ctor): Take a MethodBase instead of a
9178         ParameterInfo[].  If we have any type parameters, get the generic
9179         method definition and ask it whether we have variable arguments.
9180
9181 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9182
9183         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9184         routines to check if a type is an enumerable/enumerator allow
9185         classes that implement the IEnumerable or IEnumerator interfaces.
9186
9187         * class.cs (Property, Operator): Implement IIteratorContainer, and
9188         implement SetYields.
9189
9190         (Property.Define): Do the block swapping for get_methods in the
9191         context of iterators.   We need to check if Properties also
9192         include indexers or not.
9193
9194         (Operator): Assign the Block before invoking the
9195         OperatorMethod.Define, so we can trigger the Iterator code
9196         replacement. 
9197
9198         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9199         Property and Operator classes are not created when we parse the
9200         declarator but until we have the block completed, so we use a
9201         singleton SimpleIteratorContainer.Simple to flag whether the
9202         SetYields has been invoked.
9203
9204         We propagate this setting then to the Property or the Operator to
9205         allow the `yield' to function.
9206
9207 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9208
9209         * codegen.cs: Implemented attribute support for modules.
9210         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9211         Assembly/Module functionality.
9212
9213         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9214         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9215         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9216
9217 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9218
9219         * interface.cs (FindMembers): The operation is performed on all base
9220         interfaces and not only on the first. It is required for future CLS Compliance patch.
9221
9222 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9223
9224         * statement.cs, codegen.cs:
9225         This patch deals with patterns such as:
9226
9227         public class List : IEnumerable {
9228
9229                 public MyEnumerator GetEnumerator () {
9230                         return new MyEnumerator(this);
9231                 }
9232
9233                 IEnumerator IEnumerable.GetEnumerator () {
9234                         ...
9235                 }
9236                 
9237                 public struct MyEnumerator : IEnumerator {
9238                         ...
9239                 }
9240         }
9241
9242         Before, there were a few things we did wrong:
9243         1) we would emit callvirt on a struct, which is illegal
9244         2) we emited ldarg when we needed to emit ldarga
9245         3) we would mistakenly call the interface methods on an enumerator
9246         type that derived from IEnumerator and was in another assembly. For example:
9247
9248         public class MyEnumerator : IEnumerator
9249
9250         Would have the interface methods called, even if there were public impls of the
9251         method. In a struct, this lead to invalid IL code.
9252
9253 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9254
9255         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9256           renamed to Emit.
9257
9258         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9259
9260 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9261
9262         * cs-parser.jay: Fix small regression: we were not testing V2
9263         compiler features correctly.
9264
9265         * interface.cs: If the emit context is null, then create one
9266
9267 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9268
9269         * decl.cs (GetSignatureForError): New virtual method to get full name
9270           for error messages.
9271
9272         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9273           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9274
9275         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9276           Duplicated members and code in these classes has been removed.
9277           Better encapsulation in these classes.
9278
9279 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9280
9281         * assign.cs (Assign.DoResolve): When dealing with compound
9282         assignments, there is a new rule in ECMA C# 2.4 (might have been
9283         there before, but it is documented here) that states that in:
9284
9285         a op= b;
9286
9287         If b is of type int, and the `op' is a shift-operator, then the
9288         above is evaluated as:
9289
9290         a = (int) a op b 
9291
9292         * expression.cs (Binary.ResolveOperator): Instead of testing for
9293         int/uint/long/ulong, try to implicitly convert to any of those
9294         types and use that in pointer arithmetic.
9295
9296         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9297         method to print information for from the type, not from the
9298         null-method we were given.
9299
9300 2004-02-01  Duncan Mak  <duncan@ximian.com>
9301
9302         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9303         parsing for cmd, fixes bug #53694.
9304
9305 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9306
9307         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9308         in the member name duplication tests. Property and operator name duplication
9309         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9310
9311 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9312
9313         * interface.cs (PopulateMethod): Fixed crash when interface method
9314         returns not existing type (error test cs0246-3.cs).
9315
9316 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9317
9318         * cs-parser.jay (interface_accessors): Re-write actions to also
9319         store attributes attached to get and set methods. Fix spelling
9320         while at it.
9321
9322         (inteface_property_declaration): Modify accordingly.
9323
9324         (InterfaceAccessorInfo): New helper class to store information to pass
9325         around between rules that use interface_accessors.
9326
9327         * interface.cs (Emit): Apply attributes on the get and set
9328         accessors of properties and indexers too.
9329
9330         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9331         right MethodBuilder when applying attributes to the get and set accessors.
9332
9333 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9334
9335         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9336
9337 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9340
9341 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9342
9343         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9344         changes that treat `yield' specially when present before `break'
9345         or `return' tokens.
9346
9347         * cs-tokenizer.cs: yield is no longer a keyword.
9348
9349 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9352         setting for default constructors.
9353         For default constructors are almost every time set wrong Modifier. The
9354         generated IL code has been alright. But inside mcs this values was
9355         wrong and this was reason why several of my CLS Compliance tests
9356         failed.
9357
9358 2004-02-27  Martin Baulig  <martin@ximian.com>
9359
9360         * generics.cs (ConstructedType.ResolveType): Make the nested type
9361         stuff actually work.
9362
9363 2004-02-25  Martin Baulig  <martin@ximian.com>
9364
9365         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9366         property; returns the type parameters just from the current type,
9367         ie. with the ones from outer classes.
9368         (DeclSpace.LookupGeneric): First search in the current class, then
9369         in outer classes.
9370         (DeclSpace.initialize_type_params): When hiding a type parameter
9371         from an outer class, put it into the `type_param_list' anyways.
9372
9373         * expression.cs (MemberAccess.expr): Made this field protected.
9374
9375         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9376         the type parameters from the current class.
9377
9378         * generic.cs (ConstructedType.ResolveType): Support nested generic
9379         types by taking the type parameters which we inherit from outer
9380         classes into account.
9381         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9382         support for nested generic types.
9383
9384 2004-02-23  Martin Baulig  <martin@ximian.com>
9385
9386         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9387         field and check whether we're nested inside a generic type.
9388         (DeclSpace.ResolveType): If we're resolving to a generic type
9389         definition, create a ConstructedType and return its resolved type.
9390         (DeclSpace.initialize_type_params): New private method;
9391         initializes the `type_param_list' field from the type parameters
9392         from this and all enclosing classes.
9393         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9394         we're already initialized.
9395
9396 2004-02-23  Martin Baulig  <martin@ximian.com>
9397
9398         * class.cs (Method.Define): Create the generic method before
9399         calling DoDefine().
9400         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9401         the TypeContainer one); we use this for generic methods.
9402
9403         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9404         parent's TypeBuilder.
9405
9406 2004-02-18  Martin Baulig  <martin@ximian.com>
9407
9408         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9409         to check for equality.
9410
9411 2004-02-05  Martin Baulig  <martin@ximian.com>
9412
9413         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9414         `ec.TypeContainer.CurrentType', use it instead of
9415         `ec.ContainerType' to check whether we're in the type's ctor.
9416
9417 2004-01-29  Martin Baulig  <martin@ximian.com>
9418
9419         * expression.cs (Invocation.DoResolve): If we're a
9420         `ConstructedType', then we're actually a generic method, so
9421         rewrite the expr as a GenericMemberAccess.
9422
9423         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9424         here; manually parse it into a string.
9425
9426 2004-01-28  Martin Baulig  <martin@ximian.com>
9427
9428         * typemanager.cs (TypeManager.IsEqual): New static method.
9429         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9430         check for equality instead of using `=='.
9431
9432 2004-01-26  Martin Baulig  <martin@ximian.com>
9433
9434         * decl.cs (DeclSpace.CurrentType): New public field.
9435
9436         * expression.cs (This.ResolveBase): If we have an
9437         `ec.TypeContainer.CurrentType', use it instead of
9438         `ec.ContainerType'.
9439
9440         * class.cs (TypeContainer.DefineType): If we're a generic type,
9441         create the `CurrentType' (unresolved).
9442         (TypeContainer.GenericType): New private field.
9443         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9444         it and store it in `GenericType' before creating the MemberCache.
9445         (TypeContainer.GetMembers): If we have a `GenericType', call
9446         TypeManager.FindMembers() on it.
9447
9448         * interface.cs (Interface.GenericType): New private field.
9449         (Interface.DefineType): If we're a generic type, create the
9450         `CurrentType' (unresolved).
9451         (Interface.DefineMembers): If we have a `CurrentType', resolve it
9452         and store it in `GenericType' before creating the MemberCache.
9453         (Interface.GetMembers): If we have a `GenericType', call
9454         TypeManager.FindMembers() on it.
9455
9456 2004-01-22  Martin Baulig  <martin@ximian.com>
9457
9458         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9459         not a QualifiedIdentifier.  This is what `type_name_expression'
9460         was previously doing.
9461         (type_name_expression): Removed; the code is now in
9462         `namespace_or_type_name'.
9463         (qualified_identifier): Removed, use `namespace_or_type_name'
9464         instead.
9465         (QualifiedIdentifier): Removed this class.      
9466
9467 2004-01-22  Martin Baulig  <martin@ximian.com>
9468
9469         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9470         not a string as alias name.
9471
9472 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9473
9474         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9475         #52730 bug, and instead compute correctly the need to use a
9476         temporary variable when requesting an address based on the
9477         static/instace modified of the field and the constructor.
9478  
9479 2004-01-21  Martin Baulig  <martin@ximian.com>
9480
9481         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9482         class and namespace before looking up aliases.  Fixes #52517.
9483
9484 2004-01-21  Martin Baulig  <martin@ximian.com>
9485
9486         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9487         assinged in a 'try'; fixes exception4.cs.
9488
9489 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9490         * class.cs : Implemented parameter-less constructor for TypeContainer
9491
9492         * decl.cs: Attributes are now stored here. New property OptAttributes
9493
9494         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9495
9496         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9497
9498 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9499
9500         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9501           (CSharpSignature): New method for indexer and property signature.
9502
9503 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9504
9505         * pending.cs (IsVirtualFilter): Faster implementation.
9506
9507 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9508
9509         * typemanager.cs: Avoid inclusion of same assembly more than once.
9510
9511 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9512
9513         * cs-parser.jay: Fixed problem where the last assembly attribute
9514           has been applied also to following declaration (class, struct, etc.)
9515           
9516 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9517
9518         * class.cs: Added error CS0538, CS0539 reporting.
9519         Fixed crash on Microsoft runtime when field type is void.
9520
9521         * cs-parser.jay: Added error CS0537 reporting.
9522
9523         * pending.cs: Added error CS0535 reporting.
9524         Improved error report for errors CS0536, CS0534.
9525
9526 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9527
9528         Merge a few bits from the Anonymous Method MCS tree.
9529
9530         * statement.cs (ToplevelBlock): New class for toplevel methods,
9531         will hold anonymous methods, lifted variables.
9532
9533         * cs-parser.jay: Create toplevel blocks for delegates and for
9534         regular blocks of code. 
9535
9536 2004-01-20  Martin Baulig  <martin@ximian.com>
9537
9538         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9539         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9540         and `NeedExplicitReturn'; added `IsLastStatement'.
9541         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9542         have a `ReturnLabel' or we're not unreachable.
9543
9544         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9545         child's reachability; don't just override ours with it.  Fixes
9546         #58058 (lluis's example).
9547         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9548         InFinally(), InLoop(), InSwitch() and
9549         BreakCrossesTryCatchBoundary() methods.
9550
9551         * statement.cs (Return): Do all error checking in Resolve().
9552         Unless we are the last statement in a top-level block, always
9553         create a return label and jump to it.
9554         (Break, Continue): Do all error checking in Resolve(); also make
9555         sure we aren't leaving a `finally'.
9556         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9557         statement in a top-level block.
9558         (Block.Flags): Added `IsDestructor'.
9559         (Block.IsDestructor): New public property.
9560
9561 2004-01-20  Martin Baulig  <martin@ximian.com>
9562
9563         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9564
9565 2004-01-20  Martin Baulig  <martin@ximian.com>
9566
9567         * statement.cs (Statement.ResolveUnreachable): New public method.
9568         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9569         (Block.Resolve): Resolve unreachable statements.
9570
9571 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9572
9573         * expression.cs: We need to fix the case where we do
9574         not have a temp variable here.
9575
9576         * assign.cs: Only expression compound assignments need
9577         temporary variables.
9578
9579 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9580
9581         * flowanalysis.cs: Reduce memory allocation in a few ways:
9582           - A block with no variables should not allocate a bit
9583             vector for itself.
9584           - A method with no out parameters does not need any tracking
9585             for assignment of the parameters, so we need not allocate
9586             any data for it.
9587           - The arrays:
9588                 public readonly Type[] VariableTypes;
9589                 public readonly string[] VariableNames;
9590             Are redundant. The data is already stored in the variable
9591             map, so we need not allocate another array for it.
9592           - We need to add alot of checks for if (params | locals) == null
9593             due to the first two changes.
9594
9595 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9596
9597         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9598         implement IMemoryLocation, we store a copy on a local variable and
9599         take the address of it.  Patch from Benjamin Jemlich
9600
9601         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9602         to use a special "type_name_expression" rule which reduces the
9603         number of "QualifiedIdentifier" classes created, and instead
9604         directly creates MemberAccess expressions.
9605
9606 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9607
9608         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9609         that fixes #52853.  Null literal assignment to ValueType
9610
9611         * class.cs (MethodData.Emit): Instead of checking the name of the
9612         method to determine if its a destructor, create a new derived
9613         class from Method called Destructor, and test for that.  
9614
9615         * cs-parser.jay: Create a Destructor object instead of a Method.  
9616
9617         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9618
9619         Fixes: 52933
9620
9621 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9622
9623         * expression.cs (Binary.ResolveOperator): Perform an implicit
9624         conversion from MethodGroups to their delegate types on the
9625         Addition operation.
9626
9627         * delegate.cs: Introduce a new class DelegateCreation that is the
9628         base class for `NewDelegate' and `ImplicitDelegateCreation',
9629         factor some code in here.
9630
9631         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9632         conversion from MethodGroups to compatible delegate types. 
9633
9634         * ecore.cs (Expression.Resolve): Do not flag error 654
9635         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9636         we allow conversions from MethodGroups to delegate types now.
9637
9638         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9639         assignments in v2 either.
9640
9641 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9642
9643         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9644         static read-only fields in ctors.
9645
9646         Applied patch from Benjamin Jemlich 
9647
9648         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9649
9650 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9651
9652         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9653         here to return true, as they can be used like this:
9654
9655                 (XXX) int.MEMBER ()
9656
9657         Fixed 49836 and all the other dups
9658
9659 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9660
9661         * driver.cs: Implement /win32res and /win32icon.
9662
9663 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9664
9665         * cs-parser.jay: Add a rule to improve error handling for the
9666         common mistake of placing modifiers after the type.
9667
9668 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9669
9670         * cs-parser.jay (interface_event_declaration): Catch
9671         initialization of events on interfaces, and report cs0068
9672
9673         * cs-parser.jay (interface_event_declaration): Catch
9674         initialization of events. 
9675
9676         * ecore.cs: Better report missing constructors.
9677
9678         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9679         the error reporting done in the wrong place.  Fix.
9680
9681         * expression.cs (Binary.ResolveOperator): Catch the 
9682         operator + (E x, E y) error earlier, and later allow for implicit
9683         conversions in operator +/- (E e, U x) from U to the underlying
9684         type of E.
9685
9686         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9687         52596, if the container class is abstract, the default constructor
9688         is protected otherwise its public (before, we were always public).
9689
9690         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9691         fixed statement.
9692
9693         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9694         Jemlich that fixes bug #52597, MCS was generating invalid code for
9695         idisposable structs.   Thanks to Ben for following up with this
9696         bug as well.
9697
9698 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9699
9700         * driver.cs: Allow assemblies without code to be generated, fixes
9701         52230.
9702
9703 2004-01-07  Nick Drochak <ndrochak@gol.com>
9704
9705         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9706
9707 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9708
9709         * cs-parser.jay: Add rules to improve error reporting if fields or
9710         methods are declared at the namespace level (error 116)
9711
9712         * Add rules to catch event add/remove
9713
9714 2004-01-04  David Sheldon <dave-mono@earth.li>
9715
9716   * expression.cs: Added matching ")" to error message for 
9717   CS0077
9718
9719 2004-01-03 Todd Berman <tberman@gentoo.org>
9720
9721         * ecore.cs, attribute.cs:
9722         Applying fix from #52429.
9723
9724 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9725
9726         * ecore.cs, expression.cs, statement.cs:
9727         Total rewrite of how we handle branching. We
9728         now handle complex boolean expressions with fewer
9729         jumps. As well if (x == 0) no longer emits a ceq.
9730
9731         if (x is Foo) is much faster now, because we generate
9732         better code.
9733
9734         Overall, we get a pretty big improvement on our benchmark
9735         tests. The code we generate is smaller and more readable.
9736
9737         I did a full two-stage bootstrap. The patch was reviewed
9738         by Martin and Miguel.
9739
9740 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9741
9742         * cs-parser.jay: Make primary_expression not take a QI.
9743         we dont need this because the member_access rule covers
9744         us here. So we replace the rule with just IDENTIFIER.
9745
9746         This has two good effects. First, we remove a s/r conflict.
9747         Second, we allocate many fewer QualifiedIdentifier objects.
9748
9749 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9750
9751         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9752         set the correct information via SRE. This prevents
9753         hanging on the MS runtime. Fixes #29374.
9754
9755 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9756
9757         * convert.cs: correctly handle conversions to value types
9758         from Enum and ValueType as unboxing conversions.
9759
9760         Fixes bug #52569. Patch by Benjamin Jemlich.
9761
9762 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9763
9764         * expression.cs (BetterConversion): Prefer int -> uint
9765         over int -> ulong (csc's behaviour). This fixed bug #52046.
9766
9767 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9768
9769         * decl.cs (MemberCache.FindMembers): now returns a
9770         MemberInfo [].
9771
9772         * typemanager.cs: In general, go with with ^^.
9773         (CopyNewMethods): take an IList.
9774         (RealMemberLookup): Only allocate an arraylist
9775         if we copy from two sets of methods.
9776
9777         This change basically does two things:
9778         1) Fewer array lists allocated due to CopyNewMethods.
9779         2) the explicit cast in MemberList costed ALOT.
9780
9781 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9782
9783         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9784         a hashtable to avoid needless string allocations when an identifier is
9785         used more than once (the common case).
9786
9787 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9788
9789         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9790         is broken, it will not return anything. So, we
9791         have to use the information we have in mcs to
9792         do the task.
9793
9794         * typemanager.cs: Add a cache for GetInterfaces,
9795         since this will now be used more often (due to ^^)
9796
9797         (GetExplicitInterfaces) New method that gets the
9798         declared, not effective, interfaces on a type
9799         builder (eg, if you have interface IFoo, interface
9800         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9801         { IBar }.
9802
9803         This patch makes MCS able to bootstrap itself on
9804         Windows again.
9805
9806 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9807
9808         * expression.cs: Remove the Nop's that Miguel put
9809         in by mistake.
9810
9811 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9812
9813         * report.cs, codegen.cs: Give the real stack trace to
9814         the error when an exception is thrown.
9815
9816 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9817
9818         * decl.cs: only allocate hashtables for ifaces if 
9819         it is an iface!
9820
9821 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9822
9823         * expression.cs: fix the error from cs0121-2.cs
9824         (a parent interface has two child interfaces that
9825         have a function with the same name and 0 params
9826         and the function is called through the parent).
9827
9828 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9829
9830         * class.cs, rootcontext.cs, typmanager.cs: do not
9831         leak pointers.
9832
9833 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9834
9835         * codegen.cs: remove stack for the ec flow branching.
9836         It is already a linked list, so no need.
9837
9838 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9839
9840         * Makefile: Allow custom profiler here.
9841
9842 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9843
9844         * typemanager.cs (LookupType):
9845           - Use a static char [], because split takes
9846             a param array for args, so it was allocating
9847             every time.
9848           - Do not store true in a hashtable, it boxes.
9849
9850 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9851
9852         * flowanalysis.cs: bytify common enums.
9853
9854 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9855
9856         * modifiers.cs: Add a new set of flags for the
9857         flags allowed on explicit interface impls.
9858         * cs-parser.jay: catch the use of modifiers in
9859         interfaces correctly.
9860         * class.cs: catch private void IFoo.Blah ().
9861
9862         All related to bug #50572.
9863
9864 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9865
9866         * decl.cs: Rewrite the consistant accessability checking.
9867         Accessability is not linear, it must be implemented in
9868         a tableish way. Fixes #49704.
9869
9870 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9871
9872         * expression.cs: Handle negation in a checked context.
9873         We must use subtraction from zero. Fixes #38674.
9874
9875 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9876
9877         * class.cs: Ignore static void main in DLLs.
9878         * rootcontext.cs: Handle the target type here,
9879         since we are have to access it from class.cs
9880         * driver.cs: account for the above.
9881
9882 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9883
9884         * report.cs: Give line numbers and files if available.
9885
9886 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9887
9888         * driver.cs: Implement /addmodule.
9889
9890         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9891         ModuleBuilders.
9892
9893 2003-12-20  Martin Baulig  <martin@ximian.com>
9894
9895         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9896         (FieldBase.IsAssigned): Removed this field.
9897         (FieldBase.SetAssigned): New public method.
9898         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9899
9900 2003-12-20  Martin Baulig  <martin@ximian.com>
9901
9902         * expression.cs (LocalVariableReference.DoResolve): Don't set
9903         `vi.Used' if we're called from DoResolveLValue().
9904
9905         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9906         returns the usage vector it just merged into the current one -
9907         pass this one to UsageWarning().
9908         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9909         of the `EmitContext', don't call this recursively on our children.
9910
9911 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9912
9913         * driver.cs: Implement /target:module.
9914
9915 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9916
9917         * support.cs (CharArrayHashtable): New helper class.
9918
9919         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9920         char arrays, not strings, so we can avoid creating a string in
9921         consume_identifier if the identifier is a keyword.
9922
9923 2003-12-16  Martin Baulig  <martin@ximian.com>
9924
9925         * statement.cs (LocalInfo.Assigned): Removed this property.
9926         (LocalInfo.Flags): Removed `Assigned'.
9927         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9928         and uses flow analysis.
9929         (Block.UsageWarning): Made this method private.
9930         (Block.Resolve): Call UsageWarning() if appropriate.
9931
9932         * expression.cs (LocalVariableReference.DoResolve): Always set
9933         LocalInfo.Used here.
9934
9935 2003-12-13  Martin Baulig  <martin@ximian.com>
9936
9937         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9938         any value here; we're now using flow analysis to figure out
9939         whether a statement/block returns a value.
9940
9941 2003-12-13  Martin Baulig  <martin@ximian.com>
9942
9943         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9944         working again.
9945         (FlowBranching.MergeFinally): Don't call
9946         `branching.CheckOutParameters()' here, this is called in
9947         MergeTopBlock().
9948         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9949         when adding the `finally' vector.       
9950
9951 2003-12-13  Martin Baulig  <martin@ximian.com>
9952
9953         * flowanalysis.cs
9954         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9955         actually work and also fix #48962.
9956
9957 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9958
9959         * decl.cs: Do not check System.Object for nested types,
9960         since we know it does not have any. Big bang for buck:
9961
9962         BEFORE:
9963            Run 1:   8.35 seconds
9964            Run 2:   8.32 seconds
9965            corlib:  17.99 seconds
9966         AFTER:
9967            Run 1:   8.17 seconds
9968            Run 2:   8.17 seconds
9969            corlib:  17.39 seconds
9970
9971 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9972
9973         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9974         time we are returning 0 members, so we save alot here.
9975
9976 2003-12-11  Martin Baulig  <martin@ximian.com>
9977
9978         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9979         `MergeChild()', also just take the `FlowBranching' as argument;
9980         call Merge() on it and return the result.
9981         (FlowBranching.Merge): We don't need to do anything if we just
9982         have one sibling.
9983
9984 2003-12-11  Martin Baulig  <martin@ximian.com>
9985
9986         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9987         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9988         Maurer for this idea.
9989
9990 2003-12-11  Martin Baulig  <martin@ximian.com>
9991
9992         * flowanalysis.cs (MergeResult): This class is now gone; we now
9993         use the `UsageVector' for this.  The reason for this is that if a
9994         branching just has one sibling, we don't need to "merge" them at
9995         all - that's the next step to do.
9996         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9997         `MergeResult'.
9998
9999 2003-12-11  Martin Baulig  <martin@ximian.com>
10000
10001         Reworked flow analyis and made it more precise and bug-free.  The
10002         most important change is that we're now using a special `Reachability'
10003         class instead of having "magic" meanings of `FlowReturns'.  I'll
10004         do some more cleanups and optimizations and also add some more
10005         documentation this week.
10006
10007         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10008         largely reworked this class.
10009         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10010         the new `Reachability' class instead of having "magic" values here.
10011         (FlowBranching): We're now using an instance of `Reachability'
10012         instead of having separate `Returns', `Breaks' etc. fields.
10013
10014         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10015         based on flow analysis; ignore the return value of block.Emit ().
10016
10017 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10018
10019         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10020         if they are private.
10021
10022 2003-12-09  Martin Baulig  <martin@ximian.com>
10023
10024         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10025         call them directly on the UsageVector.
10026
10027 2003-12-09  Martin Baulig  <martin@ximian.com>
10028
10029         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10030         Changed return type from `FlowReturns' to `Reachability'.
10031
10032 2003-12-09  Martin Baulig  <martin@ximian.com>
10033
10034         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10035         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10036         `Reachable' fields with a single `Reachability' one.
10037
10038 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10039
10040         * class.cs (FindMembers): Remove foreach's.
10041
10042         Bootstrap times:
10043
10044         BEFORE
10045                 Run 1:   8.74 seconds
10046                 Run 2:   8.71 seconds
10047
10048         AFTER
10049                 Run 1:   8.64 seconds
10050                 Run 2:   8.58 seconds
10051
10052
10053 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10054
10055         * cs-parser.jay:
10056         * gen-treedump.cs:
10057         * statement.cs:
10058         This patch does a few things:
10059                 1. EmptyStatement is now a singleton, so it is never reallocated.
10060                 2. All blah is EmptyStatement constructs have been changed to
10061                    blah == EmptyStatement.Value, which is much faster and valid
10062                    now that EmptyStatement is a singleton.
10063                 3. When resolving a block, rather than allocating a new array for
10064                    the non-empty statements, empty statements are replaced with
10065                    EmptyStatement.Value
10066                 4. Some recursive functions have been made non-recursive.
10067         Mainly the performance impact is from (3), however (1) and (2) are needed for
10068         this to work. (4) does not make a big difference in normal situations, however
10069         it makes the profile look saner.
10070
10071         Bootstrap times:
10072
10073         BEFORE
10074         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10075         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10076         Total memory allocated: 56397 KB
10077
10078         AFTER
10079         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10080         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10081         Total memory allocated: 55666 KB
10082
10083 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10084
10085         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10086         than the hashtable in a hashtable version
10087
10088         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10089         we always end up concating a string. This results in a huge perf
10090         loss, because many strings have to be tracked by the GC. In this
10091         patch, we first use a hashtable that works with two keys, so that
10092         the strings do not need to be concat'ed.
10093
10094         Bootstrap times:
10095         BEFORE
10096                 Run 1:   8.74 seconds
10097                 Run 2:   8.71 seconds
10098
10099         AFTER
10100                 Run 1:   8.65 seconds
10101                 Run 2:   8.56 seconds
10102
10103 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10104
10105         * Makefile: Add a new target `do-time' that does a quick and simple
10106         profile, leaving easy to parse output.
10107
10108 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10109
10110         * codegen.cs (Init): Create the dynamic assembly with 
10111         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10112
10113 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10114
10115         * support.cs: Make the PtrHashtable use only one
10116         instance of its comparer.
10117
10118 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10119
10120         * typemanager.cs: Fix lookup of GetNamespaces.
10121
10122 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10123
10124         * expression.cs: Removed redundant line.
10125
10126         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10127         ArrayLists, use for loops with bounds.  
10128
10129         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10130         arraylist.
10131
10132         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10133         arraylists, use for loop with bounds.
10134
10135         The above three changes give us a 0.071 second performance
10136         improvement out of 3.294 seconds down to 3.223.  On my machine
10137         the above changes reduced the memory usage by 1,387 KB during
10138         compiler bootstrap.
10139
10140         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10141         QualifiedIdentifiers.  Before we created a new string through
10142         concatenation, and mostly later on, the result would be
10143         manipulated by DecomposeQI through string manipulation.
10144
10145         This reduced the compiler memory usage for bootstrapping from
10146         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10147         compile times in 0.05 seconds.
10148
10149 2003-11-28  Dick Porter  <dick@ximian.com>
10150
10151         * support.cs: Do string compares with the Invariant culture.
10152
10153         * rootcontext.cs: 
10154         * gen-treedump.cs: 
10155         * expression.cs: 
10156         * driver.cs: 
10157         * decl.cs: 
10158         * codegen.cs: 
10159         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10160         the comparison is done with the Invariant culture.
10161
10162 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10163
10164         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10165         GetEnumerator method.
10166
10167         (ProbeCollectionType): Iterate starting at the most specific type
10168         upwards looking for a GetEnumerator
10169
10170         * expression.cs: Shift count can be up to 31 for int/uint and 63
10171         for long/ulong.
10172
10173 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10174
10175         * statement.cs (Block.LookupLabel): Also look for the label on the
10176         children blocks.  Use a hash table to keep track of visited
10177         nodes. 
10178
10179         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10180         we actually did transform the other operand, otherwise fall back
10181         to the common codepath that casts to long.
10182
10183         * cs-tokenizer.cs: Use the same code pattern as the int case.
10184         Maybe I should do the parsing myself, and avoid depending on the
10185         Parse routines to get this done.
10186
10187 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10188
10189         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10190         which fixes bug 51347.  This time test it.
10191
10192         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10193         attributes for example can not tell the difference between these.
10194         The difference was only a syntax feature of the language. 
10195
10196         * attribute.cs: Apply attributes to delegates.
10197
10198         * delegate.cs: Call the apply attributes method.
10199
10200 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10201
10202         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10203         comparing 0 vs Byte.MinValue, not the value
10204
10205         (ImplicitConversionRequired): When reporting a conversion error,
10206         use error 31 to print out the constant error instead of the
10207         simpler 29.
10208
10209         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10210         which fixes bug 51347.
10211
10212 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10213
10214         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10215         which fixes the -warnaserror command line option.
10216
10217 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10218
10219         * cfold.cs (DoNumericPromotions): During constant folding of
10220         additions on UIntConstant, special case intconstants with
10221         IntConstants like we do on the expression binary operator. 
10222
10223 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10224
10225         * convert.cs (ImplicitReferenceConversion): We were missing a case
10226         (System.Enum are not value types or class types, so we need to
10227         classify them separatedly).
10228
10229         * driver.cs: We do not support error 2007.
10230
10231 2003-11-12 Jackson Harper <jackson@ximian.com>
10232
10233         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10234         system directory. Also use the full file name so users can
10235         libraries names mscorlib-o-tron.dll in a non system dir.
10236         
10237 2004-01-04  David Sheldon <dave-mono@earth.li>
10238
10239         * expression.cs: Added matching ")" to error message for CS0077.
10240
10241 2003-12-19  Martin Baulig  <martin@ximian.com>
10242
10243         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10244         static method; see documentation in the method.
10245         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10246
10247         * convert.cs (Convert.ImplicitReferenceConversion,
10248         Convert.ImplicitReferenceConversionExists): Add support for
10249         generic type declarations; see gen-36.cs.
10250
10251 2003-12-19  Martin Baulig  <martin@ximian.com>
10252
10253         * pending.cs (Pending.InterfaceMethod): Use
10254         `Type.IsAssignableFrom()' instead of `=='.
10255
10256 2003-12-18  Martin Baulig  <martin@ximian.com>
10257
10258         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10259         byref types first.
10260
10261         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10262         `expr_type.Equals (target_type)' instead of `=='.
10263
10264 2003-12-08  Martin Baulig  <martin@ximian.com>
10265
10266         * generics.cs (Constraints.Types): Removed.
10267         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10268         to Type's.
10269         (Constraints.ResolveTypes): New public method; resolves the
10270         TypeExpr's to Type's.
10271         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10272         longer takes the constraints.
10273         (TypeParameter.DefineMethod): Likewise.
10274         (TypeParameter.DefineType): New public method.  Calls
10275         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10276         the constraints.
10277
10278 2003-12-08  Martin Baulig  <martin@ximian.com>
10279
10280         * convert.cs (Convert.ImplicitConversionStandard): Use
10281         `expr_type.Equals (target_type)' instead of `=='.
10282
10283 2003-12-08  Martin Baulig  <martin@ximian.com>
10284
10285         * typemanager.cs (TypeManager.GetReferenceType): Call
10286         `Type.MakeByRefType ()'.
10287
10288 2003-12-08  Martin Baulig  <martin@ximian.com>
10289
10290         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10291         just has some special meaning in some situations.  For instance,
10292         it is allowed to use `where' as the name of a variable etc.
10293
10294 2003-12-04  Martin Baulig  <martin@ximian.com>
10295
10296         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10297         `Type.MakeArrayType()' for array types.
10298
10299 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10300
10301         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10302         debugging message.
10303
10304         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10305         corlib to compile.
10306
10307 2003-11-16  Martin Baulig  <martin@ximian.com>
10308
10309         * codegen.cs (EmitContext.IsGeneric): Removed.
10310
10311         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10312         ResolveGeneric() on the DeclSpace.
10313
10314 2003-11-16  Martin Baulig  <martin@ximian.com>
10315
10316         * generic.cs (TypeArguments.Resolve):
10317         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10318         `ResolveType()' on it to get the Type.
10319
10320 2003-11-15  Martin Baulig  <martin@ximian.com>
10321
10322         * generic.cs (ConstructedType.GetInterfaces): Override this.
10323
10324 2003-11-14  Martin Baulig  <martin@ximian.com>
10325
10326         * interface.cs (Interface.DefineType): Define all type parameters
10327         before adding the interfaces we inherit.
10328
10329 2003-11-11  Martin Baulig  <martin@ximian.com>
10330
10331         * generic.cs (ConstructedType.ResolveType): Always call
10332         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10333
10334 2003-11-10  Martin Baulig  <martin@ximian.com>
10335
10336         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10337         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10338         calling `ResolveType()' on them, directly assign their `Type'.
10339
10340 2003-11-08  Martin Baulig  <martin@ximian.com>
10341
10342         * generic.cs (ConstructedType): Override `IsClass' etc.
10343
10344 2003-11-08  Martin Baulig  <martin@ximian.com>
10345
10346         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10347         return value and the `out parent' parameter.
10348         (TypeContainer.DefineType): Moved the CS0644 check into
10349         GetClassBases().  Don't pass the interface types to the
10350         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10351         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10352
10353         * ecore.cs (TypeExpr.IsAttribute): New property.
10354         (TypeExpr.GetInterfaces): New method.
10355
10356         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10357         TypeExpr instead of a Type.
10358         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10359         (Interface.DefineType): Don't pass the interface types to the
10360         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10361         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10362
10363         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10364         instead of a `Type[]'.
10365         (TypeManager.RegisterBuilder): Likewise.
10366         (TypeManager.AddUserInterface): Likewise.
10367         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10368         `Type[]' and also return a `TypeExpr[]'.
10369         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10370
10371 2003-11-08  Martin Baulig  <martin@ximian.com>
10372
10373         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10374         Expression.     
10375
10376 2003-11-08  Martin Baulig  <martin@ximian.com>
10377
10378         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10379         TypeManager.ResolveExpressionTypes().
10380
10381         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10382         instead of an Expression.
10383         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10384         (TypeExpression): New public class; formerly known as `TypeExpr'.
10385
10386         * expression.cs (ComposedCast): Derive from TypeExpr.
10387
10388         * typemanager.cs (TypeManager.system_*_expr): These are now
10389         TypExpr's instead of Expression's.
10390         (TypeManager.ResolveExpressionTypes): New public static function;
10391         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10392         of them.        
10393
10394 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * expression.cs (New.DoResolve): Do not dereference value that
10397         might be a null return.
10398
10399         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10400         sure that the constant value has the right type.  Fixes an
10401         unreported bug, similar to 50425.
10402
10403         * const.cs (Const.LookupConstantValue): Call
10404         ImplicitStandardConversionExists before doing a conversion to
10405         avoid havng the TypeManager.ChangeType do conversions.
10406
10407         Reduced the number of casts used
10408
10409         (Const.ChangeType): New routine to enable reuse of the constant
10410         type changing code from statement.
10411
10412         * typemanager.cs (ChangeType): Move common initialization to
10413         static global variables.
10414
10415         Fixes #50425.
10416
10417         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10418         every value type to go through, even if it was void.  Fix that. 
10419
10420         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10421         character of the define, and the is_identifier_part_character for
10422         the rest of the string.
10423
10424 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * expression.cs (UnaryMutator.EmitCode): When I updated
10427         LocalVariableReference.DoResolve, I overdid it, and dropped an
10428         optimization done on local variable references.
10429
10430 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * ecore.cs: Convert the return from Ldlen into an int.
10433
10434 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10435
10436         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10437         the accessibility, this is a special case for toplevel non-public
10438         classes (internal for instance).
10439
10440 2003-10-20  Nick Drochak <ndrochak@gol.com>
10441
10442         * ecore.cs: Fix typo and build.  Needed another right paren.
10443
10444 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10445
10446         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10447         `internal' case regular and protected, but not allowing protected
10448         to be evaluated later.  Bug 49840
10449
10450 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10453         to kb.Nlast, and not the kb.nFirst to isolate the switch
10454         statement.
10455
10456         Extract the underlying type, so enumerations of long/ulong are
10457         treated like long/ulong.
10458
10459 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10460
10461         * expression.cs (New): Overload the meaning of RequestedType to
10462         track the possible creation of the NewDelegate type, since
10463         DoResolve is invoked more than once for new constructors on field
10464         initialization.
10465
10466         See bugs: #48800 and #37014
10467
10468         * cs-parser.jay (declare_local_constants): Take an arraylist
10469         instead of a single constant.
10470
10471         (local_constant_declaration): It should take a
10472         constant_declarators, not a constant_declarator.  Fixes 49487
10473
10474         * convert.cs: Fix error report.
10475
10476 2003-10-13 Jackson Harper <jackson@ximian.com>
10477
10478         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10479         bug #49611
10480         
10481 2003-11-03  Martin Baulig  <martin@ximian.com>
10482
10483         * expression.cs (ArrayAccess.GetStoreOpcode): Added
10484         `out bool has_type_arg'; if set, we need to pass the type to
10485         ig.Emit().
10486         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10487         Stelem_Any/Ldelem_Any for generic parameters.   
10488
10489 2003-11-02  Martin Baulig  <martin@ximian.com>
10490
10491         * expression.cs (Invocation.EmitCall): Use
10492         `TypeManager.IsValueType()' to check whether it's a value type.
10493         Don't set `struct_call' when calling a method on a type parameter.
10494
10495 2003-11-02  Martin Baulig  <martin@ximian.com>
10496
10497         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10498         and removed the TypeBuilder argument.
10499
10500         * typemanager.cs (TypeManager.IsValueType): Return
10501         `t.IsGenericParameter || t.IsValueType'.
10502
10503 2003-10-25  Martin Baulig  <martin@ximian.com>
10504
10505         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10506         call ConstructedType.Resolve() on it.
10507
10508         * generic.cs (ConstructedType.Resolve): Set `type' on success.
10509
10510 2003-10-25  Martin Baulig  <martin@ximian.com>
10511
10512         * class.cs (TypeContainer.GetClassBases): Changed
10513         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
10514         CS8214 reporting here.
10515         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10516         instead of a `Type' for our parent.  In case of a recursive
10517         declaration (see tests/gen-23.cs for an example), our parent is a
10518         ConstructedType and it doesn't have its type set.  So, first
10519         create our own TypeBuilder, then call constructed.Resolve() to get
10520         the parent's type and finally TypeBuilder.SetParent() it.
10521
10522         * ecore.cs (TypeExpr.Name): New public virtual property.
10523
10524         * generic.cs
10525         (ConstructedType): We're now a TypeExpr and not just an Expression.
10526         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10527         arguments here; this is done later.
10528         (ConstructedType.Resolve): New public method to resolve the type
10529         arguments and bind them.
10530
10531 2003-10-21  Martin Baulig  <martin@ximian.com>
10532
10533         * convert.cs: Use `TypeManager.IsValueType' instead of
10534         'type.IsValueType' everywhere.
10535
10536         * typemanager.cs (TypeManager.IsValueType): Return true for type
10537         parameters.  The reason for this is that we need to box a type
10538         parameter when converting it to a reference type.
10539
10540         * cs-parser.jay: Added support for default value expressions.
10541
10542         * generics.cs (DefaultValueExpression): New public class.       
10543
10544 2003-10-17  Martin Baulig  <martin@ximian.com>
10545
10546         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10547         TypeContainer so we can also use this for Interfaces.
10548         (TypeParameter.Resolve): Likewise.
10549
10550         * interface.cs (Interface.DefineType): Added support for generic
10551         interfaces.
10552
10553         * cs-parser.jay: Added support for generic structs and interfaces.
10554
10555 2003-10-17  Martin Baulig  <martin@ximian.com>
10556
10557         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10558         call generic methods :-)
10559
10560 2003-10-16  Martin Baulig  <martin@ximian.com>
10561
10562         * cs-parser.jay (namespace_or_type_name): Only create a
10563         GenericMemberAccess if we actually have type arguments.
10564
10565 2003-10-13  Martin Baulig  <martin@ximian.com>
10566
10567         * class.cs (Method.Define): If we're a generic method, call
10568         TypeBuilder.DefineGenericMethod () before resolving
10569         the parameters.
10570         (MethodData): Added .ctor which takes an additional MethodBuilder
10571         argument; this is used for generic methods.
10572         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10573         we already have a MethodBuilder.
10574
10575 2003-10-10  Martin Baulig  <martin@ximian.com>
10576
10577         * class.cs (Method): Added .ctor which takes a `GenericMethod'
10578         instead of a `DeclSpace'.  This is used for generic methods.
10579
10580         * cs-parser.jay (method_header): Added support for generic
10581         methods; create a `GenericMethod' instance and pass it to the
10582         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10583         parameters and locals.
10584
10585         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10586         since we already have the location.  Check whether we're a generic
10587         type declaration or a generic method and create the correct type
10588         parameter.
10589
10590         * generic.cs (TypeParameter.DefineMethod): New public method.
10591         (GenericMethod): New public class; derives from DeclSpace and is
10592         used for generic methods.       
10593
10594 2003-10-09  Martin Baulig  <martin@ximian.com>
10595
10596         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10597         to the .ctor.
10598         (MethodCore.DoDefineParameters): Removed the TypeContainer
10599         argument; use the DeclSpace which was passed to the .ctor instead.
10600         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10601         TypeContainer; we only need a DeclSpace here.
10602
10603 2003-10-09  Martin Baulig  <martin@ximian.com>
10604
10605         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10606         to the .ctor.
10607         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10608         EmitContext's .ctor.    
10609
10610 2003-10-09  Martin Baulig  <martin@ximian.com>
10611
10612         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10613         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10614         AsAccessible(), moved them as well.
10615
10616         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10617
10618 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10619
10620         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10621         generation for >=, as spotted by Paolo, bug 48679.  
10622         Patch from David Waite.
10623
10624         * cs-tokenizer.cs: Add handling for #pragma.
10625
10626         * cs-parser.jay: Allow for both yield and yield return in the
10627         syntax.  The anti-cobolization of C# fight will go on!
10628
10629         * class.cs (TypeBuilder.DefineType): Catch error condition here
10630         (Parent.DefineType erroring out and returning null).
10631
10632         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10633         coping with enumerations variables, we were mistakenly processing
10634         them as a regular value type instead of built-in types.  Fixes the
10635         bug #48063
10636
10637         * typemanager.cs (IsBuiltinOrEnum): New method.
10638
10639 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10640
10641         * cs-parser.jay: Upgrade: yield now needs the return clause.
10642
10643 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10644
10645         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10646
10647 2003-09-29  Martin Baulig  <martin@ximian.com>
10648
10649         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10650         inflated generic methods.
10651
10652         * generics.cs (ConstructedType): Distinguish between open and
10653         closed constructed types; correctly resolve the arguments.
10654
10655 2003-09-22  Martin Baulig  <martin@ximian.com>
10656
10657         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10658         all type arguments meet their constraints.
10659
10660 2003-09-19  Martin Baulig  <martin@ximian.com>
10661
10662         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10663         `MemberCache parent' argument.  Normally, an interface doesn't
10664         have a parent type except System.Object, but we use this in gmcs
10665         for generic type parameters.
10666
10667 2003-09-18  Martin Baulig  <martin@ximian.com>
10668
10669         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10670         on `type.IsInterface'; don't check whether the type has a parent
10671         to determine whether it's an interface.
10672
10673 2003-09-17  Martin Baulig  <martin@ximian.com>
10674
10675         * generic.cs (ConstructedType.ToString): Always use `name' as the
10676         type name.
10677
10678 2003-09-15  Martin Baulig  <martin@ximian.com>
10679
10680         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10681
10682         * generic.cs (Constraints.Resolve): New public method; this is
10683         called to resolve the constraint types and to check whether all
10684         the constraints are correct.
10685         (Constraints.Types): New public property.
10686         (TypeParameter.Resolve): New public method; resolves all the
10687         type's constraints.
10688
10689         * class.cs (TypeContainer.DefineType): Call
10690         TypeParameter.Resolve() before actually defining the type.
10691
10692 2003-09-15  Martin Baulig  <martin@ximian.com>
10693
10694         * class.cs (TypeContainer.DefineType): Added an error flag to
10695         avoid reporting duplicate CS0146's ("class definition is
10696         circular.").
10697
10698         * driver.cs (Driver.MainDriver): Abort if
10699         RootContext.ResolveTree() reported any errors.
10700
10701 2003-09-07  Martin Baulig  <martin@ximian.com>
10702
10703         * report.cs (Error, Warning): Added overloaded versions which take
10704         a `params object[] args' and call String.Format().
10705
10706 2003-09-07  Martin Baulig  <martin@ximian.com>
10707
10708         * decl.cs (DeclSpace..ctor): Don't call
10709         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10710         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10711         (DeclSpace.RecordDecl): New method.
10712
10713         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10714
10715 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10716
10717         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10718         value attributes to be applied to ParameterBuilders.
10719
10720         * class.cs (MethodCore.LabelParameters): Make static and more
10721         generic so that it can be used from other places - like interface
10722         methods, for instance.
10723
10724         * interface.cs (Interface.Emit): Call LabelParameters before
10725         emitting attributes on the InterfaceMethod.
10726
10727 2003-09-07  Martin Baulig  <martin@ximian.com>
10728
10729         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10730         if the number of type parameters doesn't match.
10731
10732 2003-09-04  Martin Baulig  <martin@ximian.com>
10733
10734         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10735         for arrays of generic type params (ie. `!0[]').
10736
10737 2003-09-04  Martin Baulig  <martin@ximian.com>
10738
10739         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10740         for the moment.
10741
10742 2003-09-04  Martin Baulig  <martin@ximian.com>
10743
10744         * decl.cs (DeclSpace.LookupGeneric): New method.
10745         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10746         moment.
10747
10748         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10749         argument, not just a string.
10750         (TypeParameter.Define): New public method; this is called to
10751         actually define the generic parameter; after this, you can use the
10752         new `Type' property to get the type.
10753
10754 2003-09-04  Martin Baulig  <martin@ximian.com>
10755
10756         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10757         is now an ArrayList; initialize the result of the `TypeParameters'
10758         property here.
10759         (DeclSpace.GetGenericData): Removed.
10760         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10761         implement this in a different way.
10762         (DeclSpace.GetTypeParameters): Removed; there's now a
10763         `TypeParameters' property.
10764         (DeclSpace.TypeParameters): New public property.
10765
10766         * generic.cs (Constraints): Make this class public.
10767         (TypeParameter): New public class.
10768
10769 2003-09-04  Martin Baulig  <martin@ximian.com>
10770
10771         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10772         generic parameters.
10773
10774         * class.cs (TypeContainer.DefineType): Call
10775         TypeBuilder.DefineGenericParameter () on all generic parameters if
10776         this is a generic type.
10777
10778 2003-08-28  Martin Baulig  <martin@ximian.com>
10779
10780         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10781         sample-stack.il".
10782
10783         * sample-hello.cs: Compile this with gmcs: "gmcs
10784         /r:sample-stack.dll sample-hello.cs".
10785
10786 2003-08-28  Martin Baulig  <martin@ximian.com>
10787
10788         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10789         the parameters to the generic type.
10790
10791 2003-08-28  Martin Baulig  <martin@ximian.com>
10792
10793         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10794
10795 2003-08-28  Martin Baulig  <martin@ximian.com>
10796
10797         * cs-parser.jay (opt_type_argument_list): Use
10798         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10799         (primary_expression): Replace `qualified_identifier' with `type_name'.
10800         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10801
10802         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10803         parser to check whether it is syntactically a type parameter list;
10804         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10805         this case.
10806
10807 2003-08-26  Martin Baulig  <martin@ximian.com>
10808
10809         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10810         resolving aliases; fixes #47927.
10811
10812 2003-08-26  Martin Baulig  <martin@ximian.com>
10813
10814         * statement.cs (Using.DoResolve): This is internally emitting a
10815         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10816         do not always return.  Fixes #47681.
10817
10818 2003-08-26  Martin Baulig  <martin@ximian.com>
10819
10820         * decl.cs (MemberCore): Moved WarningNotHiding(),
10821         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10822         into MemberBase.
10823         (AdditionResult): Make this nested in DeclSpace.
10824         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10825         argument; call NamespaceEntry.Define() unless we're nested in a
10826         class or struct.
10827
10828         * namespace.cs (Namespace.DefineName): New public function.  This
10829         is called from DeclSpace's .ctor to add 
10830         (Namespace.Lookup): Include DeclSpaces in the lookup.
10831
10832         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10833
10834         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10835
10836 2003-08-25  Martin Baulig  <martin@ximian.com>
10837
10838         * convert.cs (Convert.ExplicitReferenceConversion): When
10839         converting from an interface type to a class, unbox if the target
10840         type is a struct type.  Fixes #47822.
10841
10842 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10843
10844         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10845         #47854.
10846
10847 2003-08-22  Martin Baulig  <martin@ximian.com>
10848
10849         * class.cs (TypeManager.DefineType): When defining a nested type,
10850         call DefineType() on our parent; fixes #47801.
10851
10852 2003-08-22  Martin Baulig  <martin@ximian.com>
10853
10854         * class.cs (MethodData.Define): While checking if a method is an
10855         interface implementation, improve the test a bit more to fix #47654.
10856
10857 2003-08-22  Martin Baulig  <martin@ximian.com>
10858
10859         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10860         correctly; fixes #47722.
10861
10862 2003-08-22  Martin Baulig  <martin@ximian.com>
10863
10864         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10865         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10866
10867         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10868
10869 2003-08-22  Martin Baulig  <martin@ximian.com>
10870
10871         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10872         can only be assigned in static constructors.  Fixes #47161.
10873
10874 2003-08-22  Martin Baulig  <martin@ximian.com>
10875
10876         Rewrote and improved the flow analysis code.
10877
10878         * flowbranching.cs (FlowBranching): Make this class abstract.
10879         (FlowBranching.CreateBranching): New static function to create a
10880         new flow branching.
10881         (FlowBranchingBlock, FlowBranchingException): New classes.
10882         (FlowBranching.UsageVector.Type): New public readonly field.
10883         (FlowBranching.UsageVector.Breaks): Removed the setter.
10884         (FlowBranching.UsageVector.Returns): Removed the setter.
10885         (FlowBranching.UsageVector): Added Break(), Return(),
10886         NeverReachable() and Throw() methods to modify the reachability.
10887         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10888         done by FlowBranching.Merge().
10889         (FlowBranching.UsageVector.MergeChild): New method; merges the
10890         merge result into the current vector.
10891         (FlowBranching.Merge): New abstract method to merge a branching.
10892
10893 2003-08-12  Martin Baulig  <martin@ximian.com>
10894
10895         * expression.cs (Indirection.CacheTemporaries): Create the
10896         LocalTemporary with the pointer type, not its element type.
10897
10898 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10899
10900         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10901         token was a keyword or not.
10902
10903         Add `error' options where an IDENTIFIER was expected;  Provide
10904         CheckToken and CheckIdentifierToken convenience error reporting
10905         functions. 
10906
10907         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10908
10909         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10910         NameSpaceEntry NameSpaceEntry.
10911
10912         (LookupInterfaceOrClass): Avoid creating a full qualified name
10913         from namespace and name: avoid doing lookups when we know the
10914         namespace is non-existant.   Use new Tree.LookupByNamespace which
10915         looks up DeclSpaces based on their namespace, name pair.
10916
10917         * driver.cs: Provide a new `parser verbose' to display the
10918         exception thrown during parsing.  This is turned off by default
10919         now, so the output of a failure from mcs is more graceful.
10920
10921         * namespace.cs: Track all the namespaces defined in a hashtable
10922         for quick lookup.
10923
10924         (IsNamespace): New method
10925
10926 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10927
10928         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10929         we know that we need to concatenate (full typename can never be
10930         null). 
10931
10932         * class.cs: ditto.
10933
10934         * statement.cs: Use a bitfield;  Do not initialize to null things
10935         which are done by the constructor by default.
10936
10937         * cs-parser.jay: bug fix, parameter was 4, not 3.
10938
10939         * expression.cs: Just use the property;
10940
10941         * statement.cs: No need for GetVariableInfo method.
10942
10943 2003-08-08  Martin Baulig  <martin@ximian.com>
10944
10945         * flowanalysis.cs (FlowReturns): This is now nested in the
10946         `FlowBranching' class.
10947         (MyBitVector): Moved this here from statement.cs.
10948         (FlowBranching.SiblingType): New enum type.
10949         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10950
10951 2003-08-07  Martin Baulig  <martin@ximian.com>
10952
10953         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10954         `FlowBranching' class and called `BranchingType'.
10955
10956 2003-08-07  Martin Baulig  <martin@ximian.com>
10957
10958         * flowanalysis.cs: Moved all the control flow analysis code into
10959         its own file.
10960
10961 2003-08-07  Martin Baulig  <martin@ximian.com>
10962
10963         * assign.cs (Assign.DoResolve): `target' must either be an
10964         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10965         #37319.
10966
10967 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10968
10969         * expression.cs (BinaryMethod): This kind of expression is created by the
10970         Binary class if it determines that the operator has to be handled
10971         by a method.
10972
10973         (BinaryDelegate): This kind of expression is created if we are
10974         dealing with a + or - operator on delegates.
10975
10976         (Binary): remove method, argumetns, and DelegateOperator: when
10977         dealing with methods, 
10978
10979         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10980
10981         * statement.cs (Block): use bitfields for the three extra booleans
10982         we had in use.   Remove unused topblock parameter.
10983
10984         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10985
10986         * assign.cs: Drop extra unneeded tests.
10987
10988 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10989
10990         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10991
10992         * statement.cs (Foreach): Use VariableStorage instead of
10993         LocalBuilders.   
10994
10995         * codegen.cs (VariableStorage): New class used by clients that
10996         require a variable stored: locals or fields for variables that
10997         need to live across yield.
10998
10999         Maybe provide a convenience api for EmitThis+EmitLoad?
11000
11001         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11002         these bad boys.
11003
11004 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11005
11006         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11007         RemapParameterLValue): New methods that are used to turn a
11008         precomputed FieldInfo into an expression like this:
11009
11010                 instance.FieldInfo
11011
11012         The idea is to use this instead of making LocalVariableReference
11013         have more than one meaning.
11014
11015         * cs-parser.jay: Add error production to BASE.
11016
11017         * ecore.cs: Deal with TypeManager.GetField returning null, which
11018         is now a valid return value.
11019
11020         (FieldExprNoAddress): New expression for Fields whose address can
11021         not be taken.
11022
11023         * expression.cs (LocalVariableReference): During the resolve
11024         phases, create new expressions if we are in a remapping context.
11025         Remove code that dealt with remapping here.
11026
11027         (ParameterReference): same.
11028
11029         (ProxyInstance): New expression, like the `This' expression, but
11030         it is born fully resolved.  We know what we are doing, so remove
11031         the errors that are targeted to user-provided uses of `this'.
11032
11033         * statement.cs (Foreach): our variable is now stored as an
11034         Expression;  During resolution, follow the protocol, dont just
11035         assume it will return this.
11036
11037 2003-08-06  Martin Baulig  <martin@ximian.com>
11038
11039         * support.cs (SeekableStreamReader.cs): New public class.
11040
11041         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11042         SeekableStreamReader instead of the normal StreamReader.
11043
11044 2003-08-04  Martin Baulig  <martin@ximian.com>
11045
11046         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11047         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11048         deambiguate casts and delegate invocations.
11049         (parenthesized_expression): Use the new tokens to ensure this is
11050         not a cast of method invocation.
11051
11052         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11053         when reading a `)' and Deambiguate_CloseParens () was previously
11054         called.
11055
11056         * expression.cs (ParenthesizedExpression): New class.  This is
11057         just used for the CS0075 test.
11058         (Binary.DoResolve): Check for CS0075.   
11059
11060 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11061
11062         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11063         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11064         reference comparison.
11065
11066         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11067         examine the ReturnType for equality - this is necessary in the
11068         cases of implicit and explicit operators whose signature also
11069         includes the return type.
11070
11071 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * namespace.cs: Cache the result of the namespace computation,
11074         instead of computing it every time.
11075
11076 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11077
11078         * decl.cs: Use a global arraylist that we reuse over invocations
11079         to avoid excesive memory consumption.  Reduces memory usage on an
11080         mcs compile by one meg (45 average).
11081
11082         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11083         private, work around that.
11084
11085 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11086
11087         * literal.cs (IntLiteral): Define Zero and One static literals. 
11088
11089         * cs-parser.jay (integer_literal): use static literals to reduce
11090         memory usage for the most used literals (0, 1 and -1).  211kb
11091         reduced in memory usage.
11092
11093         Replace all calls to `new ArrayList' with `new
11094         ArrayList(4)' which is a good average number for most allocations,
11095         and also requires only 16 bytes of memory for its buffer by
11096         default. 
11097
11098         This reduced MCS memory usage in seven megabytes for the RSS after
11099         bootstrapping.
11100
11101 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11102
11103         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11104         handle params methods the correct way by forming only one
11105         applicable set with params and normal methods in them. Earlier we
11106         were looking at params methods only if we found no normal methods
11107         which was not the correct thing to do.
11108
11109         (Invocation.BetterFunction): Take separate arguments indicating
11110         when candidate and the best method are params methods in their
11111         expanded form.
11112
11113         This fixes bugs #43367 and #46199.
11114
11115         * attribute.cs: Documentation updates.
11116
11117         (CheckAttribute): Rename to CheckAttributeTarget.
11118         (GetValidPlaces): Rename to GetValidTargets.
11119
11120         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11121         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11122
11123         Fixes bug #44468.
11124
11125 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11126
11127         * codegen.cs: Compute IsGeneric correctly.
11128
11129         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11130         resolution. 
11131
11132         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11133         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11134         regressions, and I was chasing more bugs than I required.
11135
11136         * interface.cs: Use expressions for base type names (like classes
11137         and structs have been doing for a while now), and resolve that.
11138         This patch should probably go into head as well.
11139
11140         This makes it one less user of FindType.
11141
11142 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11143
11144         This compiler can not self host currently.  Need to fix that.
11145         
11146         * Makefile: compile to `gmcs.exe'
11147
11148         * driver.cs: Turn on v2 by default on gmcs.
11149
11150         * generic.cs (ConstructedType): Does no longer take a container
11151         type argument;  That will be taken care of later.
11152
11153         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11154         Use SimpleName to resolve for now, so we can continue the work on
11155         the parser, until we get Type.GetType that understands generics.
11156
11157         (ConstructedType.ToString): Implement
11158
11159         (TypeArguments.Resolve): Resolve the child expressions as types. 
11160         
11161         * cs-parser.jay: Rename interface_constraints to
11162         type_parameter_constraints
11163
11164         (namespace_or_type_name): Only use constructed types for the basic
11165         construction, we will deal with identifier<...> later.
11166
11167         (type/type_name): No longer call DecomposeQI, as
11168         namespace_or_type_name is always decoded now.
11169         
11170 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11171
11172         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11173         closely: we eliminate methods in base types when we have an
11174         applicable method in a top-level type.
11175
11176         Please see section 14.5.5.1 for an exact description of what goes
11177         on. 
11178
11179         This fixes bug #45127 and a host of other related to corlib compilation.
11180
11181         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11182         array is the method corresponding to the top-level type (this is
11183         because of the changes made to icall.c) so we change this
11184         accordingly.
11185
11186         (MethodGroupExpr.Name): This too.
11187
11188         * typemanager.cs (GetElementType): New method which does the right
11189         thing when compiling corlib. 
11190
11191         * everywhere: Make use of the above in the relevant places.
11192
11193 2003-07-22  Martin Baulig  <martin@ximian.com>
11194
11195         * cs-parser.jay (invocation_expression): Moved
11196         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11197         `cast_expression', but create a InvocationOrCast which later
11198         resolves to either an Invocation or a Cast.
11199
11200         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11201         method; call this before EmitStatement() to make sure that this
11202         expression can be used as a statement.
11203
11204         * expression.cs (InvocationOrCast): New class; resolves to either
11205         an Invocation or a Cast.
11206
11207         * statement.cs (StatementExpression): Call ResolveStatement() on
11208         the ExpressionStatement before emitting it.
11209
11210 2003-07-21  Martin Baulig  <martin@ximian.com>
11211
11212         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11213         `ref' and `out' attributes match; fixes #46220.
11214         (MemberAccess.ResolveMemberAccess): You can't reference a type
11215         through an expression; fixes #33180.
11216         (Indexers.GetIndexersForType): Don't return the indexers from
11217         interfaces the class implements; fixes #46502.
11218
11219 2003-07-21  Martin Baulig  <martin@ximian.com>
11220
11221         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11222         CS0661 checks; fixes bug #30442.
11223
11224 2003-07-21  Martin Baulig  <martin@ximian.com>
11225
11226         * decl.cs (AdditionResult): Added `Error'.
11227
11228         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11229
11230         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11231         cs0031.cs actually work.
11232
11233  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11234  
11235         * cs-parser.jay (namespace_name): do not use
11236         namespace_or_type_name, use qualified_identifier, because
11237         namespace_or_type_name will soon return a composed expression
11238         instead of a string.
11239  
11240         (namespace_or_type_name): Instead of returning a string, now this
11241         production returns an expression.
11242  
11243         * codegen.cs (EmitContext): Setup IsGeneric property based on
11244         whether our DeclSpace is generic, our the method is generic.
11245  
11246         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11247         the method is generic.
11248  
11249         * cs-parser.jay (type_arguments, opt_type_argument_list,
11250         type_parameters, type_parameter_list, opt_type_parameter_list,
11251         type_parameter,, opt_type_parameter_constraints_clauses,
11252         type_parameter_constraints_clauses,
11253         type_parameter_constraint_clause, type_parameter_constraint,
11254         interface_constraints): Add new production
11255  
11256         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11257         DeclSpace is generic or not.
11258  
11259         (DeclSpace.SetParameterInfo): New routine, used to set the
11260         parameter info for a type.
11261  
11262         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11263         returns a GenericTypeExpr
11264  
11265         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11266         generic, lookup the generic argument.
11267  
11268         * attribute.cs: Do not allow TypeParameterExpressions in
11269         Attributes.
11270  
11271         * class.cs: Do not allow the Main method to be defined in a
11272         Generic container.
11273  
11274         * expression.cs (SizeOf): Do not allow generic types to be used as
11275         arguments to sizeof.
11276  
11277         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11278         it: whether a type is generic or not.  Only works for types we are
11279         currently building for now.
11280         
11281 2003-07-20  Martin Baulig  <martin@ximian.com>
11282
11283         * namespace.cs: Fixed that bug which caused a crash when compiling
11284         the debugger's GUI.
11285
11286 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * typemanager.cs (LookupTypeReflection): Never expose types which
11289         are NotPublic, NestedPrivate, NestedAssembly, or
11290         NestedFamANDAssem.  We used to return these, and later do a check
11291         that would report a meaningful error, but the problem is that we
11292         would not get the real match, if there was a name override.
11293
11294 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * namespace.cs (Namespace, Name): Do not compute the namespace
11297         name dynamically, compute it in the constructor.  This reduced
11298         memory usage by 1697 KB.
11299
11300         * driver.cs: Use --pause to pause at the end.
11301
11302 2003-07-17  Peter Williams  <peter@newton.cx>
11303
11304         * Makefile: Change the name of the test target so that it doesn't
11305         conflict with the recursive test target.
11306
11307 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11308
11309         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11310         AddressOf): Do not use EmitThis, that was wrong, use the actual
11311         this pointer.
11312
11313 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11314
11315         * class.cs (MethodData.Define): While checking if a method is an
11316         interface implementation, improve the test: If we are not public
11317         (use new test here: use the computed MethodAttributes directly,
11318         instead of the parsed modifier flags) check if the `implementing'
11319         method comes from an interface or not.
11320
11321         * pending.cs (VerifyPendingMethods): Slightly better error
11322         message.
11323
11324         * makefile: add test target that does the mcs bootstrap.
11325
11326 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11327
11328         * interface.cs (Define): Do nothing here since there are no
11329         members to populate etc. Move the attribute emission out of here
11330         since this was just totally the wrong place to put it. Attribute
11331         application happens during the 'Emit' phase, not in the 'Define'
11332         phase.
11333
11334         (Emit): Add this method and move the attribute emission here
11335
11336         * rootcontext.cs (EmitCode): Call the Emit method on interface
11337         types too.
11338
11339 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11340
11341         * expression.cs (OverloadResolve): Report error only if Location
11342         is not 'Null' which means that there was a probe going on.
11343
11344 2003-07-14  Martin Baulig  <martin@ximian.com>
11345
11346         * expression.cs (ConditionalLogicalOperator): New public class to
11347         implement user defined conditional logical operators.
11348         This is section 14.11.2 in the spec and bug #40505.
11349
11350 2003-07-14  Martin Baulig  <martin@ximian.com>
11351
11352         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11353
11354 2003-07-14  Martin Baulig  <martin@ximian.com>
11355
11356         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11357
11358         * ecore.cs (IVariable.VerifyFixed): New interface method.
11359
11360         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11361         operator, check whether the variable is actually fixed.  Fixes bug
11362         #36055.  Set a variable definitely assigned when taking its
11363         address as required by the spec.
11364
11365         * statement.cs (LocalInfo.IsFixed): New field.
11366         (LocalInfo.MakePinned): Set `IsFixed' to true.
11367
11368 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11369
11370         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11371         for .ctors, ensure that we only ask for members declared in the
11372         attribute type (BindingFlags.DeclaredOnly).
11373
11374         Fixes bug #43632.
11375
11376         * expression.cs (Error_WrongNumArguments): Report error 1501
11377         correctly the way CSC does.
11378
11379 2003-07-13  Martin Baulig  <martin@ximian.com>
11380
11381         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11382         lookup on the fully qualified name, to make things like "X.X" work
11383         where "X.X" is a fully qualified type name, but we also have a
11384         namespace "X" in the using list.  Fixes #41975.
11385
11386 2003-07-13  Martin Baulig  <martin@ximian.com>
11387
11388         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11389         function. If we're a CompoundAssign, we need to create an embedded
11390         CompoundAssign, not an embedded Assign.
11391         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11392         Fixes #45854.
11393
11394 2003-07-13  Martin Baulig  <martin@ximian.com>
11395
11396         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11397         work to fix bug #46088.
11398
11399 2003-07-13  Ravi Pratap <ravi@ximian.com>
11400
11401         * class.cs (Operator.Emit): Do not emit attributes here - it is
11402         taken care of by the Method class that we delegate too. This takes
11403         care of bug #45876.
11404
11405 2003-07-10  Martin Baulig  <martin@ximian.com>
11406
11407         * expression.cs (TypeOfVoid): New class.
11408         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11409
11410 2003-07-10  Martin Baulig  <martin@ximian.com>
11411
11412         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11413         bug #35957.
11414
11415 2003-07-10  Martin Baulig  <martin@ximian.com>
11416
11417         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11418         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11419
11420         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11421
11422         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11423
11424 2003-07-10  Martin Baulig  <martin@ximian.com>
11425
11426         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11427         of decimal.  Fixes #42850.
11428
11429         NOTE: I also fixed the created byte blob, but this doesn't work on
11430         the MS runtime and csc never produces any byte blobs for decimal
11431         arrays.
11432
11433 2003-07-10  Martin Baulig  <martin@ximian.com>
11434
11435         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11436         structs; fixes #32068.
11437         (Block.AddChildVariableNames): Fixed #44302.
11438
11439 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11440
11441         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11442
11443 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11444
11445         * attribute.cs: And this test is onger needed.
11446
11447 2003-07-08  Martin Baulig  <martin@ximian.com>
11448
11449         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11450         inaccessible types.  Fixes #36313.
11451
11452         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11453
11454         * namespace.cs (NamespaceEntry): Create implicit entries for all
11455         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11456         implicit entries for N1.N2 and N1.
11457
11458 2003-07-08  Martin Baulig  <martin@ximian.com>
11459
11460         Rewrote the handling of namespaces to fix a lot of the issues
11461         wrt. `using' aliases etc.
11462
11463         * namespace.cs (Namespace): Splitted this class into a
11464         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11465
11466         * typemanager.cs (TypeManager.IsNamespace): Removed.
11467         (TypeManager.ComputeNamespaces): Only compute namespaces from
11468         loaded assemblies here, not the namespaces from the assembly we're
11469         currently compiling.
11470
11471 2003-07-08  Martin Baulig  <martin@ximian.com>
11472
11473         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11474
11475 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11476
11477         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11478         already fixed it.  
11479
11480         I thought about the memory savings here, but LookupTypeReflection
11481         is used under already very constrained scenarios.  Compiling
11482         corlib or mcs only exposes one hit, so it would not really reduce
11483         any memory consumption.
11484
11485 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11486
11487         * typemanager.cs: fixes bug #45889 by only adding public types from
11488         other assemblies to the list of known types.
11489
11490 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11493         on the type we resolved.
11494
11495 2003-07-05  Martin Baulig  <martin@ximian.com>
11496
11497         * pending.cs (PendingImplementation.ParentImplements): Don't
11498         create the proxy if the parent is abstract.
11499
11500         * class.cs (TypeContainer.DefineIndexers): Process explicit
11501         interface implementations first.  Fixes #37714.
11502
11503 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11506         defined recursively;  but since we modify the input parameters
11507         (left is set to `this' temporarily), we reset this value if the
11508         left_is_explicit is false, which gives the original semantics to
11509         the code.  
11510
11511         * literal.cs (NullPointer): new class used to represent a null
11512         literal in a pointer context.
11513
11514         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11515         type is a pointer, use a NullPointer object instead of a
11516         NullLiteral.   Closes 43687
11517
11518         (ExplicitConversion): Convert pointer values using
11519         the conv opcode to the proper type.
11520
11521         * ecore.cs (New): change ValueTypeVariable property into a method,
11522         that returns whether the valuetype is suitable for being used.
11523
11524         * expression.cs (Binary.DoNumericPromotions): Only return if we
11525         the int constant was a valid uint, and we can return both left and
11526         right as uints.  If not, we continue processing, to trigger the
11527         type conversion.  This fixes 39018.
11528
11529         * statement.cs (Block.EmitMeta): During constant resolution, set
11530         the CurrentBlock property on the emitcontext, so that we resolve
11531         constants propertly.
11532
11533 2003-07-02  Martin Baulig  <martin@ximian.com>
11534
11535         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11536         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11537
11538         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11539         than emitting it here.
11540
11541         * statement.cs: Fixed some more flow analysis bugs.
11542
11543 2003-07-02  Martin Baulig  <martin@ximian.com>
11544
11545         * class.cs (MethodData.Define): When implementing interface
11546         methods, set Final unless we're Virtual.
11547
11548         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11549         check work for interface methods.
11550
11551 2003-07-01  Martin Baulig  <martin@ximian.com>
11552
11553         * ecore.cs (EmitContext.This): Replaced this property with a
11554         GetThis() method which takes a Location argument.  This ensures
11555         that we get the correct error location for a CS0188.
11556
11557 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11558
11559         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11560         ImplicitStandardConversion.
11561
11562         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11563
11564 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11565
11566         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11567         optimization.
11568
11569 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11570
11571         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11572         constructors.
11573
11574         (MethodData.Define): Turn off initlocals for unsafe methods.
11575
11576 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11579         complete;  Fixes #37521.
11580
11581         * delegate.cs: Use Modifiers.TypeAttr to compute the
11582         TypeAttributes, instead of rolling our own.  This makes the flags
11583         correct for the delegates.
11584
11585 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11586
11587         * class.cs (Constructor.Define): Set the private flag for static
11588         constructors as well.
11589
11590         * cs-parser.jay (statement_expression): Set the return value to
11591         null, to avoid a crash when we catch an error.
11592
11593 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11594
11595         * cs-parser.jay: Applied patch from Jackson that adds support for
11596         extern and unsafe modifiers to destructor declarations.
11597
11598         * expression.cs: Report error 21 if the user is trying to index a
11599         System.Array.
11600
11601         * driver.cs: Add an error message, suggested by the bug report.
11602
11603         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11604         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11605
11606 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11607
11608         * namespace.cs: Add some information to reduce FAQs.
11609
11610 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11611
11612         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11613         underlying enumeration types.  Fixes #43915.
11614
11615         * expression.cs: Treat ushort/short as legal values to be used in
11616         bitwise operations.
11617
11618 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11619
11620         * delegate.cs: transfer custom attributes for paramenters from
11621         the delegate declaration to Invoke and BeginInvoke.
11622
11623 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11624
11625         * attribute.cs: handle custom marshalers and emit marshal info
11626         for fields, too.
11627
11628 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11629
11630         * makefile.gnu: Added anonymous.cs to the compiler sources.
11631
11632 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11633
11634         * iterators.cs: Change the name of the proxy class to include two
11635         underscores.
11636
11637         * cs-parser.jay: Update grammar to include anonymous methods.
11638
11639         * anonymous.cs: new file.
11640
11641 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11642
11643         * class.cs (Field.Define): Add missing test for pointers and
11644         safety. 
11645
11646 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11647
11648         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11649         we use the stobj opcode.
11650
11651         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11652         since it wasn't the correct fix. 
11653
11654         It still is puzzling that we are required to use stobj for IntPtr
11655         which seems to be a ValueType.
11656
11657 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11658
11659         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11660         during regular simple name resolution.   Now, the trick is that
11661         instead of returning for processing the simplename, we do a
11662         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11663         contextual lookup type).   If a match is found, return that, if
11664         not, return for further composition.
11665
11666         This fixes long-standing 30485.
11667
11668         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11669         using the address to initialize an object, do an Stobj instead of
11670         using the regular Stelem.
11671
11672         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11673         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11674         Because if we are a BaseIndexerAccess that value will be true.
11675         Fixes 43643.
11676
11677         * statement.cs (GotoCase.Resolve): Return after reporting an
11678         error, do not attempt to continue. 
11679
11680         * expression.cs (PointerArithmetic.Emit): If our operand is a
11681         long, convert our constants to match the operand before
11682         multiplying.  Convert to I type before adding.   Fixes 43670.
11683
11684 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11685
11686         * enum.cs (ImplicitConversionExists) : Rename to
11687         ImplicitEnumConversionExists to remove ambiguity. 
11688
11689         * ecore.cs (NullCast): New type of cast expression class which
11690         basically is very similar to EmptyCast with the difference being
11691         it still is a constant since it is used only to cast a null to
11692         something else
11693         (eg. (string) null)
11694
11695         * convert.cs (ImplicitReferenceConversion): When casting a null
11696         literal, we return a NullCast.
11697
11698         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11699         should be around anymore.
11700
11701         The renaming (reported was slightly wrong). Corrections:
11702
11703         ConvertImplicitStandard -> ImplicitConversionStandard
11704         ConvertExplicitStandard -> ExplicitConversionStandard
11705
11706         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11707         before passing them in !
11708
11709         * convert.cs (ImplicitConversionStandard): When comparing for
11710         equal expr and target types, ensure that expr is not a
11711         NullLiteral.
11712
11713         In general, we must not be checking (expr_type ==
11714         target_type) in the top level conversion methods
11715         (ImplicitConversion, ExplicitConversion etc). This checking is
11716         done in the methods that they delegate to.
11717
11718 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11719
11720         * convert.cs: Move Error_CannotConvertType,
11721         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11722         ImplicitNumericConversion, ImplicitConversionExists,
11723         ImplicitUserConversionExists, StandardConversionExists,
11724         FindMostEncompassedType, FindMostSpecificSource,
11725         FindMostSpecificTarget, ImplicitUserConversion,
11726         ExplicitUserConversion, GetConversionOperators,
11727         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11728         TryImplicitIntConversion, Error_CannotConvertImplicit,
11729         ConvertImplicitRequired, ConvertNumericExplicit,
11730         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11731         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11732         its own file.
11733
11734         Perform the following renames:
11735
11736         StandardConversionExists -> ImplicitStandardConversionExists
11737         ConvertImplicit -> ImplicitConversion
11738         ConvertImplicitStandard -> ImplicitStandardConversion
11739         TryImplicitIntConversion -> ImplicitIntConversion
11740         ConvertImplicitRequired -> ImplicitConversionRequired
11741         ConvertNumericExplicit -> ExplicitNumericConversion
11742         ConvertReferenceExplicit -> ExplicitReferenceConversion
11743         ConvertExplicit -> ExplicitConversion
11744         ConvertExplicitStandard -> ExplicitStandardConversion
11745
11746 2003-05-19  Martin Baulig  <martin@ximian.com>
11747
11748         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11749         (TypeInfo): Added support for structs having structs as fields.
11750
11751         * ecore.cs (FieldExpr): Implement IVariable.
11752         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11753         VariableInfo for the field.
11754
11755 2003-05-18  Martin Baulig  <martin@ximian.com>
11756
11757         * expression.cs (This.DoResolve): Report a CS0027 if we're
11758         emitting a field initializer.
11759
11760 2003-05-18  Martin Baulig  <martin@ximian.com>
11761
11762         * expression.cs (This.ResolveBase): New public function.
11763         (This.DoResolve): Check for CS0188.
11764
11765         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11766         This.Resolve().
11767
11768         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11769         `instance_expression' to null if we don't have any non-static
11770         methods.
11771
11772 2003-05-18  Martin Baulig  <martin@ximian.com>
11773
11774         Reworked the way how local variables and parameters are handled by
11775         the flow analysis code.
11776
11777         * statement.cs (TypeInfo, VariableMap): New public classes.
11778         (VariableInfo): New public class.  This is now responsible for
11779         checking whether a variable has been assigned.  It is used for
11780         parameters and local variables.
11781         (Block.EmitMeta): Take the InternalParameters as argument; compute
11782         the layout of the flow vectors here.
11783         (Block.LocalMap, Block.ParameterMap): New public properties.
11784         (FlowBranching): The .ctor doesn't get the InternalParameters
11785         anymore since Block.EmitMeta() now computes the layout of the flow
11786         vector.
11787         (MyStructInfo): This class is now known as `StructInfo' and nested
11788         in `TypeInfo'; we don't access this directly anymore.
11789
11790         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11791         property and removed IsAssigned(), IsFieldAssigned(),
11792         SetAssigned() and SetFieldAssigned(); we now call them on the
11793         VariableInfo so we don't need to duplicate this code everywhere.
11794
11795         * expression.cs (ParameterReference): Added `Block block' argument
11796         to the .ctor.
11797         (LocalVariableReference, ParameterReference, This): The new
11798         VariableInfo class is now responsible for all the definite
11799         assignment stuff.
11800
11801         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11802         IsParameterAssigned, SetParameterAssigned): Removed.
11803
11804 2003-05-18  Martin Baulig  <martin@ximian.com>
11805
11806         * typemanager.cs (InitCoreTypes): Try calling
11807         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11808         the 3-args-version.  Corlib now also needs our `void_type'.
11809         (GetMethod): Added overloaded version which takes an optional
11810         `bool report_errors' to allow lookups of optional methods.
11811
11812 2003-05-12  Martin Baulig  <martin@ximian.com>
11813
11814         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11815         only used for locals and not for parameters.
11816
11817 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11818
11819         * support.cs (InternalParameters.ParameterType): Return the
11820         ExternalType of the parameter.
11821
11822         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11823         they were unused.
11824
11825 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11826
11827         * class.cs (MethodData.Define): Do not set the `newslot' on
11828         interface members, if they are also flagged as "override".
11829
11830         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11831         better code for ++i and i++.  This only works for static fields
11832         and local variables.
11833
11834         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11835         want to pull the DeclSpace out of the builder_to_declspace instead
11836         of the TypeBuilder (like in TypeContainer.FindMembers).
11837
11838         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11839         instead of LookupTypeContainer.  Fixes the crash on .NET for
11840         looking up interface members.
11841
11842         * const.cs: Create our own emit context during the Definition
11843         stage, so that constants are evaluated in the proper context, when
11844         a recursive definition happens.
11845
11846 2003-05-11  Martin Baulig  <martin@ximian.com>
11847
11848         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11849         new block for a switch section.
11850         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11851         the adding/lookup in the switch block.  Fixes #39828.
11852
11853 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11856         functionality: I needed to convert the data after I had performed
11857         the add/sub operation into the operands type size.
11858
11859         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11860         pass the type for the box operation, otherwise the resulting
11861         object would have been of type object.
11862
11863         (BoxedCast): Add constructor to specify the type to box as.
11864
11865 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11866
11867         * iterators.cs: I was reusing the `count' variable inadvertently,
11868         take steps to not allow this to happen.
11869
11870 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11871
11872         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11873         by creating an array at the point where the params starts and
11874         putting all those arguments there, then adjusting the size of the
11875         array.
11876
11877 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * expression.cs (New.AddressOf): Implement interface
11880         IMemoryLocation.  This is used when the `new' operator is used in
11881         the context of an invocation to a method on a value type.
11882
11883         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11884         example. 
11885
11886         * namespace.cs: Also check the using aliases here.
11887
11888         * driver.cs: Move the test for using validity after the types have
11889         been entered, so we do a single pass that also includes the using
11890         aliases. 
11891
11892         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11893         in the regular case.   CreateSiblingForFinally is doing extra
11894         error checking.
11895
11896         * attribute.cs (GetAttributeArgumentExpression): Store the result
11897         on an out value, and use the return value to indicate failure
11898         instead of using null (which is a valid return for Constant.GetValue).
11899
11900         * statement.cs: Perform the analysis flow for the increment
11901         portion after the statement, because this will be the real flow of
11902         execution.  Fixes #42385
11903
11904         * codegen.cs (EmitContext.EmitArgument,
11905         EmitContext.EmitStoreArgument): New helper functions when the
11906         RemapToProxy flag is set.
11907
11908         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11909         function.
11910
11911         Add support for remapping parameters. 
11912
11913         * iterators.cs: Propagate parameter values;  Store parameter
11914         values in the proxy classes.
11915
11916 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11919         need a proxy reference;  I do not know what I was thinking
11920
11921         * cs-parser.jay (constructor_initializer): catch another error,
11922         and display nice message.
11923
11924         (field_declaration): catch void field declaration
11925         to flag a better error. 
11926
11927         * class.cs (MemberBase.CheckBase): Report an error instead of a
11928         warning if a new protected member is declared in a struct. 
11929         (Field.Define): catch the error of readonly/volatile.
11930
11931         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11932
11933         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11934         volatile variable is taken
11935
11936 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11937
11938         * statement.cs (Fixed.Resolve): Report an error if we are not in
11939         an unsafe context.
11940
11941 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * typemanager.cs: reuse the code that handles type clashes for
11944         delegates and enumerations.
11945
11946         * class.cs (Report28): Always report.
11947
11948         * expression.cs (EncodeAsAttribute): Allow nulls here.
11949
11950 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11951
11952         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11953         the functionality for testing whether an expression is valid for
11954         an attribute here.  Also handle the case of arrays of elements
11955         being stored. 
11956
11957         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11958         encoding a linear array into an array of objects that are suitable
11959         to be passed to an CustomAttributeBuilder.
11960
11961         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11962
11963         * ecore.cs: (FieldExpr): Handle field remapping here.
11964
11965         * iteratators.cs: Pass the instance variable (if the method is an
11966         instance method) to the constructors, so we can access the field
11967         variables on the class.
11968
11969         TODO: Test this with structs.  I think the THIS variable on
11970         structs might have to be a pointer, and not a refenrece
11971
11972 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11973
11974         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11975         local variables to fields in a proxy class.
11976
11977         * iterators.cs (PopulateProxy): Rename our internal fields to
11978         <XXX>.  
11979         Create a <THIS> field if we are an instance method, so we can
11980         reference our parent container variables.
11981         (MapVariable): Called back from the EmitContext code to enter a
11982         new variable to field mapping into the proxy class (we just create
11983         a FieldBuilder).
11984
11985         * expression.cs
11986         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11987         for using the remapped locals to fields.
11988
11989         I placed the code here, because that gives the same semantics to
11990         local variables, and only changes the Emit code.
11991
11992         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11993         statements inside iterators.
11994         (VariableInfo): Add a FieldBuilder for the cases when we are
11995         remapping local variables to fields in a proxy class
11996
11997         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11998         current_block != null.
11999
12000         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12001         not cope with strings, as it has been moved to the
12002         TableSwitchEmit.  Fixed bug in switch generation.
12003
12004         * expression.cs (New.DoResolve): Provide more context for the user
12005         when reporting an error.
12006
12007         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12008         pointers. 
12009
12010         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12011         check the permissions for it.  Note than in a type-resolution
12012         context the check was already present in DeclSpace.ResolveType,
12013         but was missing from the MemberAccess.
12014
12015         (ArrayCreation.CheckIndices): warn if the user has
12016         more nested levels of expressions, but there are no more
12017         dimensions specified.  Avoids crash on bug 41906.
12018
12019 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12020
12021         * statement.cs (Block): replace Implicit bool, for a generic
12022         flags.   
12023         New flag: `Unchecked'.  This is used during the EmitMeta phase
12024         (which is out-of-line with the regular Resolve/Emit process for a
12025         statement, as this is done ahead of time, but still gets a chance
12026         to call constant resolve).
12027
12028         (Block.Flags): new enum for adding a new flag.
12029
12030         (Block.EmitMeta): track the state of unchecked.
12031
12032         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12033         to enable constant resolution to work there as well.
12034
12035 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12036
12037         * typemanager.cs (ienumerable_type): Also look up
12038         System.Collections.IEnumerable. 
12039
12040 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12041
12042         TODO: Test more than one conditional per method.
12043
12044         * class.cs (Indexer.Define): Report the location where the user is
12045         referencing the unsupported feature.
12046
12047         (MethodData): Overload the use of `conditionals' to
12048         minimize the creation of needless ArrayLists.   This saves roughly
12049         212kb on my machine.
12050
12051         (Method): Implement the new IIteratorContainer interface.
12052         (Method.SetYields): Implement the method by setting the ModFlags
12053         to contain METHOD_YIELDS.
12054
12055         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12056         which just got set to null.
12057
12058         * iterators.cs: New file.
12059
12060         (Yield, YieldBreak): New statements.
12061
12062         * statement.cs (Return.Resolve): Flag an error if we are used in
12063         an iterator method.
12064
12065         * codegen.cs (InIterator): New flag set if the code is being
12066         compiled in an iterator method.
12067
12068         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12069         internal modifier, and we just use it to avoid adding extra
12070         fields, as this is seldom used.  
12071
12072         * cs-parser.jay: Add yield_statement (yield and yield break).
12073
12074         * driver.cs: New flag -v2 to turn on version 2 features. 
12075
12076         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12077         hashtable when v2 is enabled.
12078
12079 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12080
12081         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12082         there is already a namespace defined with this name.
12083
12084         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12085         people upgraded their corlibs.
12086
12087         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12088         always use fully qualified types, no need to use the compiler
12089         front end.
12090
12091         (TypeManager.IsNamespace): Use binarysearch.
12092
12093         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12094         AddDelegate): I did not quite use the new IsValid API properly: I
12095         have to pass the short-name and the fullname.  I was passing only
12096         the basename instead of the fullname sometimes. 
12097
12098         (TypeContainer.DefineType): call NamespaceClash.
12099
12100         * interface.cs (Interface.DefineType): use NamespaceClash before
12101         defining the type.
12102
12103         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12104         defining the type.
12105
12106         * enum.cs: (Enum.DefineType): use NamespaceClash before
12107         defining the type.
12108
12109         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12110         speed increase.  First, use the negative_hits cache when we get a
12111         negative.  Second, add the type with its full original name
12112         instead of the new . and + encoded name (reflection uses + to
12113         separate type from a nested type).  Use LookupTypeReflection
12114         directly which bypasses the type->name hashtable (that we already
12115         know does not contain the type.
12116
12117         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12118         location/container type. 
12119
12120         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12121
12122 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12123
12124         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12125
12126         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12127         method is being referenced in the method group from a static
12128         context, and report error 120 if so.
12129
12130         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12131         Error118. 
12132
12133         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12134         is created, we create the A namespace).
12135
12136         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12137         Fixes #41591
12138
12139 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12140
12141         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12142         invocation to ModuleBuilder.GetType with the same values will
12143         return a new type instance, so we need to cache its return
12144         values. 
12145
12146         * expression.cs (Binary.ResolveOperator): Only allow the compare
12147         operators on enums if they are of the same type.
12148
12149         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12150         types of ValueType on their own case.  Before we were giving them
12151         the same treatment as objects.
12152
12153         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12154         fullname.  Short name is used to compare against container name.
12155         Fullname is used to check against defined namespace names.
12156
12157         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12158         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12159
12160         (Method.CheckBase): Call parent.
12161         (MemberBase.CheckBase): Check for protected members on sealed
12162         classes.
12163         (PropertyBase.CheckBase): Call parent.
12164         (Field.Define): Call parent.
12165
12166         * report.cs: Negative error codes are now mapped to 8000 - code,
12167         so that the display is render more nicely.
12168
12169         * typemanager.cs: Do not use try/catch, instead report a regular
12170         error. 
12171
12172         (GetPointerType, GetReferenceType): These methods provide
12173         mechanisms to obtain the T* and T& from a T.  We had the code
12174         previously scattered around the code base, and it also used
12175         TypeManager.LookupType that would go through plenty of caches.
12176         This one goes directly to the type source.
12177
12178         In some places we did the Type.GetType followed by
12179         ModuleBuilder.GetType, but not in others, so this unifies the
12180         processing as well.
12181
12182         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12183         statements now that we have namespace information.
12184
12185         * typemanager.cs (IsNamespace): New method, returns whether the
12186         string presented is a namespace or not.
12187
12188         (ComputeNamespaces): New public entry point, computes the list of
12189         available namespaces, using the GetNamespaces API call in Mono, or
12190         the slower version in MS.NET.   
12191
12192         Now before we start the semantic analysis phase, we have a
12193         complete list of namespaces including everything that the user has
12194         provided.
12195
12196         Deleted old code to cache namespaces in .nsc files.
12197
12198 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12199
12200         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12201         class/struct location definition Location for the implicit
12202         constructor location.
12203
12204         (Operator.Define): Use the location of the operator for the
12205         implicit Method definition.
12206
12207         (Constructor.Emit): use the constructor location for the implicit
12208         base initializer constructor.
12209
12210         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12211         and the Expression class now contains two new methods:
12212
12213         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12214         isolate type lookup from the rest of the resolution process.
12215
12216         Since we use Expressions to hold type definitions due to the way
12217         we parse the input we have historically overloaded Resolve to
12218         perform the Type lookups if a special flag is passed.  Now this is
12219         eliminated and two methods take their place. 
12220
12221         The differences in the two methods between xStep and xTerminal is
12222         that xStep is involved in our current lookup system that uses
12223         SimpleNames to compose a name, while xTerminal is used just to
12224         catch the case where the simplename lookup failed.
12225
12226 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12227
12228         * expression.cs (ResolveMemberAccess): Remove redundant code.
12229         TypeExpr expressions are always born fully resolved.
12230
12231         * interface.cs (PopulateMethod): Do not lookup the types twice.
12232         We were doing it once during SemanticAnalysis and once during
12233         PopulateMethod.
12234
12235         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12236         in local variable type definitions, were being returned as a
12237         SimpleName (we decomposed everything into a string), that is
12238         because primary_expression was being used instead of a type in the
12239         grammar (reduce/reduce conflicts).
12240
12241         The part that was wrong is that we converted the expression into a
12242         string (an oversimplification in one hand, compounded with primary
12243         expressions doing string concatenation).
12244
12245         So things like:
12246
12247         A.B.C [] x;
12248
12249         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12250         using clauses from working on this particular context.  And a type
12251         was being matched directly against "A.B.C[]".
12252
12253         We now use the correct approach, and allow for ComposedCast to be
12254         part of the unary expression.  So the "A.B.C []" become a composed
12255         cast of "A.B.C" (as a nested group of MemberAccess with a
12256         SimpleName at the end) plus the rank composition "[]". 
12257
12258         Also fixes 35567
12259
12260 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12261
12262         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12263         for the access level checking.
12264
12265         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12266         `TypeContainer container', because I kept getting confused when I
12267         was debugging this code.
12268
12269         * expression.cs (Indexers): Instead of tracking getters/setters,
12270         we now track them in parallel.  We create one arraylist less, but
12271         most importantly it is possible now for the LValue code to find a
12272         matching get for a set.
12273
12274         (IndexerAccess.DoResolveLValue): Update the code.
12275         GetIndexersForType has been modified already to extract all the
12276         indexers from a type.  The code assumed it did not.
12277
12278         Also make the code set the correct return type for the indexer.
12279         This was fixed a long time ago for properties, but was missing for
12280         indexers.  It used to be void_type.
12281
12282         (Binary.Emit): Test first for doubles instead of
12283         floats, as they are more common.
12284
12285         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12286         when dealing with floats and the <=, >= operators.  This fixes bug
12287         #39314 
12288
12289         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12290         to load the array value by emitting a load on the foreach variable
12291         type.  This was incorrect.  
12292
12293         We now emit the code to load an element using the the array
12294         variable type, and then we emit the conversion operator.
12295
12296         Fixed #40176
12297
12298 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12299
12300         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12301
12302 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12303
12304         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12305         test for protection before we test for signatures. 
12306
12307         (MethodSignature.ToString): implement.
12308
12309         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12310         to the case where we reduced into a LongConstant.
12311
12312         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12313         depend on whether the information is acurrate, because the
12314         Microsoft runtime will always claim that the array type is public,
12315         regardless of the real state.
12316
12317         If the type is a pointer, another problem happens: the type is
12318         reported as non-public in Microsoft.  
12319
12320         In both cases we have to call CheckAccessLevel recursively with
12321         the underlying type as the argument to be tested.
12322
12323 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12324
12325         * assign.cs (Assign.Emit): If we are dealing with a compound
12326         assignment expression, we should use the code path that stores the
12327         intermediate result in a temporary value.  This fixes #40903.
12328
12329         *expression.cs (Indirection.ToString): Provide ToString method for
12330         debugging. 
12331
12332 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12333
12334         * class.cs: Null out fields holding references to Block objects so
12335         they can be garbage collected.
12336
12337         * expression.cs (OverloadResolve): Remove unused local.
12338
12339 2003-04-07  Martin Baulig  <martin@ximian.com>
12340
12341         * codegen.cs (EmitContext.CurrentFile): New public field.
12342         (EmitContext.Mark): Use the CurrentFile to check whether the
12343         location is in the correct file.
12344         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12345
12346 2003-04-07  Martin Baulig  <martin@ximian.com>
12347
12348         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12349
12350         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12351         location.  [FIXME: The location argument which gets passed to this
12352         method is sometimes wrong!]
12353
12354 2003-04-07  Nick Drochak <ndrochak@gol.com>
12355
12356         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12357
12358 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12359
12360         * expression.cs (Indirection.EmitAssign): We were using the
12361         temporary, but returning immediately instead of continuing the
12362         EmitAssing flow.
12363
12364 2003-04-06  Martin Baulig  <martin@ximian.com>
12365
12366         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12367         if it's a nested child, but also deriving from the outer class.
12368         See test 190.cs.
12369
12370         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12371         nested child, but also deriving from the outer class.  See
12372         test-190.cs.
12373         (FilterWithClosure): We may access private members of the outer
12374         class if we're a nested child and deriving from the outer class.
12375         (RealMemberLookup): Only set `closure_private_ok' if the
12376         `original_bf' contained BindingFlags.NonPublic.
12377
12378 2003-04-05  Martin Baulig  <martin@ximian.com>
12379
12380         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12381         probe if its a type parameter, and if so, flag an error.
12382
12383         * decl.cs: Move here the SetParameterInfo code from class.cs.
12384         Handle IsGeneric here.
12385
12386         Handle a variety of errors in the parameter info definition.
12387
12388         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12389         type parameters here.
12390
12391         * cs-parser.jay (class_declaration): report errors for parameters
12392         here as well.
12393
12394 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12395
12396         * generic.cs: New file, contains support code for generics.
12397
12398         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12399         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12400
12401         Update parser for the above removals.
12402
12403         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12404         now taken care of in the parser.
12405
12406 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12407
12408         * class.cs (Event.Define): Do not allow abstract events to have
12409         initializers. 
12410
12411 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12414         block in event declarations.
12415
12416         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12417         value type, get its address.
12418
12419         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12420         leaving a class on the stack instead of a boolean value (int
12421         0/1).  Change the code so we compare against null, and then the
12422         result against zero.
12423
12424         * class.cs (TypeContainer.GetClassBases): We were checking for the
12425         parent class being sealed too late.
12426
12427         * expression.cs (Binary.Emit): For <= and >= when dealing with
12428         floating point values, use cgt.un and clt.un instead of cgt and
12429         clt alone.
12430
12431 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12432
12433         * statement.cs: Apply the same optimization as MS: skip the 
12434         GetEnumerator returning an IEnumerator, and use the one returning a 
12435         CharEnumerator instead. This allows us to avoid the try-finally block 
12436         and the boxing.
12437
12438 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12439
12440         * cs-parser.jay: Attributes cannot be applied to
12441                          namespaces. Fixes #40473
12442
12443 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12444
12445         * class.cs:
12446         (Add*): check if the name is valid using the full name for constants,
12447         fields, properties and events.
12448
12449 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12452         char constants to be part of the enumeration.
12453
12454         * expression.cs (Conditional.DoResolve): Add support for operator
12455         true. Implements the missing functionality from 14.12
12456
12457         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12458         operator true/false as required by the spec.
12459
12460         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12461         implicit conversion to boolean.
12462
12463         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12464         also one where the type implements `operator true'. 
12465
12466         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12467         get an expression that will invoke operator true based on an
12468         expression.  
12469
12470         (GetConversionOperators): Removed the hack that called op_True
12471         here.  
12472
12473         (Expression.ResolveBoolean): Move this from Statement.
12474
12475 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12476
12477         * ecore.cs (FieldExpr): do not allow initialization of initonly
12478         fields on derived classes
12479
12480 2003-03-13  Martin Baulig  <martin@ximian.com>
12481
12482         * statement.cs (Block.Emit): Call ig.BeginScope() and
12483         ig.EndScope() when compiling with debugging info; call
12484         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12485
12486 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12487
12488         * expression.cs (Indexers): Do not construct immediately, allow
12489         for new members to be appended as we go.  Fixes 38143
12490
12491 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12492
12493         * expression.cs: save/restore context when resolving an unchecked
12494         expression.
12495
12496 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * cfold.cs: Catch division by zero in modulus operator during
12499         constant folding.
12500
12501 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12502
12503         * interface.cs (Interface.DefineMembers): Avoid defining members
12504         twice. 
12505
12506 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * driver.cs: handle the +/- options for -noconfig
12509
12510         * statement.cs (Unckeched.Resolve): Also track the state of
12511         unchecked in the Resolve phase.
12512
12513 2003-02-27  Martin Baulig  <martin@ximian.com>
12514
12515         * ecore.cs (Expression.MemberLookup): Don't create a
12516         MethodGroupExpr for something which is not a method.  Fixes #38291.
12517
12518 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * class.cs (MemberBase.CheckParameters): Also check that the type
12521         is unmanaged if it is a pointer.
12522
12523         * expression.cs (SizeOf.Resolve): Add location information.
12524
12525         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12526         a managed type is declared.
12527
12528         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12529         parameter modifiers as well.  Fixes bug 38606
12530
12531         * class.cs: Very sad.  Am backing out the speed up changes
12532         introduced by the ArrayList -> Array in the TypeContainer, as they
12533         were not actually that much faster, and introduced a bug (no error
12534         reports on duplicated methods).
12535
12536         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12537         source first, this will guarantee that we have a valid expression
12538         before calling in lower levels functions that will require a
12539         resolved object.  Then use this original_source in the
12540         target.ResolveLValue instead of the original source that was
12541         passed to us.
12542
12543         Another change.  Use target.Resolve instead of LValueResolve.
12544         Although we are resolving for LValues, we will let the Assign code
12545         take care of that (it will be called again from Resolve).  This
12546         basically allows code like this:
12547
12548         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12549         class Y { void A (X x) { x [0] += o; }
12550
12551         The problem was that the indexer was trying to resolve for
12552         set_Item (idx, object o) and never finding one.  The real set_Item
12553         was set_Item (idx, X).  By delaying the process we get the right
12554         semantics. 
12555
12556         Fixes bug 36505
12557
12558 2003-02-23  Martin Baulig  <martin@ximian.com>
12559
12560         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12561         while calling DoEmit ().
12562
12563         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12564         source files; if you use the #line directive inside a method, the
12565         compiler stops emitting line numbers for the debugger until it
12566         reaches the end of the method or another #line directive which
12567         restores the original file.
12568
12569 2003-02-23  Martin Baulig  <martin@ximian.com>
12570
12571         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12572
12573 2003-02-23  Martin Baulig  <martin@ximian.com>
12574
12575         * statement.cs (Block.AddChildVariableNames): We need to call this
12576         recursively, not just for our immediate children.
12577
12578 2003-02-23  Martin Baulig  <martin@ximian.com>
12579
12580         * class.cs (Event.Define): Always make the field private, like csc does.
12581
12582         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12583         actually work, fixes bug #37521.
12584
12585 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12586
12587         * delegate.cs: When creating the various temporary "Parameters"
12588         classes, make sure that we call the ComputeAndDefineParameterTypes
12589         on those new parameters (just like we do with the formal ones), to
12590         allow them to be resolved in the context of the DeclSpace.
12591
12592         This fixes the bug that Dick observed in Bugzilla #38530.
12593
12594 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12595
12596         * expression.cs (ResolveMemberAccess): When resolving a constant,
12597         do not attempt to pull a constant if the value was not able to
12598         generate a valid constant.
12599
12600         * const.cs (LookupConstantValue): Do not report more errors than required.
12601
12602 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12603
12604         * expression.cs: fixes bug #38328.
12605
12606 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * class.cs: Changed all the various members that can be part of a
12609         class from being an ArrayList to be an Array of the right type.
12610         During the DefineType type_list, interface_list, delegate_list and
12611         enum_list are turned into types, interfaces, delegates and enums
12612         arrays.  
12613
12614         And during the member population, indexer_list, event_list,
12615         constant_list, field_list, instance_constructor_list, method_list,
12616         operator_list and property_list are turned into their real arrays.
12617
12618         Although we could probably perform this operation earlier, for
12619         good error reporting we need to keep the lists and remove the
12620         lists for longer than required.
12621
12622         This optimization was triggered by Paolo profiling the compiler
12623         speed on the output of `gen-sample-program.pl' perl script. 
12624
12625         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12626         not crash in methods like MemberLookupFailed that use this field.  
12627
12628         This problem arises when the compiler fails to resolve a type
12629         during interface type definition for example.
12630
12631 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12634         inherit from System.Object, so we have to stop at null, not only
12635         when reaching System.Object.
12636
12637 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12640         DeclaredOnly because the parent indexer might have had a different
12641         name, but did not loop until the top of the hierarchy was reached.
12642
12643         The problem this one fixes is 35492: when a class implemented an
12644         indexer from an interface, we were getting the interface method
12645         (which was abstract) and we were flagging an error (can not invoke
12646         abstract method).
12647
12648         This also keeps bug 33089 functioning, and test-148 functioning.
12649
12650         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12651         out if a method is special is to see if it is declared in a
12652         property or event, or whether it is one of the predefined operator
12653         names.   This should fix correctly #36804.
12654
12655 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12656
12657         The goal here is to remove the dependency on EmptyCast.Peel ().
12658         Killing it completely.
12659
12660         The problem is that currently in a number of places where
12661         constants are expected, we have to "probe" for an EmptyCast, and
12662         Peel, which is not the correct thing to do, as this will be
12663         repetitive and will likely lead to errors. 
12664
12665         The idea is to remove any EmptyCasts that are used in casts that
12666         can be reduced to constants, so we only have to cope with
12667         constants. 
12668
12669         This bug hunt was triggered by Bug 37363 and the desire to remove
12670         the duplicate pattern where we were "peeling" emptycasts to check
12671         whether they were constants.  Now constants will always be
12672         constants.
12673
12674         * ecore.cs: Use an enumconstant here instead of wrapping with
12675         EmptyCast.  
12676
12677         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12678         throwing me off.  By handling this we can get rid of a few hacks.
12679
12680         * statement.cs (Switch): Removed Peel() code.
12681
12682 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12683
12684         * class.cs: Location information for error 508
12685
12686         * expression.cs (New.DoResolve): Add a guard against double
12687         resolution of an expression.  
12688
12689         The New DoResolve might be called twice when initializing field
12690         expressions (see EmitFieldInitializers, the call to
12691         GetInitializerExpression will perform a resolve on the expression,
12692         and later the assign will trigger another resolution
12693
12694         This leads to bugs (#37014)
12695
12696         * delegate.cs: The signature for EndInvoke should contain any ref
12697         or out parameters as well.  We were not doing this in the past. 
12698
12699         * class.cs (Field.Define): Do not overwrite the type definition
12700         inside the `volatile' group.  Turns out that volatile enumerations
12701         were changing the type here to perform a validity test, which
12702         broke conversions. 
12703
12704 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12705
12706         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12707         and structs, we do not want to load the instance variable
12708
12709         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12710         enum_type has to be handled like an object reference (implicit
12711         conversions exists from this to object), but the regular IsClass
12712         and IsValueType tests will never return true for this one.
12713
12714         Also we use TypeManager.IsValueType instead of type.IsValueType,
12715         just for consistency with the rest of the code (this is only
12716         needed if we ever use the construct exposed by test-180.cs inside
12717         corlib, which we dont today).
12718
12719 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12720
12721         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12722         just InternalCall.
12723
12724 2003-02-09  Martin Baulig  <martin@ximian.com>
12725
12726         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12727         (Namespace.DefineNamespaces): New static public method; this is
12728         called when we're compiling with debugging to add all namespaces
12729         to the symbol file.
12730
12731         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12732         pass it to the Namespace's .ctor.
12733
12734         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12735         and MethodBase arguments; pass the namespace ID to the symwriter;
12736         pass the MethodBase instead of the token to the symwriter.
12737         (SymbolWriter.DefineNamespace): New method to add a namespace to
12738         the symbol file.
12739
12740 2003-02-09  Martin Baulig  <martin@ximian.com>
12741
12742         * symbolwriter.cs: New file.  This is a wrapper around
12743         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12744         methods here in near future.
12745
12746 2003-02-09  Martin Baulig  <martin@ximian.com>
12747
12748         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12749         ILGenerator.MarkSequencePoint() which are actually used by the
12750         symbol writer.
12751
12752 2003-02-09  Martin Baulig  <martin@ximian.com>
12753
12754         * location.cs (SourceFile): New public sealed class.  This
12755         contains the name and an index which is used in the location's token.
12756         (Location): Reserve an appropriate number of bits in the token for
12757         the source file instead of walking over that list, this gives us a
12758         really huge performance improvement when compiling with debugging.
12759
12760         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12761         `SourceFile' argument instead of a string.
12762         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12763         but don't parse/tokenize here, we need to generate the list of all
12764         source files before we do that.
12765         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12766         the files.
12767
12768         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12769         instead of a string.
12770
12771         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12772         of a string.
12773
12774 2003-02-09  Martin Baulig  <martin@ximian.com>
12775
12776         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12777         filename on `#line default'.
12778
12779 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12780
12781         * statement.cs: don't clear the pinned var when the fixed statement
12782         returns from the method (fixes bug#37752).
12783
12784 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12785
12786         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12787         to IsValueType.
12788
12789 2003-02-07  Martin Baulig  <martin@ximian.com>
12790
12791         * driver.cs: Removed the `--debug-args' command line argument.
12792
12793         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12794         automatically by the AsssemblyBuilder.
12795         (CodeGen.InitializeSymbolWriter): We don't need to call any
12796         initialization function on the symbol writer anymore.  This method
12797         doesn't take any arguments.
12798
12799 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12800
12801         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12802         from referenced assemblies as well.
12803
12804 2003-02-02  Martin Baulig  <martin@ximian.com>
12805
12806         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12807
12808 2003-02-02  Martin Baulig  <martin@ximian.com>
12809
12810         * class.cs (Constructor.Emit): Open the symbol writer before
12811         emitting the constructor initializer.
12812         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12813         single-stepping through constructor initializers.
12814
12815 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12816
12817         * class.cs: Handle error 549: do not allow virtual methods in
12818         sealed classes. 
12819
12820 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12821
12822         * decl.cs: Check access levels when resolving types
12823
12824 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12825
12826         * statement.cs: Add parameters and locals set in catch blocks that might 
12827         return to set vector
12828
12829 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12830
12831         * class.cs (Operator): Set the SpecialName flags for operators.
12832
12833         * expression.cs (Invocation.DoResolve): Only block calls to
12834         accessors and operators on SpecialName methods.
12835
12836         (Cast.TryReduce): Handle conversions from char constants.
12837
12838
12839 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12840
12841         * statement.cs: small memory and time optimization in FlowBranching.
12842
12843 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12844
12845         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12846         problem that the last fix but in the other sid (Set).
12847
12848         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12849         access when there is no indexer in the hierarchy.
12850
12851 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12852
12853         * class.cs: Combine some if statements.
12854
12855 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12856
12857         * driver.cs: fixed bug #37187.
12858
12859 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12860
12861         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12862         any indexer, it's needed to build a list with all the indexers in the
12863         hierarchy (AllGetters), else we have problems. Fixes #35653.
12864
12865 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12866
12867         * class.cs (MethodData.Define): It is wrong for an interface
12868         implementation to be static in both cases: explicit and implicit.
12869         We were only handling this in one case.
12870
12871         Improve the if situation there to not have negations.
12872
12873         * class.cs (Field.Define): Turns out that we do not need to check
12874         the unsafe bit on field definition, only on usage.  Remove the test.
12875
12876 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12877
12878         * driver.cs: use assembly.Location instead of Codebase (the latest
12879         patch made mcs fail when using MS assemblies).
12880
12881 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12882
12883         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12884         get the path to *corlib.dll.
12885
12886 2003-01-21  Nick Drochak <ndrochak@gol.com>
12887
12888         * cs-tokenizer.cs:
12889         * pending.cs:
12890         * typemanager.cs: Remove compiler warnings
12891
12892 2003-01-20  Duncan Mak  <duncan@ximian.com>
12893
12894         * AssemblyInfo.cs: Bump the version number to 0.19.
12895
12896 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12897
12898         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12899
12900 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12901
12902         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12903
12904 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12905
12906         * cs-parser.jay: Small fix: we were not comparing the constructor
12907         name correctly.   Thanks to Zoltan for the initial pointer.
12908
12909 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12910
12911         * cs-tokenizer.cs: Set file name when specified with #line
12912
12913 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12914
12915         * cs-parser.jay: Only perform the constructor checks here if we
12916         are named like the class;  This will help provider a better
12917         error.  The constructor path is taken when a type definition is
12918         not found, but most likely the user forgot to add the type, so
12919         report that rather than the constructor error.
12920
12921 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12922
12923         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12924         allocations.
12925
12926 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12927
12928         * cs-parser.jay: Add cleanup call.
12929
12930 2003-01-13  Duncan Mak  <duncan@ximian.com>
12931
12932         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12933         consistent with other methods.
12934
12935 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12936
12937         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12938
12939 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12940
12941         * attribute.cs: only set GuidAttr to true when we have a
12942         GuidAttribute.
12943
12944 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12945
12946         * ecore.cs:
12947         * expression.cs:
12948         * typemanager.cs: fixes to allow mcs compile corlib with the new
12949         Type.IsSubclassOf fix.
12950
12951 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * expression.cs (LocalVariableReference.DoResolve): Classify a
12954         constant as a value, not as a variable.   Also, set the type for
12955         the variable.
12956
12957         * cs-parser.jay (fixed_statement): take a type instead of a
12958         pointer_type, so we can produce a better error message later.
12959
12960         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12961         as an error.  
12962
12963         (For.DoEmit): Make inifinite loops have a
12964         non-conditional branch back.
12965
12966         (Fixed.DoEmit): First populate the pinned variables, then emit the
12967         statement, then clear the variables.  Before I was emitting the
12968         code once for each fixed piece.
12969
12970
12971 2003-01-08  Martin Baulig  <martin@ximian.com>
12972
12973         * statement.cs (FlowBranching.MergeChild): A break in a
12974         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12975
12976 2003-01-08  Martin Baulig  <martin@ximian.com>
12977
12978         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12979         lives in the same number space than `param_map'.  Fixes #36154.
12980
12981 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12982
12983         * cs-parser.jay (constructor_declaration): Set the
12984         Constructor.ModFlags before probing for it.  This makes the
12985         compiler report 514, 515 and 132 (the code was there, but got
12986         broken). 
12987
12988         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12989         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12990         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12991
12992 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12993
12994         * enum.cs: create the enum static fields using the enum type.
12995
12996 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12997
12998         * class.cs: don't try to create the ParamBuilder for the return
12999         type if it's not needed (and handle it breaking for the ms runtime
13000         anyway).
13001
13002 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13003
13004         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13005
13006 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13007
13008         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13009         the command.   This showed up while compiling the JANET source
13010         code, which used \r as its only newline separator.
13011
13012 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13013
13014         * class.cs (Method.Define): If we are an operator (because it
13015         reuses our code), then set the SpecialName and HideBySig.  #36128
13016
13017 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13018
13019         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13020         exception, report error 120 `object reference required'.
13021
13022         * driver.cs: Add --pause option, used during to measure the size
13023         of the process as it goes with --timestamp.
13024
13025         * expression.cs (Invocation.DoResolve): Do not allow methods with
13026         SpecialName to be invoked.
13027
13028 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13031         number before adding it.
13032
13033 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13034
13035         * ecore.cs (StandardImplicitConversion): When in an unsafe
13036         context, we allow conversion between void * to any other pointer
13037         type. This fixes bug #35973.
13038
13039 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13040
13041         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13042         is not thrown when extensionless outputs are used 
13043
13044 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13045
13046         * rootcontext.cs: fixed compilation of corlib.
13047
13048 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13049
13050         * attribute.cs (Attributes.Contains): Add new method.
13051
13052         * class.cs (MethodCore.LabelParameters): if the parameter is an
13053         `out' parameter, check that no attribute `[In]' has been passed.
13054
13055         * enum.cs: Handle the `value__' name in an enumeration.
13056
13057 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13058
13059         * decl.cs: Added special case to allow overrides on "protected
13060         internal" methods
13061
13062 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13063
13064         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13065         since it makes much more sense.
13066
13067         (Attributes.ctor): Don't require a Location parameter.
13068
13069         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13070
13071         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13072         since we already have that information per attribute.
13073
13074         * everywhere : make appropriate changes.
13075
13076         * class.cs (LabelParameters): Write the code which actually
13077         applies attributes to the return type. We can't do this on the MS
13078         .NET runtime so we flag a warning in the case an exception is
13079         thrown.
13080
13081 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * const.cs: Handle implicit null conversions here too.
13084
13085 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13086
13087         * class.cs (MethodCore.LabelParameters): Remove the extra
13088         Type [] parameter since it is completely unnecessary. Instead
13089         pass in the method's attributes so that we can extract
13090         the "return" attribute.
13091
13092 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13095         of ignoring it and letting the compile continue.
13096
13097         * typemanager.cs (ChangeType): use an extra argument to return an
13098         error condition instead of throwing an exception.
13099
13100 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13101
13102         * expression.cs (Unary.TryReduce): mimic the code for the regular
13103         code path.  Perform an implicit cast in the cases where we can
13104         implicitly convert to one of the integral types, and then reduce
13105         based on that constant.   This fixes bug #35483.
13106
13107 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13108
13109         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13110
13111 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13112
13113         * namespace.cs: fixed bug #35489.
13114
13115 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * class.cs: Remove some dead code.
13118
13119         * cs-parser.jay: Estimate the number of methods needed
13120         (RootContext.MethodCount);
13121
13122         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13123         numbers instead of StringBuilders.
13124
13125         * support.cs (PtrHashtable): Add constructor with initial size;
13126         We can now reduce reallocations of the method table.
13127
13128 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13129
13130         * attribute.cs (ApplyAttributes): Keep track of the emitted
13131         attributes on a per-target basis. This fixes bug #35413.
13132
13133 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13134
13135         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13136         default to the Windows 1252 encoding.
13137
13138         (UnixParseOption): Support version, thanks to Alp for the missing
13139         pointer. 
13140
13141         * AssemblyInfo.cs: Add nice assembly information.
13142
13143         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13144         (bug 35169).
13145
13146         * cs-parser.jay: Allow a trailing comma before the close bracked
13147         in the attribute_section production.
13148
13149         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13150         address of the instance was being taken, I will take this out,
13151         because we take the address of the object immediately here.
13152
13153 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13154
13155         * typemanager.cs (AreMultipleAllowed): Take care of the most
13156         obvious case where attribute type is not in the current assembly -
13157         stupid me ;-)
13158
13159 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13162         definitions, instead of doing that afterwards.  
13163
13164         Also we use a nice little hack, depending on the constructor, we
13165         know if we are a "composed" name or a simple name.  Hence, we
13166         avoid the IndexOf test, and we avoid 
13167
13168         * codegen.cs: Add code to assist in a bug reporter to track down
13169         the source of a compiler crash. 
13170
13171 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13172
13173         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13174         types have been emitted for a given element and flag an error
13175         if something which does not have AllowMultiple set is used more
13176         than once.
13177
13178         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13179         attribute types and their corresponding AllowMultiple properties
13180
13181         (AreMultipleAllowed): Check the property for a given type.
13182
13183         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13184         property in the case we have a TypeContainer.
13185
13186         (Attributes.AddAttribute): Detect duplicates and just skip on
13187         adding them. This trivial fix catches a pretty gross error in our
13188         attribute emission - global attributes were being emitted twice!
13189
13190         Bugzilla bug #33187 is now fixed.
13191
13192 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13193
13194         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13195         instead of pp_and).
13196
13197         * expression.cs (Binary.ResolveOperator): I can only use the
13198         Concat (string, string, string) and Concat (string, string,
13199         string, string) if the child is actually a concatenation of
13200         strings. 
13201
13202 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13205         context where we need a 2-character lookahead.
13206
13207         * pending.cs (PendingImplementation): Rework so we can keep track
13208         of interface types all the time, and flag those which were
13209         implemented by parents as optional.
13210
13211 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13212
13213         * expression.cs (Binary.ResolveOperator): Use
13214         String.Concat(string,string,string) or
13215         String.Concat(string,string,string,string) when possible. 
13216
13217         * typemanager: More helper methods.
13218
13219
13220 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13221
13222         * pending.cs: remove the bogus return from GetMissingInterfaces()
13223         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13224
13225 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13226
13227         * namespace.cs: avoid duplicated 'using xxx' being added to
13228         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13229         when we get more than one 'using' statement for the same namespace.
13230         Report a CS0105 warning for it.
13231
13232 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13233
13234         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13235         of calling getChar/putback, uses internal knowledge of it.    
13236
13237         (xtoken): Reorder tokenizer so most common patterns are checked
13238         first.  This reduces the compilation time in another 5% (from 8.11s
13239         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13240
13241         The parsing time is 22% of the compilation in mcs, and from that
13242         64% is spent on the tokenization process.  
13243
13244         I tried using a binary search for keywords, but this is slower
13245         than the hashtable.  Another option would be to do a couple of
13246         things:
13247
13248                 * Not use a StringBuilder, instead use an array of chars,
13249                   with a set value.  Notice that this way we could catch
13250                   the 645 error without having to do it *afterwards*.
13251
13252                 * We could write a hand-parser to avoid the hashtable
13253                   compares altogether.
13254
13255         The identifier consumption process takes 37% of the tokenization
13256         time.  Another 15% is spent on is_number.  56% of the time spent
13257         on is_number is spent on Int64.Parse:
13258
13259                 * We could probably choose based on the string length to
13260                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13261                   computations. 
13262
13263         Another 3% is spend on wrapping `xtoken' in the `token' function.
13264
13265         Handle 0xa0 as whitespace (#34752)
13266
13267 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13268
13269         * typemanager.cs (IsCLRType): New routine to tell whether a type
13270         is one of the builtin types.  
13271
13272         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13273         typecode in more places instead of doing pointer comparissions.
13274         We could leverage some knowledge about the way the typecodes are
13275         laid out.
13276
13277         New code to cache namespaces in assemblies, it is currently not
13278         invoked, to be used soon.
13279
13280         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13281
13282         * expression.cs (Binary.ResolveOperator): specially handle
13283         strings, and do not perform user-defined operator overloading for
13284         built-in types.
13285
13286 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13287
13288         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13289         internalcall as it is a pretty simple operation;  Avoid whenever
13290         possible to call Char.IsLetter.
13291
13292         (consume_identifier): Cut by half the number of
13293         hashtable calls by merging the is_keyword and GetKeyword behavior.
13294
13295         Do not short-circuit, because if we do, we
13296         report errors (ie, #if false && true would produce an invalid
13297         directive error);
13298
13299
13300 2002-11-24  Martin Baulig  <martin@ximian.com>
13301
13302         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13303         check constant ranges and report a CS0221.  Fixes #33186.
13304
13305 2002-11-24  Martin Baulig  <martin@ximian.com>
13306
13307         * cs-parser.jay: Make this work for uninitialized variable
13308         declarations in the `for' initializer.  Fixes #32416.
13309
13310 2002-11-24  Martin Baulig  <martin@ximian.com>
13311
13312         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13313         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13314
13315 2002-11-24  Martin Baulig  <martin@ximian.com>
13316
13317         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13318         argument; if true, we also check for user-defined conversions.
13319         This is only needed if both arguments are of a user-defined type.
13320         Fixes #30443, added test-175.cs.
13321         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13322
13323         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13324
13325 2002-11-24  Martin Baulig  <martin@ximian.com>
13326
13327         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13328         function to get the store opcode.
13329         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13330         only emit the Ldelema if the store opcode is Stobj.  You must run
13331         both test-34 and test-167 to test this.  Fixes #34529.
13332
13333 2002-11-23  Martin Baulig  <martin@ximian.com>
13334
13335         * ecore.cs (Expression.MemberLookup): Added additional
13336         `qualifier_type' argument which is used when we're being called
13337         from MemberAccess.DoResolve() and null if we're called from a
13338         SimpleName lookup.
13339         (Expression.MemberLookupFailed): New method to report errors; this
13340         does the CS1540 check and reports the correct error message.
13341
13342         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13343         argument for the CS1540 check and redone the way how we're dealing
13344         with private members.  See the comment in the source code for details.
13345         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13346         `closure_start_type' to `closure_qualifier_type' and check whether
13347         it's not null.  It was not this filter being broken, it was just
13348         being called with the wrong arguments.
13349
13350         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13351         and pass it the correct `qualifier_type'; this also does the error
13352         handling for us.
13353
13354 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13355
13356         * expression.cs (Invocation.EmitParams): If the we are dealing
13357         with a non-built-in value type, load its address as well.
13358
13359         (ArrayCreation): Use a a pretty constant instead
13360         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13361         static initializers.  
13362
13363         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13364         because they are not really value types, just glorified integers. 
13365
13366         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13367
13368         * ecore.cs: Remove redundant code for enumerations, make them use
13369         the same code path as everything else, fixes the casting issue
13370         with enumerations in Windows.Forms.
13371
13372         * attribute.cs: Do only cast to string if it is a string, the
13373         validation happens later.
13374
13375         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13376         people upgrade their corlibs.
13377
13378         * ecore.cs: Oops, enumerations were not following the entire code path
13379
13380 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13381
13382         * typemanager.cs (FilterWithClosure): Commented out the test for
13383         1540 in typemanager.cs, as it has problems when accessing
13384         protected methods from a parent class (see test-174.cs). 
13385
13386         * attribute.cs (Attribute.ValidateGuid): new method.
13387         (Attribute.Resolve): Use above.
13388
13389 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13390
13391         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13392
13393         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13394         handling for enumerations, as we only needed the TypeContainer
13395         functionality to begin with (this is required for the fix below to
13396         work for enums that reference constants in a container class for
13397         example). 
13398
13399         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13400
13401         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13402         a valid TypeBuilder to perform lookups on.o
13403
13404         * class.cs (InheritableMemberSignatureCompare): Use true in the
13405         call to GetGetMethod and GetSetMethod, because we are comparing
13406         the signature, and we need to get the methods *even* if they are
13407         private. 
13408
13409         (PropertyBase.CheckBase): ditto.
13410
13411         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13412         GotoCase.Resolve): Use Peel on EmpytCasts.
13413
13414         * ecore.cs (EmptyCast): drop child, add Peel method.
13415
13416 2002-11-17  Martin Baulig  <martin@ximian.com>
13417
13418         * ecore.cs (EmptyCast.Child): New public property.
13419
13420         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13421         label resolved to an EmptyCast.  Fixes #34162.
13422         (GotoCase.Resolve): Likewise.
13423         (Block.EmitMeta): Likewise.
13424
13425 2002-11-17  Martin Baulig  <martin@ximian.com>
13426
13427         * expression.cs (Invocation.BetterConversion): Prefer int over
13428         uint; short over ushort; long over ulong for integer literals.
13429         Use ImplicitConversionExists instead of StandardConversionExists
13430         since we also need to check for user-defined implicit conversions.
13431         Fixes #34165.  Added test-173.cs.
13432
13433 2002-11-16  Martin Baulig  <martin@ximian.com>
13434
13435         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13436         with the `true' and `false' literals.  Fixes #33151.
13437
13438 2002-11-16  Martin Baulig  <martin@ximian.com>
13439
13440         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13441         October 22nd; don't do the cs1540 check for static members.
13442
13443         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13444         now using our own filter here and doing the cs1540 check again.
13445
13446 2002-11-16  Martin Baulig  <martin@ximian.com>
13447
13448         * support.cs (InternalParameters): Don't crash if we don't have
13449         any fixed parameters.  Fixes #33532.
13450
13451 2002-11-16  Martin Baulig  <martin@ximian.com>
13452
13453         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13454         when looking up static methods to make this work on Windows.
13455         Fixes #33773.
13456
13457 2002-11-16  Martin Baulig  <martin@ximian.com>
13458
13459         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13460         a setter rather than using PropertyInfo.CanWrite.
13461
13462 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13463
13464         * class.cs: Allow acces to block member by subclasses. Fixes build
13465         breaker.
13466
13467 2002-11-14  Martin Baulig  <martin@ximian.com>
13468
13469         * class.cs (Constructor.Emit): Added the extern/block check.
13470         Fixes bug #33678.
13471
13472 2002-11-14  Martin Baulig  <martin@ximian.com>
13473
13474         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13475         iteration while looking for indexers, this is needed because the
13476         indexer may have a different name in our base classes.  Fixed the
13477         error reporting (no indexers at all, not get accessor, no
13478         overloaded match).  Fixes bug #33089.
13479         (IndexerAccess.DoResolveLValue): Likewise.
13480
13481 2002-11-14  Martin Baulig  <martin@ximian.com>
13482
13483         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13484         indexers.  Fixes the first part of bug #33089.
13485         (MethodSignature.InheritableMemberSignatureCompare): Added support
13486         for properties.
13487
13488 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13489
13490         * attribute.cs (Attribute.Resolve): Catch the
13491         NullReferenceException and report it since it isn't supposed to
13492         happen. 
13493
13494 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13495
13496         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13497         LogicalOr and LogicalAnd that can benefit from recursively
13498         handling EmitBranchable.  The code now should be nice for Paolo.
13499
13500 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13501
13502         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13503         the Type lookups, as we perform quite a number of lookups on
13504         non-Types.  This can be removed once we can deterministically tell
13505         whether we have a type or a namespace in advance.
13506
13507         But this might require special hacks from our corlib.
13508
13509         * TODO: updated.
13510
13511         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13512         and double which avoids a conversion from an integer to a double.
13513
13514         * expression.cs: tiny optimization, avoid calling IsConstant,
13515         because it effectively performs the lookup twice.
13516
13517 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13518
13519         But a bogus return here to keep the semantics of the old code
13520         until the Mono runtime is fixed.
13521
13522         * pending.cs (GetMissingInterfaces): New method used to remove all
13523         the interfaces that are already implemented by our parent
13524         classes from the list of pending methods. 
13525
13526         * interface.cs: Add checks for calls after ResolveTypeExpr.
13527
13528 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * class.cs (Class.Emit): Report warning 67: event not used if the
13531         warning level is beyond 3.
13532
13533         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13534         being a NullLiteral.
13535
13536         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13537         specifiers. 
13538
13539         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13540         path that might fail if a type can not be resolved.
13541
13542         * expression.cs (Binary.Emit): Emit unsigned versions of the
13543         operators. 
13544
13545         * driver.cs: use error 5.
13546
13547 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13548
13549         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13550
13551 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * cs-parser.jay (switch_section): A beautiful patch from Martin
13554         Baulig that fixed 33094.
13555
13556 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13557
13558         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13559         Check whether the base is abstract and report an error if so.
13560
13561         * expression.cs (IndexerAccess.DoResolveLValue,
13562         IndexerAccess.DoResolve): ditto. 
13563
13564         (Invocation.DoResolve): ditto.
13565
13566         (Invocation.FullMethodDesc): Improve the report string.
13567
13568         * statement.cs (Block): Eliminate IsVariableDefined as it is
13569         basically just a wrapper for GetVariableInfo.
13570
13571         * ecore.cs (SimpleName): Use new 
13572
13573         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13574         type, as we return the actual parameter ref/unref state on a
13575         different call.
13576
13577 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13578
13579         * support.cs: Return proper flags REF/OUT fixing the previous
13580         commit.  
13581
13582         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13583         not used to mean `ref' but `ref or out' in ParameterReference
13584
13585         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13586         full type signature instead of calling TypeManger.CSharpName
13587         ourselves. 
13588
13589         * support.cs (InternalParameters.ParameterDesc): Do not compare
13590         directly to the modflags, because REF/OUT will actually be bitsets
13591         if set. 
13592
13593         * delegate.cs (VerifyMethod): Check also the modifiers.
13594
13595         * cs-tokenizer.cs: Fix bug where floating point values with an
13596         exponent where a sign was missing was ignored.
13597
13598         * driver.cs: Allow multiple assemblies to be specified in a single
13599         /r: argument
13600
13601 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13602
13603         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13604         because identifiers after a parenthesis would end up in this kind
13605         of production, and we needed to desamiguate it for having casts
13606         like:
13607
13608                 (UserDefinedType *) xxx
13609
13610 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13613         we should set on the Bindingflags.NonPublic, but not turn on
13614         private_ok.  private_ok controls whether a Private member is
13615         returned (this is chekced on the filter routine), while the
13616         BindingFlags.NonPublic just controls whether private/protected
13617         will be allowed.   This fixes the problem part of the problem of
13618         private properties being allowed to be used in derived classes.
13619
13620         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13621         so we can call the children DoResolveLValue method (this will
13622         properly signal errors on lvalue assignments to base properties)
13623
13624         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13625         getter are null, and we have a property info, we know that this
13626         happened because the lookup failed, so we report an error 122 for
13627         protection level violation.
13628
13629         We also silently return if setter and getter are null in the
13630         resolve functions, this condition only happens if we have flagged
13631         the error before.  This is the other half of the problem. 
13632
13633         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13634         not have accessibility information, that is why we were returning
13635         true in the filter function in typemanager.cs.
13636
13637         To properly report 122 (property is inaccessible because of its
13638         protection level) correctly, we report this error in ResolveAccess
13639         by failing if both the setter and the getter are lacking (ie, the
13640         lookup failed). 
13641
13642         DoResolve and DoLResolve have been modified to check for both
13643         setter/getter being null and returning silently, the reason being
13644         that I did not want to put the knowledge about this error in upper
13645         layers, like:
13646
13647         int old = Report.Errors;
13648         x = new PropertyExpr (...);
13649         if (old != Report.Errors)
13650                 return null;
13651         else
13652                 return x;
13653
13654         So the property expr is returned, but it is invalid, so the error
13655         will be flagged during the resolve process. 
13656
13657         * class.cs: Remove InheritablePropertySignatureCompare from the
13658         class, as we no longer depend on the property signature to compute
13659         whether it is possible to implement a method or not.
13660
13661         The reason is that calling PropertyInfo.GetGetMethod will return
13662         null (in .NET, in Mono it works, and we should change this), in
13663         cases where the Get Method does not exist in that particular
13664         class.
13665
13666         So this code:
13667
13668         class X { public virtual int A { get { return 1; } } }
13669         class Y : X { }
13670         class Z : Y { public override int A { get { return 2; } } }
13671
13672         Would fail in Z because the parent (Y) would not have the property
13673         defined.  So we avoid this completely now (because the alternative
13674         fix was ugly and slow), and we now depend exclusively on the
13675         method names.
13676
13677         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13678         reference method, instead of using the property.
13679
13680         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13681         routines are gone now.
13682
13683         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13684         names, they were incorrectly named.
13685
13686         * cs-tokenizer.cs: Return are more gentle token on failure. 
13687
13688         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13689         had an out-of-sync index variable, which caused it to remove from
13690         the list of pending methods the wrong method sometimes.
13691
13692 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13695         CanWrite, because those refer to this particular instance of the
13696         property, and do not take into account the fact that we can
13697         override single members of a property.
13698
13699         Constructor requires an EmitContext.  The resolution process does
13700         not happen here, but we need to compute the accessors before,
13701         because the resolution does not always happen for properties.
13702
13703         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13704         subclass, before we did not update this flag, but we did update
13705         bindingflags. 
13706
13707         (GetAccessors): Drop this routine, as it did not work in the
13708         presence of partially overwritten set/get methods. 
13709
13710         Notice that this broke the cs1540 detection, but that will require
13711         more thinking. 
13712
13713 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13714
13715         * class.cs:
13716         * codegen.cs:
13717         * driver.cs: issue a warning instead of an error if we don't support
13718         debugging for the platform. Also ignore a couple of errors that may
13719         arise when trying to write the symbols. Undo my previous patch.
13720
13721 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13722
13723         * driver.cs: ignore /debug switch except for Unix platforms.
13724
13725 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13726
13727         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13728
13729 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13730
13731         * driver.cs: Do not make mcs-debug conditional, so we do not break
13732         builds that use it.
13733
13734         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13735         review this patch.  But basically after all the children variables
13736         have been merged, the value of "Breaks" was not being set to
13737         new_breaks for Switch blocks.  I think that it should be set after
13738         it has executed.  Currently I set this to the value of new_breaks,
13739         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13740         conservative, but I do not understand this code very well.
13741
13742         I did not break anything in the build, so that is good ;-)
13743
13744         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13745
13746 2002-10-20  Mark Crichton  <crichton@gimp.org>
13747
13748         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13749
13750 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13751
13752         * cfold.cs: Fixed compile blocker.
13753
13754 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13755
13756         * driver.cs: I was chekcing the key, not the file.
13757
13758 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13759
13760         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13761         message that we were generating - we just need to silently return
13762         a null.
13763
13764 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13765
13766         * class.cs (Event.Define): Change my previous commit, as this
13767         breaks the debugger.  This is a temporary hack, as it seems like
13768         the compiler is generating events incorrectly to begin with.
13769
13770         * expression.cs (Binary.ResolveOperator): Added support for 
13771         "U operator - (E x, E y)"
13772
13773         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13774         y)".
13775
13776         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13777         init-only variables, but this path did not take into account that
13778         there might be also instance readonly variables.  Correct this
13779         problem. 
13780
13781         This fixes bug 32253
13782
13783         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13784         delegates as well.
13785
13786         * driver.cs: Change the extension for modules to `netmodule'
13787
13788         * cs-parser.jay: Improved slightly the location tracking for
13789         the debugger symbols.
13790
13791         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13792         modifiers that were specified instead of the hardcoded value
13793         (FamAndAssem).  This was basically ignoring the static modifier,
13794         and others.  Fixes 32429.
13795
13796         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13797         fixed a bug in the process (32476)
13798
13799         * expression.cs (ArrayAccess.EmitAssign): Patch from
13800         hwang_rob@yahoo.ca that fixes bug 31834.3
13801
13802 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13803
13804         * driver.cs: Make the module extension .netmodule.
13805
13806 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * driver.cs: Report an error if the resource file is not found
13809         instead of crashing.
13810
13811         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13812         false, like Emit does.
13813
13814 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13815
13816         * typemanager.cs: Remove unused private member.  Also reported mcs
13817         bug to report this as a warning like csc.
13818
13819 2002-10-15  Martin Baulig  <martin@gnome.org>
13820
13821         * statement.cs (Statement.Emit): Made this a virtual method; emits
13822         the line number info and calls DoEmit().
13823         (Statement.DoEmit): New protected abstract method, formerly knows
13824         as Statement.Emit().
13825
13826         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13827
13828 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13831         have fixed a remaining problem: not every AddXXXX was adding a
13832         fully qualified name.  
13833
13834         Now everyone registers a fully qualified name in the DeclSpace as
13835         being defined instead of the partial name.  
13836
13837         Downsides: we are slower than we need to be due to the excess
13838         copies and the names being registered this way.  
13839
13840         The reason for this is that we currently depend (on the corlib
13841         bootstrap for instance) that types are fully qualified, because
13842         we dump all the types in the namespace, and we should really have
13843         types inserted into the proper namespace, so we can only store the
13844         basenames in the defined_names array.
13845
13846 2002-10-10  Martin Baulig  <martin@gnome.org>
13847
13848         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13849         from bug #31834, see the bug report for a testcase which is
13850         miscompiled.
13851
13852 2002-10-10  Martin Baulig  <martin@gnome.org>
13853
13854         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13855         flow analysis code for this.
13856
13857         * statement.cs (Do, While, For): Tell the flow analysis code about
13858         infinite loops.
13859         (FlowBranching.UsageVector): Added support for infinite loops.
13860         (Block.Resolve): Moved the dead code elimination here and use flow
13861         analysis to do it.
13862
13863 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * class.cs (Field.Define): Catch cycles on struct type
13866         definitions. 
13867
13868         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13869         fields if the fields are static.  We only need to check instance
13870         fields. 
13871
13872         * expression.cs (As.DoResolve): Test for reference type.
13873
13874         * statement.cs (Using.ResolveExpression): Use
13875         ConvertImplicitRequired, not ConvertImplicit which reports an
13876         error on failture
13877         (Using.ResolveLocalVariableDecls): ditto.
13878
13879         * expression.cs (Binary.ResolveOperator): Report errors in a few
13880         places where we had to.
13881
13882         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13883
13884 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * expression.cs: Use StoreFromPtr instead of extracting the type
13887         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13888
13889         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13890         an enumeration value to a System.Enum, but System.Enum is not a
13891         value type, but an class type, so we need to box.
13892
13893         (Expression.ConvertExplicit): One codepath could return
13894         errors but not flag them.  Fix this.  Fixes #31853
13895
13896         * parameter.cs (Resolve): Do not allow void as a parameter type.
13897
13898 2002-10-06  Martin Baulig  <martin@gnome.org>
13899
13900         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13901         if it's a class type and not a struct.  Fixes #31815.
13902
13903 2002-10-06  Martin Baulig  <martin@gnome.org>
13904
13905         * statement.cs: Reworked the flow analysis code a bit to make it
13906         usable for dead code elimination.
13907
13908 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13909
13910         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13911
13912 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13915         to fix the test 165, will investigate deeper.
13916
13917 2002-10-04  Martin Baulig  <martin@gnome.org>
13918
13919         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13920         finally blocks actually work.
13921         (Try.Resolve): We don't need to create a sibling for `finally' if
13922         there is no finally block.
13923
13924 2002-10-04  Martin Baulig  <martin@gnome.org>
13925
13926         * class.cs (Constructor.Define): The default accessibility for a
13927         non-default constructor is private, not public.
13928
13929 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13930
13931         * class.cs (Constructor): Make AllowedModifiers public, add
13932         EXTERN.
13933
13934         * cs-parser.jay: Perform the modifiers test here, as the
13935         constructor for the Constructor class usually receives a zero
13936         because of the way we create it (first we create, later we
13937         customize, and we were never checking the modifiers).
13938
13939         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13940         is a version of LookupTypeReflection that includes the type-name
13941         cache.  This can be used as a fast path for functions that know
13942         the fully qualified name and are only calling into *.GetType() to
13943         obtain a composed type.
13944
13945         This is also used by TypeManager.LookupType during its type
13946         composition.
13947
13948         (LookupType): We now also track the real type name, as sometimes
13949         we can get a quey for the real type name from things like
13950         ComposedCast.  This fixes bug 31422.
13951
13952         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13953         complete type fullname, it does not have to go through the type
13954         resolution system to obtain the composed version of the type (for
13955         obtaining arrays or pointers).
13956
13957         (Conditional.Emit): Use the EmitBoolExpression to
13958         generate nicer code, as requested by Paolo.
13959
13960         (ArrayCreation.CheckIndices): Use the patch from
13961         hwang_rob@yahoo.ca to validate the array initializers. 
13962
13963 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * class.cs (ConstructorInitializer.Emit): simplify code by using
13966         Invocation.EmitCall, and at the same time, fix the bugs in calling
13967         parent constructors that took variable arguments. 
13968
13969         * ecore.cs (Expression.ConvertNumericExplicit,
13970         Expression.ImplicitNumericConversion): Remove the code that
13971         manually wrapped decimal (InternalTypeConstructor call is now gone
13972         as well).
13973
13974         * expression.cs (Cast.TryReduce): Also handle decimal types when
13975         trying to perform a constant fold on the type.
13976
13977         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13978
13979         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13980         that only turned off an error report, and did nothing else. 
13981
13982 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * driver.cs: Handle and ignore /fullpaths
13985
13986 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13987
13988         * expression.cs (Binary.ResolveOperator): Catch the case where
13989         DoNumericPromotions returns true, 
13990
13991         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13992
13993 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13994
13995         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13996         report error 70.
13997
13998 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13999
14000         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14001         conversion exists, but it is also required that the conversion be
14002         performed.  This manifested in "(Type64Enum) 2".  
14003
14004         * class.cs (TypeManager.AddMethod): The fix is not to change
14005         AddEnum, because that one was using a fully qualified name (every
14006         DeclSpace derivative does), but to change the AddMethod routine
14007         that was using an un-namespaced name.  This now correctly reports
14008         the duplicated name.
14009
14010         Revert patch until I can properly fix it.  The issue
14011         is that we have a shared Type space across all namespaces
14012         currently, which is wrong.
14013
14014         Options include making the Namespace a DeclSpace, and merge
14015         current_namespace/current_container in the parser.
14016
14017 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14018
14019         * cs-parser.jay: Improve error reporting when we get a different
14020         kind of expression in local_variable_type and
14021         local_variable_pointer_type. 
14022
14023         Propagate this to avoid missleading errors being reported.
14024
14025         * ecore.cs (ImplicitReferenceConversion): treat
14026         TypeManager.value_type as a target just like object_type.   As
14027         code like this:
14028
14029         ValueType v = 1;
14030
14031         Is valid, and needs to result in the int 1 being boxed before it
14032         is assigned to the value type v.
14033
14034         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14035         to validate the enumeration name.
14036
14037         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14038         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14039         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14040
14041         * ecore.cs (TryImplicitIntConversion): When doing an
14042         implicit-enumeration-conversion, check if the type is 64-bits and
14043         perform a conversion before passing to EnumConstant.
14044
14045 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14048         report ambiguous type references.  Unlike the MS version, we
14049         report what the ambiguity is.   Innovation at work ;-)
14050
14051         (DeclSpace.FindType): Require a location argument to
14052         display when we display an ambiguous error.
14053
14054         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14055
14056         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14057
14058         * expression.cs (EmitDynamicInitializers): Apply patch from
14059         hwang_rob@yahoo.ca that fixes the order in which we emit our
14060         initializers. 
14061
14062 2002-09-21  Martin Baulig  <martin@gnome.org>
14063
14064         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14065         delegate takes no arguments.
14066
14067 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14068
14069         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14070         from integers.
14071
14072         * expression.cs: Extract the underlying type.
14073
14074         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14075
14076         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14077
14078 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14079
14080         * class.cs (TypeContainer.DefineType): We can not use the nice
14081         PackingSize with the size set to 1 DefineType method, because it
14082         will not allow us to define the interfaces that the struct
14083         implements.
14084
14085         This completes the fixing of bug 27287
14086
14087         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14088         means also structs.  This fixes part of the problem. 
14089         (Expresion.ImplicitReferenceConversionExists): ditto.
14090
14091         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14092         error if there were no errors reported during the type lookup
14093         process, to avoid duplicates or redundant errors.  Without this
14094         you would get an ambiguous errors plus a type not found.  We have
14095         beaten the user enough with the first error.  
14096
14097         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14098         reference. 
14099
14100         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14101         during the resolution process, stop the lookup, this avoids
14102         repeated error reports (same error twice).
14103
14104         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14105
14106         * typemanager.cs (LookupType): Redo the type lookup code to match
14107         the needs of System.Reflection.  
14108
14109         The issue is that System.Reflection requires references to nested
14110         types to begin with a "+" sign instead of a dot.  So toplevel
14111         types look like: "NameSpace.TopLevelClass", and nested ones look
14112         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14113         levels. 
14114
14115 2002-09-19  Martin Baulig  <martin@gnome.org>
14116
14117         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14118         says that a method always returns or always throws an exception,
14119         don't report the CS0161.
14120
14121         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14122         set `Returns = new_returns'.
14123
14124 2002-09-19  Martin Baulig  <martin@gnome.org>
14125
14126         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14127         to an enum constant, check for a CS0176.
14128
14129 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14130
14131         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14132         for operators that must be in pairs and report errors.
14133
14134         * ecore.cs (SimpleName.DoResolveType): During the initial type
14135         resolution process, when we define types recursively, we must
14136         check first for types in our current scope before we perform
14137         lookups in the enclosing scopes.
14138
14139         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14140
14141         (Invocation.VerifyArgumentsCompat): Call
14142         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14143         I thought we were supposed to always call this, but there are a
14144         few places in the code where we dont do it.
14145
14146 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14147
14148         * driver.cs: Add support in -linkres and -resource to specify the
14149         name of the identifier.
14150
14151 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * ecore.cs (StandardConversionExists): Sync with the conversion
14154         code: allow anything-* to void* conversions.
14155
14156         (FindMostSpecificSource): Use an Expression argument
14157         instead of a Type, because we might be handed over a Literal which
14158         gets a few more implicit conversions that plain types do not.  So
14159         this information was being lost.
14160
14161         Also, we drop the temporary type-holder expression when not
14162         required.
14163
14164 2002-09-17  Martin Baulig  <martin@gnome.org>
14165
14166         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14167         this is an explicit interface implementation.
14168
14169 2002-09-17  Martin Baulig  <martin@gnome.org>
14170
14171         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14172         different `IndexerName' attributes.
14173
14174         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14175         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14176         virtual CommonResolve().
14177
14178 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14179
14180         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14181         and convert that to the UnderlyingType.
14182
14183         * statement.cs (Foreach.Resolve): Indexers are just like variables
14184         or PropertyAccesses.
14185
14186         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14187         inside quoted strings, we were not doing this before.
14188
14189 2002-09-16  Martin Baulig  <martin@gnome.org>
14190
14191         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14192         resolve it.  This is needed for the definite assignment check of the
14193         instance expression, fixes bug #29846.
14194         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14195
14196 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14197
14198         * parameter.cs: Fix compile error.  Cannot reference static member
14199         from an instance object.  Is this an mcs bug?
14200
14201 2002-09-14  Martin Baulig  <martin@gnome.org>
14202
14203         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14204         multiple times.  Fixes bug #30295, added test-166.cs.
14205
14206 2002-09-14  Martin Baulig  <martin@gnome.org>
14207
14208         * statement.cs (Block.Emit): Don't emit unreachable code.
14209         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14210         `break' statements.
14211         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14212
14213 2002-09-14  Martin Baulig  <martin@gnome.org>
14214
14215         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14216         is set.
14217
14218 2002-09-14  Martin Baulig  <martin@gnome.org>
14219
14220         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14221         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14222         be false on the ms runtime.
14223
14224 2002-09-13  Martin Baulig  <martin@gnome.org>
14225
14226         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14227         the CS0038 error message.
14228
14229 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14230
14231         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14232         constant inside, return it.
14233
14234 2002-09-12  Martin Baulig  <martin@gnome.org>
14235
14236         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14237         implicit conversion can be done between enum types.
14238
14239         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14240         check whether an implicit conversion to the current enum's UnderlyingType
14241         exists and report an error if not.
14242
14243         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14244         without debugging support.
14245
14246         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14247         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14248
14249 2002-09-12  Martin Baulig  <martin@gnome.org>
14250
14251         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14252
14253         * ecore.cs (IMemberExpr.DeclaringType): New property.
14254         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14255         nonstatic member of an outer type (CS0038).
14256
14257 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * driver.cs: Activate the using-error detector at warning level
14260         4 (at least for MS-compatible APIs).
14261
14262         * namespace.cs (VerifyUsing): Small buglett fix.
14263
14264         * pending.cs (PendingImplementation): pass the container pointer. 
14265
14266         * interface.cs (GetMethods): Allow for recursive definition.  Long
14267         term, I would like to move every type to support recursive
14268         definitions, not the current ordering mechanism that we have right
14269         now.
14270
14271         The situation is this: Attributes are handled before interfaces,
14272         so we can apply attributes to interfaces.  But some attributes
14273         implement interfaces, we will now handle the simple cases
14274         (recursive definitions will just get an error).  
14275
14276         * parameter.cs: Only invalidate types at the end if we fail to
14277         lookup all types.  
14278
14279 2002-09-09  Martin Baulig  <martin@gnome.org>
14280
14281         * ecore.cs (PropertyExpr.Emit): Also check for
14282         TypeManager.system_int_array_get_length so this'll also work when
14283         compiling corlib.  Fixes #30003.
14284
14285 2002-09-09  Martin Baulig  <martin@gnome.org>
14286
14287         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14288         and throw an exception if we can't get the type's size.  Fixed #30040,
14289         added test-165.cs.
14290
14291 2002-09-09  Martin Baulig  <martin@gnome.org>
14292
14293         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14294
14295         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14296         context.  Fixes bug #30027.
14297
14298         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14299         virtual functions.  Fixes bug #30043, added test-164.cs.
14300
14301 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14302
14303         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14304
14305 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14306
14307         * driver.cs: Use an object to get the windows codepage since it's not a
14308         static property.
14309
14310 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14311
14312         * statement.cs (For.Emit): for infinite loops (test == null)
14313         return whether there is a break inside, not always "true".
14314
14315         * namespace.cs (UsingEntry): New struct to hold the name of the
14316         using definition, the location where it is defined, and whether it
14317         has been used in a successful type lookup.
14318
14319         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14320         strings.
14321
14322         * decl.cs: ditto.
14323
14324 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14325
14326         * attribute.cs : Fix incorrect code which relied on catching
14327         a NullReferenceException to detect a null being passed in
14328         where an object was expected.
14329
14330 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14331
14332         * statement.cs (Try): flag the catch variable as assigned
14333
14334         * expression.cs (Cast): Simplified by using ResolveType instead of
14335         manually resolving.
14336
14337         * statement.cs (Catch): Fix bug by using ResolveType.
14338
14339 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14340
14341         * expression.cs (BetterConversion): Special case for when we have
14342         a NullLiteral as the argument and we have to choose between string
14343         and object types - we choose string the way csc does.
14344
14345         * attribute.cs (Attribute.Resolve): Catch the
14346         NullReferenceException and report error #182 since the Mono
14347         runtime no more has the bug and having this exception raised means
14348         we tried to select a constructor which takes an object and is
14349         passed a null.
14350
14351 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14352
14353         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14354         message (1502, 1503) when we can't locate a method after overload
14355         resolution. This is much more informative and closes the bug
14356         Miguel reported.
14357
14358         * interface.cs (PopulateMethod): Return if there are no argument
14359         types. Fixes a NullReferenceException bug.
14360
14361         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14362         expressions too. Previously we were checking only in one place for
14363         positional arguments leaving out named arguments.
14364
14365         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14366         type to the enum type is not allowed. Remove code corresponding to
14367         that.
14368
14369         (ConvertNumericExplicit): Allow explicit conversions from
14370         the underlying type to enum type. This precisely follows the spec
14371         and closes a bug filed by Gonzalo.
14372
14373 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14374
14375         * compiler.csproj:
14376         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14377
14378 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14379
14380         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14381         it was important that we stored the right value after the
14382         reduction in `converted'.
14383
14384 2002-09-04  Martin Baulig  <martin@gnome.org>
14385
14386         * location.cs (Location.SymbolDocument): Use full pathnames for the
14387         source files.
14388
14389 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14390
14391         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14392         of the expression resolve mechanism, because that will catch the
14393         SimpleName error failures.
14394
14395         (Conditional): If we can not resolve the
14396         expression, return, do not crash.
14397
14398 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14399
14400         * cs-tokenizer.cs:
14401         (location): display token name instead of its number.
14402
14403 2002-08-28  Martin Baulig  <martin@gnome.org>
14404
14405         * expression.cs (Binary.ResolveOperator): Don't silently return
14406         but return an error if an operator cannot be applied between two
14407         enum types.
14408
14409 2002-08-28  Martin Baulig  <martin@gnome.org>
14410
14411         * class.cs (Constructor.Define): Set the permission attributes
14412         correctly instead of making all constructors public.
14413
14414 2002-08-28  Martin Baulig  <martin@gnome.org>
14415
14416         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14417         for private members before reporting a CS0103; if we find anything,
14418         it's a CS0122.
14419
14420 2002-08-28  Martin Baulig  <martin@gnome.org>
14421
14422         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14423         to check whether `closure_start_type == closure_invocation_type',
14424         we also need to check whether `m.DeclaringType == closure_invocation_type'
14425         before bypassing the permission checks.  We might be accessing
14426         protected/private members from the base class.
14427         (TypeManager.RealMemberLookup): Only set private_ok if private
14428         members were requested via BindingFlags.NonPublic.
14429
14430         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14431
14432         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14433         MethodGroupExpr.IsExplicitImpl if appropriate.
14434         (Invocation.DoResolve): Don't report the CS0120 for explicit
14435         interface implementations.
14436
14437 2002-08-27  Martin Baulig  <martin@gnome.org>
14438
14439         * expression.cs (Invocation.DoResolve): If this is a static
14440         method and we don't have an InstanceExpression, we must report
14441         a CS0120.
14442
14443 2002-08-25  Martin Baulig  <martin@gnome.org>
14444
14445         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14446         `==' between a valuetype and an object.
14447
14448 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * ecore.cs (TypeExpr): Provide a ToString method.
14451
14452 2002-08-24  Martin Baulig  <martin@gnome.org>
14453
14454         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14455         now called proggie.dbg and it's a binary file.
14456
14457 2002-08-23  Martin Baulig  <martin@gnome.org>
14458
14459         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14460
14461 2002-08-23  Martin Baulig  <martin@gnome.org>
14462
14463         * struct.cs (MyStructInfo.ctor): Make this work with empty
14464         structs; it's not allowed to use foreach() on null.
14465
14466 2002-08-23  Martin Baulig  <martin@gnome.org>
14467
14468         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14469         writer the full pathname of the generated assembly.
14470
14471 2002-08-23  Martin Baulig  <martin@gnome.org>
14472
14473         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14474         A `finally' block never returns or breaks; improved handling of
14475         unreachable code.
14476
14477 2002-08-23  Martin Baulig  <martin@gnome.org>
14478
14479         * statement.cs (Throw.Resolve): Allow `throw null'.
14480
14481 2002-08-23  Martin Baulig  <martin@gnome.org>
14482
14483         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14484         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14485         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14486         MemberLookup would return a wrong event if this is an explicit
14487         interface implementation and the class has an event with the same
14488         name.
14489
14490 2002-08-23  Martin Baulig  <martin@gnome.org>
14491
14492         * statement.cs (Block.AddChildVariableNames): New public method.
14493         (Block.AddChildVariableName): Likewise.
14494         (Block.IsVariableNameUsedInChildBlock): Likewise.
14495         (Block.AddVariable): Check whether a variable name has already
14496         been used in a child block.
14497
14498         * cs-parser.jay (declare_local_variables): Mark all variable names
14499         from the current block as being used in a child block in the
14500         implicit block.
14501
14502 2002-08-23  Martin Baulig  <martin@gnome.org>
14503
14504         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14505         find the symbol writer.
14506
14507         * driver.cs: csc also allows the arguments to /define being
14508         separated by commas, not only by semicolons.
14509
14510 2002-08-23  Martin Baulig  <martin@gnome.org>
14511
14512         * interface.cs (Interface.GetMembers): Added static check for events.
14513
14514 2002-08-15  Martin Baulig  <martin@gnome.org>
14515
14516         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14517         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14518
14519         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14520         why the MethodData.EmitDestructor() change was necessary.
14521
14522 2002-08-20  Martin Baulig  <martin@gnome.org>
14523
14524         * class.cs (TypeContainer.FindMembers): Added static check for events.
14525
14526         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14527
14528         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14529         use Type.GetEvents(), not Type.FindMembers().
14530
14531 2002-08-20  Martin Baulig  <martin@gnome.org>
14532
14533         * decl.cs (MemberCache): Added a special method cache which will
14534         be used for method-only searched.  This ensures that a method
14535         search will return a MethodInfo with the correct ReflectedType for
14536         inherited methods.      
14537
14538 2002-08-20  Martin Baulig  <martin@gnome.org>
14539
14540         * decl.cs (DeclSpace.FindMembers): Made this public.
14541
14542 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14543
14544         * delegate.cs: fixed build on windows.
14545         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14546
14547 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14548
14549         * ecore.cs (StandardConversionExists): Return a false
14550         if we are trying to convert the void type to anything else
14551         since that is not allowed.
14552
14553         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14554         we flag error 70 in the event an event is trying to be accessed
14555         directly from outside the declaring type.
14556
14557 2002-08-20  Martin Baulig  <martin@gnome.org>
14558
14559         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14560         MemberCache from typemanager.cs to decl.cs.
14561
14562 2002-08-19  Martin Baulig  <martin@gnome.org>
14563
14564         * class.cs (TypeContainer): Implement IMemberContainer.
14565         (TypeContainer.DefineMembers): Create the MemberCache.
14566         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14567         return public members if BindingFlags.Public was given, check
14568         whether members are static.
14569
14570 2002-08-16  Martin Baulig  <martin@gnome.org>
14571
14572         * decl.cs (DeclSpace.Define): Splitted this in Define and
14573         DefineMembers.  DefineMembers is called first and initializes the
14574         MemberCache.
14575
14576         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14577         DefineMembers() on all our DeclSpaces.
14578
14579         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14580         but call DefineMembers() on all nested interfaces.  We call their
14581         Define() in our new Define() function.
14582
14583         * interface.cs (Interface): Implement IMemberContainer.
14584         (Interface.Define): Moved all code except the attribute stuf to
14585         DefineMembers().
14586         (Interface.DefineMembers): Initialize the member cache.
14587
14588         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14589         need this anymore since we can use MemberCache.FindMembers directly.
14590
14591 2002-08-19  Martin Baulig  <martin@gnome.org>
14592
14593         * typemanager.cs (MemberCache): When creating the cache for an
14594         interface type, add all inherited members.
14595         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14596         to `out bool used_cache' and documented it.
14597         (TypeManager.MemberLookup): If we already used the cache in the first
14598         iteration, we don't need to do the interfaces check.
14599
14600 2002-08-19  Martin Baulig  <martin@gnome.org>
14601
14602         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14603         here from IMemberFinder and don't implement this interface anymore.
14604         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14605
14606         * typemanager.cs (IMemberFinder): This interface is now only used by
14607         classes which actually support the member cache.
14608         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14609         since we only put DeclSpaces into this Hashtable.
14610         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14611         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14612
14613 2002-08-16  Martin Baulig  <martin@gnome.org>
14614
14615         * typemanager.cs (ICachingMemberFinder): Removed.
14616         (IMemberFinder.MemberCache): New property.
14617         (TypeManager.FindMembers): Merged this with RealFindMembers().
14618         This function will never be called from TypeManager.MemberLookup()
14619         so we can't use the cache here, just the IMemberFinder.
14620         (TypeManager.MemberLookup_FindMembers): Check whether the
14621         IMemberFinder has a MemberCache and call the cache's FindMembers
14622         function.
14623         (MemberCache): Rewrote larger parts of this yet another time and
14624         cleaned it up a bit.
14625
14626 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14627
14628         * driver.cs (LoadArgs): Support quoting.
14629
14630         (Usage): Show the CSC-like command line arguments.
14631
14632         Improved a few error messages.
14633
14634 2002-08-15  Martin Baulig  <martin@gnome.org>
14635
14636         * typemanager.cs (IMemberContainer.Type): New property.
14637         (IMemberContainer.IsInterface): New property.
14638
14639         The following changes are conditional to BROKEN_RUNTIME, which is
14640         defined at the top of the file.
14641
14642         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14643         class'es members, but add all members from TypeHandle.ObjectType
14644         if we're an interface.
14645         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14646         is the current type.
14647         (MemberCache.CacheEntry.Container): Removed this field.
14648         (TypeHandle.GetMembers): Include inherited members.
14649
14650 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14651
14652         * typemanager.cs: fixed compilation and added a comment on a field that
14653         is never used.
14654
14655 2002-08-15  Martin Baulig  <martin@gnome.org>
14656
14657         * class.cs (ConstructorInitializer.Resolve): In the
14658         Expression.MemberLookup call, use the queried_type as
14659         invocation_type.
14660
14661         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14662         declared' attribute, it's always true.
14663         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14664         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14665         temporary wrapper for FindMembers which tells MemberLookup whether
14666         members from the base classes are included in the return value.
14667         This will go away soon.
14668         (TypeManager.MemberLookup): Use this temporary hack here; once the
14669         new MemberCache is completed, we don't need to do the DeclaredOnly
14670         looping here anymore since the MemberCache will take care of this.
14671         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14672         (MemberCache): When creating the MemberCache for a class, get
14673         members from the current class and all its base classes.
14674         (MemberCache.CacheEntry.Container): New field.  This is a
14675         temporary hack until the Mono runtime is fixed to distinguish
14676         between ReflectedType and DeclaringType.  It allows us to use MCS
14677         with both the MS runtime and the unfixed Mono runtime without
14678         problems and without accecting performance.
14679         (MemberCache.SearchMembers): The DeclaredOnly looping from
14680         TypeManager.MemberLookup is now done here.      
14681
14682 2002-08-14  Martin Baulig  <martin@gnome.org>
14683
14684         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14685         Type.GetFields on dynamic types but get the fields from the
14686         corresponding TypeContainer.
14687         (MyStructInfo.GetStructInfo): Added check for enum types.
14688
14689         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14690         (MemberList.SyncRoot): Implemented.
14691         (TypeManager.FilterWithClosure): No need to check permissions if
14692         closure_start_type == closure_invocation_type, don't crash if
14693         closure_invocation_type is null.
14694
14695 2002-08-13  Martin Baulig  <martin@gnome.org>
14696
14697         Rewrote TypeContainer.FindMembers to use a member cache.  This
14698         gives us a speed increase of about 35% for the self-hosting MCS
14699         build and of about 15-20% for the class libs (both on GNU/Linux).
14700
14701         * report.cs (Timer): New class to get enhanced profiling.  This
14702         whole class is "TIMER" conditional since it remarkably slows down
14703         compilation speed.
14704
14705         * class.cs (MemberList): New class.  This is an IList wrapper
14706         which we're now using instead of passing MemberInfo[]'s around to
14707         avoid copying this array unnecessarily.
14708         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14709         (ICachingMemberFinder, IMemberContainer): New interface.
14710         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14711         has already been checked, otherwise use it for the name comparision.
14712         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14713         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14714         if possible.  Returns a MemberList, not a MemberInfo [].
14715         (TypeHandle): New class, implements IMemberContainer.  We create
14716         one instance of this class per type, it contains a MemberCache
14717         which is used to do the member lookups.
14718         (MemberCache): New class.  Each instance of this class contains
14719         all members of a type and a name-based hash table.
14720         (MemberCache.FindMembers): This is our new member lookup
14721         function.  First, it looks up all members of the requested name in
14722         the hash table.  Then, it walks this list and sorts out all
14723         applicable members and returns them.
14724
14725 2002-08-13  Martin Baulig  <martin@gnome.org>
14726
14727         In addition to a nice code cleanup, this gives us a performance
14728         increase of about 1.4% on GNU/Linux - not much, but it's already
14729         half a second for the self-hosting MCS compilation.
14730
14731         * typemanager.cs (IMemberFinder): New interface.  It is used by
14732         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14733         Enum, Delegate or Interface.
14734         (TypeManager.finder_to_member_finder): New PtrHashtable.
14735         (TypeManager.finder_to_container): Removed.
14736         (TypeManager.finder_to_delegate): Removed.
14737         (TypeManager.finder_to_interface): Removed.
14738         (TypeManager.finder_to_enum): Removed.
14739
14740         * interface.cs (Interface): Implement IMemberFinder.
14741
14742         * delegate.cs (Delegate): Implement IMemberFinder.
14743
14744         * enum.cs (Enum): Implement IMemberFinder.
14745
14746         * class.cs (TypeContainer): Implement IMemberFinder.
14747
14748 2002-08-12  Martin Baulig  <martin@gnome.org>
14749
14750         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14751
14752 2002-08-12  Martin Baulig  <martin@gnome.org>
14753
14754         * ecore.cs (ITypeExpression): New interface for expressions which
14755         resolve to a type.
14756         (TypeExpression): Renamed to TypeLookupExpression.
14757         (Expression.DoResolve): If we're doing a types-only lookup, the
14758         expression must implement the ITypeExpression interface and we
14759         call DoResolveType() on it.
14760         (SimpleName): Implement the new ITypeExpression interface.
14761         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14762         hack, the situation that we're only looking up types can't happen
14763         anymore when this method is called.  Moved the type lookup code to
14764         DoResolveType() and call it.
14765         (SimpleName.DoResolveType): This ITypeExpression interface method
14766         is now doing the types-only lookup.
14767         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14768         (ResolveFlags): Added MaskExprClass.
14769
14770         * expression.cs (MemberAccess): Implement the ITypeExpression
14771         interface.
14772         (MemberAccess.DoResolve): Added support for a types-only lookup
14773         when we're called via ITypeExpression.DoResolveType().
14774         (ComposedCast): Implement the ITypeExpression interface.
14775
14776         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14777         Expression.Resolve() with ResolveFlags.Type instead.
14778
14779 2002-08-12  Martin Baulig  <martin@gnome.org>
14780
14781         * interface.cs (Interface.Define): Apply attributes.
14782
14783         * attribute.cs (Attribute.ApplyAttributes): Added support for
14784         interface attributes.
14785
14786 2002-08-11  Martin Baulig  <martin@gnome.org>
14787
14788         * statement.cs (Block.Emit): Only check the "this" variable if we
14789         do not always throw an exception.
14790
14791         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14792         whether the property has a set accessor.
14793
14794 2002-08-11  Martin Baulig  <martin@gnome.org>
14795
14796         Added control flow analysis support for structs.
14797
14798         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14799         with control flow analysis turned off.
14800         (IVariable): New interface.
14801         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14802         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14803         (FieldExpr.DoResolve): Resolve the instance expression with flow
14804         analysis turned off and do the definite assignment check after the
14805         resolving when we know what the expression will resolve to.
14806
14807         * expression.cs (LocalVariableReference, ParameterReference):
14808         Implement the new IVariable interface, only call the flow analysis
14809         code if ec.DoFlowAnalysis is true.
14810         (This): Added constructor which takes a Block argument.  Implement
14811         the new IVariable interface.
14812         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14813         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14814         This does the definite assignment checks for struct members.
14815
14816         * class.cs (Constructor.Emit): If this is a non-static `struct'
14817         constructor which doesn't have any initializer, call
14818         Block.AddThisVariable() to tell the flow analysis code that all
14819         struct elements must be initialized before control returns from
14820         the constructor.
14821
14822         * statement.cs (MyStructInfo): New public class.
14823         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14824         argument to this indexer.  If non-zero, check an individual struct
14825         member, not the whole struct.
14826         (FlowBranching.CheckOutParameters): Check struct members.
14827         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14828         overloaded versions of these methods which take an additional
14829         `int field_idx' argument to check struct members.
14830         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14831         overloaded versions of these methods which take an additional
14832         `string field_name' argument to check struct member.s
14833         (VariableInfo): Implement the IVariable interface.
14834         (VariableInfo.StructInfo): New public property.  Returns the
14835         MyStructInfo instance of the variable if it's a struct or null.
14836         (Block.AddThisVariable): New public method.  This is called from
14837         Constructor.Emit() for non-static `struct' constructor which do
14838         not have any initializer.  It creates a special variable for the
14839         "this" instance variable which will be checked by the flow
14840         analysis code to ensure that all of the struct's fields are
14841         initialized before control returns from the constructor.
14842         (UsageVector): Added support for struct members.  If a
14843         variable/parameter is a struct with N members, we reserve a slot
14844         in the usage vector for each member.  A struct is considered fully
14845         initialized if either the struct itself (slot 0) or all its
14846         members are initialized.
14847
14848 2002-08-08  Martin Baulig  <martin@gnome.org>
14849
14850         * driver.cs (Driver.MainDriver): Only report an error CS5001
14851         if there were no compilation errors.
14852
14853         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14854         `UnsafeContext' property to determine whether the parent is in
14855         unsafe context rather than checking the parent's ModFlags:
14856         classes nested in an unsafe class are unsafe as well.
14857
14858 2002-08-08  Martin Baulig  <martin@gnome.org>
14859
14860         * statement.cs (UsageVector.MergeChildren): Distinguish between
14861         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14862         we return.  Added test17() and test18() to test-154.cs.
14863
14864 2002-08-08  Martin Baulig  <martin@gnome.org>
14865
14866         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14867         Family access, make sure the invoking type isn't a subclass of the
14868         queried type (that'd be a CS1540).
14869
14870         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14871         this method which takes an additional `Type invocation_type'.
14872
14873         * expression.cs (BaseAccess.DoResolve): Use the base type as
14874         invocation and query type.
14875         (MemberAccess.DoResolve): If the lookup failed and we're about to
14876         report a CS0122, try a lookup with the ec.ContainerType - if this
14877         succeeds, we must report a CS1540.
14878
14879 2002-08-08  Martin Baulig  <martin@gnome.org>
14880
14881         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14882         (MethodGroupExpr): Implement the IMemberExpr interface.
14883
14884         * expression (MemberAccess.ResolveMemberAccess): No need to have
14885         any special code for MethodGroupExprs anymore, they're now
14886         IMemberExprs.   
14887
14888 2002-08-08  Martin Baulig  <martin@gnome.org>
14889
14890         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14891         Family, FamANDAssem and FamORAssem permissions.
14892         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14893
14894 2002-08-08  Martin Baulig  <martin@gnome.org>
14895
14896         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14897         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14898         or loop block.
14899
14900 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14901
14902         * driver.cs: implemented /resource option to embed managed resources.
14903
14904 2002-08-07  Martin Baulig  <martin@gnome.org>
14905
14906         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14907         (FieldBase.HasFieldInitializer): New public property.
14908         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14909         returns the field initializer and makes sure it is only resolved once.
14910         (TypeContainer.EmitFieldInitializers): Call
14911         FieldBase.GetInitializerExpression to get the initializer, this ensures
14912         that it isn't resolved multiple times.
14913
14914         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14915         the resolving process (SimpleName/MemberLookup) that we're currently
14916         emitting a field initializer (which must not access any instance members,
14917         this is an error CS0236).
14918
14919         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14920         argument, if the `IsFieldInitializer' flag is set, we must report and
14921         error CS0236 and not an error CS0120.   
14922
14923 2002-08-07  Martin Baulig  <martin@gnome.org>
14924
14925         * ecore.cs (IMemberExpr): New public interface.
14926         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14927         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14928         if the expression is an IMemberExpr.
14929
14930         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14931         to be null, implicitly default to `this' if we're non-static in
14932         this case.  Simplified the code a lot by using the new IMemberExpr
14933         interface.  Also fixed bug #28176 here.
14934
14935 2002-08-06  Martin Baulig  <martin@gnome.org>
14936
14937         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14938         ParameterReferences during semantic analysis so that we can do a
14939         type-only search when resolving Cast, TypeOf and SizeOf.
14940         (block): Pass the `current_local_parameters' to the Block's
14941         constructor.
14942
14943         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14944         argument to the constructor.
14945         (ConstructorInitializer.Resolve): Create a temporary implicit
14946         block with the parameters.
14947
14948         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14949         references here if we aren't doing a type-only search.
14950
14951         * statement.cs (Block): Added constructor which takes a
14952         `Parameters parameters' argument.
14953         (Block.Parameters): New public property.
14954
14955         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14956         to `Parameters' and made it public readonly.
14957
14958 2002-08-06  Martin Baulig  <martin@gnome.org>
14959
14960         * ecore.cs (Expression.Warning): Made this public as well.
14961
14962         * report.cs (Report.Debug): Print the contents of collections.
14963
14964 2002-08-06  Martin Baulig  <martin@gnome.org>
14965
14966         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14967         used to tell Resolve() which kinds of expressions it may return.
14968         (Expression.Resolve): Added overloaded version of this method which
14969         takes a `ResolveFlags flags' argument.  This can be used to tell
14970         Resolve() which kinds of expressions it may return.  Reports a
14971         CS0118 on error.
14972         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14973         ResolveFlags.SimpleName.
14974         (Expression.Error118): Added overloaded version of this method which
14975         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14976         which kinds of expressions are allowed.
14977
14978         * expression.cs (Argument.ResolveMethodGroup): New public method.
14979         Resolves an argument, but allows a MethodGroup to be returned.
14980         This is used when invoking a delegate.
14981
14982         * TODO: Updated a bit.
14983
14984 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14985
14986         Fixed compilation with csc.
14987
14988         * ecore.cs: Expression.Error made public. Is this correct? Should
14989         Warning be made public too?
14990
14991         * expression.cs: use ea.Location instead of ea.loc.
14992         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14993
14994 2002-08-06  Martin Baulig  <martin@gnome.org>
14995
14996         * ecore.cs (Expression.loc): Moved the location here instead of
14997         duplicating it in all derived classes.
14998         (Expression.Location): New public property.
14999         (Expression.Error, Expression.Warning): Made them non-static and
15000         removed the location argument.
15001         (Expression.Warning): Added overloaded version which takes an
15002         `int level' argument.
15003         (Expression.Error118): Make this non-static and removed the
15004         expression and location arguments.
15005         (TypeExpr): Added location argument to the constructor.
15006
15007         * expression.cs (StaticCallExpr): Added location argument to
15008         the constructor.
15009         (Indirection, PointerArithmetic): Likewise.
15010         (CheckedExpr, UnCheckedExpr): Likewise.
15011         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15012         (StringPtr): Likewise.
15013
15014
15015 2002-08-05  Martin Baulig  <martin@gnome.org>
15016
15017         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15018
15019         * assign.cs (Assign.DoResolve): Check whether the source
15020         expression is a value or variable.
15021
15022         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15023         while resolving the corresponding blocks.
15024
15025         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15026         an error, don't silently return null.
15027
15028         * statement.cs (Block.AddVariable): Do the error reporting here
15029         and distinguish between CS0128 and CS0136.
15030         (Block.DoResolve): Report all unused labels (warning CS0164).
15031         (LabeledStatement): Pass the location to the constructor.
15032         (LabeledStatement.HasBeenReferenced): New property.
15033         (LabeledStatement.Resolve): Set it to true here.
15034
15035         * statement.cs (Return.Emit): Return success even after reporting
15036         a type mismatch error (CS0126 or CS0127), this is what csc does and
15037         it avoids confusing the users with any consecutive errors.
15038
15039 2002-08-05  Martin Baulig  <martin@gnome.org>
15040
15041         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15042
15043         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15044
15045         * expression.cs (MemberAccess.DoResolve): Silently return if an
15046         error has already been reported.
15047
15048         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15049         error has already been reported.
15050
15051 2002-08-05  Martin Baulig  <martin@gnome.org>
15052
15053         * statement.cs (UsageVector): Only initialize the `parameters'
15054         vector if we actually have any "out" parameters.
15055
15056 2002-08-05  Martin Baulig  <martin@gnome.org>
15057
15058         * expression.cs (Binary.ResolveOperator): When combining delegates,
15059         they must have the same type.
15060
15061 2002-08-05  Martin Baulig  <martin@gnome.org>
15062
15063         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15064         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15065         work with the ms runtime and we also don't need it: if we're a
15066         PropertyBuilder and not in the `indexer_arguments' hash, then we
15067         are a property and not an indexer.
15068
15069         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15070         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15071         since the latter one doesn't work with the ms runtime.
15072
15073 2002-08-03  Martin Baulig  <martin@gnome.org>
15074
15075         Fixed bugs #27998 and #22735.
15076
15077         * class.cs (Method.IsOperator): New public field.
15078         (Method.CheckBase): Report CS0111 if there's already a method
15079         with the same parameters in the current class.  Report CS0508 when
15080         attempting to change the return type of an inherited method.
15081         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15082         and it's not marked abstract or extern.
15083         (PropertyBase): New abstract base class for Property and Indexer.
15084         (PropertyBase.CheckBase): Moved here from Property and made it work
15085         for indexers.
15086         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15087         the same so we can reuse it there.
15088         (Property, Indexer): Derive from PropertyBase.
15089         (MethodSignature.inheritable_property_signature_filter): New delegate
15090         to find properties and indexers.
15091
15092         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15093         argument and improved error reporting.
15094
15095         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15096         EmptyReadOnlyParameters and made it a property.
15097
15098         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15099         version of this method which takes a `PropertyInfo indexer'.
15100         (TypeManager.RegisterIndexer): New method.
15101
15102         * class.cs: Added myself as author of this file :-)
15103
15104 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15105
15106         * class.cs: fixed compilation on windoze.
15107
15108 2002-08-03  Martin Baulig  <martin@gnome.org>
15109
15110         * interface.cs (Interface.GetInterfaceBases): Check whether all
15111         base interfaces are at least as accessible than the current one.
15112
15113         * class.cs (TypeContainer.GetClassBases): Check whether base types
15114         are at least as accessible than the current type.
15115         (TypeContainer.AsAccessible): Implemented and made non-static.
15116         (MemberBase.CheckParameters): Report errors if the accessibility
15117         checks fail.
15118
15119         * delegate.cs (Delegate.Delegate): The default visibility is
15120         internal for top-level types and private for nested types.
15121         (Delegate.Define): Report errors if the accessibility checks fail.
15122
15123         * enum.cs (Enum.Enum): The default visibility is internal for
15124         top-level types and private for nested types.
15125         (Enum.DefineType): Compute the correct visibility.
15126
15127         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15128         function which takes a `bool is_toplevel' instead of a TypeContainer.
15129
15130         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15131         builtin type.
15132
15133 2002-08-02  Martin Baulig  <martin@gnome.org>
15134
15135         * expression.cs (LocalVariableReferenc): Added constructor which
15136         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15137         (LocalVariableReference.IsReadOnly): New property.
15138         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15139         variable is readonly, use our own readonly flag to do this; you can
15140         use the new constructor to get a writable reference to a read-only
15141         variable.
15142
15143         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15144         reference to the local variable.
15145
15146 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * rootcontext.cs (ResolveCore): Also include System.Exception
15149
15150         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15151         we reach an EmptyStatement.
15152
15153         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15154         is also fine.
15155
15156         * expression.cs (Binary.ResolveOperator): Check error result in
15157         two places.
15158
15159         use brtrue/brfalse directly and avoid compares to null.
15160
15161 2002-08-02  Martin Baulig  <martin@gnome.org>
15162
15163         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15164         Fixes bug #28407, added test-155.cs.
15165
15166 2002-08-01  Martin Baulig  <martin@gnome.org>
15167
15168         * class.cs (Event.EmitDefaultMethod): Make this work with static
15169         events.  Fixes #28311, added verify-3.cs.
15170
15171 2002-08-01  Martin Baulig  <martin@gnome.org>
15172
15173         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15174         `is_disposable' fields.
15175         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15176         `hm.is_disposable' if we're using the collection pattern.
15177         (Foreach.EmitCollectionForeach): Use the correct type for the
15178         enumerator's local variable, only emit the try/finally block if
15179         necessary (fixes #27713).
15180
15181 2002-08-01  Martin Baulig  <martin@gnome.org>
15182
15183         * ecore.cs (Expression.report118): Renamed to Error118 and made
15184         it public static.
15185
15186         * statement.cs (Throw.Resolve): Check whether the expression is of
15187         the correct type (CS0118) and whether the type derives from
15188         System.Exception (CS0155).
15189         (Catch.Resolve): New method.  Do the type lookup here and check
15190         whether it derives from System.Exception (CS0155).
15191         (Catch.CatchType, Catch.IsGeneral): New public properties.
15192
15193         * typemanager.cs (TypeManager.exception_type): Added.
15194
15195 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * driver.cs: Updated About function.
15198
15199 2002-07-31  Martin Baulig  <martin@gnome.org>
15200
15201         Implemented Control Flow Analysis.
15202
15203         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15204         (EmitContext.CurrentBranching): Added.
15205         (EmitContext.StartFlowBranching): Added.
15206         (EmitContext.EndFlowBranching): Added.
15207         (EmitContext.KillFlowBranching): Added.
15208         (EmitContext.IsVariableAssigned): Added.
15209         (EmitContext.SetVariableAssigned): Added.
15210         (EmitContext.IsParameterAssigned): Added.
15211         (EmitContext.SetParameterAssigned): Added.
15212         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15213         Added control flow analysis stuff here.
15214
15215         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15216         resolve the expression as lvalue.
15217         (LocalVariableReference.DoResolve): Check whether the variable has
15218         already been assigned.
15219         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15220         the parameter as assigned here.
15221         (ParameterReference.DoResolve): Check whether the parameter has already
15222         been assigned.
15223         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15224         expression as lvalue.
15225
15226         * statement.cs (FlowBranching): New class for the flow analysis code.
15227         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15228         (LabeledStatement.IsDefined): New public property.
15229         (LabeledStatement.AddUsageVector): New public method to tell flow
15230         analyis that the label may be reached via a forward jump.
15231         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15232         flow analysis.
15233         (VariableInfo.Number): New public field.  This is used by flow analysis
15234         to number all locals of a block.
15235         (Block.CountVariables): New public property.  This is the number of
15236         local variables in this block (including the locals from all parent
15237         blocks).
15238         (Block.EmitMeta): Number all the variables.
15239
15240         * statement.cs: Added flow analysis support to all classes.
15241
15242 2002-07-31  Martin Baulig  <martin@gnome.org>
15243
15244         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15245         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15246         then use this argument.
15247
15248         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15249
15250         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15251         use this to specify /define options.
15252
15253 2002-07-29  Martin Baulig  <martin@gnome.org>
15254
15255         * statement.cs (Fixed): Moved all code that does variable lookups
15256         and resolvings from Emit to Resolve.
15257
15258         * statement.cs (For): Moved all code that does variable lookups
15259         and resolvings from Emit to Resolve.
15260
15261         * statement.cs (Using): Moved all code that does variable lookups
15262         and resolvings from Emit to Resolve.
15263
15264 2002-07-29  Martin Baulig  <martin@gnome.org>
15265
15266         * attribute.cs (Attribute.Resolve): Explicitly catch a
15267         System.NullReferenceException when creating the
15268         CustromAttributeBuilder and report a different warning message.
15269
15270 2002-07-29  Martin Baulig  <martin@gnome.org>
15271
15272         * support.cs (ParameterData.ParameterName): Added method to
15273         get the name of a parameter.
15274
15275         * typemanager.cs (TypeManager.IsValueType): New public method.
15276
15277 2002-07-29  Martin Baulig  <martin@gnome.org>
15278
15279         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15280         is a flag which specifies that it's either ref or out.
15281         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15282         the out parameter to `out Parameter.Modifier mod', also set the
15283         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15284
15285         * support.cs (InternalParameters.ParameterModifier): Distinguish
15286         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15287         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15288
15289         * expression.cs (Argument.GetParameterModifier): Distinguish
15290         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15291         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15292
15293 2002-07-29  Martin Baulig  <martin@gnome.org>
15294
15295         * expression.cs (ParameterReference.ParameterReference): Added
15296         `Location loc' argument to the constructor.
15297
15298         * cs-parser.jay: Pass location to ParameterReference.
15299
15300 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * statement.cs (Try): Initialize the location.
15303
15304         * cs-parser.jay: pass location to Try.
15305
15306         * expression.cs (Unary.Reduce): Change the prototype to return
15307         whether a constant fold could be performed or not.  The result is
15308         returned in an out parameters.  In the case of Indirection and
15309         AddressOf, we want to perform the full tests.
15310
15311 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * statement.cs (Statement.Emit): Flag dead code.
15314
15315 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15316
15317         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15318
15319 2002-07-27  Martin Baulig  <martin@gnome.org>
15320
15321         * class.cs (MethodData.Define): Put back call to
15322         TypeManager.AddMethod(), accidentally commented this out.
15323
15324         * report.cs (Debug): New public method to print debugging information,
15325         this is `[Conditional ("DEBUG")]'.
15326
15327 2002-07-26  Martin Baulig  <martin@gnome.org>
15328
15329         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15330         (switch_statement): Push the current_block to the switch_stack and
15331         pop it again when we're done with the switch.
15332         (switch_section): The new block is a child of the current_block.
15333         Fixes bug #24007, added test-152.cs.
15334
15335 2002-07-27  Martin Baulig  <martin@gnome.org>
15336
15337         * expression.cs (Invocation.EmitArguments): When calling a varargs
15338         function with only its fixed arguments, we need to pass an empty
15339         array.
15340
15341 2002-07-27  Martin Baulig  <martin@gnome.org>
15342
15343         Mono 0.13 has been released.
15344
15345 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * driver.cs: Rename --resource to --linkres, because that is what
15348         we do currently, we dont support --resource yet.
15349
15350         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15351
15352 2002-07-25  Martin Baulig  <martin@gnome.org>
15353
15354         * class.cs (MethodData): New public class.  This is a `method builder'
15355         class for a method or one accessor of a Property/Indexer/Event.
15356         (MethodData.GetMethodFlags): Moved here from MemberBase.
15357         (MethodData.ApplyAttributes): Likewise.
15358         (MethodData.ApplyObsoleteAttribute): Likewise.
15359         (MethodData.ApplyConditionalAttribute): Likewise.
15360         (MethodData.ApplyDllImportAttribute): Likewise.
15361         (MethodData.CheckAbstractAndExternal): Likewise.
15362         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15363         (MethodData.Emit): Formerly known as Method.Emit().
15364         (MemberBase): Moved everything which was specific to a single
15365         accessor/method to MethodData.
15366         (Method): Create a new MethodData and call Define() and Emit() on it.
15367         (Property, Indexer, Event): Create a new MethodData objects for each
15368         accessor and call Define() and Emit() on them.
15369
15370 2002-07-25  Martin Baulig  <martin@gnome.org>
15371
15372         Made MethodCore derive from MemberBase to reuse the code from there.
15373         MemberBase now also checks for attributes.
15374
15375         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15376         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15377         as virtual.
15378         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15379         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15380         (MemberBase.ApplyAttributes): New virtual method; applies the
15381         attributes to a method or accessor.
15382         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15383         (MemberBase.ApplyConditionalAttribute): Likewise.
15384         (MemberBase.ApplyDllImportAttribute): Likewise.
15385         (MemberBase.CheckAbstractAndExternal): Likewise.
15386         (MethodCore.ParameterTypes): This is now a property instead of a
15387         method, it's initialized from DoDefineParameters().
15388         (MethodCore.ParameterInfo): Removed the set accessor.
15389         (MethodCore.DoDefineParameters): New protected virtual method to
15390         initialize ParameterTypes and ParameterInfo.
15391         (Method.GetReturnType): We can now simply return the MemberType.
15392         (Method.GetMethodFlags): Override the MemberBase version and add
15393         the conditional flags.
15394         (Method.CheckBase): Moved some code from Define() here, call
15395         DoDefineParameters() here.
15396         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15397         here to avoid some larger code duplication.
15398         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15399         ensure that abstract and external accessors don't declare a body.
15400
15401         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15402         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15403         lookup in the attribute's parent classes, so we need to abort as soon
15404         as we found the first match.
15405         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15406         the attribute has no arguments.
15407
15408         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15409         of a Method.
15410
15411 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15412
15413         * cs-parser.jay: reverted previous patch.
15414
15415 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15416
15417         * cs-parser.jay: fixed bug #22119.
15418
15419 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15420
15421         * attribute.cs: fixed compilation. The error was:
15422         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15423         be assigned to before control leaves the current method."
15424         [FIXME:  Filed as bug #28186: MCS must report this error.]
15425
15426 2002-07-25  Martin Baulig  <martin@gnome.org>
15427
15428         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15429         method to pull the condition name ouf of a Conditional attribute.
15430         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15431         the obsolete message and error flag out of an Obsolete attribute.
15432
15433         * class.cs (Method.GetMethodFlags): New public method to get the
15434         TypeManager.MethodFlags for this method.
15435         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15436         private methods.
15437         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15438         if we're overriding a virtual function, set the new private variable
15439         `parent_method'; call the new TypeManager.AddMethod().
15440
15441         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15442         the MethodBuilder and the Method in a PtrHashtable.
15443         (TypeManager.builder_to_method): Added for this purpose.
15444         (TypeManager.MethodFlags): Added IsObsoleteError.
15445         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15446         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15447         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15448         the message from the attribute.
15449
15450 2002-07-24  Martin Baulig  <martin@gnome.org>
15451
15452         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15453         preprocessor directives, ensure that the argument to #define/#undef is
15454         exactly one identifier and that it's actually an identifier.
15455
15456         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15457         did not work ....
15458
15459 2002-07-24  Martin Baulig  <martin@gnome.org>
15460
15461         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15462         initialize it to TypeManager.object_type in the constructor.
15463         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15464         of the `hm.get_current' method if we're using the collection pattern.
15465         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15466         for the explicit conversion to make it work when we're using the collection
15467         pattern and the `Current' property has a different return type than `object'.
15468         Fixes #27713.
15469
15470 2002-07-24  Martin Baulig  <martin@gnome.org>
15471
15472         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15473         does not match, but don't report any errors.  This method is called in
15474         order for all methods in a MethodGroupExpr until a matching method is
15475         found, so we don't want to bail out if the first method doesn't match.
15476         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15477         matches, report the 123.  Fixes #28070.
15478
15479 2002-07-24  Martin Baulig  <martin@gnome.org>
15480
15481         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15482         TypeManager.TypeToCoreType() to the top of the method so the
15483         following equality checks will work.  Fixes #28107.
15484
15485 2002-07-24  Martin Baulig  <martin@gnome.org>
15486
15487         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15488         operand is of type uint, and the other operand is of type sbyte,
15489         short or int, the operands are converted to type long." -
15490         Actually do what this comment already told us.  Fixes bug #28106,
15491         added test-150.cs.
15492
15493 2002-07-24  Martin Baulig  <martin@gnome.org>
15494
15495         * class.cs (MethodBase): New abstract class.  This is now a base
15496         class for Property, Indexer and Event to avoid some code duplication
15497         in their Define() and DefineMethods() methods.
15498         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15499         generic methods for Define() and DefineMethods().
15500         (FieldBase): Derive from MemberBase, not MemberCore.
15501         (Property): Derive from MemberBase, not MemberCore.
15502         (Property.DefineMethod): Moved all the code from this method to the
15503         new MethodBase.DefineAccessor(), just call it with appropriate
15504         argumetnts.
15505         (Property.Define): Call the new Property.DoDefine(), this does some
15506         sanity checks and we don't need to duplicate the code everywhere.
15507         (Event): Derive from MemberBase, not MemberCore.
15508         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15509         accessors, this will also make them work with interface events.
15510         (Indexer): Derive from MemberBase, not MemberCore.
15511         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15512         (Indexer.Define): Use the new MethodBase functions.
15513
15514         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15515         argument to the constructor.
15516         (Interface.FindMembers): Added support for interface events.
15517         (Interface.PopluateEvent): Implemented.
15518
15519         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15520
15521 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15524         but this is required to check for a method name being the same as
15525         the containing class.  
15526
15527         Handle this now.
15528
15529 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15530
15531         * interface.cs: initialize variable.
15532
15533 2002-07-23  Martin Baulig  <martin@gnome.org>
15534
15535         Implemented the IndexerName attribute in interfaces.
15536
15537         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15538         name if this is an explicit interface implementation.
15539         (Indexer.InterfaceIndexerName): New public variable.  If we're
15540         implementing an interface indexer, this is the IndexerName in that
15541         interface.  Otherwise, it's the IndexerName.
15542         (Indexer.DefineMethod): If we're implementing interface indexer,
15543         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15544         and Pending.ImplementIndexer methods.
15545         (Indexer.Define): Also define the PropertyBuilder if we're
15546         implementing an interface indexer and this is neither an explicit
15547         interface implementation nor do the IndexerName match the one in
15548         the interface.
15549
15550         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15551         If a method is defined here, then we always need to create a proxy
15552         for it.  This is used when implementing interface indexers.
15553         (Pending.IsInterfaceIndexer): New public method.
15554         (Pending.ImplementIndexer): New public method.
15555         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15556         This is used when implementing interface indexers to define a proxy
15557         if necessary.
15558         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15559         define a proxy if necessary.
15560
15561         * interface.cs (Interface.IndexerName): New public variable.
15562         (Interface.PopulateIndexer): Set the IndexerName.
15563         (Interface.DefineIndexers): New private method.  Populate all the
15564         indexers and make sure their IndexerNames match.
15565
15566         * typemanager.cs (IndexerPropertyName): Added support for interface
15567         indexers.
15568
15569 2002-07-22  Martin Baulig  <martin@gnome.org>
15570
15571         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15572         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15573         ret if HasReturnLabel.
15574         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15575         variables.
15576
15577         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15578         and set the ec.LoopBeginTryCatchLevel.
15579         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15580         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15581         the current ec.TryCatchLevel, the branch goes out of an exception
15582         block.  In this case, we need to use Leave and not Br.
15583
15584 2002-07-22  Martin Baulig  <martin@gnome.org>
15585
15586         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15587         block unless the block does not always return or it is contained in
15588         another try { ... } catch { ... } block.  Fixes bug #26506.
15589         Added verify-1.cs to the test suite.
15590
15591 2002-07-22  Martin Baulig  <martin@gnome.org>
15592
15593         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15594         then we do not always return.  Fixes bug #24985.
15595
15596 2002-07-22  Martin Baulig  <martin@gnome.org>
15597
15598         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15599         lookup on a per-class level; ie. walk up the class hierarchy until we
15600         found at least one applicable method, then choose the best among them.
15601         Fixes bug #24463 and test-29.cs.
15602
15603 2002-07-22  Martin Baulig  <martin@gnome.org>
15604
15605         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15606         return types of the methods.  The return type is not part of the
15607         signature and we must not check it to make the `new' modifier work.
15608         Fixes bug #27999, also added test-147.cs.
15609         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15610
15611         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15612         on the method's return type.
15613
15614 2002-07-21  Martin Baulig  <martin@gnome.org>
15615
15616         * assign.cs: Make this work if the rightmost source is a constant and
15617         we need to do an implicit type conversion.  Also adding a few more tests
15618         to test-38.cs which should have caught this.
15619
15620         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15621         target in the makefile for this.  The makefile.gnu is primarily intended
15622         for end-users who don't want to debug the compiler.
15623
15624 2002-07-21  Martin Baulig  <martin@gnome.org>
15625
15626         * assign.cs: Improved the Assign class so it can now handle embedded
15627         assignments (X = Y = Z = something).  As a side-effect this'll now also
15628         consume less local variables.  test-38.cs now passes with MCS, added
15629         a few new test cases to that test.
15630
15631 2002-07-20  Martin Baulig  <martin@gnome.org>
15632
15633         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15634         instructions.  Fixes bug #27977, also added test-146.cs.
15635
15636 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15637
15638         * cs-tokenizer.cs: fixed getHex ().
15639
15640 2002-07-19  Martin Baulig  <martin@gnome.org>
15641
15642         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15643         not Type.GetType() to lookup the array type.  This is needed when
15644         we're constructing an array of a user-defined type.
15645         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15646         single-dimensional arrays, but also for single-dimensial arrays of
15647         type decimal.
15648
15649 2002-07-19  Martin Baulig  <martin@gnome.org>
15650
15651         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15652         this function is called, it's not allowed to share LocalBuilders
15653         among ILGenerators.
15654
15655 2002-07-19  Martin Baulig  <martin@gnome.org>
15656
15657         * expression.cs (Argument.Resolve): Report an error 118 when trying
15658         to pass a type as argument.
15659
15660 2002-07-18  Martin Baulig  <martin@gnome.org>
15661
15662         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15663         Conv_R_Un for the signed `long' type.
15664
15665 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15666
15667         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15668         `expr' for the temporary result, as that will fail if we do
15669         multiple resolves on the same expression.
15670
15671 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15672
15673         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15674         ec.TypeContainer for looking up aliases. 
15675
15676         * class.cs (TypeContainer): Remove LookupAlias from here.
15677
15678         * decl.cs (DeclSpace); Move here.
15679
15680 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15681
15682         * class.cs (FindMembers): Only call filter if the constructor
15683         bulider is not null.
15684
15685         Also handle delegates in `NestedTypes' now.  Now we will perform
15686         type lookups using the standard resolution process.  This also
15687         fixes a bug.
15688
15689         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15690         This uses Expressions (the limited kind that can be parsed by the
15691         tree) instead of strings.
15692
15693         * expression.cs (ComposedCast.ToString): Implement, used to flag
15694         errors since now we have to render expressions.
15695
15696         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15697         FormArrayType. 
15698
15699         * ecore.cs (SimpleName.ToString): ditto.
15700
15701         * cs-parser.jay: Instead of using strings to assemble types, use
15702         Expressions to assemble the type (using SimpleName, ComposedCast,
15703         MemberAccess).  This should fix the type lookups in declarations,
15704         because we were using a different code path for this.
15705
15706         * statement.cs (Block.Resolve): Continue processing statements
15707         even when there is an error.
15708
15709 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * class.cs (Event.Define): Also remove the `remove' method from
15712         the list of pending items.
15713
15714         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15715         generate more compact code. 
15716
15717 2002-07-17  Martin Baulig  <martin@gnome.org>
15718
15719         * const.cs (Const.LookupConstantValue): Add support for constant
15720         `unchecked' and `checked' expressions.
15721         Also adding test case test-140.cs for this.
15722
15723 2002-07-17  Martin Baulig  <martin@gnome.org>
15724
15725         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15726         check whether mi.ReturnType implements the IEnumerator interface; the
15727         `==' and the IsAssignableFrom() will fail in this situation.
15728
15729 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15730
15731         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15732         here too.
15733
15734 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15735
15736         * expression.cs: fixed bug #27811.
15737
15738 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15739
15740         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15741         Molaro: when we are a ref, the value already contains a pointer
15742         value, do not take the address of it.
15743
15744 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15745         * removed mb-parser.jay and mb-tokenizer.cs
15746
15747 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15748
15749         * expression.cs: check against the building corlib void type.
15750
15751 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15752
15753         * ecore.cs: fix for valuetype static readonly fields: when 
15754         initializing them, we need their address, not the address of a copy.
15755
15756 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15757
15758         * typemanager.cs: register also enum_type in corlib.
15759
15760 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15761
15762         * class.cs: allow calling this (but not base) initializers in structs.
15763
15764 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15765
15766         * ecore.cs: make sure we compare against the building base types
15767         in GetTypeSize ().
15768
15769 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15770
15771         * typemanager.cs: fix TypeToCoreType() to handle void and object
15772         (corlib gets no more typerefs after this change).
15773
15774 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15775
15776         * expression.cs (ArrayCreation.EmitArrayArguments): use
15777         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15778
15779         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15780         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15781         array indexes, the runtime actually forbids them.
15782
15783         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15784         for array arguments here.
15785
15786         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15787         instead of the default for ValueTypes.
15788
15789         (New.DoEmit): Use IsValueType instead of
15790         IsSubclassOf (value_type)
15791         (New.DoResolve): ditto.
15792         (Invocation.EmitCall): ditto.
15793
15794         * assign.cs (Assign): ditto.
15795
15796         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15797         Statements *are* currently doing part of their resolution during
15798         Emit.  
15799
15800         Expressions do always resolve during resolve, but statements are
15801         only required to propagate resolution to their children.
15802
15803 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15806
15807         (LoadAssembly): Do not add the dll if it is already specified
15808
15809         (MainDriver): Add the System directory to the link path at the end,
15810         after all the other -L arguments. 
15811
15812         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15813         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15814         ldelem.u1) and using the opposite for sbytes.
15815
15816         This fixes Digger, and we can finally run it.
15817
15818         * driver.cs (UnixParseOption): Move the option parsing here.  
15819         (CSCParseOption): Implement CSC-like parsing of options.
15820
15821         We now support both modes of operation, the old Unix way, and the
15822         new CSC-like way.  This should help those who wanted to make cross
15823         platform makefiles.
15824
15825         The only thing broken is that /r:, /reference: and /lib: are not
15826         implemented, because I want to make those have the same semantics
15827         as the CSC compiler has, and kill once and for all the confussion
15828         around this.   Will be doing this tomorrow.
15829
15830         * statement.cs (Unsafe.Resolve): The state is checked during
15831         resolve, not emit, so we have to set the flags for IsUnsfe here.
15832
15833 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15834
15835         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15836         not catch the Error_ObjectRefRequired in SimpleName (as it is
15837         possible to have a class/instance variable name that later gets
15838         deambiguated), we have to check this here.      
15839
15840 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15841
15842         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15843         make static and put into Expression.
15844
15845         (Event.Define): Register the private field of the event with the 
15846         TypeManager so that GetFieldFromEvent can get at it.
15847
15848         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15849         keep track of the private field associated with an event which
15850         has no accessors.
15851
15852         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15853         private field.
15854
15855         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15856
15857 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * expression.cs (Binary.EmitBranchable): this routine emits the
15860         Binary expression in a branchable context.  This basically means:
15861         we need to branch somewhere, not just get the value on the stack.
15862
15863         This works together with Statement.EmitBoolExpression.
15864
15865         * statement.cs (Statement.EmitBoolExpression): Use
15866         EmitBranchable. 
15867
15868 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * statement.cs (For): Reduce the number of jumps in loops.
15871
15872         (For): Implement loop inversion for the For statement.
15873
15874         (Break): We can be breaking out of a Try/Catch controlled section
15875         (foreach might have an implicit try/catch clause), so we need to
15876         use Leave instead of Br.
15877
15878         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15879         now).  If the instace expression supports IMemoryLocation, we use
15880         the AddressOf method from the IMemoryLocation to extract the
15881         address instead of emitting the instance.
15882
15883         This showed up with `This', as we were emitting the instance
15884         always (Emit) instead of the Address of This.  Particularly
15885         interesting when This is a value type, as we dont want the Emit
15886         effect (which was to load the object).
15887
15888 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15891
15892         * statement.cs (Checked): Set the CheckedState during the resolve
15893         process too, as the ConvCast operations track the checked state on
15894         the resolve process, and not emit.
15895
15896         * cs-parser.jay (namespace_member_declaration): Flag that we have
15897         found a declaration when we do.  This is used to flag error 1529
15898
15899         * driver.cs: Report ok when we display the help only.
15900
15901 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15902
15903         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15904
15905 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * cs-tokenizer.cs (define): We also have to track locally the
15908         defines.  AllDefines is just used for the Conditional Attribute,
15909         but we also need the local defines for the current source code. 
15910
15911 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * statement.cs (While, For, Do): These loops can exit through a
15914         Break statement, use this information to tell whether the
15915         statement is the last piece of code.
15916
15917         (Break): Flag that we break.
15918
15919         * codegen.cs (EmitContexts): New `Breaks' state variable.
15920
15921 2002-07-03  Martin Baulig  <martin@gnome.org>
15922
15923         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15924         modifiers in method declarations in structs.  Otherwise, you won't
15925         be able to override things like Object.Equals().
15926
15927 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * class.cs (Method, Property, Indexer): Do not allow the public
15930         modifier to be used in explicit interface implementations.
15931
15932         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15933         override modifiers in method declarations in structs
15934
15935 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15936
15937         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15938         integer or real overflow, report an error
15939
15940 2002-07-02  Martin Baulig  <martin@gnome.org>
15941
15942         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15943         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15944         to tell the runtime about our newly created System.Object and
15945         System.ValueType types.
15946
15947 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15950         struct instead of Ldarg/Starg.
15951
15952 2002-07-02  Martin Baulig  <martin@gnome.org>
15953
15954         * expression.cs (Indirection.Indirection): Call
15955         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15956
15957 2002-07-02  Martin Baulig  <martin@gnome.org>
15958
15959         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15960         ValueType, call TypeManager.TypeToCoreType() on it.
15961         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15962         the OpCodes.Newarr argument.
15963
15964 2002-07-02  Martin Baulig  <martin@gnome.org>
15965
15966         * expression.cs (Invocation.EmitCall): When compiling corlib,
15967         replace all calls to the system's System.Array type to calls to
15968         the newly created one.
15969
15970         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15971         System.Array methods.
15972         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15973         from the system's System.Array type which must be replaced.
15974
15975 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15976
15977         * typemanager.cs: load unverifiable_code_ctor so we can build
15978         corlib using the correct type. Avoid using GetTypeCode() with
15979         TypeBuilders.
15980         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15981         TypeManager.object_type to allow building corlib.
15982
15983 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15984
15985         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15986
15987 2002-07-01  Martin Baulig  <martin@gnome.org>
15988
15989         * class.cs: Make the last change actually work, we need to check
15990         whether `ifaces != null' to avoid a crash.
15991
15992 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15993
15994         * class.cs: when we build structs without fields that implement
15995         interfaces, we need to add the interfaces separately, since there is
15996         no API to both set the size and add the interfaces at type creation
15997         time.
15998
15999 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16000
16001         * expression.cs: the dimension arguments to the array constructors
16002         need to be converted if they are a long.
16003
16004 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16005
16006         * class.cs: don't emit ldarg.0 if there is no parent constructor
16007         (fixes showstopper for corlib).
16008
16009 2002-06-29  Martin Baulig  <martin@gnome.org>
16010
16011         MCS now compiles corlib on GNU/Linux :-)
16012
16013         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16014         ie. check for MethodImplOptions.InternalCall.
16015
16016         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16017         and TypeManager.attribute_type are null, so we must explicitly check
16018         whether parent is not null to find out whether it's an attribute type.
16019         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16020         and SetBuilder, not only if the property is neither abstract nor external.
16021         This is necessary to set the MethodImplOptions on the accessor methods.
16022         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16023         SetBuilder, see Property.Emit().
16024
16025         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16026         populate "System.Object", "System.ValueType" and "System.Attribute" since
16027         they've already been populated from BootCorlib_PopulateCoreTypes().
16028
16029 2002-06-29  Martin Baulig  <martin@gnome.org>
16030
16031         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16032         is the NullLiteral, we also need to make sure that target_type is not
16033         an enum type.   
16034
16035 2002-06-29  Martin Baulig  <martin@gnome.org>
16036
16037         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16038         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16039         before calling BootstrapCorlib_ResolveDelegate ().
16040
16041 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16042
16043         * statement.cs: fixed build-breaker. All tests passed ok.
16044
16045 2002-06-27  Martin Baulig  <martin@gnome.org>
16046
16047         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16048         for System.Decimal when compiling corlib.
16049
16050 2002-06-27  Martin Baulig  <martin@gnome.org>
16051
16052         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16053         switch blocks which contain nothing but a default clause.
16054
16055 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16056
16057        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16058
16059 2002-06-27  Martin Baulig  <martin@gnome.org>
16060
16061         * ecore.cs (PropertyExpr.PropertyExpr): Call
16062         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16063
16064         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16065         is already a TypeBuilder.
16066
16067 2002-06-27  Martin Baulig  <martin@gnome.org>
16068
16069         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16070         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16071         the "from an array-type to System.Array" case.  This makes it work
16072         when compiling corlib.
16073
16074 2002-06-27  Martin Baulig  <martin@gnome.org>
16075
16076         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16077         non-static PropertyExpr, set its InstanceExpression.  This makes
16078         the `ICollection.Count' property work in System/Array.cs.
16079
16080 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16081
16082         * driver.cs: Made error handling more consistent.  Errors now
16083         tracked by Report class, so many methods which used to return int
16084         now return void.  Main() now prints success/failure and 
16085         errors/warnings message.
16086
16087         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16088         the magic number return values (123 and 124).  Now, if the
16089         expected error occurs, the compiler exits with success (exit value
16090         0).  If the compilation completes without seeing that particular
16091         error, the compiler exits with failure (exit value 1).  The
16092         makefile in mcs/errors has been changed to handle the new behaviour.
16093
16094         * report.cs: Made 'expected error' number a property and renamed
16095         it from 'Probe' to 'ExpectedError'.
16096
16097         * genericparser.cs: Removed error handling support, since it is
16098         now all done by Report class.
16099
16100         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16101         class, so parse() no longer returns an int.
16102
16103         * namespace.cs: Use Report.Error instead of GenericParser.error
16104
16105 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16108         TypeContainer.AddOperator): At the front of the list put the
16109         explicit implementations, so they get resolved/defined first. 
16110
16111 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16112
16113         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16114         interface type is implemented by this TypeContainer.  Used during
16115         explicit interface implementation.
16116
16117         (Property.Define, Indexer.Define, Method.Define): Validate that
16118         the given interface in the explicit implementation is one of the
16119         base classes for the containing type.
16120
16121         Also if we are explicitly implementing an interface, but there is
16122         no match in the pending implementation table, report an error.
16123
16124         (Property.Define): Only define the property if we are
16125         not explicitly implementing a property from an interface.  Use the
16126         correct name also for those properties (the same CSC uses,
16127         although that is really not needed).
16128
16129         (Property.Emit): Do not emit attributes for explicitly implemented
16130         properties, as there is no TypeBuilder.
16131
16132         (Indexer.Emit): ditto.
16133
16134         Hiding then means that we do not really *implement* a pending
16135         implementation, which makes code fail.
16136
16137 2002-06-22  Martin Baulig  <martin@gnome.org>
16138
16139         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16140         the return value of Object.GetType().  [FIXME: we need to do this whenever
16141         we get a type back from the reflection library].
16142
16143 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16144
16145         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16146
16147 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * attribute.cs: Return null if we can not look up the type.
16150
16151         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16152         the interface types found.
16153
16154         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16155         interface types found.
16156
16157         * typemanager.cs (GetInterfaces): Make this routine returns alll
16158         the interfaces and work around the lame differences between
16159         System.Type and System.Reflection.Emit.TypeBuilder in the results
16160         result for GetInterfaces.
16161
16162         (ExpandInterfaces): Given an array of interface types, expand and
16163         eliminate repeated ocurrences of an interface.  This expands in
16164         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16165         be IA, IB, IC.
16166
16167 2002-06-21  Martin Baulig  <martin@gnome.org>
16168
16169         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16170         on System.Enum.
16171
16172 2002-06-21  Martin Baulig  <martin@gnome.org>
16173
16174         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16175         and called with one of the core types, return the corresponding typebuilder for
16176         that type.
16177
16178         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16179         element type.
16180
16181 2002-06-21  Martin Baulig  <martin@gnome.org>
16182
16183         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16184         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16185         (Expression.ConvertReferenceExplicit): Likewise.
16186
16187         * expression.cs (ElementAccess.DoResolve): Likewise.
16188         (ElementAccess.DoResolveLValue): Likewise.
16189
16190 2002-06-10  Martin Baulig  <martin@gnome.org>
16191
16192         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16193         add the "value" parameter to the parameter list.
16194
16195         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16196         to our caller.
16197
16198 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16199
16200         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16201         the argument to an int, uint, long or ulong, per the spec.  Also
16202         catch negative constants in array creation.
16203
16204 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16205
16206         * class.cs: do not allow the same interface to appear twice in
16207         the definition list.
16208
16209 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16210
16211         * ecore.cs: don't use ldlen with System.Array.
16212
16213 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16214
16215         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16216
16217 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16218
16219         * modifiers.cs: produce correct field attributes for protected
16220         internal. Easy fix so miguel can work on ther harder stuff:-)
16221
16222 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16223
16224         * pending.cs: New file.  Move the code from class.cs here.
16225         Support clearning the pending flag for all methods (when not doing
16226         explicit interface implementation).
16227
16228 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16229
16230         * rootcontext.cs: added a couple more types needed to bootstrap.
16231
16232 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16233
16234         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16235         constructor in the type, instead of any constructor in the type
16236         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16237         a bug in the Mono runtime when applying the params attribute). 
16238
16239 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16240         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16241
16242 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16243
16244         * expression.cs (Unary.ResolveOperator): Use TypeManager
16245         to resolve the type.
16246
16247 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16248
16249         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16250         attached.
16251
16252         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16253         with each member too.
16254
16255         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16256         field builders too - this takes care of the enum member case.
16257
16258 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16259
16260         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16261         address-of operator on both value types and pointers.
16262
16263 2002-06-10  Martin Baulig  <martin@gnome.org>
16264
16265         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16266         PropertyBuilder to the `property_builders' list.
16267
16268         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16269         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16270         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16271         find any indexers which are inherited from an interface.
16272
16273 2002-06-09  Martin Baulig  <martin@gnome.org>
16274
16275         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16276         the same type as the constant if necessary.  There's also a test-130.cs
16277         for this.
16278
16279         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16280
16281         * typemanager.cs (TypeManager.ChangeType): Previously known as
16282         Enum.ChangeEnumType().
16283
16284 2002-06-09  Martin Baulig  <martin@gnome.org>
16285
16286         * expression.cs (Cast.TryReduce): Added support for consts.
16287
16288 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16289
16290         * class.cs (Accessor): Hold attributes information so we can pass
16291         it along.
16292
16293         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16294         Modify to pass in attributes attached to the methods.
16295
16296         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16297
16298         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16299         to handle the Accessor kind :-)
16300
16301         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16302
16303 2002-06-08  Martin Baulig  <martin@gnome.org>
16304
16305         * expression.cs (Unary.TryReduceNegative): Added support for
16306         ULongConstants.
16307
16308 2002-06-08  Martin Baulig  <martin@gnome.org>
16309
16310         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16311         name can't be found in the `defined_names' - the caller will do a
16312         MemberLookup in this case and thus find methods in System.Enum
16313         such as Enum.IsDefined().
16314
16315 2002-06-08  Martin Baulig  <martin@gnome.org>
16316
16317         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16318         Convert.ChangeType() which works with TypeBuilder created types.
16319         (Enum.LookupEnumValue, Enum.Define): Use it here.
16320
16321         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16322         `TypeBuilder.BaseType != null' check.
16323         (TypeContainer.FindMembers): Only lookup parent members if we
16324         actually have a parent.
16325         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16326         (ConstructorInitializer.Resolve): Likewise.
16327
16328         * interface.cs (Interface.FindMembers): Added
16329         `TypeBuilder.BaseType != null' check.
16330
16331         * rootcontext.cs (RootContext.ResolveCore): Added
16332         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16333         classes_second_stage.
16334
16335         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16336         debug_type and trace_type when compiling with --nostdlib.       
16337
16338 2002-06-07  Martin Baulig  <martin@gnome.org>
16339
16340         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16341         (AddField): Set it to true when adding a non-static field.
16342         (DefineType): Use `have_nonstatic_fields' to find out whether we
16343         have non-static fields, not `Fields != null'.
16344
16345 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16346
16347         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16348         dereferencing a null on the static-field code path)
16349
16350 2002-05-30  Martin Baulig  <martin@gnome.org>
16351
16352         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16353         to take command line arguments.  Use reflection to call the new
16354         custom `Initialize' function on the symbol writer and pass it the
16355         command line arguments.
16356
16357         * driver.cs (--debug-args): New command line argument to pass command
16358         line arguments to the symbol writer.
16359
16360 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16363         the target type for indexers and properties.  Thanks to Joe for
16364         catching this.
16365
16366 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16367
16368         * typemanager.cs (MethodFlags): returns the method flags
16369         (Obsolete/ShouldIgnore) that control warning emission and whether
16370         the invocation should be made, or ignored. 
16371
16372         * expression.cs (Invocation.Emit): Remove previous hack, we should
16373         not do this on matching a base type, we should do this based on an attribute
16374
16375         Only emit calls to System.Diagnostics.Debug and
16376         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16377         on the command line.
16378
16379         * rootcontext.cs: Global settings for tracing and debugging.
16380
16381         * cs-tokenizer.cs (define): New utility function to track
16382         defines.   Set the global settings for TRACE and DEBUG if found.
16383
16384 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16385
16386         * interface.cs (Populate*): Pass in the TypeContainer as well as
16387         the DeclSpace as parameters so that we can create EmitContexts and
16388         then use that to apply attributes etc.
16389
16390         (PopulateMethod, PopulateEvent, PopulateProperty)
16391         (PopulateIndexer): Apply attributes everywhere.
16392
16393         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16394         etc.
16395
16396         (ApplyAttributes): Update accordingly.
16397
16398         We now apply interface attributes for all members too.
16399
16400 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * class.cs (Indexer.Define); Correctly check if we are explicit
16403         implementation (instead of checking the Name for a ".", we
16404         directly look up if the InterfaceType was specified).
16405
16406         Delay the creation of the PropertyBuilder.
16407
16408         Only create the PropertyBuilder if we are not an explicit
16409         interface implementation.   This means that explicit interface
16410         implementation members do not participate in regular function
16411         lookups, and hence fixes another major ambiguity problem in
16412         overload resolution (that was the visible effect).
16413
16414         (DefineMethod): Return whether we are doing an interface
16415         implementation. 
16416
16417         * typemanager.cs: Temporary hack until we get attributes in
16418         interfaces (Ravi is working on that) and we get IndexerName
16419         support in interfaces.
16420
16421         * interface.cs: Register the indexers as properties.
16422
16423         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16424         warning, I have verified that this is a bug in the .NET runtime
16425         (JavaScript suffers of the same problem).
16426
16427         * typemanager.cs (MemberLookup): When looking up members for
16428         interfaces, the parent of an interface is the implicit
16429         System.Object (so we succeed in searches of Object methods in an
16430         interface method invocation.  Example:  IEnumerable x;  x.ToString
16431         ()) 
16432
16433 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16434
16435         * class.cs (Event): Events should also register if they do
16436         implement the methods that an interface requires.
16437
16438         * typemanager.cs (MemberLookup); use the new GetInterfaces
16439         method. 
16440
16441         (GetInterfaces): The code used to lookup interfaces for a type is
16442         used in more than one place, factor it here. 
16443
16444         * driver.cs: Track the errors at the bottom of the file, we kept
16445         on going.
16446
16447         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16448         instance if the method we are calling is static!
16449
16450 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * attribute.cs (ApplyAttributes): Make this function filter out
16453         the IndexerName attribute (as that attribute in reality is never
16454         applied) and return the string constant for the IndexerName
16455         attribute. 
16456
16457         * class.cs (TypeContainer.Emit): Validate that all the indexers
16458         have the same IndexerName attribute, and if so, set the
16459         DefaultName attribute on the class. 
16460
16461         * typemanager.cs: The return value might contain other stuff (not
16462         only methods).  For instance, consider a method with an "Item"
16463         property and an Item method.
16464
16465         * class.cs: If there is a problem with the parameter types,
16466         return. 
16467
16468 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16469
16470         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16471         looks at user defined conversion after making a call to 
16472         StandardConversionExists - we need this for overload resolution.
16473
16474         * expression.cs : Update accordingly the various method calls.
16475
16476         This fixes 2 bugs filed against implicit user defined conversions 
16477
16478 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16479
16480         * statement.cs: Track the result of the assignment.
16481
16482 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16483
16484         * expression.cs (MemberAccess): Improved error reporting for
16485         inaccessible members.
16486
16487 2002-05-22  Martin Baulig  <martin@gnome.org>
16488
16489         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16490         itself with debugging support.
16491
16492 2002-05-22  Martin Baulig  <martin@gnome.org>
16493
16494         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16495         Removed, this isn't needed anymore.
16496
16497 2002-05-20  Martin Baulig  <martin@gnome.org>
16498
16499         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16500         be underlying type for an enum.
16501
16502 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16503
16504         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16505         that splits out the loading of just the core types.
16506
16507         * rootcontext.cs (ResolveCore): Split the struct resolution in
16508         two, so we can load the enumeration underlying types before any
16509         enums are used.
16510
16511         * expression.cs (Is): Bandaid until we fix properly Switch (see
16512         bug #24985 for details).
16513
16514         * typemanager.cs (ImplementsInterface): The hashtable will contain
16515         a null if there are no interfaces implemented.
16516
16517 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16518
16519         * cs-parser.jay (indexer_declarator): It is fine to have array
16520         parameters
16521
16522 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * typemanager.cs: (RegisterBuilder): New function used to register
16525         TypeBuilders that implement interfaces.  Since
16526         TypeBuilder.GetInterfaces (as usual) does not work with lame
16527         Reflection.Emit. 
16528         (AddUserType): register interfaces.
16529
16530         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16531         dealing with TypeBuilder.  Also, arrays are showing up as
16532         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16533         methods can not be invoked on them!
16534
16535         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16536         (ImplicitReferenceConversionExists): Split out from
16537         StandardConversionExists. 
16538
16539         * expression.cs (As): We were only implementing one of the three
16540         cases for the as operator.  We now implement them all.
16541         (Is): Implement the various other cases for Is as well.
16542
16543         * typemanager.cs (CACHE): New define used to control if we want or
16544         not the FindMembers cache.  Seems to have a negative impact on
16545         performance currently
16546
16547         (MemberLookup): Nested types have full acess to
16548         enclosing type members
16549
16550         Remove code that coped with instance/static returns for events, we
16551         now catch this in RealFindMembers.
16552
16553         (RealFindMembers): only perform static lookup if the instance
16554         lookup did not return a type or an event.  
16555
16556 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16557
16558         * assign.cs (CompoundAssign): We pass more semantic information
16559         now to Compound Assignments than we did before: now we have all
16560         the information at hand, and now we resolve the target *before* we
16561         do the expression expansion, which allows the "CacheValue" method
16562         to have the effect we intended (before, a [x] += 1 would generate
16563         two differen ArrayAccess expressions from the ElementAccess,
16564         during the resolution process).
16565
16566         (CompoundAssign.DoResolve): Resolve target and original_source here.
16567
16568 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * expression.cs (ArrayAccess): dropped debugging information. 
16571
16572         * typemanager.cs: Small bug fix: I was always returning i_members,
16573         instead of one of i_members or s_members (depending on which had
16574         the content).
16575
16576         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16577         method is invoked before any code generation takes place, and it
16578         is a mechanism to inform that the expression will be invoked more
16579         than once, and that the method should use temporary values to
16580         avoid having side effects
16581
16582         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16583
16584         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16585         implementation.
16586
16587         * expression.cs (Indirection, ArrayAccess): Add support for
16588         CacheTemporaries in these two bad boys. 
16589
16590         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16591         ldobj or ldind_ref.  
16592         (StoreFromPtr): Handle stobj as well.
16593
16594         * expression.cs (UnaryMutator): Share more code.
16595
16596         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16597         down: I was not tracking the Filter function as well, which
16598         was affecting the results of the cache.
16599
16600 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * attribute.cs: Remove the hack to handle the CharSet property on
16603         StructLayouts. 
16604
16605 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * attribute.cs (DoResolve): More uglyness, we now only try to
16608         resolve the attribute partially, to extract the CharSet
16609         information (only if we are a StructLayout attribute).  Otherwise 
16610
16611         (GetExtraTypeInfo): Add some code to conditionally kill in the
16612         future this.   I am more and more convinced that the .NET
16613         framework has special code to handle the attribute setting on
16614         certain elements.
16615
16616         * expression.cs (IsParamsMethodApplicable): Revert my previous
16617         foreach change here, it was wrong.
16618
16619 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16622         (pp_expr): do not abort on unknown input, just return.
16623         (eval): abort if there are pending chars.
16624
16625         * attribute.cs (Attribute.Resolve): Positional parameters are
16626         optional.  Deal with that case.
16627
16628         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16629         the Ansi/Unicode/Auto information for the type.
16630
16631         (TypeContainer.DefineType): instantiate the EmitContext here, as
16632         we will be using it during the type definition (to resolve
16633         attributes) and during the emit phase.
16634
16635         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16636         to pull type information out of the attributes
16637
16638         (Attribute.Resolve): track the constructor builder, and allow for
16639         multiple invocations (structs and classes will use this).
16640
16641         * ecore.cs (MemberLookupFinal): new version with all the
16642         parameters customizable.
16643
16644         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16645         constructors.  Return if the result value is null (as the error
16646         would have been flagged already by MemberLookupFinal)
16647
16648         Do not allow instances of abstract classes or interfaces to be
16649         created.
16650
16651         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16652         We have to compare the assembly property here when dealing with
16653         FamANDAssem and Assembly access modifiers, because we might be
16654         creating an assembly from *modules* (that means that we are not
16655         getting TypeBuilders for types defined in other modules that are
16656         part of this assembly).
16657
16658         (Method.Emit): If the method is marked abstract and has a body,
16659         emit an error. 
16660
16661         (TypeContainer.DefineMembers): If both the defined member and the
16662         parent name match are methods, then do not emit any warnings: let
16663         the Method.Define routine take care of flagging warnings.  But if
16664         there is a mismatch (method overrides something else, or method is
16665         overriwritten by something, then emit warning).
16666
16667         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16668         set to null, this means `do not check for the return type on the
16669         signature'. 
16670
16671         (Method.Define): set the return type for the method signature to
16672         null, so that we get methods with the same name and parameters and
16673         different return types.  This is used to flag warning 114 (you are
16674         hiding a method, and you probably want to use the new/override
16675         keywords instead).
16676
16677         * typemanager.cs (MemberLookup): Implemented proper access
16678         control, closing a long standing set of bug reports.  The problem
16679         was that the Framework only has two bits: Public and NonPublic,
16680         and NonPublic includes private and protected methods, but we need
16681         to enforce the FamANDAssem, FamOrAssem and Family. 
16682
16683 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16684
16685         * statement.cs (GotoCase): Return true: Ammounts to giving up
16686         knowledge on whether we return or not, and letting the other case
16687         be responsible for it.
16688
16689 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16690
16691         * driver.cs: Do not load directories for each file processed, only
16692         do it if there is a pattern.
16693
16694         * ecore.cs: Report readonly assigns here as well, as we might have
16695         been resolved only by MemberAccess.
16696
16697         (SimpleName.SimpleNameResolve): Also be useful for LValue
16698         resolution.   We need this to propagate assign to local readonly variables
16699
16700         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16701         do not want to reuse potential criteria memory.
16702
16703         * class.cs (MyEventBuilder): Set reflected_type;
16704
16705         * ecore.cs (Constantify): Added support for constifying bools.
16706
16707         (RootContext.LookupType): Added a cache for values looked up in
16708         the declaration space.
16709
16710         * typemanager.cs (FindMembers): Now is a front-end to
16711         RealFindMembers, and provides a two-level hashtable-based cache to
16712         the request.  
16713
16714         15% performance improvement: from 22.5 to 19.2 seconds.
16715
16716         * expression.cs (IsParamsMethodApplicable): use foreach.
16717         (Invocation.DoResolve): ditto.
16718         (New.DoResolve): ditto.
16719         (ArrayCreation.DoResolve): ditto.
16720
16721         * ecore.cs (FindMostEncompassingType): use foreach.
16722
16723         * delegate.cs (NewDelegate.DoResolve): Use foreach
16724
16725         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16726         (RemoveMethods): use foreach.
16727
16728         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16729         nested foreach statements instead of for, and also break out of
16730         the inner loop once a match is found.
16731
16732         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16733
16734 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16735
16736         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16737         we actually unwrap the expression to allow for extra information
16738         to be extracted. 
16739
16740         * expression.cs: Use Shr_Un on unsigned operations. 
16741
16742 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16743
16744         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16745         applicable operators was not being considered correctly. This closes
16746         the bug Miguel reported.
16747
16748 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16749
16750         * attribute.cs: check that the type derives from System.Attribute
16751         and report the correct error in that case (moved the duplicate code to
16752         its own method, too).
16753
16754 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16755
16756         * attribute.cs: lookup attribute type name as the spec says: first the
16757         bare attribute name and then name + "Attribute" (nant compiles with
16758         mcs after this fix).
16759
16760 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16763         Because of the way we parse things, we should try to see if a
16764         UIntConstant can fit in an integer.
16765
16766 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16767
16768         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16769         when we are in an explicit context.
16770
16771         (ConvertReferenceExplicit): When converting from Iface type S to Class
16772         T make sure the rules are implemented as an OR.
16773
16774         * parameter.cs (ParameterType): Make it a property for now although the
16775         purpose really isn't anything immediate.
16776
16777         * expression.cs (Is*Applicable): Do better checking on the parameter type
16778         of a ref/out parameter. The ones from the system assemblies are already 
16779         marked with the correct type so we don't need to do any correction.
16780
16781         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16782         the object type is standard too so include that.
16783
16784 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16785
16786         * ecore.cs (StandardConversionExists): Augment with missing code:
16787         deal with IntConstant, LongConstants and Enumerations.
16788
16789         * assign.cs: Report the error, instead of failing silently
16790
16791         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16792         typecontainer that they are declared, because the
16793         typecontainer/namespace will have the list of using clauses that
16794         need to be applied.
16795
16796         Assembly Attributes were escaping the normal registration
16797         mechanism. 
16798
16799         (EmitCode): Apply attributes within an EmitContext that represents
16800         the container they were declared on.
16801
16802         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16803
16804 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16805
16806         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16807         Revamp completely - make much cleaner as we now operate only
16808         on a set of Types.
16809
16810         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16811         to implement the logic detailed in the spec more correctly.
16812
16813         (UserDefinedConversion): Update accordingly.
16814
16815 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16816
16817         * statement.cs: Return flow analysis information up.
16818
16819         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16820         and the default.
16821
16822         (token): Do not consume an extra character before calling
16823         decimal_digits.
16824
16825 2002-05-06  Piers Haken <piersh@friskit.com>
16826
16827         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16828
16829 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16830
16831         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16832         EmitContext during the instance constructor initializer
16833         resolution, to stop access to instance variables.
16834
16835         This is mandated by the spec, last paragraph of the `constructor
16836         initializers' section. 
16837
16838 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16839
16840         * cs-parser.jay, class.cs (Accessor): new class used to represent
16841         an accessor (get or set).  In the past we used `null' to represent
16842         a missing accessor.  But this is ambiguous because there was no
16843         way to tell in abstract indexers/properties if one of them was
16844         specified.
16845
16846         Now there is a way of addressing that.
16847
16848         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16849         instead of FindMembers.
16850
16851         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16852         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16853
16854         * attribute.cs: Treat indexers and properties as the same in terms
16855         of applying attributes
16856
16857         * ecore.cs (FindMostEncompassedType): Use statically initialized
16858         EmptyExpressions()s like we do elsewhere to avoid creating useless
16859         objects (and we take this out of the tight loop).
16860
16861         (GetConversionOperators): Move the code to extract the actual
16862         operators to a separate routine to clean things up.
16863
16864 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16865
16866         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16867         events are always registered FieldBuilders.
16868
16869         * class.cs (FieldBase): New class shared by Fields 
16870
16871         * delegate.cs: If we are a toplevel delegate, use our full name.
16872         If we are a nested delegate, then only use our tail name.
16873
16874 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16875
16876         * expression.cs (IsApplicable): Ensure that we add the "&" to
16877         ref/out types before comparing it with the type of the argument.
16878
16879         (IsParamsMethodApplicable): Ditto.
16880
16881         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16882         silly me ;-)
16883
16884         * delegate.cs : Handle the case when we have more than one applicable
16885         method. Flag an error only when we finish checking all.
16886
16887 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16888
16889         * expression.cs: Add support for boolean static initializers.
16890
16891 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16892
16893         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16894
16895         * parameter.cs (ComputeParameterTypes,
16896         ComputeAndDefineParameterTypes): Better error handling: now we
16897         clear the `types' cache if we fail during any of the type lookups.
16898         We also return the status code correctly to our caller
16899
16900         * delegate.cs: If we fail to define a delegate, abort the extra
16901         steps. 
16902
16903         * expression.cs (Binary.ResolveOperator): for
16904         operator==(object,object) and operator !=(object, object) we also
16905         have to verify that there is an implicit conversion from one to
16906         the other.
16907
16908         (ArrayAccess.DoResolve): Array Access can operate on
16909         non-variables. 
16910
16911 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * assign.cs (CompoundAssign): A new class used as a "flag" that
16914         the assignment actually is happening as part of a compound
16915         assignment operator.
16916
16917         During compound assignment, a few new rules exist to enable things
16918         like:
16919
16920         byte b |= 1 + 2
16921
16922         From the spec:
16923
16924         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16925         to the type of x) if y is implicitly convertible to the type of x,
16926         and the operator is a builtin operator and the return type of the
16927         operator is explicitly convertible to the type of x. 
16928
16929         * rootcontext.cs: Reset warning level to 2.  4 catches various
16930         "interesting" features in mcs, we must clean this up at some
16931         point, but currently am trying to kill other bugs ;-)
16932
16933         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16934         in container classes as well.  
16935
16936         * expression.cs (Binary.ResolveOperator): Handle string case
16937         before anything else (as operator overloading does emit an error
16938         before doing anything else).
16939
16940         This code could go away when we move to a table driven model, but
16941         i could not come up with a good plan last night.
16942
16943 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16944
16945         * typemanager.cs (CSharpName): reimplementation using regex.
16946         * class.cs: added null check for fields in Emit
16947         * rootcontext.cs: set warninglevel to 4
16948
16949 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * typemanager.cs (CSharpName): reimplemented with Lupus
16952         suggestion.
16953
16954 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16955
16956         * statement.cs (If): correclty implement Resolve, because we were
16957         not catching sem errors in there.  The same process is needed
16958         everywhere else. 
16959         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16960
16961
16962         (Statement.Warning_DeadCodeFound): Factorize code.
16963         (While): Report dead code here too.
16964
16965         (Statement): Added Resolve virtual method to allow
16966         for resolution split from the emit code.
16967
16968 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16969
16970         * statement.cs (EmitBoolExpression): No longer try to resolve the
16971         expression here.    
16972         (MakeBoolean): New utility function that resolve, implicitly
16973         converts to boolean and tags the expression. 
16974
16975
16976         (If, Do): Implement dead code elimination.
16977         (While): Implement loop inversion
16978
16979         (Do, While, For, If): Resolve the expression prior to calling our
16980         code generation.
16981
16982 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16983
16984         * class.cs:
16985           - added method Report28 (warning: program has more than one entry point)
16986           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16987           - modified method Method.Define, the part at the end of the method
16988
16989         * rootcontext.cs: added static public Location EntryPointLocation;
16990           
16991         * ../errors/cs0028.cs : Add test case for the above warning.              
16992
16993         * typemanager.cs:
16994           - modified method CSharpName to allow arrays of primitive type to
16995             be printed nicely (e.g. instead of System.Int32[][] it now prints
16996             int[][])
16997           - added method CSharpSignature: returns the signature of a method
16998             in string format to be used in reporting errors, warnings, etc.
16999
17000         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17001         with String.Empty.
17002
17003 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17004
17005         * delegate.cs (Define): Fix extremely silly bug where I was
17006         setting the type of the 'object' parameter of the BeginInvoke
17007         method to System.IAsyncResult instead of System.Object ;-)
17008
17009 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17010
17011         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17012         here. 
17013
17014         (Constructor.Emit): return if we fail to initialize the
17015         constructor.  Another door closed!  
17016
17017         * expression.cs (New.DoResolve): Improve error message (from -6 to
17018         1501).  Use DeclaredOnly lookup to find the exact constructor.
17019
17020         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17021         loop.  This is useful.
17022
17023         * cs-parser.jay: Adjust the default parameters so that destructors
17024         have the proper signature.
17025
17026 2002-04-26  Martin Baulig  <martin@gnome.org>
17027
17028         * driver.cs (LoadAssembly): If `assembly' contains any characters
17029         which are only valid in path names and not in assembly names
17030         (currently slash, backslash and point), use Assembly.LoadFrom ()
17031         instead of Assembly.Load () on the `assembly' (before iteration
17032         over the link_paths).
17033
17034 2002-04-26  Martin Baulig  <martin@gnome.org>
17035
17036         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17037
17038 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * class.cs (Property): use the new typemanager.MemberLookup
17041
17042         (TypeContainer.MemberLookup): Implement using the
17043         TypeManager.MemberLookup now. 
17044
17045         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17046         and return MemberInfos, so that these can be used without an
17047         EmitContext (what we had before).
17048
17049 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17050
17051         * expression.cs: Fix the case where the argument to params if the
17052         type of the params.  I omitted handling this before.   Fixed
17053
17054 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * driver.cs: Call BootCorlib_PopulateCoreType
17057
17058         * class.cs (Property.CheckBase): Check for properties only, not
17059         for all members. 
17060
17061         * interface.cs: Temporary hack: try/catch around the
17062         CustomAttributeBuilder, because I am getting an exception that I
17063         do not understand.
17064
17065         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17066         types whose definitions are required to be there (attributes are
17067         defined before standard types).
17068
17069         Compute definitions as we boot the various types, as they are used
17070         immediately (value_type class will need object_type, but if we do
17071         not initialize object_type, we will pass a null, which will let
17072         the runtime pick the System.Object from the existing corlib, which
17073         is not what we want).
17074
17075 2002-04-22  Patrik Torstensson <totte@labs2.com>
17076
17077         * cs-tokenizer.cs: fixed a number of trim() issues.
17078
17079 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17080
17081         * expression.cs (Argument.Type): Ensure that we return the correct
17082         type when we have out or ref parameters [in which case we 
17083         append a "&"].
17084
17085 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * class.cs (Property, Indexer): Allow extern modifier in there. 
17088
17089         * typemanager.cs (InitBaseTypes): Initializes object_type and
17090         value_type, since those will be used early on during the bootstrap
17091         process to compile corlib.
17092
17093         (InitCoreTypes): Move code from here to InitBaseTypes.
17094
17095 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17096
17097         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17098         single-dimension arrays as using the ldlen opcode.  
17099
17100         Daniel Lewis discovered this optimization.  
17101
17102         * typemanager.cs: Add signature for System.Array::get_Length
17103
17104 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17105
17106         * statement.cs: report the error when the foreach does not apply to an
17107         array nor a collection.
17108
17109 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * expression.cs: Add implicit conversions to the operator ~.
17112
17113         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17114
17115         * typemanager.cs: Locate the decimal constructor.
17116
17117 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17118
17119         * attribute.cs: use the new property of TypeOf.
17120         * expression.cs: added 'get' property around typearg.
17121
17122         These changes fix a build breaker reported by NickD. Is this the
17123         correct way to fix?  If not, please, revert my changes and make it
17124         work :-).
17125
17126 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * attribute.cs: Add support for typeof in attribute invocations.
17129         I am not sure that this is right though.
17130
17131 2002-04-14  Duncan Mak  <duncan@ximian.com>
17132
17133         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17134         Binary.Operator.Division case.
17135
17136 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17137
17138         * class.cs (DefineType): Ensure that we do a proper check on
17139         attribute types and also register it with the TypeManager.
17140
17141         (TypeContainer.Targets): The default for attribute types is
17142         AttributeTargets.All.
17143
17144         * attribute.cs (ApplyAttributes): Registering the attribute type
17145         is done elsewhere, not when we discover we have a Usage attribute.
17146
17147 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17148
17149         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17150         and get rid of is_delegate parameter.
17151
17152         * everywhere : update.
17153
17154 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17155
17156         * cs-parser.jay (compilation_unit): Revamp completely to use
17157         some new ideas that I got from Rhys' grammar to solve the problems
17158         with assembly level attributes.
17159
17160         (outer_declaration): New grammar production.
17161
17162         (attribute_sections): Add.
17163
17164         (opt_attributes): Base on attribute_sections
17165
17166         (namespace_declaration): Allow opt_attributes to tackle the case
17167         when we have assembly level attributes - we are clever in this
17168         regard now ;-)
17169
17170         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17171         attributes in the non-global context.
17172
17173         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17174         instead of SetGlobalAttributes.
17175
17176         * class.cs, rootcontext.cs : Ensure we define and generate 
17177         attribute types before anything else.
17178
17179         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17180         and flag the new error -20 for the case when the attribute type
17181         does not have valid targets specified. csc does not catch this.
17182
17183         * ../errors/errors.txt : update for error # -20
17184
17185 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17186
17187         * support.cs (InternalParameters.ParameterModifier): Do some null
17188         checking and return sane values.
17189
17190         * class.cs (Method.Define): If we are a PInvoke method, ensure
17191         that we are static and extern. Report error # 601
17192
17193         * ../errors/cs0601.cs : Add test case for the above error.
17194
17195 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17196
17197         * rootcontext.cs (attribute_types): We need to keep type of
17198         all attribute types separately and emit code for them first.
17199
17200         (RegisterAttribute) : Implement.
17201
17202         * class.cs (DefineType): Check if the current Type is a custom
17203         attribute type and register it accordingly.
17204
17205         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17206         adding the first attribute twice and rename to
17207
17208         (SetGlobalAttributes): this.
17209
17210         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17211         lookups.
17212
17213         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17214         if we are processing global arguments. Hmm, I am unsure of this.
17215
17216 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17217
17218         * expression.cs: added static array of strings to avoid calling
17219         Enum.ToString () for Operator in Binary. Significant recover of
17220         performance.
17221
17222 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17223
17224         * class.cs (FindMembers): Allow the Builders of the various
17225         members to be null.  If they are skip them.  This only happens
17226         during the PInvoke declaration.
17227
17228 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17231         failure, so we do not keep going afterwards.
17232
17233         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17234         wanted to pass `false' as the `is_delegate' argument.  If this is
17235         the case, why not use delegate_type == null to mean `is_delegate =
17236         false' and anything else as is_delegate = true.
17237
17238 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17239
17240         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17241         code for the section, not the beginning of the tests.
17242
17243 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17244
17245         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17246
17247         * expression.cs (Binary): same.  Warn about errors where we have
17248         Enum/Enum in operator + as well.
17249
17250 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17251
17252         * statement.cs:
17253                 - added support for switch(bool)
17254                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17255                 - add TableSwitchEmit() to handle table-based switch statements
17256
17257 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17258
17259         * expression.cs (Invocation.OverloadResolve): Factor out code which
17260         does parameter compatibility checking with arguments so that we can 
17261         re-use the code even from Delegate.VerifyApplicability
17262
17263         (VerifyArgumentsCompat): Move above code here.
17264
17265         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17266         and instead make a call to the above method.
17267
17268 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17269
17270         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17271         We use it to keep track of classes which are attribute types.
17272
17273 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17274
17275         * delegate.cs (Delegate.Define): Correctly define the types in the
17276         presence of fixed and array parameters.
17277
17278         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17279         doing FindMembers.
17280
17281         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17282         include NonPublic after the first iteration.
17283
17284         * class.cs (Indexer.CheckBase): Only check if both parents are
17285         non-null. 
17286
17287         * cs-parser.jay (accessor_body): If empty, set to null.
17288
17289         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17290         same code path here to resolve constants names that we did have in
17291         MemberAccess.DoResolve.  There is too much code duplicated here.
17292
17293 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17294
17295         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17296
17297         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17298         to MakeUnionSet.
17299
17300         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17301         tokens, numbers and strings.
17302
17303         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17304         parenthesis.
17305
17306         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17307         asyncronous parameters and the regular parameters.  
17308
17309         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17310         specify the target directory.
17311
17312         * expression.cs: (This.DoResolve): Simplify
17313         (As.Emit): Optimize, do not generate IsInst if the expression is
17314         always of the given type.
17315
17316         (Is.DoResolve): Bug fix, we were reporting both always/never for
17317         the is expression.
17318
17319         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17320         creating too many unnecessary arrays.
17321
17322 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17323
17324         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17325         fields instead of rolling our own initializer.   Takes care of all
17326         implicit conversions, and drops unnecessary static checks/argument.
17327
17328 2002-03-31  Dick Porter  <dick@ximian.com>
17329
17330         * driver.cs: use the GetDirectories() return values properly, and
17331         use "/" as path separator.
17332
17333 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17334
17335         * expression.cs (Unary): Optimize - - expr into expr.
17336         (Binary): Optimize a + (-b) into a -b.
17337
17338         * codegen.cs (CodeGen): Made all methods static.
17339
17340 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * rootcontext.cs: 
17343
17344         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17345         TypeBuilder property.
17346
17347         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17348         instead. 
17349
17350         * tree.cs: Removed the various RecordXXXX, and replaced with a
17351         single RecordDecl.  Removed all the accessor methods, and just
17352         left a single access point Type 
17353
17354         * enum.cs: Rename DefineEnum to DefineType.
17355
17356         * decl.cs: New abstract method `DefineType' used to unify the
17357         Defines for Enumerations, Interfaces, TypeContainers and
17358         Delegates.
17359
17360         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17361         LookupBaseClasses method that used to live in class.cs and
17362         interface.cs here, and renamed to FindType.
17363
17364         * delegate.cs: Implement DefineType.  Take advantage of the
17365         refactored pattern for locating the parent builder without taking
17366         the parent_builder argument (which we know does not work if we are
17367         nested, and triggering a toplevel definition).
17368
17369 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17372         accessibility of a member has changed during override and report
17373         an error if so.
17374
17375         * class.cs (Method.Define, Property.Define): Only complain on
17376         overrides if the method is private, any other accessibility is
17377         fine (and since we just checked the permission is the same, we are
17378         good to go).
17379
17380         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17381         and elif are processed always.  The other pre-processing
17382         directives are only processed if we are "taking" the path
17383
17384 2002-03-29  Martin Baulig  <martin@gnome.org>
17385
17386         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17387         current location is not Null.
17388
17389         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17390         a separate method so we can profile it.
17391
17392         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17393         `span.Seconds' are just seconds, but no minutes or hours.
17394         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17395
17396 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17399         Remove the gratuitous set of Final:
17400
17401                                 // If an interface implementation, then we can set Final.
17402                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17403                                     implementing.DeclaringType.IsInterface)
17404                                         flags |= MethodAttributes.Final;
17405
17406         I do not know what I was smoking when I used that.
17407
17408
17409         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17410         step into fixing the name resolution issues for delegates and
17411         unifying the toplevel name resolution.
17412
17413 2002-03-28  Martin Baulig  <martin@gnome.org>
17414
17415         * class.cs (Method.Emit): If we have a symbol writer, call its
17416         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17417         tell it about the current method.
17418
17419         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17420         writer that we're going to emit the first byte of IL code for a new
17421         statement (a new source line).
17422         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17423         EmitContext.Mark() before emitting any code.
17424
17425         * location.cs (SymbolDocument): Return null when we're Null.
17426
17427         * statement.cs (Statement): Moved the `Location loc' variable here.
17428         (Statement.EmitBoolExpression): If we have a symbol writer, call
17429         ec.Mark() before emitting any code to tell it that we're at the
17430         beginning of a new statement.
17431         (StatementExpression): Added `Location' argument to the constructor.
17432         (Block): Added public readonly variable `StartLocation' and public
17433         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17434         (Block): Added constructor which takes a start and end location.
17435         (Block.SetEndLocation): New method. This sets the end location.
17436         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17437         local variables we create.
17438         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17439         each statement and do also mark the begin and end of the block.
17440
17441         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17442         tell it the current lexer.Location, use Location.Null for the end of the
17443         block.
17444         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17445         current block, set its end location using SetEndLocation().
17446         (statement_expression): StatementExpression constructor now takes the
17447         lexer.Location as additional argument.
17448         (for_statement, declare_local_variables): Likewise.
17449         (declare_local_variables): When creating a new implicit block, use the
17450         new Block constructor and pass it the lexer.Location.
17451
17452 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17453
17454         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17455         members also on the parent interfaces recursively.
17456
17457 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * report.cs: Use new formats, since Gonzalo finished the missing
17460         bits. 
17461
17462         * expression.cs (Binary.ResolveOperator): added missing operator|
17463         operator& and operator^ for bool/bool.
17464
17465         * cs-parser.jay: CheckDef now takes a Location argument that is
17466         used to report errors more precisly (instead of reporting the end
17467         of a definition, we try to track something which is a lot closer
17468         to the source of the problem).
17469
17470         * cs-tokenizer.cs: Track global token use, so we can properly flag
17471         the use of #define/#undef after the first token has been seen.
17472
17473         Also, rename the reportXXXX to Error_DescriptiveName
17474
17475         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17476         TypeContainer, so that Enum and Interface can use this too.
17477
17478         * class.cs (TypeContainer.LookupInterfaceOrClass,
17479         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17480         `builder' argument.  Typically this was used to pass the parent
17481         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17482         the definition).  
17483
17484         The problem is that a nested class could trigger the definition of
17485         a toplevel class, and the builder would be obviously wrong in that
17486         case. 
17487
17488         So we drop this argument, and we compute dynamically the
17489         TypeBuilder/ModuleBuilder (the correct information was available
17490         to us anyways from DeclSpace.Parent)
17491
17492         * interface.cs (Interface.DefineInterface): Drop builder
17493         parameter cleanup like class.cs
17494
17495         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17496         like class.cs
17497
17498         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17499         values. 
17500
17501         (Try.Emit): Propagate the returns value from the statement.
17502
17503         (Return.Emit): Even if we are leavning 
17504
17505         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17506
17507         * modifiers.cs: Fix the computation of MethodAttributes flags.
17508
17509 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17510
17511         * driver.cs: allow compilation of files that start with '/'.
17512         Add a default case when checking the argument of --target.
17513
17514 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17515
17516         * interface.cs: Implement the same search algorithm for types in
17517         the interface code.
17518
17519         * delegate.cs: Do not allow multiple definition.
17520
17521         * Recovered ChangeLog that got accidentally amputated
17522
17523         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17524
17525         * rootcontext.cs: Load manually enum to allow core classes to
17526         contain enumerations.
17527
17528         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17529         Update to new static methods in TypeManager.
17530
17531         * typemanager.cs (GetMethod, GetConstructor): Use our
17532         implementation of FindMembers to find the members, since during
17533         corlib compilation, the types are TypeBuilders and GetMethod and
17534         GetConstructor do not work.
17535
17536         Make all methods in TypeManager static.
17537
17538         (InitCodeHelpers): Split the functionality from
17539         the InitCodeTypes function.
17540
17541         * driver.cs: Call InitCodeHelpers after we have populated the
17542         types. 
17543
17544         * cs-parser.jay (delegate_declaration): we did not used to compute
17545         the delegate name correctly for void delegates.
17546
17547 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17548
17549         * rootcontext.cs (RootContext): Init the interface_resolve_order
17550         and type_container_resolve_order always.
17551
17552         (ResolveCore, BootstrapCorlib_ResolveClass,
17553         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17554         compiler when compiling with --nostdlib
17555
17556         * class.cs (TypeContainer.DefineType): Check that our parent is
17557         not null.  This test is most important when we are bootstraping
17558         the core types.
17559
17560         * codegen.cs: Split out the symbol writing code.
17561
17562 2002-03-25  Martin Baulig  <martin@gnome.org>
17563
17564         * driver.cs (-g): Made -g an alias for --debug.
17565
17566 2002-03-24  Martin Baulig  <martin@gnome.org>
17567
17568         * codegen.cs (SymbolWriter): New public variable. Returns the
17569         current symbol writer.
17570         (CodeGen): Added `bool want_debugging_support' argument to the
17571          constructor. If true, tell the ModuleBuild that we want debugging
17572         support and ask it for the ISymbolWriter.
17573         (Save): If we have a symbol writer, call it's Close() method after
17574         saving the assembly.
17575
17576         * driver.c (--debug): New command line argument to create a
17577         debugger information file.
17578
17579         * location.cs (SymbolDocument): New public property. Returns an
17580         ISymbolDocumentWriter object for the current source file or null
17581         if we don't have a symbol writer.
17582
17583 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * driver.cs (LoadAssembly): Correctly return when all the paths
17586         have been tried and not before.
17587
17588         * statement.cs (Switch.Emit): return the actual coverage for this
17589         statement (returns/not-returns)
17590
17591         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17592         switch of the statement if we are the last switch section.  That
17593         kills two problems: try/catch problems (we used to emit an empty
17594         nop at the end) and switch statements where all branches would
17595         return. 
17596
17597 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17598
17599         * driver.cs: Add default assemblies (the equivalent to the
17600         Microsoft CSC.RSP file)
17601
17602         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17603         also update tokens_seen and set it to false.
17604
17605         * driver.cs: Implement --recurse for Mike.
17606
17607         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17608         correctly splitting out the paths.
17609
17610 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17611
17612         * interface.cs (Interface.PopulateProperty): Instead of using
17613         `parent' as the declaration space for the set parameters, use
17614         `this' 
17615
17616         * support.cs (InternalParameters): InternalParameters constructor
17617         takes a DeclSpace instead of a TypeContainer.
17618
17619         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17620         types are being initialized, load the address of it before calling
17621         the function.  
17622
17623         (New): Provide a mechanism to disable the generation of local
17624         value type temporaries when the caller will be providing us with
17625         an address to store it.
17626
17627         (ArrayCreation.EmitDynamicInitializers): Use it.
17628
17629 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * expression.cs (Invocation.EmitArguments): Only probe for array
17632         property if there is more than one argument.  Sorry about that.
17633
17634         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17635         empty param arrays.
17636
17637         * class.cs (Method.LabelParameters): Fix incorrect code path that
17638         prevented the `ParamArrayAttribute' from being applied to the
17639         params attribute.
17640
17641 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * support.cs (ReflectionParameters): Correctly compute whether the
17644         last argument is a params array.  Fixes the problem with
17645         string.Split ('a')
17646
17647         * typemanager.cs: Make the assemblies array always be non-null
17648         (empty, but non-null)
17649
17650         * tree.cs (RecordDecl): New function that abstracts the recording
17651         of names.  This reports error 101, and provides a pointer to the
17652         previous declaration.  Fixes a crash in the compiler.
17653
17654         * cs-parser.jay (constructor_declaration): Update to new grammar,
17655         and provide a constructor_body that can be empty.
17656
17657 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17658
17659         * driver.cs: Add support for --resources.
17660
17661         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17662         Make all types for the various array helper methods be integer.
17663
17664         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17665         CheckState to ConvCast.
17666
17667         (ConvCast): Now it takes a `checked' state argument, to avoid
17668         depending on the emit context for the conversion, and just using
17669         the resolve time setting.
17670
17671         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17672         instead of Invocation.EmitArguments.  We do not emit the original
17673         arguments, instead we emit those which have been converted to
17674         unsigned int expressions.
17675
17676         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17677
17678         * codegen.cs: ditto.
17679
17680         * expression.cs (LocalVariableReference): Drop the use of the
17681         Store function that depended on the variable index.
17682
17683         * statement.cs (VariableInfo): Drop the `Idx' property from this
17684         class, as this is not taking into account the indexes for
17685         temporaries tat we generate during the execution, getting the
17686         indexes wrong.
17687
17688         * class.cs: First emit class initializers, then call the parent
17689         constructor. 
17690
17691         * expression.cs (Binary): Fix opcode emision.
17692         (UnaryMutator.EmitCode): Support checked code generation
17693
17694         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17695         matches for events for both the Static and Instance scans,
17696         pointing to the same element.   Fix that.
17697
17698 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17699
17700         * rootcontext.cs (ResolveTree): Always set the
17701         interface_resolve_order, because nested interfaces will be calling
17702         into us.
17703
17704         * class.cs (GetInterfaceOrClass): Track the same resolution
17705         process used by TypeManager.LookupType.  This fixes the nested
17706         type lookups in class declarations (separate path from
17707         LookupType). 
17708
17709         (TypeContainer.DefineType): Also define nested interfaces.
17710         (TypeContainer.RegisterOrder): New public function used to
17711         register the order in which child interfaces need to be closed.
17712
17713         Nested interfaces need to be closed after their parents have been
17714         created. 
17715
17716         * interface.cs (InterfaceAttr): Put all the logic for computing
17717         the interface attribute here. 
17718
17719         (DefineInterface): Register our interface order with the
17720         RootContext or with the TypeContainer depending on the case.
17721
17722 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17723
17724         * cs-parser.jay: rework foreach statement to work with the new
17725         changes to the policy on SimpleNames.
17726
17727         * report.cs: support Stacktrace on warnings as well.
17728
17729         * makefile: drop --unsafe and /unsafe from the compile.
17730
17731 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17732
17733         * ecore.cs (StandardConversionExists): Modify to take an Expression
17734         as the first parameter. Ensure we do null -> reference type conversion
17735         checking.
17736
17737         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17738         temporary Expression objects.
17739
17740 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17741
17742         * interface.cs: workaround bug in method overloading resolution
17743         (there is already a bugzilla bug for it).
17744
17745 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17746
17747         We could also solve this problem by having a separate path for
17748         performing type lookups, instead of DoResolve, we could have a
17749         ResolveType entry point, and only participating pieces of the
17750         production (simplename, deref, array) would implement this. 
17751
17752         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17753         signal SimpleName to only resolve type names and not attempt to
17754         resolve anything else.
17755
17756         * expression.cs (Cast): Set the flag.
17757
17758         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17759
17760         * class.cs: Only report 108 if there is no `new' modifier.
17761
17762         * cs-parser.jay: rework foreach statement to work with the new
17763         changes to the policy on SimpleNames.
17764         
17765         * report.cs: support Stacktrace on warnings as well.
17766
17767         * makefile: drop --unsafe and /unsafe from the compile.
17768
17769 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17772         lookups here, instead of doing that at parse time.  This means
17773         that our grammar will not introduce `LocalVariableReferences' as
17774         expressions at this point.  That solves the problem of code like
17775         this:
17776
17777         class X {
17778            static void Main ()
17779            { int X = 1;
17780             { X x = null }}}
17781
17782         This is only half the fix.  The full fix requires parameters to
17783         also be handled in this way.
17784
17785         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17786         makes the use more obvious of the DeclSpace.  The
17787         ec.TypeContainer.TypeBuilder is now only used to pull the
17788         TypeBuilder for it.
17789
17790         My theory is that I can get rid of the TypeBuilder completely from
17791         the EmitContext, and have typecasts where it is used (from
17792         DeclSpace to where it matters).  
17793
17794         The only pending problem is that the code that implements Aliases
17795         is on TypeContainer, and probably should go in DeclSpace.
17796
17797         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17798         lookups here, instead of doing that at parse time.  This means
17799         that our grammar will not introduce `LocalVariableReferences' as
17800         expressions at this point.  That solves the problem of code like
17801         this:
17802
17803         class X {
17804            static void Main ()
17805            { int X = 1;
17806             { X x = null }}}
17807
17808         This is only half the fix.  The full fix requires parameters to
17809         also be handled in this way.
17810
17811         * class.cs (Property.DefineMethod): When implementing an interface
17812         method, set newslot, when implementing an abstract method, do not
17813         set the flag (before we tried never setting it, or always setting
17814         it, which is the difference).
17815         (Indexer.DefineMethod): same.
17816         (Method.DefineMethod): same.
17817
17818         * ecore.cs: Only set the status used flag if we get back a Field.
17819
17820         * attribute.cs: Temporary hack, so Paolo can keep working.
17821
17822 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17823
17824         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17825         the unmanaged type in the case we have a MarshalAs attribute.
17826
17827         (Resolve): Handle the case when we are parsing the special MarshalAs
17828         attribute [we need to store the unmanaged type to use later]
17829
17830         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17831         MarshalAs Attribute.
17832
17833         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17834         on parameters and accordingly set the marshalling info.
17835
17836 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17837
17838         * class.cs: Optimizing slightly by removing redundant code after
17839         we switched to the `NoTypes' return value.
17840         (Property.DefineMethod): use NoTypes here too.
17841
17842         This fixes the bug I introduced in my last batch of changes.
17843
17844 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17845
17846         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17847
17848         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17849         Enums since those are types too. 
17850
17851         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17852
17853         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17854         thanks to a call during the lookup process.
17855
17856 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * statement.cs (Foreach): Lots of work to accomodate a particular
17859         kind of foreach statement that I had not kept in mind.  It is
17860         possible to have foreachs on classes that provide a GetEnumerator
17861         method that return objects that implement the "pattern" for using
17862         a foreach, there is no need to support GetEnumerator
17863         specifically. 
17864
17865         This is needed to compile nant.
17866
17867         * decl.cs: Only report 114 if the member is not `Finalize' and if
17868         the warning level is at least 2.
17869
17870         * class.cs: Moved the compare function from Method to
17871         MethodSignature. 
17872
17873         (MethodSignature.InheritableMemberSignatureCompare): Add new
17874         filter function that is used to extract inheritable methods from a
17875         class. 
17876
17877         (Method.Define): Use the new `inheritable_method_signature_filter'
17878         delegate
17879
17880         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17881         command. 
17882
17883 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17884
17885         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17886
17887         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17888
17889         * expression.cs: Pass location information to
17890         ConvertImplicitStandard. 
17891
17892         * class.cs: Added debugging code to track return values from
17893         interfaces. 
17894
17895 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs (Is.DoResolve): If either side of the `is' is an
17898         interface, do not flag the warning.
17899
17900         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17901         for interfaces
17902
17903         * report.cs: Allow for --fatal to be used with --probe.
17904
17905         * typemanager.cs (NoTypes): Move the definition for the empty Type
17906         array here. 
17907
17908         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17909         properties. 
17910         (TypeContainer.DefineProxy): New function used to proxy to parent
17911         implementations when implementing interfaces.
17912         (TypeContainer.ParentImplements): used to lookup if our parent
17913         implements a public function that is required by an interface.
17914         (TypeContainer.VerifyPendingMethods): Hook this up.
17915
17916         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17917         `modules' and `assemblies' arraylists into arrays.  We only grow
17918         these are the very early start up of the program, so this improves
17919         the speedof LookupType (nicely measured).
17920
17921         * expression.cs (MakeByteBlob): Replaced unsafe code with
17922         BitConverter, as suggested by Paolo.
17923
17924         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17925         folding of string concatenation, but if either side is a string,
17926         and the other is not, then return null, and let the runtime use
17927         the concatenation on the string plus the object (using
17928         `Object.ToString'). 
17929
17930 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17931
17932         Constant Folding has been implemented now.
17933
17934         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17935         the error instead on types that are not supported in one's
17936         complement. 
17937
17938         * constant.cs (Constant and all children): New set of functions to
17939         perform implict and explicit conversions.
17940
17941         * ecore.cs (EnumConstant): Implement the new functions to perform
17942         conversion by proxying to the child expression.
17943
17944         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17945         own separate setting that can not be turned off from the command
17946         line using --unchecked or --checked and is only controlled using
17947         the checked/unchecked statements and expressions.  This setting is
17948         used by the constant folder to flag errors.
17949
17950         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17951         ConstantCheckState as well.   
17952
17953         During Resolve, they also have to flag the state, because the
17954         constant folder runs completely in the Resolve phase.
17955
17956         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17957         well.
17958
17959 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17960
17961         * cfold.cs: New file, this file contains the constant folder.
17962
17963         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17964         argument to track whether we are using the resulting address to
17965         load or store a value and provide better error messages. 
17966
17967         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17968         new AddressOf arguments.
17969
17970         * statement.cs (Foreach.EmitCollectionForeach): Update
17971
17972         * expression.cs (Argument.Emit): Call AddressOf with proper
17973         arguments to track usage.
17974
17975         (New.DoEmit): Call AddressOf with new arguments.
17976
17977         (Unary.Emit): Adjust AddressOf call.
17978
17979 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17980
17981         * cs-parser.jay (member_access): Change the case for pre-defined types
17982         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17983         this suggestion.
17984
17985         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17986         a method body.
17987
17988         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17989         essentially like methods and apply attributes like MethodImplOptions to them too.
17990
17991         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17992         not being null.
17993
17994         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17995         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17996         is the DeclSpace.
17997
17998         * Update code everywhere accordingly.
17999
18000         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18001
18002         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18003
18004 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18005
18006         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18007         try performing lookups against those instead of jumping straight into using
18008         the 'using' clauses.
18009
18010         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18011
18012         (LookupType): Perform lookups in implicit parents too.
18013
18014         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18015         sequence as RootContext.LookupType. 
18016
18017         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18018         the various cases of namespace lookups into this method.
18019
18020 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18021
18022         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18023         in positional arguments)
18024
18025         * class.cs (Operator): Update the AllowedModifiers to contain
18026         extern. 
18027
18028         * cs-parser.jay: Update operator declaration to allow for the
18029         operator body to be empty.
18030
18031         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18032         values. 
18033
18034 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * class.cs (Method.Emit): Label parameters.
18037
18038         * driver.cs: Return 1 or 0 as the program exit code.
18039
18040 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18041
18042         * expression.cs: Special case the `null' object when trying to
18043         auto-compute the type, as anything can be explicitly converted to
18044         that. 
18045
18046         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18047         spotting this Paolo.
18048
18049         (Expression.ImplicitNumericConversion): Perform comparissions of
18050         the type using the underlying type in the case of an enumeration
18051         rather than using the enumeration type for the compare.
18052
18053         Cope with the underlying == type case, which is not possible to
18054         catch before. 
18055
18056         (Expression.ConvertNumericExplicit): Perform comparissions of
18057         the type using the underlying type in the case of an enumeration
18058         rather than using the enumeration type for the compare.
18059
18060         * driver.cs: If the user does not supply an extension, assume .exe
18061
18062         * cs-parser.jay (if_statement): Rewrote so that we can track the
18063         location for the if statement.
18064
18065         * expression.cs (Binary.ConstantFold): Only concat strings when
18066         the operation is "+", not everything ;-)
18067
18068         * statement.cs (Statement.EmitBoolExpression): Take a location
18069         argument. 
18070         (If, While, Do): Track location.
18071
18072         * expression.cs (Binary.ResolveOperator): In the object + string
18073         case, I was missing a call to ConvertImplicit
18074
18075 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18076
18077         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18078         Location arguments. Ensure we use RootContext.LookupType to do our work
18079         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18080
18081         * interface.cs (PopulateMethod): Handle the type of the parameter being
18082         null gracefully.
18083
18084         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18085         have a params method with no fixed arguments and a call is made with no
18086         arguments.
18087
18088 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18091         the verbatim-string-literal
18092
18093         * support.cs (InternalParameters.ParameterModifier): handle null
18094         fixed parameters.
18095         (InternalParameters.ParameterType): ditto.
18096
18097         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18098         duplicating the name of the variable parameter.
18099         (GetParameterByName): Fix bug where we were not looking up array
18100         paramters if they were the only present (thanks Paolo!).
18101         (GetParameterInfo): We only have an empty set of types if both
18102         fixed and array are set to null.
18103         (GetParameterInfo-idx): Handle FixedParameter == null
18104
18105         * cs-parser.jay: Handle the case where there is no catch
18106         statements (missing null test).
18107
18108 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18109
18110         * driver.cs (MainDriver): Be conservative on our command line
18111         handling.
18112
18113         Catch DirectoryNotFoundException when calling GetFiles.
18114
18115         (SplitPathAndPattern): Used to split the input specification into
18116         a path and a pattern that we can feed to Directory.GetFiles.
18117
18118 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * statement.cs (Fixed): Implement the last case of the Fixed
18121         statement (string handling).
18122
18123         * expression.cs (StringPtr): New class used to return a char * to
18124         a string;  Used by the Fixed statement.
18125
18126         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18127
18128         * expression.cs (Binary.ResolveOperator): Remove redundant
18129         MemberLookup pn parent type.
18130         Optimize union call, we do not need a union if the types are the same.
18131         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18132         type.
18133
18134         Specialize the use of MemberLookup everywhere, instead of using
18135         the default settings. 
18136
18137         (StackAlloc): Implement stackalloc keyword.
18138
18139         * cs-parser.jay: Add rule to parse stackalloc.
18140
18141         * driver.cs: Handle /h, /help, /?
18142
18143         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18144         before we supported unsafe code.
18145
18146         * makefile: add --unsafe to the self compilation of mcs.
18147
18148 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18149
18150         * expression.cs (PointerArithmetic): New class that is used to
18151         perform pointer arithmetic.
18152         (Binary.Resolve): Handle pointer arithmetic
18153         Handle pointer comparission.
18154         (ArrayPtr): Utility expression class that is used to take the
18155         address of an array.
18156
18157         (ElementAccess): Implement array access for pointers
18158
18159         * statement.cs (Fixed): Implement fixed statement for arrays, we
18160         are missing one more case before we are done.
18161
18162         * expression.cs (Indirection): Implement EmitAssign and set the
18163         ExprClass to Variable.  This allows pointer dereferences to be
18164         treated as variables, and to have values assigned to them.
18165
18166         * ecore.cs (Expression.StoreFromPtr): New utility function to
18167         store values dereferencing.
18168
18169 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18170
18171         * expression.cs (Binary.ResolveOperator): Ensure that we are
18172         not trying to operate on a void type - this fixes the reported
18173         bug.
18174
18175         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18176         the parent implementation is sealed.
18177
18178         * ../errors/cs0239.cs : Add.
18179
18180         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18181
18182         * typemanager.cs (unverifiable_code_type): Corresponds to 
18183         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18184         which have unsafe code in them.
18185
18186         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18187         unsafe context.
18188
18189 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * cs-tokenizer.cs: Add support for @"litreal strings"
18192
18193         Make tokenizer accept pre-processor directives
18194         on any column (remove the old C-like limitation). 
18195
18196         * rootcontext.cs (EmitCode): Emit any global attributes.
18197         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18198
18199         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18200
18201         * cs-parser.jay: Add support for global attributes.  
18202
18203 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * expression.cs (Indirection): New helper class.  Unary will
18206         create Indirection classes to be able to implement the
18207         IMemoryLocation interface on it.
18208
18209 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18210
18211         * cs-parser.jay (fixed_statement): reference the right statement.
18212
18213         * statement.cs (Fixed.Emit): Finish implementing the fixed
18214         statement for the &x case.
18215
18216 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * class.cs (Property.Define, Method.Define): Remove newslot when
18219         `implementing'.  
18220
18221         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18222         wrong.  NewSlot should only be used if the `new' keyword is present.
18223
18224         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18225         locating our system dir.  Sorry about this.
18226
18227 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18228
18229         * driver.cs (GetSystemDir): Compute correctly the location of our
18230         system assemblies.  I was using the compiler directory instead of
18231         the library directory.
18232
18233 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18234
18235         * expression.cs (BetterFunction): Put back in what Miguel commented out
18236         since it is the correct fix. The problem is elsewhere ;-)
18237
18238         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18239         parameters of the parms method are themselves compatible or not !
18240
18241         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18242         to check that a class implements an interface before saying that an implicit
18243         conversion was allowed. Use ImplementsInterface to do the checking.
18244
18245 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18246
18247         * class.cs (Method.Define): Track whether we are an explicit
18248         implementation or not.  And only call DefineMethodOverride if we
18249         are an explicit implementation.
18250
18251         (Property.DefineMethod): Ditto.
18252
18253 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18254
18255         * expression.cs (BetterFunction): Catch hideous bug which was
18256          preventing us from detecting ambiguous calls due to implicit casts i.e
18257         cs0121.
18258
18259 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * support.cs (Pair): Remove un-needed method.  I figured why I was
18262         getting the error in cs-parser.jay, the variable in a foreach loop
18263         is readonly, and the compiler does not really treat this as a variable.
18264
18265         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18266         instead of EQUALS in grammar.  
18267
18268         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18269
18270         * expression.cs (Unary.DoResolve): Check whether the argument is
18271         managed or not.
18272
18273 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * support.cs: Api for Pair to set a value.  Despite the fact that
18276         the variables are public the MS C# compiler refuses to compile
18277         code that accesses the field if the variable is part of a foreach
18278         statement. 
18279
18280         * statement.cs (Fixed): Begin implementation of the fixed
18281         statement.
18282
18283         (Block.AddVariable): Return the VariableInfo on success and null
18284         on failure instead of true/false. 
18285
18286         * cs-parser.jay (foreach): Catch errors on variables already
18287         defined (we were ignoring this value before) and properly unwind
18288         the block hierarchy
18289
18290         (fixed_statement): grammar for the fixed statement.
18291
18292 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18293
18294         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18295         pointer types to be incretemented.
18296
18297         (SizeOf): Implement.
18298
18299         * cs-parser.jay (pointer_member_access): Implement
18300         expr->IDENTIFIER production.
18301
18302         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18303         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18304         on safe contexts.
18305
18306         (Unary): Implement indirection.
18307
18308         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18309         use in non-unsafe context).
18310
18311         (SimpleName.DoResolve): Check for pointers in field access on safe
18312         contexts. 
18313
18314         (Expression.LoadFromPtr): Factor the load-indirect code in this
18315         function.  This was duplicated in UnboxCast and ParameterReference
18316
18317 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18318
18319         * expression.cs (ComposedCast): report an error if a pointer cast
18320         is used in a safe region.
18321
18322         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18323         pointer type casts in unsafe context.
18324
18325         * codegen.cs (EmitContext): Set up IsUnsafe.
18326
18327         * cs-parser.jay (non_expression_type): Add productions for pointer
18328         casts. 
18329
18330         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18331         code.  We should not use force into static mode if the method is
18332         not virtual.  Fixes bug in MIS
18333
18334         * statement.cs (Do.Emit, While.Emit, For.Emit,
18335         Statement.EmitBoolExpression): Add support to Do and While to
18336         propagate infinite loop as `I do return' semantics.
18337
18338         Improve the For case to also test for boolean constants.
18339
18340         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18341         to the list of attributes we can add.
18342
18343         Remove `EmitContext' argument.
18344
18345         * class.cs (Method.Define): Apply parameter attributes.
18346         (Constructor.Define): Apply parameter attributes.
18347         (MethodCore.LabelParameters): Move here the core of labeling
18348         parameters. 
18349
18350         * support.cs (ReflectionParameters.ParameterModifier,
18351         InternalParameters.ParameterModifier): Use IsByRef on the type and
18352         only return the OUT bit for these parameters instead of in/out/ref
18353         flags.
18354
18355         This is because I miss-understood things.  The ParameterInfo.IsIn
18356         and IsOut represent whether the parameter has the [In] and [Out]
18357         attributes set.  
18358
18359 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18360
18361         * ecore.cs (FieldExpr.Emit): Release temporaries.
18362
18363         * assign.cs (LocalTemporary.Release): new function.
18364
18365         * codegen.cs (EmitContext.GetTemporaryStorage,
18366         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18367         temporary storage.  Now we can "put back" localbuilders when we
18368         are done with them
18369
18370 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18371
18372         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18373         need to make a copy of the variable to generate verifiable code.
18374
18375 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18376
18377         * driver.cs: Compute dynamically the system directory.
18378
18379         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18380         Slower, but more generally useful.  Used by the abstract
18381         registering implementation. 
18382
18383         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18384         the rules for the special rule on Type/instances.  First check if
18385         we have the same name, and if so, try that special static path
18386         rather than the instance path.
18387
18388 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18391         for, while and if.
18392
18393         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18394         Enum, ValueType, Delegate or Array for non-corlib compiles.
18395
18396         * cs-tokenizer.cs: Catch long identifiers (645)
18397
18398         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18399         piece of code.
18400
18401         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18402         fix, we were returning too early, so we were not registering
18403         pending methods from abstract classes.
18404
18405         Do not register pending methods if the class is abstract.
18406
18407         * expression.cs (Conditional.DoResolve): Report circular implicit
18408         conversions when we neecd to compute it for conditional
18409         expressions. 
18410
18411         (Is.DoResolve): If the expression is always of the provided type,
18412         flag warning 183.  If the expression can not ever be of the
18413         provided type flag warning 184.
18414
18415         * class.cs: Catch 169 as well.
18416
18417         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18418         read. 
18419
18420 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18421
18422         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18423
18424 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18425
18426         * interface.cs: (PopulateMethod): Check for pointers being defined
18427         only if the unsafe context is active.
18428         (PopulateProperty): ditto.
18429         (PopulateIndexer): ditto.
18430
18431         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18432         specified.  If pointers are present, make sure that they are
18433         present in an unsafe context.
18434         (Constructor, Constructor.Define): ditto.
18435         (Field, Field.Define): ditto.
18436         (Property, Property.Define): ditto.
18437         (Event, Event.Define): ditto.
18438
18439         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18440         hashtable if there are classes or structs defined.
18441
18442         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18443         code, as the constant resolution moved.
18444
18445         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18446         the metadata, so we can flag error 133. 
18447
18448         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18449         pointer is being declared in an unsafe context.
18450
18451 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * modifiers.cs (Modifiers.Check): Require a Location argument.
18454         Report error 227 for Unsafe use.
18455
18456         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18457
18458         * statement.cs (For.Emit): If the test is null, then report that
18459         we do `return', as we wont reach anything afterwards.
18460
18461         (Switch.SwitchGoverningType): Track the expression that matched
18462         the conversion.
18463
18464         * driver.cs: Allow negative numbers as an error code to flag.
18465
18466         * cs-parser.jay: Handle 1551.
18467
18468         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18469
18470 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18471
18472         * cs-parser.jay: Report 1518 (type declaration can only contain
18473         class, struct, interface, enum or delegate)
18474
18475         (switch_label): Report 1523 (keywords `case' or `default' must
18476         preced code)
18477
18478         (opt_switch_sections): Report 1522 (empty switch)
18479
18480         * driver.cs: Report 1515 (response file specified multiple times)
18481         Report 1516 (Source file specified multiple times).
18482
18483         * expression.cs (Argument.Resolve): Signal 1510
18484
18485         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18486         access not allowed in static code)
18487
18488 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18489
18490         * typemanager.cs (IsPointerType): Utility method which we are going
18491         to need a lot.
18492
18493         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18494         the object type, so we take care of that.
18495
18496         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18497
18498         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18499         added to non-params parameters :-)
18500
18501         * typemanager.cs (CSharpName): Include 'void' type too. 
18502
18503         (void_ptr_type): Include in the set of core types.
18504
18505         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18506         duplicating code.
18507
18508         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18509         an unsafe context.
18510
18511         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18512         completely forgotten about it.
18513
18514 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18515
18516         * cs-parser.jay (pointer_type): Add. This begins our implementation
18517         of parsing rules for unsafe code.
18518
18519         (unsafe_statement): Implement.
18520
18521         (embedded_statement): Modify to include the above.
18522
18523         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18524
18525         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18526         if the current context is an unsafe one.
18527
18528         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18529         are handled differently, we need separate rules for them.
18530
18531         (local_variable_declaration): Update to use local_variable_pointer_type
18532         to allow variable declarations of unmanaged pointer types.
18533
18534         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18535         in unsafe contexts.
18536
18537         * ../errors/cs0214.cs : Add.
18538
18539 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18540
18541         * makefile: remove 'response' file when cleaning.
18542
18543 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18544
18545         * cs-parser.jay: Report 1524.
18546
18547 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * typemanager.cs (RegisterMethod): drop checking if we have
18550         registered this from here
18551
18552 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * class.cs (Method.EmitDestructor): Implement calling our base
18555         destructor. 
18556
18557         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18558         value of InFinally.
18559
18560         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18561         this routine and will wrap the call in a try/catch block.  Deal
18562         with the case.
18563
18564 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18565
18566         * ecore.cs (Expression.MemberLookup): instead of taking a
18567         parameter `same_type' that was used to tell whether we could
18568         access private members we compute our containing type from the
18569         EmitContext.
18570
18571         (FieldExpr): Added partial support for volatile fields.  This does
18572         not work for volatile fields exposed from assemblies, as I can not
18573         figure out how to extract the modreq from it.
18574
18575         Updated all the source files to use this.
18576
18577         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18578         because it is referenced by MemberLookup very often. 
18579
18580 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18581
18582         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18583         TypeBuilder.GetCustomAttributes to retrieve what we need.
18584
18585         Get rid of redundant default_member_attr_type as this is the same as
18586         default_member_type which already exists.
18587
18588         * interface.cs, attribute.cs : Update accordingly.
18589
18590 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18591
18592         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18593         work for TYpeBuilders though.  Ravi, can you please fix this?
18594
18595         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18596
18597         * expression.cs (Argument.Emit): Handle the case of ref objects
18598         being passed to ref functions;  
18599
18600         (ParameterReference.EmitLoad): Loads the content of the pointer
18601         without dereferencing.
18602
18603 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18604
18605         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18606
18607 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18608
18609         * class.cs (Indexer.DefineMethod): Incorporate the interface
18610         type in the name of the method if we are doing explicit interface
18611         implementation.
18612
18613         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18614
18615         (BetterConversion): Fix extremely trivial bug where we were referring to
18616         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18617         again !
18618
18619         * ../errors/bug16.cs : Add although we have fixed it.
18620
18621 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18622
18623         * expression.cs (BaseIndexer): Begin implementation.
18624
18625         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18626
18627         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18628         production directly to remove a shift/reduce, and implement
18629         explicit interface implementation.
18630
18631         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18632         after a floating point suffix.
18633
18634         * expression.cs (DoNumericPromotions): Improved the conversion for
18635         uint/uint.  If we have a constant, we avoid doing a typecast to a
18636         larger type.
18637
18638         * class.cs (Indexer): Implement explicit interface implementation
18639         for indexers.
18640
18641 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18642
18643         * class.cs: make the default instance constructor public and hidebysig.
18644
18645 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18646
18647         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18648         so we can call it from elsewhere.
18649
18650         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18651         we emit it internally if the class has a defined indexer; otherwise the user
18652         emits it by decorating the class definition with the DefaultMemberAttribute.
18653
18654         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18655         attribute is not used on a type which defines an indexer.
18656
18657         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18658         character when we skip whitespace.
18659
18660         * ../errors/cs0646.cs : Add.
18661
18662 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18665         again. 
18666
18667         * makefile: Add practical target `mcs3.exe' which builds the third
18668         generation compiler. 
18669
18670         * expression.cs (New): Fix structures constructor calling.
18671
18672         * class.cs (Property, Method, Indexer): Emit Final flag on the
18673         method if we are an interface implementation and we are not
18674         abstract. 
18675
18676         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18677         whether this property is referencing a `base' method.
18678
18679         * expression.cs (Invocation.EmitCall): take an extra argument:
18680         is_base, this is used to determine whether the `call' or
18681         `callvirt' opcode should be used.
18682
18683
18684         * delegate.cs: update EmitCall.
18685
18686         * class.cs (Method.Define): Set NewSlot for the cases where we are
18687         not implementing an interface method.
18688
18689         (Property.Define): ditto.
18690
18691 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18692
18693         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18694         'r'.  Allows mcs to parse itself fully.
18695
18696 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18697
18698         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18699         of the number of initializers that require the InitializeArray method.
18700
18701         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18702         update the above field where necessary.
18703
18704         (MakeByteBlob): Update accordingly.
18705
18706         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18707         greater than 2.
18708
18709         (EmitDynamicInitializers): Update in accordance with the new optimization.
18710
18711         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18712         same OpCode applies.
18713
18714         * cs-parser.jay : Fix some glaring errors I introduced.
18715
18716 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18717
18718         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18719         so that we can check for name clashes there too.
18720
18721         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18722         for interface indexers.
18723
18724         * interfaces.cs (Define): Emit the default member attribute.
18725
18726         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18727         variable was being referred to while setting the value ;-)
18728
18729 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18732         byte-by-byte information when we know the data is zero.
18733
18734         Make the block always a multiple of 4, because
18735         DefineInitializedData has a bug.
18736
18737         * assign.cs: Fix, we should assign from the temporary, not from
18738         the source. 
18739
18740         * expression.cs (MakeByteBlob): Fix my incorrect code.
18741
18742 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * typemanager.cs (EnumToUnderlying): This function is used to get
18745         the underlying type from an enumeration, because it does not
18746         always work. 
18747
18748         * constant.cs: Use the I4_S form for values between -128 and 127.
18749
18750         * statement.cs (Block.LookupLabel): Looks up a label.
18751         (Block): Drop support for labeled blocks.
18752
18753         (LabeledStatement): New kind of statement that represents a label
18754         only.
18755
18756         (Goto): Finally implement this bad boy.
18757
18758         * cs-parser.jay: Update to reflect new mechanism to implement
18759         labels.
18760
18761 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18762
18763         * codegen.cs (EmitContext.This): a codegen property that keeps the
18764         a single instance of this instead of creating many different this
18765         instances. 
18766
18767         * delegate.cs (Delegate.DoResolve): Update to use the property;
18768
18769         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18770
18771         * expression.cs (BaseAccess.DoResolve): Ditto.
18772
18773 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18774
18775         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18776         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18777
18778         (InitCoreTypes): Update accordingly.
18779
18780         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18781         so we can quickly store the state.
18782
18783         (ApplyAttributes): Set the correct implementation flags
18784         for InternalCall methods.
18785
18786 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18787
18788         * expression.cs (EmitCall): if a method is not virtual, then do
18789         not use callvirt on it.
18790
18791         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18792         user defined stuff) requires the use of stobj, which takes an
18793         address on the stack instead of an array and an index.  So emit
18794         the Ldelema operation for it.
18795
18796         (EmitStoreOpcode): Use stobj for valuetypes.
18797
18798         (UnaryMutator.EmitCode): Use the right 1 value depending on
18799         whether we are dealing with int64/uint64, float or doubles.
18800
18801         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18802         constructors that I implemented last night.
18803
18804         (Constructor.IsDefault): Fix to work properly for static
18805         constructors.
18806
18807         * cs-parser.jay (CheckDef): report method signature errors.
18808         Update error number 103 to be 132.
18809
18810         * decl.cs: New AdditionResult enumeration value: MethodExists.
18811         Although we do this check for methods later on in the semantic
18812         analysis, catching repeated default constructors is so easy that
18813         we catch these here. 
18814
18815         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18816         promotions code.
18817
18818         (ParameterReference.EmitAssign, Emit): handle
18819         bools as bytes.
18820
18821         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18822         (ArrayAccess.EmitStoreOpcode): ditto.
18823
18824         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18825
18826         * expression.cs (MakeByteBlob): Complete all the missing types
18827         (uint, short, ushort, byte, sbyte)
18828
18829         * class.cs: Only init instance field initializers on instance
18830         constructors. 
18831
18832         Rename `constructors' to instance_constructors. 
18833
18834         (TypeContainer.AddConstructor): Only add constructors to the list
18835         if it is not static.
18836
18837         Make sure that we handle default_static_constructor independently
18838         everywhere where we handle instance_constructors
18839
18840 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18841
18842         * class.cs: Do not lookup or create a base initializer for a
18843         static constructor.
18844
18845         (ConstructorInitializer.Resolve): use the proper type to lookup
18846         for constructors.
18847
18848         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18849
18850         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18851         in DeclSpace. 
18852
18853         * decl.cs: CloseType is now an virtual method, the default
18854         implementation just closes this type.
18855
18856 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18857
18858         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18859         to PreserveSig by default. Also emit HideBySig on such methods.
18860
18861         Basically, set the defaults to standard values.
18862
18863         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18864         argument, if candidate is better, it can't be worse than the best !
18865
18866         (Invocation): Re-write bits to differentiate between methods being
18867         applicable in their expanded form and their normal form - for params
18868         methods of course.
18869
18870         Get rid of use_standard everywhere as only standard conversions are allowed
18871         in overload resolution. 
18872
18873         More spec conformance.
18874
18875 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18876
18877         * driver.cs: Add --timestamp, to see where the compiler spends
18878         most of its time.
18879
18880         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18881         `this' in static code.
18882
18883         (SimpleName.DoResolve): Implement in terms of a helper function
18884         that allows static-references to be passed upstream to
18885         MemberAccess.
18886
18887         (Expression.ResolveWithSimpleName): Resolve specially simple
18888         names when called by MemberAccess to implement the special
18889         semantics. 
18890
18891         (Expression.ImplicitReferenceConversion): Handle conversions from
18892         Null to reference types before others, as Null's type is
18893         System.Object. 
18894
18895         * expression.cs (Invocation.EmitCall): Handle the special case of
18896         calling methods declared on a reference type from a ValueType
18897         (Base classes System.Object and System.Enum)
18898
18899         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18900         the left hand side is a TypeExpr, not on every enumeration. 
18901
18902         (Binary.Resolve): If types are reference types, then do a cast to
18903         object on operators != and == of both arguments.
18904
18905         * typemanager.cs (FindMembers): Extract instance and static
18906         members if requested.
18907
18908         * interface.cs (PopulateProperty): Use void_type instead of null
18909         as the return type for the setter method.
18910
18911         (PopulateIndexer): ditto.
18912
18913 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18914
18915         * support.cs (ReflectionParameters): Fix minor bug where we
18916         were examining the wrong parameter for the ParamArray attribute.
18917
18918         Cope with requests for the type of the parameter at position
18919         greater than the params parameter's. We now return the element
18920         type of the params array as that makes more sense.
18921
18922         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18923         accordingly as we no longer have to extract the element type
18924         ourselves.
18925
18926         (Invocation.OverloadResolve): Update.
18927
18928 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18929
18930         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18931         against IEnumerator, test whether the return value is a descendant
18932         of the IEnumerator interface.
18933
18934         * class.cs (Indexer.Define): Use an auxiliary method to implement
18935         the other bits of the method definition.  Begin support for
18936         explicit interface implementation.
18937
18938         (Property.DefineMethod): Use TypeManager.void_type instead of null
18939         for an empty return value.
18940
18941 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18942
18943         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18944         dealing with a FieldExpr which is composed of a FieldBuilder, in
18945         the code path we did extract the constant, but we should have
18946         obtained the underlying value to be able to cast it (otherwise we
18947         end up in an infinite loop, this is what Ravi was running into).
18948
18949         (ArrayCreation.UpdateIndices): Arrays might be empty.
18950
18951         (MemberAccess.ResolveMemberAccess): Add support for section
18952         14.5.4.1 that deals with the special case of E.I when E is a type
18953         and something else, that I can be a reference to a static member.
18954
18955         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18956         handle a particular array type to create byte blobs, it is just
18957         something we dont generate byteblobs for.
18958
18959         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18960         arguments. 
18961
18962         * location.cs (Push): remove the key from the hashtable that we
18963         are about to add.   This happens for empty files.
18964
18965         * driver.cs: Dispose files after we have parsed them.
18966
18967         (tokenize): new function that only runs the tokenizer on its
18968         input, for speed testing.
18969
18970 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18971
18972         * class.cs (Event.Define): Define the private field only if there
18973         are no accessors defined.
18974
18975         * expression.cs (ResolveMemberAccess): If there is no associated
18976         field with the event, that means we have an event defined with its
18977         own accessors and we should flag error cs0070 since transforming
18978         ourselves into a field is not valid in that case.
18979
18980         * ecore.cs (SimpleName.DoResolve): Same as above.
18981
18982         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18983         and charset to sane values.
18984
18985 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18986
18987         * assign.cs (DoResolve): Perform check on events only if they 
18988         are being accessed outside the declaring type.
18989
18990         * cs-parser.jay (event_declarations): Update rules to correctly
18991         set the type of the implicit parameter etc.
18992
18993         (add_accessor, remove_accessor): Set current local parameters.
18994
18995         * expression.cs (Binary): For delegate addition and subtraction,
18996         cast the return value from the method into the appropriate delegate
18997         type.
18998
18999 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19000
19001         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19002         of these as the workaround is unnecessary.
19003
19004         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19005         delegate data - none of that is needed at all.
19006
19007         Re-write bits to extract the instance expression and the delegate method
19008         correctly.
19009
19010         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19011         on delegates too.
19012
19013         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19014         of attaching attributes instead of duplicating code everywhere.
19015
19016         * everywhere : Update code to do attribute emission using the above method.
19017
19018 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19019
19020         * expression.cs (IsParamsMethodApplicable): if there are not
19021         parameters, return immediately.
19022
19023         * ecore.cs: The 0 literal can be implicity converted to an enum
19024         type. 
19025
19026         (SimpleName.DoResolve): First lookup the type, then lookup the
19027         members. 
19028
19029         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19030         want to get its address.  If the InstanceExpression is not
19031         addressable, store the result in a temporary variable, then get
19032         the address of it.
19033
19034         * codegen.cs: Only display 219 errors on warning level or above. 
19035
19036         * expression.cs (ArrayAccess): Make it implement the
19037         IMemoryLocation interface.
19038
19039         (Binary.DoResolve): handle the operator == (object a, object b)
19040         and operator != (object a, object b) without incurring into a
19041         BoxedCast (because 5 != o should never be performed).
19042
19043         Handle binary enumerator operators.
19044
19045         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19046         value type, otherwise use Ldelem_ref.
19047
19048         Use precomputed names;
19049
19050         (AddressOf): Implement address of
19051
19052         * cs-parser.jay (labeled_statement): Fix recursive block
19053         addition by reworking the production.
19054
19055         * expression.cs (New.DoEmit): New has a special case:
19056                 
19057                  If we are dealing with a ValueType, we have a few
19058                  situations to deal with:
19059                 
19060                     * The target of New is a ValueType variable, that is
19061                       easy, we just pass this as the variable reference
19062                 
19063                     * The target of New is being passed as an argument,
19064                       to a boxing operation or a function that takes a
19065                       ValueType.
19066                 
19067                       In this case, we need to create a temporary variable
19068                       that is the argument of New.
19069
19070
19071 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19072
19073         * rootcontext.cs (LookupType): Check that current_type is not null before
19074         going about looking at nested types.
19075
19076         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19077         not implement the IAssignMethod interface any more.
19078
19079         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19080         where we tranform them into FieldExprs if they are being resolved from within
19081         the declaring type.
19082
19083         * ecore.cs (SimpleName.DoResolve): Do the same here.
19084
19085         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19086
19087         * ../errors/bug10.cs : Add.
19088
19089         * ../errors/cs0070.cs : Add.
19090
19091         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19092
19093         * assign.cs : Get rid of EventIsLocal everywhere.
19094
19095 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * ecore.cs (ConvertIntLiteral): finished the implementation.
19098
19099         * statement.cs (SwitchLabel): Convert the value we are using as a
19100         key before looking up the table.
19101
19102 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * codegen.cs (EmitTopBlock): Require a Location argument now.
19105
19106         * cs-parser.jay (constructor_declarator): We need to setup
19107         current_local_parameters before we parse the
19108         opt_constructor_initializer, to allow the variables to be bound
19109         to the constructor arguments.
19110
19111         * rootcontext.cs (LookupType): First lookup nested classes in our
19112         class and our parents before we go looking outside our class.
19113
19114         * expression.cs (ConstantFold): Extract/debox the values at the
19115         beginnning. 
19116
19117         * rootcontext.cs (EmitCode): Resolve the constants first before we
19118         resolve the types.  This is not really needed, but it helps debugging.
19119
19120         * statement.cs: report location.
19121
19122         * cs-parser.jay: pass location to throw statement.
19123
19124         * driver.cs: Small bug fix.
19125
19126         * report.cs: Updated format to be 4-zero filled digits.
19127
19128 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19129
19130         * expression.cs (CheckIndices): Fix minor bug where the wrong
19131         variable was being referred to ;-)
19132
19133         (DoEmit): Do not call EmitStaticInitializers when the 
19134         underlying type is System.Object.
19135
19136 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19137
19138         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19139         and do the usual workaround for SRE.
19140
19141         * class.cs (MyEventBuilder.EventType): New member to get at the type
19142         of the event, quickly.
19143
19144         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19145
19146         * assign.cs (Assign.DoResolve): Handle the case when the target
19147         is an EventExpr and perform the necessary checks.
19148
19149         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19150         interface.
19151
19152         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19153
19154         (EventExpr): Set the type in the constructor itself since we 
19155         are meant to be born fully resolved.
19156
19157         (EventExpr.Define): Revert code I wrote earlier.
19158                 
19159         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19160         instance expression is null. The instance expression is a This in that case
19161         or a null, depending on whether it is a static method or not.
19162
19163         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19164         refers to more than one method.
19165
19166         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19167         and accordingly flag errors.
19168
19169 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19172
19173 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19174
19175         * location.cs (ToString): Provide useful rutine.
19176
19177 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19178
19179         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19180         objects, return the actual integral boxed.
19181
19182         * statement.cs (SwitchLabel): define an ILLabel for each
19183         SwitchLabel. 
19184
19185         (Switch.CheckSwitch): If the value is a Literal, extract
19186         the underlying literal.
19187
19188         Also in the unused hashtable we had, add the SwitchLabel so we can
19189         quickly look this value up.
19190
19191         * constant.cs: Implement a bunch of new constants.  Rewrite
19192         Literal based on this.  Made changes everywhere to adapt to this.
19193
19194         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19195         dereferencing array only once, and also copes with enumrations.
19196
19197         bytes are two bytes wide, not one.
19198
19199         (Cast): Perform constant conversions.
19200
19201         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19202         wrappers to the literals here.
19203
19204         * expression.cs (DoNumericPromotions): long literals can converted
19205         to ulong implicity (this is taken care of elsewhere, but I was
19206         missing this spot).
19207
19208         * ecore.cs (Expression.Literalize): Make the return type Literal,
19209         to improve type checking.
19210
19211         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19212
19213 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19214
19215         * literal.cs: Revert code from ravi that checked the bounds.  The
19216         bounds are sane by the definition of the type itself. 
19217
19218         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19219         need to actually look up in our parent hierarchy for interfaces
19220         implemented. 
19221
19222         * const.cs: Use the underlying type for enumerations
19223
19224         * delegate.cs: Compute the basename for the delegate creation,
19225         that should fix the delegate test case, and restore the correct
19226         Type Lookup semantics in rootcontext
19227
19228         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19229         referencing a nested type with the Reflection API is using the "+"
19230         sign. 
19231
19232         * cs-parser.jay: Do not require EOF token at the end.
19233
19234 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19235
19236         * rootcontext.cs (LookupType): Concatenate type names with
19237         a '.' instead of a '+' The test suite passes again.
19238
19239         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19240         field of the enumeration.
19241
19242         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19243         the case when the member is an EventExpr.
19244
19245         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19246         static has an associated instance expression.
19247
19248         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19249
19250         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19251
19252         * class.cs (Event.Define): Register event and perform appropriate checks
19253         for error #111.
19254
19255         We define the Add and Remove methods even if the use provides none because
19256         in that case, we provide default implementations ourselves.
19257
19258         Define a private field of the type of the event. This is done by the CSC compiler
19259         and we should be doing it too ;-)
19260
19261         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19262         More methods we use in code we generate.
19263
19264         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19265         is important.
19266
19267         (InitCoreTypes): Update accordingly for the above.
19268
19269         * class.cs (Event.Emit): Generate code for default accessors that we provide
19270
19271         (EmitDefaultMethod): Do the job in the above.
19272
19273         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19274         appropriate place.
19275
19276 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19279         builders even if we were missing one.
19280
19281         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19282         pass the Basename as our class name instead of the Name.  The
19283         basename will be correctly composed for us.
19284
19285         * parameter.cs (Paramters): Now takes a Location argument.
19286
19287         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19288         make all the code call directly LookupType in RootContext and take
19289         this chance to pass the Location information everywhere.
19290
19291         * Everywhere: pass Location information.
19292
19293 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19294
19295         * class.cs (Constructor.Define): Updated way of detecting the
19296         length of the parameters.
19297
19298         (TypeContainer.DefineType): Use basename as the type name for
19299         nested types.
19300
19301         (TypeContainer.Define): Do not recursively define types here, as
19302         definition is taken care in order by the RootContext.
19303
19304         * tree.cs: Keep track of namespaces in a per-file basis.
19305
19306         * parameter.cs (Parameter.ComputeSignature): Update to use
19307         DeclSpace. 
19308
19309         (Parameters.GetSignature): ditto.
19310
19311         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19312         instead of a TypeContainer.
19313
19314         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19315         resolve names.  Because we need to be resolve in our context, not
19316         our parents.
19317
19318         * driver.cs: Implement response files.
19319
19320         * class.cs (TypeContainer.DefineType): If we are defined, do not
19321         redefine ourselves.
19322
19323         (Event.Emit): Emit the code for add/remove handlers.
19324         (Event.Define): Save the MethodBuilders for add/remove.
19325
19326         * typemanager.cs: Use pair here too.
19327
19328         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19329         DictionaryEntry requires the first argument to be non-null.  
19330
19331         (enum_declaration): Compute full name for registering the
19332         enumeration.
19333
19334         (delegate_declaration): Instead of using
19335         formal_parameter_list, use opt_formal_parameter_list as the list
19336         can be empty.
19337
19338         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19339         (EventParsing): New property that controls whether `add' and
19340         `remove' are returned as tokens or identifiers (for events);
19341
19342 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19343
19344         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19345         use MyEventBuilder only and let it wrap the real builder for us.
19346
19347         (MyEventBuilder): Revamp constructor etc.
19348
19349         Implement all operations that we perform on EventBuilder in precisely the same
19350         way here too.
19351
19352         (FindMembers): Update to use the EventBuilder member.
19353
19354         (Event.Emit): Update accordingly.
19355
19356 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19357
19358         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19359         by calling the appropriate methods.
19360
19361         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19362         useful.
19363
19364         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19365
19366 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19367
19368         * delegate.cs (Delegate.Populate): Check that the return type
19369         and various parameters types are indeed accessible.
19370
19371         * class.cs (Constructor.Define): Same here.
19372
19373         (Field.Define): Ditto.
19374
19375         (Event.Define): Ditto.
19376
19377         (Operator.Define): Check that the underlying Method defined itself
19378         correctly - so it's MethodBuilder should not be null.
19379
19380         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19381         expression happens to be null.
19382
19383         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19384         members but as of now we don't seem to be able to do anything really useful with it.
19385
19386         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19387         not the EventBuilder.
19388
19389 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * cs-tokenizer.cs: Add support for defines.
19392         Add support for #if, #elif, #else, #endif
19393
19394         (eval_var): evaluates a variable.
19395         (eval): stubbed for evaluating functions.
19396
19397         * cs-parser.jay: Pass the defines information
19398
19399         * driver.cs: Add --define command line option.
19400
19401         * decl.cs: Move MemberCore here.
19402
19403         Make it the base class for DeclSpace.  This allows us to catch and
19404         report 108 and 109 for everything now.
19405
19406         * class.cs (TypeContainer.Define): Extract all the members
19407         before populating and emit the warning 108 (new keyword required
19408         to override) instead of having each member implement this.
19409
19410         (MemberCore.Define): New abstract method, we will be using this in
19411         the warning reporting engine in Populate.
19412
19413         (Operator.Define): Adjust to new MemberCore protocol. 
19414
19415         * const.cs (Const): This does not derive from Expression, it is a
19416         temporary object we use to create fields, it is a MemberCore. 
19417
19418         * class.cs (Method.Define): Allow the entry point to be in a
19419         specific class.
19420
19421         * driver.cs: Rewrite the argument handler to clean it up a bit.
19422
19423         * rootcontext.cs: Made it just an auxiliary namespace feature by
19424         making everything static.
19425
19426         * driver.cs: Adapt code to use RootContext type name instead of
19427         instance variable.
19428
19429         * delegate.cs: Remove RootContext argument.
19430
19431         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19432         argument. 
19433
19434         * class.cs (Event.Define): The lookup can fail.
19435
19436         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19437
19438         * expression.cs: Resolve the this instance before invoking the code.
19439
19440 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19441
19442         * cs-parser.jay: Add a production in element_access that allows
19443         the thing to become a "type" reference.  This way we can parse
19444         things like "(string [])" as a type.
19445
19446         Note that this still does not handle the more complex rules of
19447         casts. 
19448
19449
19450         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19451
19452         * ecore.cs: (CopyNewMethods): new utility function used to
19453         assemble the list of methods from running FindMembers.
19454
19455         (MemberLookup): Rework FindMembers so that 
19456
19457 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19458
19459         * class.cs (TypeContainer): Remove Delegates who fail to be
19460         defined.
19461
19462         * delegate.cs (Populate): Verify that we dont get null return
19463         values.   TODO: Check for AsAccessible.
19464
19465         * cs-parser.jay: Use basename to emit error 574 (destructor should
19466         have the same name as container class), not the full name.
19467
19468         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19469         possible representation.  
19470
19471         Also implements integer type suffixes U and L.
19472
19473 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * expression.cs (ArrayCreation.DoResolve): We need to do the
19476         argument resolution *always*.
19477
19478         * decl.cs: Make this hold the namespace.  Hold the root context as
19479         well.
19480         (LookupType): Move here.
19481
19482         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19483
19484         * location.cs (Row, Name): Fixed the code, it was always returning
19485         references to the first file.
19486
19487         * interface.cs: Register properties defined through interfaces.
19488
19489         * driver.cs: Add support for globbing on the command line
19490
19491         * class.cs (Field): Make it derive from MemberCore as well.
19492         (Event): ditto.
19493
19494 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19495
19496         * class.cs (Event::Define): Check that the type of the event is a delegate
19497         type else flag error #66.
19498
19499         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19500         same.
19501
19502         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19503         values of EntryPoint, CharSet etc etc.
19504
19505         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19506
19507         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19508         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19509         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19510         which needs this to do its work.
19511
19512         * ../errors/cs0066.cs : Add.
19513
19514 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19515
19516         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19517         helper functions.
19518
19519         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19520         clears out the parameters field.
19521         (MemberSignatureCompare): Cleanup
19522
19523         (MemberCore): New base class used to share code between MethodCore
19524         and Property.
19525
19526         (RegisterRequiredImplementations) BindingFlags.Public requires
19527         either BindingFlags.Instace or Static.  Use instance here.
19528
19529         (Property): Refactored code to cope better with the full spec.
19530
19531         * parameter.cs (GetParameterInfo): Return an empty array instead
19532         of null on error.
19533
19534         * class.cs (Property): Abstract or extern properties have no bodies.
19535
19536         * parameter.cs (GetParameterInfo): return a zero-sized array.
19537
19538         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19539         method modifier validation to the typecontainer so we can reuse
19540         this on properties.
19541
19542         (MethodCore.ParameterTypes): return an empty sized array of types.
19543
19544         (Property.Define): Test property modifier validity.
19545
19546         Add tests for sealed/override too.
19547
19548         (Method.Emit): abstract or extern methods have no bodies.
19549
19550 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19551
19552         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19553         thing.
19554
19555         (Method::Define, ::Emit): Modify accordingly.
19556
19557         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19558
19559         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19560
19561         * makefile: Pass in /unsafe.
19562
19563 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * class.cs (MakeKey): Kill routine.
19566
19567         * class.cs (TypeContainer.Define): Correctly define explicit
19568         method implementations (they require the full interface name plus
19569         the method name).
19570
19571         * typemanager.cs: Deply the PtrHashtable here and stop using the
19572         lame keys.  Things work so much better.
19573
19574         This of course broke everyone who depended on `RegisterMethod' to
19575         do the `test for existance' test.  This has to be done elsewhere.
19576
19577         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19578         the object stupid Equals method (because, that like fails all over
19579         the place).  We still do not use it.
19580
19581         * class.cs (TypeContainer.SetRequiredInterface,
19582         TypeContainer.RequireMethods): Killed these two routines and moved
19583         all the functionality to RegisterRequiredImplementations.
19584
19585         (TypeContainer.RegisterRequiredImplementations): This routine now
19586         registers all the implementations required in an array for the
19587         interfaces and abstract methods.  We use an array of structures
19588         which can be computed ahead of time to reduce memory usage and we
19589         also assume that lookups are cheap as most classes will not
19590         implement too many interfaces.
19591
19592         We also avoid creating too many MethodSignatures.
19593
19594         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19595         clear the "pending" bit if we find that there are problems with
19596         the declaration.
19597
19598         (TypeContainer.VerifyPendingMethods): Update to report errors of
19599         methods that look like implementations but are not.
19600
19601         (TypeContainer.Define): Add support for explicit interface method
19602         implementation. 
19603
19604 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * typemanager.cs: Keep track of the parameters here instead of
19607         being a feature of the TypeContainer.
19608
19609         * class.cs: Drop the registration of parameters here, as
19610         InterfaceMethods are also interface declarations.
19611
19612         * delegate.cs: Register methods with the TypeManager not only with
19613         the TypeContainer.  This code was buggy.
19614
19615         * interface.cs: Full registation here.
19616
19617 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * expression.cs: Remove reducer for binary expressions, it can not
19620         be done this way.
19621
19622         * const.cs: Put here the code that used to go into constant.cs
19623
19624         * constant.cs: Put here the code for constants, this is a new base
19625         class for Literals.
19626
19627         * literal.cs: Make Literal derive from Constant.
19628
19629 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19630
19631         * statement.cs (Return.Emit): Report error 157 if the user
19632         attempts to return from a finally block.
19633
19634         (Return.Emit): Instead of emitting a return, jump to the end of
19635         the function.
19636
19637         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19638         LocalBuilder to store the result of the function.  ReturnLabel is
19639         the target where we jump.
19640
19641
19642 2001-12-09  Radek Doulik  <rodo@ximian.com>
19643
19644         * cs-parser.jay: remember alias in current namespace
19645
19646         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19647         namespaces
19648
19649         * class.cs (LookupAlias): lookup alias in my_namespace
19650
19651         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19652         aliases hashtable
19653         (LookupAlias): lookup alias in this and if needed in parent
19654         namespaces
19655
19656 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * support.cs: 
19659
19660         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19661         making things static.  I need this to avoid passing the
19662         TypeContainer when calling ParameterType.
19663
19664         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19665         that did string manipulation to compute the type and then call
19666         GetType.  Use Parameter.ParameterType instead.
19667
19668         * cs-tokenizer.cs: Consume the suffix for floating values.
19669
19670         * expression.cs (ParameterReference): figure out whether this is a
19671         reference parameter or not.  Kill an extra variable by computing
19672         the arg_idx during emission.
19673
19674         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19675         function that returns whether a parameter is an out/ref value or not.
19676
19677         (Parameter.ParameterType): The type of the parameter (base,
19678         without ref/out applied).
19679
19680         (Parameter.Resolve): Perform resolution here.
19681         (Parameter.ExternalType): The full type (with ref/out applied).
19682
19683         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19684         support for expressions on the using statement.
19685
19686 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19687
19688         * statement.cs (Using.EmitLocalVariableDecls): Split the
19689         localvariable handling of the using statement.
19690
19691         (Block.EmitMeta): Keep track of variable count across blocks.  We
19692         were reusing slots on separate branches of blocks.
19693
19694         (Try.Emit): Emit the general code block, we were not emitting it. 
19695
19696         Check the type of the declaration to be an IDisposable or
19697         something that can be implicity converted to it. 
19698
19699         Emit conversions if required.
19700
19701         * ecore.cs (EmptyExpression): New utility class.
19702         (Expression.ImplicitConversionExists): New utility function.
19703
19704 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * statement.cs (Using): Implement.
19707
19708         * expression.cs (LocalVariableReference): Support read only variables.
19709
19710         * statement.cs: Remove the explicit emit for the Leave opcode.
19711         (VariableInfo): Add a readonly field.
19712
19713 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * ecore.cs (ConvCast): new class used to encapsulate the various
19716         explicit integer conversions that works in both checked and
19717         unchecked contexts.
19718
19719         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19720         properly generate the overflow opcodes.
19721
19722 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * statement.cs: The correct type for the EmptyExpression is the
19725         element_type, not the variable type.  Ravi pointed this out.
19726
19727 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19728
19729         * class.cs (Method::Define): Handle PInvoke methods specially
19730         by using DefinePInvokeMethod instead of the usual one.
19731
19732         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19733         above to do the task of extracting information and defining the method.
19734
19735 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19736
19737         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19738         of the condition for string type.
19739
19740         (Emit): Move that here. 
19741
19742         (ArrayCreation::CheckIndices): Keep string literals in their expression
19743         form.
19744
19745         (EmitDynamicInitializers): Handle strings appropriately.
19746
19747 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19748
19749         * codegen.cs (EmitContext): Replace multiple variables with a
19750         single pointer to the current Switch statement.
19751
19752         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19753         EmitContext.
19754
19755 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19756
19757         * statement.cs 
19758
19759         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19760         default'.
19761
19762         (Foreach.Emit): Foreach on arrays was not setting
19763         up the loop variables (for break/continue).
19764
19765         (GotoCase): Semi-implented.
19766
19767 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19768
19769         * attribute.cs (CheckAttribute): Handle system attributes by using
19770         Attribute.GetAttributes to examine information we need.
19771
19772         (GetValidPlaces): Same here.
19773
19774         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19775
19776         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19777
19778         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19779
19780         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19781
19782         (Method::Emit): Handle the case when we are a PInvoke method.
19783
19784 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19785
19786         * expression.cs: Use ResolveWithSimpleName on compound names.
19787
19788 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19789
19790         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19791         before trying to reduce it.
19792
19793         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19794
19795         * constant.cs (LookupConstantValue): Implement.
19796
19797         (EmitConstant): Use the above in emitting the constant.
19798
19799         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19800         that are user-defined by doing a LookupConstantValue on them.
19801
19802         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19803         too, like above.
19804
19805 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19806
19807         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19808
19809         (BaseAccess.DoResolve): Implement.
19810
19811         (MemberAccess.DoResolve): Split this routine into a
19812         ResolveMemberAccess routine that can be used independently
19813
19814 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19815
19816         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19817         As that share bits of the implementation.  Is returns a boolean,
19818         while As returns the Type that is being probed.
19819
19820 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19821
19822         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19823         instead of a Literal - much easier.
19824
19825         (EnumInTransit): Remove - utterly useless :-)
19826
19827         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19828
19829         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19830
19831         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19832         chain when we have no associated expression.
19833
19834 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19835
19836         * constant.cs (Define): Use Location while reporting the errror.
19837
19838         Also emit a warning when 'new' is used and there is no inherited
19839         member to hide.
19840
19841         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19842         populated.
19843
19844         (LookupEnumValue): Implement to lookup an enum member's value and define it
19845         if necessary.
19846
19847         (Populate): Re-write accordingly to use the above routine.
19848
19849 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * expression.cs (This): Fix prototype for DoResolveLValue to
19852         override the base class DoResolveLValue.
19853
19854         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19855         declarations) 
19856
19857         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19858         (we need to load the address of the field here).  This fixes
19859         test-22. 
19860
19861         (FieldExpr.DoResolveLValue): Call the DoResolve
19862         function to initialize the Instance expression.
19863
19864         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19865         correctly the GetEnumerator operation on a value type.
19866
19867         * cs-parser.jay: Add more simple parsing error catches.
19868
19869         * statement.cs (Switch): Add support for string switches.
19870         Handle null specially.
19871
19872         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19873
19874 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19875
19876         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19877
19878         (declare_local_constant): New helper function.
19879
19880         * statement.cs (AddConstant): Keep a separate record of constants
19881
19882         (IsConstant): Implement to determine if a variable is a constant.
19883
19884         (GetConstantExpression): Implement.
19885
19886         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19887
19888         * statement.cs (IsVariableDefined): Re-write.
19889
19890 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19891
19892         * class.cs (TypeContainer::FindMembers): Look for constants
19893         in the case when we are looking for MemberTypes.Field
19894
19895         * expression.cs (MemberAccess::DoResolve): Check that in the
19896         case we are a FieldExpr and a Literal, we are not being accessed
19897         by an instance reference.
19898
19899         * cs-parser.jay (local_constant_declaration): Implement.
19900
19901         (declaration_statement): Implement for constant declarations.
19902
19903 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * statement.cs (Switch): Catch double defaults.
19906
19907         (Switch): More work on the switch() statement
19908         implementation.  It works for integral values now, need to finish
19909         string support.
19910
19911
19912 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19915         integer literals into other integer literals.  To be used by
19916         switch. 
19917
19918 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19919
19920         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19921         some memory.
19922
19923         (EmitDynamicInitializers): Cope with the above since we extract data
19924         directly from ArrayData now.
19925
19926         (ExpectInitializers): Keep track of whether initializers are mandatory
19927         or not.
19928
19929         (Bounds): Make it a hashtable to prevent the same dimension being 
19930         recorded for every element in that dimension.
19931
19932         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19933         from being found.
19934
19935         Also fix bug which was causing the indices to be emitted in the reverse
19936         order.
19937
19938 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19939
19940         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19941         unfinished.  They do not work, because the underlying code is
19942         sloppy.
19943
19944 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19945
19946         * cs-parser.jay: Remove bogus fixme.
19947
19948         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19949         on Switch statement.
19950
19951 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19952
19953         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19954         the same. 
19955
19956         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19957         parameter. Apparently, any expression is allowed. 
19958
19959         (ValidateInitializers): Update accordingly.
19960
19961         (CheckIndices): Fix some tricky bugs thanks to recursion.
19962
19963         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19964         I was being completely brain-dead.
19965
19966         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19967         and re-write acordingly.
19968
19969         (DelegateInvocation): Re-write accordingly.
19970
19971         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19972
19973         (MakeByteBlob): Handle types more correctly.
19974
19975         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19976         initialization from expressions but it is incomplete because I am a complete
19977         Dodo :-|
19978
19979 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19982         on If.  Basically, we have to return `true' (ie, we do return to
19983         our caller) only if both branches of the if return.
19984
19985         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19986         short-circuit operators, handle them as short circuit operators. 
19987
19988         (Cast.DoResolve): Resolve type.
19989         (Cast.Cast): Take an expression as the target type.
19990
19991         * cs-parser.jay (cast_expression): Remove old hack that only
19992         allowed a limited set of types to be handled.  Now we take a
19993         unary_expression and we resolve to a type during semantic
19994         analysis.
19995
19996         Use the grammar productions from Rhys to handle casts (this is
19997         not complete like Rhys syntax yet, we fail to handle that corner
19998         case that C# has regarding (-x), but we will get there.
19999
20000 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20001
20002         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20003         field which is an array type.
20004
20005         * cs-parser.jay (declare_local_variables): Support array initialization too.
20006
20007         * typemanager.cs (MakeKey): Implement.
20008
20009         (everywhere): Use the above appropriately.
20010
20011         * cs-parser.jay (for_statement): Update for array initialization while
20012         declaring variables.
20013
20014         * ecore.cs : The error message was correct, it's the variable's names that
20015         were misleading ;-) Make the code more readable.
20016
20017         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20018         the correct type etc.
20019
20020         (ConvertExplicit): Handle Enum types by examining the underlying type.
20021
20022 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20023
20024         * parameter.cs (GetCallingConvention): Always return
20025         CallingConventions.Standard for now.
20026
20027 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20030         and `r' after calling DoNumericPromotions.
20031
20032         * ecore.cs: Fix error message (the types were in the wrong order).
20033
20034         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20035         BindingFlags.Instance as well 
20036
20037         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20038         implicit int literal conversion in an empty cast so that we
20039         propagate the right type upstream.
20040
20041         (UnboxCast): new class used to unbox value types.
20042         (Expression.ConvertExplicit): Add explicit type conversions done
20043         by unboxing.
20044
20045         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20046         the target type before applying the implicit LongLiterals to ULong
20047         literal cast.
20048
20049 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * cs-parser.jay (for_statement): Reworked the way For works: now
20052         we declare manually any variables that are introduced in
20053         for_initializer to solve the problem of having out-of-band code
20054         emition (that is what got for broken).
20055
20056         (declaration_statement): Perform the actual variable declaration
20057         that used to be done in local_variable_declaration here.
20058
20059         (local_variable_declaration): Do not declare anything, just pass
20060         the information on a DictionaryEntry
20061
20062 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20063
20064         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20065         re-write of the logic to now make it recursive.
20066
20067         (UpdateIndices): Re-write accordingly.
20068
20069         Store element data in a separate ArrayData list in the above methods.
20070
20071         (MakeByteBlob): Implement to dump the array data into a byte array.
20072
20073 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20074
20075         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20076         into CheckIndices.
20077
20078         * constant.cs (Define): Implement.
20079
20080         (EmitConstant): Re-write fully.
20081
20082         Pass in location info.
20083
20084         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20085         respectively.
20086
20087         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20088         DictionaryEntry since we need location info too.
20089
20090         (constant_declaration): Update accordingly.
20091
20092         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20093         code into another method : UpdateIndices.
20094
20095 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20096
20097         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20098         some type checking etc.
20099
20100 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20101
20102         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20103         bits to provide dimension info if the user skips doing that.
20104
20105         Update second constructor to store the rank correctly.
20106
20107 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20108
20109         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20110         and try to implement.
20111
20112         * ../errors/cs0150.cs : Add.
20113
20114         * ../errors/cs0178.cs : Add.
20115
20116 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20117
20118         * statement.cs: Implement foreach on multi-dimensional arrays. 
20119
20120         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20121         name of the params argument.
20122
20123         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20124         initializing the array.
20125
20126         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20127         we can use this elsewhere.
20128
20129         * statement.cs: Finish implementation of foreach for single
20130         dimension arrays.
20131
20132         * cs-parser.jay: Use an out-of-band stack to pass information
20133         around, I wonder why I need this.
20134
20135         foreach_block: Make the new foreach_block the current_block.
20136
20137         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20138         function used to return a static Parameters structure.  Used for
20139         empty parameters, as those are created very frequently.
20140
20141         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20142
20143 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20144
20145         * interface.cs : Default modifier is private, not public. The
20146         make verify test passes again.
20147
20148 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20149
20150         * support.cs (ReflectionParameters): Fix logic to determine
20151         whether the last parameter is a params one. Test 9 passes again.
20152
20153         * delegate.cs (Populate): Register the builders we define with
20154         RegisterParameterForBuilder. Test 19 passes again.
20155
20156         * cs-parser.jay (property_declaration): Reference $6 instead
20157         of $$ to get at the location.
20158
20159         (indexer_declaration): Similar stuff.
20160
20161         (attribute): Ditto.
20162
20163         * class.cs (Property): Register parameters for the Get and Set methods
20164         if they exist. Test 23 passes again.
20165
20166         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20167         call to EmitArguments as we are sure there aren't any params arguments. 
20168         Test 32 passes again.
20169
20170         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20171         IndexOutOfRangeException. 
20172
20173         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20174         Test 33 now passes again.
20175
20176 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20177
20178         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20179         broke a bunch of things.  Will have to come up with a better way
20180         of tracking locations.
20181
20182         * statement.cs: Implemented foreach for single dimension arrays.
20183
20184 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20185
20186         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20187         an error.  This removes the lookup from the critical path.
20188
20189         * cs-parser.jay: Removed use of temporary_loc, which is completely
20190         broken. 
20191
20192 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * support.cs (ReflectionParameters.ParameterModifier): Report
20195         whether the argument is a PARAMS argument or not.
20196
20197         * class.cs: Set the attribute `ParamArrayAttribute' on the
20198         parameter argument.
20199
20200         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20201         and cons_param_array_attribute (ConstructorInfo for
20202         ParamArrayAttribute)., 
20203
20204         * codegen.cs: Emit the return using the `Return' statement, that
20205         way we can report the error correctly for missing return values. 
20206
20207         * class.cs (Method.Emit): Clean up.
20208
20209         * expression.cs (Argument.Resolve): Take another argument: the
20210         location where this argument is used.  Notice that this is not
20211         part of the "Argument" class as to reduce the size of the
20212         structure (we know the approximate location anyways).
20213
20214         Test if the argument is a variable-reference, if not, then
20215         complain with a 206.
20216
20217         (Argument.Emit): Emit addresses of variables.
20218
20219         (Argument.FullDesc): Simplify.
20220
20221         (Invocation.DoResolve): Update for Argument.Resolve.
20222
20223         (ElementAccess.DoResolve): ditto.
20224
20225         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20226         method should be virtual, as this method is always virtual.
20227
20228         (NewDelegate.DoResolve): Update for Argument.Resolve.
20229
20230         * class.cs (ConstructorInitializer.DoResolve): ditto.
20231
20232         * attribute.cs (Attribute.Resolve): ditto.
20233
20234 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20235
20236         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20237
20238         * expression.cs (ParameterReference): Drop IStackStorage and implement
20239         IAssignMethod instead. 
20240
20241         (LocalVariableReference): ditto.
20242
20243         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20244         IAssignMethod instead. 
20245
20246 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20247
20248         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20249         enumerations that are used in heavily used structures derive from
20250         byte in a laughable and pathetic attempt to reduce memory usage.
20251         This is the kind of pre-optimzations that you should not do at
20252         home without adult supervision.
20253
20254         * expression.cs (UnaryMutator): New class, used to handle ++ and
20255         -- separatedly from the other unary operators.  Cleans up the
20256         code, and kills the ExpressionStatement dependency in Unary.
20257
20258         (Unary): Removed `method' and `Arguments' from this class, making
20259         it smaller, and moving it all to SimpleCall, so I can reuse this
20260         code in other locations and avoid creating a lot of transient data
20261         strucutres when not required.
20262
20263         * cs-parser.jay: Adjust for new changes.
20264
20265 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20266
20267         * enum.cs (Enum.Populate): If there is a failure during
20268         definition, return
20269
20270         * cs-parser.jay (opt_enum_base): we used to catch type errors
20271         here, but this is really incorrect.  The type error should be
20272         catched during semantic analysis.
20273
20274 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20275
20276         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20277         current_local_parameters as expected since I, in my stupidity, had forgotten
20278         to do this :-)
20279
20280         * attribute.cs (GetValidPlaces): Fix stupid bug.
20281
20282         * class.cs (Method::Emit): Perform check on applicability of attributes.
20283
20284         (Constructor::Emit): Ditto.
20285
20286         (Field::Emit): Ditto.
20287
20288         (Field.Location): Store location information.
20289
20290         (Property, Event, Indexer, Operator): Ditto.
20291
20292         * cs-parser.jay (field_declaration): Pass in location for each field.
20293
20294         * ../errors/cs0592.cs : Add.
20295
20296 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20297
20298         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20299
20300         (InitCoreTypes): Update accordingly.
20301
20302         (RegisterAttrType, LookupAttr): Implement.
20303
20304         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20305         info about the same.
20306
20307         (Resolve): Update to populate the above as necessary.
20308
20309         (Error592): Helper.
20310
20311         (GetValidPlaces): Helper to the above.
20312
20313         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20314
20315         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20316
20317 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20318
20319         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20320
20321         * ../errors/cs0617.cs : Add.
20322
20323 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20324
20325         * enum.cs (Emit): Rename to Populate to be more consistent with what
20326         we expect it to do and when exactly it is called.
20327
20328         * class.cs, rootcontext.cs : Update accordingly.
20329
20330         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20331         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20332
20333         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20334
20335         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20336         of a fieldinfo using the above, when dealing with a FieldBuilder.
20337
20338 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20339
20340         * ../errors/cs0031.cs : Add.
20341
20342         * ../errors/cs1008.cs : Add.
20343
20344         * ../errrors/cs0543.cs : Add.
20345
20346         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20347         enum type.
20348
20349         (FindMembers): Implement.
20350
20351         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20352         enums and delegates too.
20353
20354         (enum_types): Rename to builder_to_enum.
20355
20356         (delegate_types): Rename to builder_to_delegate.
20357
20358         * delegate.cs (FindMembers): Implement.
20359
20360 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20361
20362         * typemanager.cs (IsEnumType): Implement.
20363
20364         * enum.cs (Emit): Re-write parts to account for the underlying type
20365         better and perform checking etc.
20366
20367         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20368         of the underlying type.
20369
20370         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20371         value
20372
20373         * enum.cs (error31): Helper to report error #31.
20374
20375         * cs-parser.jay (enum_declaration): Store location of each member too.
20376
20377         * enum.cs (member_to_location): New hashtable. 
20378
20379         (AddEnumMember): Update location hashtable.
20380
20381         (Emit): Use the location of each member while reporting errors.
20382
20383 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20384
20385         * cs-parser.jay: A for_initializer if is a
20386         local_variable_declaration really ammount to have an implicit
20387         block with the variable declaration and no initializer for for.
20388
20389         * statement.cs (For.Emit): Cope with null initializers.
20390
20391         This fixes the infinite loop on for initializers.
20392
20393 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * enum.cs: More cleanup.
20396
20397         * ecore.cs: Remove dead code.
20398
20399         * class.cs (Property.Emit): More simplification.
20400         (Event.Emit): ditto.
20401
20402         Reworked to have less levels of indentation.
20403
20404 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20405
20406         * class.cs (Property): Emit attributes.
20407
20408         (Field): Ditto.
20409
20410         (Event): Ditto.
20411
20412         (Indexer): Ditto.
20413
20414         (Operator): Ditto.
20415
20416         * enum.cs (Emit): Ditto.
20417
20418         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20419         Enums too.
20420
20421         * class.cs (Field, Event, etc.): Move attribute generation into the
20422         Emit method everywhere.
20423
20424         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20425         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20426         as we had no way of defining nested enums !
20427
20428         * rootcontext.cs : Adjust code accordingly.
20429
20430         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20431
20432 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20433
20434         * expression.cs (EvalConstantExpression): Move into ecore.cs
20435
20436         * enum.cs (Enum): Rename some members and make them public and readonly
20437         according to our convention.
20438
20439         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20440         nothing else.
20441
20442         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20443
20444         (Enum::Emit): Write a simple version for now which doesn't try to compute
20445         expressions. I shall modify this to be more robust in just a while.
20446
20447         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20448
20449         (TypeContainer::CloseType): Create the Enum types too.
20450
20451         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20452
20453         * expression.cs (EvalConstantExpression): Get rid of completely.
20454
20455         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20456         user-defined values and other cases.
20457
20458         (IsValidEnumLiteral): Helper function.
20459
20460         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20461         out there in the case we had a literal FieldExpr.
20462
20463         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20464
20465         (Literalize): Revamp a bit to take two arguments.
20466
20467         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20468
20469 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20470
20471         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20472
20473         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20474
20475         (Resolve): Use the above to ensure we have proper initializers.
20476
20477 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20478
20479         * expression.cs (Expression::EvalConstantExpression): New method to 
20480         evaluate constant expressions.
20481
20482         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20483
20484 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20487         in an array.
20488
20489         (Binary.ResolveOperator): Handle operator != (object a, object b)
20490         and operator == (object a, object b);
20491
20492         (Binary.DoNumericPromotions): Indicate whether the numeric
20493         promotion was possible.
20494
20495         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20496         Implement.  
20497
20498         Made the ArrayAccess implement interface IAssignMethod instead of
20499         IStackStore as the order in which arguments are passed reflects
20500         this.
20501
20502         * assign.cs: Instead of using expr.ExprClass to select the way of
20503         assinging, probe for the IStackStore/IAssignMethod interfaces.
20504
20505         * typemanager.cs: Load InitializeArray definition.
20506
20507         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20508         static data that can be used to initialize arrays. 
20509
20510 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * expression.cs: Handle operator== and operator!= for booleans.
20513
20514         (Conditioal.Reduce): Implement reducer for the ?: operator.
20515
20516         (Conditional.Resolve): Implement dead code elimination.
20517
20518         (Binary.Resolve): Catch string literals and return a new
20519         concatenated string.
20520
20521         (Unary.Reduce): Implement reduction of unary expressions.
20522
20523         * ecore.cs: Split out the expression core handling here.
20524
20525         (Expression.Reduce): New method used to perform constant folding
20526         and CSE.  This is needed to support constant-expressions. 
20527
20528         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20529         targets, and optimize for !x.
20530
20531 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20532
20533         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20534         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20535         set custom atttributes.
20536
20537         * literal.cs (Literal::GetValue): New abstract method to return the actual
20538         value of the literal, cast as an object.
20539
20540         (*Literal): Implement GetValue method.
20541
20542         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20543         expressions to the arraylist but objects of type Argument.
20544
20545         * class.cs (TypeContainer::Emit): Emit our attributes too.
20546
20547         (Method::Emit, Constructor::Emit): Ditto.
20548
20549         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20550         to be ignoring earlier.
20551
20552 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20553
20554         * attribute.cs (AttributeSection::Define): Implement to do the business
20555         of constructing a CustomAttributeBuilder.
20556
20557         (Attribute): New trivial class. Increases readability of code.  
20558
20559         * cs-parser.jay : Update accordingly.
20560
20561         (positional_argument_list, named_argument_list, named_argument): New rules
20562
20563         (attribute_arguments): Use the above so that we are more correct.
20564
20565 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20566
20567         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20568         to perform all checks for a method with a params parameter.
20569
20570         (Invocation::OverloadResolve): Update to use the above method and therefore
20571         cope correctly with params method invocations.
20572
20573         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20574         params too.
20575
20576         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20577         constructors in our parent too because we can't afford to miss out on 
20578         protected ones ;-)
20579
20580         * attribute.cs (AttributeSection): New name for the class Attribute
20581
20582         Other trivial changes to improve readability.
20583
20584         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20585         use the new class names.
20586
20587 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20588
20589         * class.cs (Method::Define): Complete definition for params types too
20590
20591         (Indexer::Define): Ditto.
20592
20593         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20594         Cope everywhere with a request for info about the array parameter.
20595
20596 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20597
20598         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20599
20600         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20601         local_variable_type to extract the string corresponding to the type.
20602
20603         (local_variable_type): Fixup the action to use the new helper method.
20604
20605         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20606         go.
20607
20608         * expression.cs : Clean out code which uses the above.
20609
20610 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20611
20612         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20613         and bale out if necessary by returning a false.
20614
20615         (RegisterProperty): Ditto.
20616
20617         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20618         and print out appropriate error messages.
20619
20620         * interface.cs (everywhere): Ditto.
20621
20622         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20623         location to constructor.
20624
20625         * class.cs (Property, Event, Indexer): Update accordingly.
20626
20627         * ../errors/cs111.cs : Added.
20628
20629         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20630         of a method, as laid down by the spec.
20631
20632         (Invocation::OverloadResolve): Use the above method.
20633
20634 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20635
20636         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20637         now take a TypeContainer and a Parameters object.
20638
20639         (ParameterData): Modify return type of ParameterModifier method to be 
20640         Parameter.Modifier and not a string.
20641
20642         (ReflectionParameters, InternalParameters): Update accordingly.
20643
20644         * expression.cs (Argument::GetParameterModifier): Same here.
20645
20646         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20647         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20648         symbol in it at all so maybe this is only for now.
20649
20650 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20651
20652         * support.cs (InternalParameters): Constructor now takes an extra argument 
20653         which is the actual Parameters class.
20654
20655         (ParameterDesc): Update to provide info on ref/out modifiers.
20656
20657         * class.cs (everywhere): Update call to InternalParameters to pass in
20658         the second argument too.
20659
20660         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20661         to return the modifier info [ref/out etc]
20662
20663         (InternalParameters, ReflectionParameters): Implement the above.
20664
20665         * expression.cs (Argument::ParameterModifier): Similar function to return
20666         info about the argument's modifiers.
20667
20668         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20669         too.
20670
20671         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20672         a new SetFormalParameters object which we pass to InternalParameters.
20673
20674 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20675
20676         * expression.cs (NewArray): Merge into the ArrayCreation class.
20677
20678 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20679
20680         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20681         NewUserdefinedArray into one as there wasn't much of a use in having
20682         two separate ones.
20683
20684         * expression.cs (Argument): Change field's name to ArgType from Type.
20685
20686         (Type): New readonly property which returns the proper type, taking into 
20687         account ref/out modifiers.
20688
20689         (everywhere): Adjust code accordingly for the above.
20690
20691         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20692         whether we are emitting for a ref or out parameter.
20693
20694         * expression.cs (Argument::Emit): Use the above field to set the state.
20695
20696         (LocalVariableReference::Emit): Update to honour the flag and emit the
20697         right stuff.
20698
20699         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20700
20701         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20702
20703         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20704
20705         (ReflectionParameters, InternalParameters): Implement the above method.
20706
20707         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20708         reporting errors.
20709
20710         (Invocation::FullMethodDesc): Ditto. 
20711
20712 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20713
20714         * cs-parser.jay: Add extra production for the second form of array
20715         creation. 
20716
20717         * expression.cs (ArrayCreation): Update to reflect the above
20718         change. 
20719
20720         * Small changes to prepare for Array initialization.
20721
20722 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20723
20724         * typemanager.cs (ImplementsInterface): interface might be null;
20725         Deal with this problem;
20726
20727         Also, we do store negative hits on the cache (null values), so use
20728         this instead of calling t.GetInterfaces on the type everytime.
20729
20730 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20731
20732         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20733
20734         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20735         split functionality out into different classes.
20736
20737         (New::FormArrayType): Move into NewBuiltinArray.
20738
20739         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20740         quite useless.
20741
20742         (NewBuiltinArray): New class to handle creation of built-in arrays.
20743
20744         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20745         account creation of one-dimensional arrays.
20746
20747         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20748
20749         (NewUserdefinedArray::DoResolve): Implement.
20750
20751         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20752
20753         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20754         we maintain inside the TypeManager. This is necessary to perform lookups on the
20755         module builder.
20756
20757         (LookupType): Update to perform GetType on the module builders too.     
20758
20759         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20760
20761         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20762
20763 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20764
20765         * expression.cs (New::DoResolve): Implement guts of array creation.
20766
20767         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20768
20769 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20770
20771         * expression.cs: Fix bug I introduced lsat night that broke
20772         Delegates. 
20773
20774         (Expression.Resolve): Report a 246 error (can not resolve name)
20775         if we find a SimpleName in the stream.
20776
20777         (Expression.ResolveLValue): Ditto.
20778
20779         (Expression.ResolveWithSimpleName): This function is a variant of
20780         ResolveName, this one allows SimpleNames to be returned without a
20781         warning.  The only consumer of SimpleNames is MemberAccess
20782
20783 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20784
20785         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20786         might arrive here.  I have my doubts that this is correct.
20787
20788         * statement.cs (Lock): Implement lock statement.
20789
20790         * cs-parser.jay: Small fixes to support `lock' and `using'
20791
20792         * cs-tokenizer.cs: Remove extra space
20793
20794         * driver.cs: New flag --checked, allows to turn on integer math
20795         checking. 
20796
20797         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20798         Threading.Monitor.Exit 
20799
20800 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20803         Expression Class to be IndexerAccess.
20804
20805         Notice that Indexer::DoResolve sets the eclass to Value.
20806
20807 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20808
20809         * class.cs (TypeContainer::Emit): Emit code for indexers.
20810
20811         * assign.cs (IAssignMethod): New interface implemented by Indexers
20812         and Properties for handling assignment.
20813
20814         (Assign::Emit): Simplify and reuse code. 
20815
20816         * expression.cs (IndexerAccess, PropertyExpr): Implement
20817         IAssignMethod, clean up old code. 
20818
20819 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20820
20821         * typemanager.cs (ImplementsInterface): New method to determine if a type
20822         implements a given interface. Provides a nice cache too.
20823
20824         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20825         method.
20826
20827         (ConvertReferenceExplicit): Ditto.
20828
20829         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20830         various methods, with correct names etc.
20831
20832         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20833         Operator.UnaryNegation.
20834
20835         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20836         we have a unary plus or minus operator.
20837
20838         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20839         UnaryMinus.
20840
20841         * everywhere : update accordingly.
20842
20843         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20844         respectively.
20845
20846         * class.cs (Method::Define): For the case where we are implementing a method
20847         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20848         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20849
20850 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20851
20852         * interface.cs (FindMembers): Implement to work around S.R.E
20853         lameness.
20854
20855         * typemanager.cs (IsInterfaceType): Implement.
20856
20857         (FindMembers): Update to handle interface types too.
20858
20859         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20860         use IsAssignableFrom as that is not correct - it doesn't work.
20861
20862         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20863         and accordingly override EmitStatement.
20864
20865         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20866         using the correct logic :-)
20867
20868 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20869
20870         * ../errors/cs-11.cs : Add to demonstrate error -11 
20871
20872 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20873
20874         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20875         then pass this as a hint to ResolveLValue.
20876
20877         * expression.cs (FieldExpr): Add Location information
20878
20879         (FieldExpr::LValueResolve): Report assignment to readonly
20880         variable. 
20881
20882         (Expression::ExprClassFromMemberInfo): Pass location information.
20883
20884         (Expression::ResolveLValue): Add new method that resolves an
20885         LValue. 
20886
20887         (Expression::DoResolveLValue): Default invocation calls
20888         DoResolve. 
20889
20890         (Indexers): New class used to keep track of indexers in a given
20891         Type. 
20892
20893         (IStackStore): Renamed from LValue, as it did not really describe
20894         what this did.  Also ResolveLValue is gone from this interface and
20895         now is part of Expression.
20896
20897         (ElementAccess): Depending on the element access type
20898
20899         * typemanager.cs: Add `indexer_name_type' as a Core type
20900         (System.Runtime.CompilerServices.IndexerNameAttribute)
20901
20902         * statement.cs (Goto): Take a location.
20903
20904 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20905
20906         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20907         if two delegates are compatible.
20908
20909         (NewDelegate::DoResolve): Update to take care of the case when
20910         we instantiate a delegate from another delegate.
20911
20912         * typemanager.cs (FindMembers): Don't even try to look up members
20913         of Delegate types for now.
20914
20915 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20916
20917         * delegate.cs (NewDelegate): New class to take care of delegate
20918         instantiation.
20919
20920         * expression.cs (New): Split the delegate related code out into 
20921         the NewDelegate class.
20922
20923         * delegate.cs (DelegateInvocation): New class to handle delegate 
20924         invocation.
20925
20926         * expression.cs (Invocation): Split out delegate related code into
20927         the DelegateInvocation class.
20928
20929 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20930
20931         * expression.cs (New::DoResolve): Implement delegate creation fully
20932         and according to the spec.
20933
20934         (New::DoEmit): Update to handle delegates differently.
20935
20936         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20937         because of which we were printing out arguments in reverse order !
20938
20939         * delegate.cs (VerifyMethod): Implement to check if the given method
20940         matches the delegate.
20941
20942         (FullDelegateDesc): Implement.
20943
20944         (VerifyApplicability): Implement.
20945
20946         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20947         delegate invocations too.
20948
20949         (Invocation::Emit): Ditto.
20950
20951         * ../errors/cs1593.cs : Added.
20952
20953         * ../errors/cs1594.cs : Added.
20954
20955         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20956
20957 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20958
20959         * typemanager.cs (intptr_type): Core type for System.IntPtr
20960
20961         (InitCoreTypes): Update for the same.
20962
20963         (iasyncresult_type, asynccallback_type): Ditto.
20964
20965         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20966         correct.
20967
20968         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20969         too.
20970
20971         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20972         the builders for the 4 members of a delegate type :-)
20973
20974         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20975         type.
20976
20977         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20978
20979         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20980
20981 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * statement.cs (Break::Emit): Implement.   
20984         (Continue::Emit): Implement.
20985
20986         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20987         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20988         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20989         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20990         end loop
20991
20992         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20993         properties that track the label for the current loop (begin of the
20994         loop and end of the loop).
20995
20996 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20997
20998         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20999         use of emitting anything at all.
21000
21001         * class.cs, rootcontext.cs : Get rid of calls to the same.
21002
21003         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21004
21005         (Populate): Define the constructor correctly and set the implementation
21006         attributes.
21007
21008         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21009         have been defined.
21010
21011         (AddDelegateType): Implement.
21012
21013         (IsDelegateType): Implement helper method.
21014
21015         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21016
21017         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21018         and accordingly handle it.
21019
21020         * delegate.cs (Populate): Take TypeContainer argument.
21021         Implement bits to define the Invoke method. However, I still haven't figured out
21022         how to take care of the native int bit :-(
21023
21024         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21025         Qualify the name of the delegate, not its return type !
21026
21027         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21028         conversion.
21029
21030         (StandardConversionExists): Checking for array types turns out to be recursive.
21031
21032         (ConvertReferenceExplicit): Implement array conversion.
21033
21034         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21035
21036 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21037
21038         * cs-parser.jay (delegate_declaration): Store the fully qualified
21039         name as it is a type declaration.
21040
21041         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21042         readonly.
21043
21044         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21045         as TypeContainer::DefineType.
21046
21047         (Populate): Method in which all the definition of the various methods (Invoke)
21048         etc is done.
21049
21050         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21051         see.
21052
21053         (CloseDelegate): Finally creates the delegate.
21054
21055         * class.cs (TypeContainer::DefineType): Update to define delegates.
21056         (Populate, Emit and CloseType): Do the same thing here too.
21057
21058         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21059         delegates in all these operations.
21060
21061 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21062
21063         * expression.cs: LocalTemporary: a new expression used to
21064         reference a temporary that has been created.
21065
21066         * assign.cs: Handle PropertyAccess back here, so that we can
21067         provide the proper semantic access to properties.
21068
21069         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21070         a few more explicit conversions. 
21071
21072         * modifiers.cs: `NEW' modifier maps to HideBySig.
21073
21074         * expression.cs (PropertyExpr): Make this into an
21075         ExpressionStatement, and support the EmitStatement code path. 
21076
21077         Perform get/set error checking, clean up the interface.
21078
21079         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21080         them into toplevel access objects.
21081
21082 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21083
21084         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21085         SRE.
21086
21087         * typemanager.cs: Keep track here of our PropertyBuilders again to
21088         work around lameness in SRE.
21089
21090 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21091
21092         * expression.cs (LValue::LValueResolve): New method in the
21093         interface, used to perform a second resolution pass for LValues. 
21094
21095         (This::DoResolve): Catch the use of this in static methods.
21096
21097         (This::LValueResolve): Implement.
21098
21099         (This::Store): Remove warning, assigning to `this' in structures
21100         is 
21101
21102         (Invocation::Emit): Deal with invocation of
21103         methods on value types.  We need to pass the address to structure
21104         methods rather than the object itself.  (The equivalent code to
21105         emit "this" for structures leaves the entire structure on the
21106         stack instead of a pointer to it). 
21107
21108         (ParameterReference::DoResolve): Compute the real index for the
21109         argument based on whether the method takes or not a `this' pointer
21110         (ie, the method is static).
21111
21112         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21113         value types returned from functions when we need to invoke a
21114         method on the sturcture.
21115
21116
21117 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21118
21119         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21120         defining the type in the Modulebuilder or Typebuilder. This is to take
21121         care of nested types which need to be defined on the TypeBuilder using
21122         DefineNestedMethod.
21123
21124         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21125         methods in RootContext, only ported to be part of TypeContainer.
21126
21127         (TypeContainer::GetInterfaceOrClass): Ditto.
21128
21129         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21130
21131         * interface.cs (Interface::DefineInterface): New method. Does exactly
21132         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21133         too.
21134
21135         (Interface::GetInterfaces): Move from RootContext here and port.
21136
21137         (Interface::GetInterfaceByName): Same here.
21138
21139         * rootcontext.cs (ResolveTree): Re-write.
21140
21141         (PopulateTypes): Re-write.
21142
21143         * class.cs (TypeContainer::Populate): Populate nested types too.
21144         (TypeContainer::Emit): Emit nested members too.
21145
21146         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21147         instead just use the name argument passed in as it is already fully
21148         qualified.
21149
21150         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21151         to TypeContainer mapping to see if a type is user-defined.
21152
21153         * class.cs (TypeContainer::CloseType): Implement. 
21154
21155         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21156         the default constructor.
21157
21158         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21159         twice.
21160
21161         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21162
21163         * interface.cs (CloseType): Create the type here.
21164
21165         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21166         the hierarchy.
21167
21168         Remove all the methods which are now in TypeContainer.
21169
21170 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21171
21172         * delegate.cs (Define): Re-write bits to define the delegate
21173         correctly.
21174
21175 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21176
21177         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21178
21179         * expression.cs (ImplicitReferenceConversion): handle null as well
21180         as a source to convert to any reference type.
21181
21182         * statement.cs (Return): Perform any implicit conversions to
21183         expected return type.  
21184
21185         Validate use of return statement.  
21186
21187         * codegen.cs (EmitContext): Pass the expected return type here.
21188
21189         * class.cs (Method, Constructor, Property): Pass expected return
21190         type to EmitContext.
21191
21192 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21193
21194         * expression.cs: Make DoResolve take an EmitContext instead of a
21195         TypeContainer.
21196
21197         Replaced `l' and `location' for `loc', for consistency.
21198
21199         (Error, Warning): Remove unneeded Tc argument.
21200
21201         * assign.cs, literal.cs, constant.cs: Update to new calling
21202         convention. 
21203
21204         * codegen.cs: EmitContext now contains a flag indicating whether
21205         code is being generated in a static method or not.
21206
21207         * cs-parser.jay: DecomposeQI, new function that replaces the old
21208         QualifiedIdentifier.  Now we always decompose the assembled
21209         strings from qualified_identifier productions into a group of
21210         memberaccesses.
21211
21212 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21213
21214         * rootcontext.cs: Deal with field-less struct types correctly now
21215         by passing the size option to Define Type.
21216
21217         * class.cs: Removed hack that created one static field. 
21218
21219 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21220
21221         * statement.cs: Moved most of the code generation here. 
21222
21223 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21224
21225         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21226         seem very right.
21227
21228         (ElementAccess): Remove useless bits for now - keep checks as the spec
21229         says.
21230
21231 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21232
21233         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21234         and start performing checks according to the spec.
21235
21236 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21237
21238         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21239         rank_specifiers instead.
21240
21241         (rank_specifiers): Change the order in which the rank specifiers are stored
21242
21243         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21244
21245         * expression.cs (ElementAccess): Implement the LValue interface too.
21246
21247 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21248
21249         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21250         except that user defined conversions are not included.
21251
21252         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21253         perform the conversion of the return type, if necessary.
21254
21255         (New::DoResolve): Check whether we are creating an array or an object
21256         and accordingly do the needful.
21257
21258         (New::Emit): Same here.
21259
21260         (New::DoResolve): Implement guts of array creation.
21261
21262         (New::FormLookupType): Helper function.
21263
21264 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21265
21266         * codegen.cs: Removed most of the code generation here, and move the
21267         corresponding code generation bits to the statement classes. 
21268
21269         Added support for try/catch/finalize and throw.
21270
21271         * cs-parser.jay: Added support for try/catch/finalize.
21272
21273         * class.cs: Catch static methods having the flags override,
21274         virtual or abstract.
21275
21276         * expression.cs (UserCast): This user cast was not really doing
21277         what it was supposed to do.  Which is to be born in fully resolved
21278         state.  Parts of the resolution were being performed at Emit time! 
21279
21280         Fixed this code.
21281
21282 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21283
21284         * expression.cs: Implicity convert the result from UserCast.
21285
21286 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21287
21288         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21289         prevented it from working correctly. 
21290
21291         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21292         merely ConvertImplicit.
21293
21294 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21295
21296         * typemanager.cs: Make the LookupTypeContainer function static,
21297         and not per-instance.  
21298
21299         * class.cs: Make static FindMembers (the one that takes a Type
21300         argument). 
21301
21302         * codegen.cs: Add EmitForeach here.
21303
21304         * cs-parser.jay: Make foreach a toplevel object instead of the
21305         inline expansion, as we need to perform semantic analysis on it. 
21306
21307 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21308
21309         * expression.cs (Expression::ImplicitUserConversion): Rename to
21310         UserDefinedConversion.
21311
21312         (Expression::UserDefinedConversion): Take an extra argument specifying 
21313         whether we look for explicit user conversions too.
21314
21315         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21316
21317         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21318
21319         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21320         with the appropriate arguments.
21321
21322         * cs-parser.jay (cast_expression): Record location too.
21323
21324         * expression.cs (Cast): Record location info.
21325
21326         (Expression::ConvertExplicit): Take location argument.
21327
21328         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21329         to determine if we are doing explicit conversions.
21330
21331         (UserCast::Emit): Update accordingly.
21332
21333         (Expression::ConvertExplicit): Report an error if everything fails.
21334
21335         * ../errors/cs0030.cs : Add.
21336
21337 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21338
21339         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21340         virtual and newslot bits. 
21341
21342         * class.cs (TypeContainer::RegisterRequiredImplementations):
21343         Record methods we need.
21344
21345         (TypeContainer::MakeKey): Helper function to make keys for
21346         MethodBases, since the Methodbase key is useless.
21347
21348         (TypeContainer::Populate): Call RegisterRequiredImplementations
21349         before defining the methods.   
21350
21351         Create a mapping for method_builders_to_methods ahead of time
21352         instead of inside a tight loop.
21353
21354         (::RequireMethods):  Accept an object as the data to set into the
21355         hashtable so we can report interface vs abstract method mismatch.
21356
21357 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * report.cs: Make all of it static.
21360
21361         * rootcontext.cs: Drop object_type and value_type computations, as
21362         we have those in the TypeManager anyways.
21363
21364         Drop report instance variable too, now it is a global.
21365
21366         * driver.cs: Use try/catch on command line handling.
21367
21368         Add --probe option to debug the error reporting system with a test
21369         suite. 
21370
21371         * report.cs: Add support for exiting program when a probe
21372         condition is reached.
21373
21374 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21375
21376         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21377         we do a forcible conversion regardless of type, to check if 
21378         ForceConversion returns a null.
21379
21380         (Binary::error19): Use location to report error.
21381
21382         (Unary::error23): Use location here too.
21383
21384         * ../errors/cs0019.cs : Check in.
21385
21386         * ../errors/cs0023.cs : Check in.
21387
21388         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21389         case of a non-null MethodInfo object with a length of 0 !
21390
21391         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21392         an applicable member - according to the spec :-)
21393         Also fix logic to find members in base types.
21394
21395         (Unary::ResolveOperator): Same here.
21396
21397         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21398         as I was getting thoroughly confused between this and error19 :-)
21399
21400         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21401         (::FindMostEncompassedType): Implement.
21402         (::FindMostEncompassingType): Implement.
21403         (::StandardConversionExists): Implement.
21404
21405         (UserImplicitCast): Re-vamp. We now need info about most specific
21406         source and target types so that we can do the necessary conversions.
21407
21408         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21409         mathematical union with no duplicates.
21410
21411 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21412
21413         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21414         in order from base classes to child classes, so that we can in
21415         child classes look up in our parent for method names and
21416         attributes (required for handling abstract, virtual, new, override
21417         constructs: we need to instrospect our base class, and if we dont
21418         populate the classes in order, the introspection might be
21419         incorrect.  For example, a method could query its parent before
21420         the parent has any methods and would determine that the parent has
21421         no abstract methods (while it could have had them)).
21422
21423         (RootContext::CreateType): Record the order in which we define the
21424         classes.
21425
21426 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * class.cs (TypeContainer::Populate): Also method definitions can
21429         fail now, keep track of this.
21430
21431         (TypeContainer::FindMembers): Implement support for
21432         DeclaredOnly/noDeclaredOnly flag.
21433
21434         (Constructor::Emit) Return the ConstructorBuilder.
21435
21436         (Method::Emit) Return the MethodBuilder. 
21437         Check for abstract or virtual methods to be public.
21438
21439         * rootcontext.cs (RootContext::CreateType): Register all the
21440         abstract methods required for the class to be complete and the
21441         interface methods that must be implemented. 
21442
21443         * cs-parser.jay: Report error 501 (method requires body if it is
21444         not marked abstract or extern).
21445
21446         * expression.cs (TypeOf::Emit): Implement.
21447
21448         * typemanager.cs: runtime_handle_type, new global type.
21449
21450         * class.cs (Property::Emit): Generate code for properties.
21451
21452 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21453
21454         * expression.cs (Unary::ResolveOperator): Find operators on base type
21455         too - we now conform exactly to the spec.
21456
21457         (Binary::ResolveOperator): Same here.
21458
21459         * class.cs (Operator::Define): Fix minor quirk in the tests.
21460
21461         * ../errors/cs0215.cs : Added.
21462
21463         * ../errors/cs0556.cs : Added.
21464
21465         * ../errors/cs0555.cs : Added.
21466
21467 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21470         single integer which is really efficient
21471
21472 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21473
21474         *  expression.cs (Expression::ImplicitUserConversion): Use location
21475         even in the case when we are examining True operators.
21476  
21477         * class.cs (Operator::Define): Perform extensive checks to conform
21478         with the rules for operator overloading in the spec.
21479
21480         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21481         some of the other conversions mentioned in the spec.
21482
21483         * typemanager.cs (array_type): New static member for the System.Array built-in
21484         type.
21485
21486         (cloneable_interface): For System.ICloneable interface.
21487
21488         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21489         we start resolving the tree and populating types.
21490
21491         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21492  
21493 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21494
21495         * expression.cs (Expression::ExprClassFromMemberInfo,
21496         Expression::Literalize): Create literal expressions from
21497         FieldInfos which are literals.
21498
21499         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21500         type casts, because they were wrong.  The test suite in tests
21501         caught these ones.
21502
21503         (ImplicitNumericConversion): ushort to ulong requires a widening
21504         cast. 
21505
21506         Int32 constant to long requires widening cast as well.
21507
21508         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21509         for integers because the type on the stack is not i4.
21510
21511 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21512
21513         * expression.cs (report118): require location argument. 
21514
21515         * parameter.cs: Do not dereference potential null value.
21516
21517         * class.cs: Catch methods that lack the `new' keyword when
21518         overriding a name.  Report warnings when `new' is used without
21519         anything being there to override.
21520
21521         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21522
21523         * class.cs: Only add constructor to hashtable if it is non-null
21524         (as now constructors can fail on define).
21525
21526         (TypeManager, Class, Struct): Take location arguments.
21527
21528         Catch field instance initialization in structs as errors.
21529
21530         accepting_filter: a new filter for FindMembers that is static so
21531         that we dont create an instance per invocation.
21532
21533         (Constructor::Define): Catch errors where a struct constructor is
21534         parameterless 
21535
21536         * cs-parser.jay: Pass location information for various new
21537         constructs. 
21538
21539         * delegate.cs (Delegate): take a location argument.
21540
21541         * driver.cs: Do not call EmitCode if there were problesm in the
21542         Definition of the types, as many Builders wont be there. 
21543
21544         * decl.cs (Decl::Decl): Require a location argument.
21545
21546         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21547         into integers, and find the most appropiate integer for it.
21548
21549         * literal.cs: Implement ULongLiteral.
21550
21551         * rootcontext.cs: Provide better information about the location of
21552         failure when CreateType fails.
21553
21554 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21555
21556         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21557         as well.
21558
21559         * expression.cs (Binary::CheckShiftArguments): Add missing type
21560         computation.
21561         (Binary::ResolveOperator): Add type to the logical and and logical
21562         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21563         before.
21564
21565         (Binary::DoNumericPromotions): In the case where either argument
21566         is ulong (and most signed types combined with ulong cause an
21567         error) perform implicit integer constant conversions as well.
21568
21569 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21570
21571         * expression.cs (UserImplicitCast): Method should always be
21572         non-null. 
21573         (Invocation::BetterConversion): Simplified test for IntLiteral.
21574
21575         (Expression::ImplicitNumericConversion): Split this routine out.
21576         Put the code that performs implicit constant integer conversions
21577         here. 
21578
21579         (Expression::Resolve): Become a wrapper around DoResolve so we can
21580         check eclass and type being set after resolve.
21581
21582         (Invocation::Badness): Remove this dead function
21583
21584         (Binary::ResolveOperator): Do not compute the expensive argumnets
21585         unless we have a union for it.
21586
21587         (Probe::Emit): Is needs to do an isinst and then
21588         compare against null.
21589
21590         (::CanConvert): Added Location argument.  If the Location argument
21591         is null (Location.Null), then we do not report errors.  This is
21592         used by the `probe' mechanism of the Explicit conversion.  We do
21593         not want to generate an error for something that the user
21594         explicitly requested to be casted.  But the pipeline for an
21595         explicit cast first tests for potential implicit casts.
21596
21597         So for now, if the Location is null, it means `Probe only' to
21598         avoid adding another argument.   Might have to revise this
21599         strategy later.
21600
21601         (ClassCast): New class used to type cast objects into arbitrary
21602         classes (used in Explicit Reference Conversions).
21603
21604         Implement `as' as well.
21605
21606         Reverted all the patches from Ravi below: they were broken:
21607
21608                 * The use of `level' as a mechanism to stop recursive
21609                   invocations is wrong.  That was there just to catch the
21610                   bug with a strack trace but not as a way of addressing
21611                   the problem.
21612
21613                   To fix the problem we have to *understand* what is going
21614                   on and the interactions and come up with a plan, not
21615                   just get things going.
21616
21617                 * The use of the type conversion cache that I proposed
21618                   last night had an open topic: How does this work across
21619                   protection domains.  A user defined conversion might not
21620                   be public in the location where we are applying the
21621                   conversion, a different conversion might be selected
21622                   (ie, private A->B (better) but public B->A (worse),
21623                   inside A, A->B applies, but outside it, B->A will
21624                   apply).
21625
21626                 * On top of that (ie, even if the above is solved),
21627                   conversions in a cache need to be abstract.  Ie, `To
21628                   convert from an Int to a Short use an OpcodeCast', not
21629                   `To convert from an Int to a Short use the OpcodeCast on
21630                   the variable 5' (which is what this patch was doing).
21631
21632 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21633
21634         * expression.cs (Invocation::ConversionExists): Re-write to use
21635         the conversion cache
21636
21637         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21638         cache all conversions done, not just user-defined ones.
21639
21640         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21641         to determine if a conversion exists instead of acutually trying to 
21642         perform the conversion. It's faster too.
21643
21644         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21645         and only then attempt the implicit conversion.
21646
21647 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21648
21649         * expression.cs (ConvertImplicit): Use a cache for conversions
21650         already found. Check level of recursion and bail out if necessary.
21651
21652 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21653
21654         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21655         Export standard methods that we expect for string operations.
21656
21657         * statement.cs (Block::UsageWarning): Track usage of variables and
21658         report the errors for not used variables.
21659
21660         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21661         operator. 
21662
21663 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * codegen.cs: remove unnneded code 
21666
21667         * expression.cs: Removed BuiltinTypeAccess class
21668
21669         Fix the order in which implicit conversions are
21670         done.  
21671
21672         The previous fixed dropped support for boxed conversions (adding a
21673         test to the test suite now)
21674
21675         (UserImplicitCast::CanConvert): Remove test for source being null,
21676         that code is broken.  We should not feed a null to begin with, if
21677         we do, then we should track the bug where the problem originates
21678         and not try to cover it up here.
21679
21680         Return a resolved expression of type UserImplicitCast on success
21681         rather than true/false.  Ravi: this is what I was talking about,
21682         the pattern is to use a static method as a "constructor" for
21683         objects. 
21684
21685         Also, do not create arguments until the very last minute,
21686         otherwise we always create the arguments even for lookups that
21687         will never be performed. 
21688
21689         (UserImplicitCast::Resolve): Eliminate, objects of type
21690         UserImplicitCast are born in a fully resolved state. 
21691
21692         * typemanager.cs (InitCoreTypes): Init also value_type
21693         (System.ValueType). 
21694
21695         * expression.cs (Cast::Resolve): First resolve the child expression.
21696
21697         (LValue): Add new method AddressOf to be used by
21698         the `&' operator.  
21699
21700         Change the argument of Store to take an EmitContext instead of an
21701         ILGenerator, because things like FieldExpr need to be able to call
21702         their children expression to generate the instance code. 
21703
21704         (Expression::Error, Expression::Warning): Sugar functions for
21705         reporting errors.
21706
21707         (Expression::MemberLookup): Accept a TypeContainer instead of a
21708         Report as the first argument.
21709
21710         (Expression::ResolvePrimary): Killed.  I still want to improve
21711         this as currently the code is just not right.
21712
21713         (Expression::ResolveMemberAccess): Simplify, but it is still
21714         wrong. 
21715
21716         (Unary::Resolve): Catch errors in AddressOf operators.
21717
21718         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21719         index to a byte for the short-version, or the compiler will choose
21720         the wrong Emit call, which generates the wrong data.
21721
21722         (ParameterReference::Emit, ::Store): same.
21723
21724         (FieldExpr::AddressOf): Implement.
21725
21726         * typemanager.cs: TypeManager: made public variable instead of
21727         property.
21728
21729         * driver.cs: document --fatal.
21730
21731         * report.cs (ErrorMessage, WarningMessage): new names for the old
21732         Error and Warning classes.
21733
21734         * cs-parser.jay (member_access): Turn built-in access to types
21735         into a normal simplename
21736
21737 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21738
21739         * expression.cs (Invocation::BetterConversion): Fix to cope
21740         with q being null, since this was introducing a bug.
21741
21742         * expression.cs (ConvertImplicit): Do built-in conversions first.
21743
21744 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21745
21746         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21747
21748 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21749
21750         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21751         I had introduced long ago (what's new ?).
21752
21753         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21754         the work of all the checking. 
21755         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21756         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21757
21758         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21759         that is the right way. 
21760
21761         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21762         overloading resolution. Use everywhere instead of cutting and pasting code.
21763
21764         (Binary::ResolveOperator): Use MakeUnionSet.
21765
21766         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21767         we have to convert to bool types. Not complete yet.
21768
21769 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * typemanager.cs (TypeManager::CSharpName): support ushort.
21772
21773         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21774         to provide an expression that performsn an implicit constant int
21775         conversion (section 6.1.6).
21776         (Expression::ConvertImplicitRequired): Reworked to include
21777         implicit constant expression conversions.
21778
21779         (Expression::ConvertNumericExplicit): Finished.
21780
21781         (Invocation::Emit): If InstanceExpression is null, then it means
21782         that we perform a call on this.
21783
21784 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21785
21786         * expression.cs (Unary::Emit): Remove some dead code.
21787         (Probe): Implement Resolve and Emit for `is'.
21788         (Expression::ConvertImplicitRequired): Attempt to do constant
21789         expression conversions here.  Maybe should be moved to
21790         ConvertImplicit, but I am not sure.
21791         (Expression::ImplicitLongConstantConversionPossible,
21792         Expression::ImplicitIntConstantConversionPossible): New functions
21793         that tell whether is it possible to apply an implicit constant
21794         expression conversion.
21795
21796         (ConvertNumericExplicit): Started work on explicit numeric
21797         conversions.
21798
21799         * cs-parser.jay: Update operator constants.
21800
21801         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21802         (Parameters::GetSignature): Hook up VerifyArgs here.
21803         (Parameters::VerifyArgs): Verifies that no two arguments have the
21804         same name. 
21805
21806         * class.cs (Operator): Update the operator names to reflect the
21807         ones that the spec expects (as we are just stringizing the
21808         operator names).
21809
21810         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21811         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21812         previous usage did only work for our methods.
21813         (Expression::ConvertImplicit): Handle decimal implicit numeric
21814         conversions as well.
21815         (Expression::InternalTypeConstructor): Used to invoke constructors
21816         on internal types for default promotions.
21817
21818         (Unary::Emit): Implement special handling for the pre/post
21819         increment/decrement for overloaded operators, as they need to have
21820         the same semantics as the other operators.
21821
21822         (Binary::ResolveOperator): ditto.
21823         (Invocation::ConversionExists): ditto.
21824         (UserImplicitCast::Resolve): ditto.
21825
21826 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21827
21828         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21829         operator, return after emitting body. Regression tests pass again !
21830
21831         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21832         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21833         (Invocation::OverloadResolve): Ditto.
21834         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21835
21836         * everywhere : update calls to the above methods accordingly.
21837
21838 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21839
21840         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21841
21842         * expression.cs (ExpressionStatement): New base class used for
21843         expressions that can appear in statements, so that we can provide
21844         an alternate path to generate expression that do not leave a value
21845         on the stack.
21846
21847         (Expression::Emit, and all the derivatives): We no longer return
21848         whether a value is left on the stack or not.  Every expression
21849         after being emitted leaves a single value on the stack.
21850
21851         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21852         facilties of ExpressionStatement if possible.
21853
21854         * cs-parser.jay: Update statement_expression.
21855
21856 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21857
21858         * driver.cs: Change the wording of message
21859
21860 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21861
21862         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21863         the type of the expression to the return type of the method if
21864         we have an overloaded operator match ! The regression tests pass again !
21865         (Unary::ResolveOperator): Ditto.
21866
21867         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21868         to find "op_Implicit", not "implicit" ;-)
21869         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21870         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21871
21872         * everywhere : Correct calls to the above accordingly.
21873
21874         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21875         (ConvertImplicit): Do user-defined conversion if it exists.
21876
21877 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * assign.cs: track location.
21880         (Resolve): Use implicit conversions on assignment.
21881
21882         * literal.cs: Oops.  Not good, Emit of short access values should
21883         pass (Bytes) or the wrong argument will be selected.
21884
21885         * expression.cs (Unary::Emit): Emit code for -expr.
21886
21887         (Unary::ResolveOperator): Handle `Substract' for non-constants
21888         (substract from zero from the non-constants).
21889         Deal with Doubles as well. 
21890
21891         (Expression::ConvertImplicitRequired): New routine that reports an
21892         error if no implicit conversion exists. 
21893
21894         (Invocation::OverloadResolve): Store the converted implicit
21895         expressions if we make them
21896
21897 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21898
21899         * class.cs (ConstructorInitializer): Take a Location argument.
21900         (ConstructorBaseInitializer): Same here.
21901         (ConstructorThisInitializer): Same here.
21902
21903         * cs-parser.jay : Update all calls accordingly.
21904
21905         * expression.cs (Unary, Binary, New): Take location argument.
21906         Update accordingly everywhere.
21907
21908         * cs-parser.jay : Update all calls to the above to take a location
21909         argument.
21910
21911         * class.cs : Ditto.
21912
21913 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21914
21915         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21916         (Invocation::BetterConversion): Same here
21917         (Invocation::ConversionExists): Ditto.
21918
21919         (Invocation::ConversionExists): Implement.
21920
21921 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21922
21923         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21924         Also take an additional TypeContainer argument.
21925
21926         * All over : Pass in TypeContainer as argument to OverloadResolve.
21927
21928         * typemanager.cs (CSharpName): Update to check for the string type and return
21929         that too.
21930
21931         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21932         a given method.
21933
21934 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21935
21936         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21937         (Invocation::BetterFunction): Implement.
21938         (Invocation::BetterConversion): Implement.
21939         (Invocation::ConversionExists): Skeleton, no implementation yet.
21940
21941         Okay, things work fine !
21942
21943 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21944
21945         * typemanager.cs: declare and load enum_type, delegate_type and
21946         void_type. 
21947
21948         * expression.cs (Expression::Emit): Now emit returns a value that
21949         tells whether a value is left on the stack or not.  This strategy
21950         might be reveted tomorrow with a mechanism that would address
21951         multiple assignments.
21952         (Expression::report118): Utility routine to report mismatches on
21953         the ExprClass.
21954
21955         (Unary::Report23): Report impossible type/operator combination
21956         utility function.
21957
21958         (Unary::IsIncrementableNumber): Whether the type can be
21959         incremented or decremented with add.
21960         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21961         complemented. 
21962         (Unary::ResolveOperator): Implement ++, !, ~,
21963
21964         (Invocation::Emit): Deal with new Emit convetion.
21965
21966         * All Expression derivatives: Updated their Emit method to return
21967         whether they leave values on the stack or not.
21968
21969         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21970         stack for expressions that are statements. 
21971
21972 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * expression.cs (LValue): New interface.  Must be implemented by
21975         LValue objects.
21976         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21977         LValue interface.
21978
21979         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21980         interface for generating code, simplifies the code.
21981
21982 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21983
21984         * expression.cs (everywhere): Comment out return statements in ::Resolve
21985         methods to avoid the warnings.
21986
21987 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21988
21989         * driver.cs (parse): Report error 2001 if we can not open the
21990         source file.
21991
21992         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21993         not resolve it.
21994
21995         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21996         object. 
21997
21998         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21999         otherwise nested blocks end up with the same index.
22000
22001         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22002
22003         * expression.cs:  Instead of having FIXMEs in the Resolve
22004         functions, throw exceptions so it is obvious that we are facing a
22005         bug. 
22006
22007         * cs-parser.jay (invocation_expression): Pass Location information.
22008
22009         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22010         Use a basename for those routines because .NET does not like paths
22011         on them. 
22012
22013         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22014         already defined.
22015
22016 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22017
22018         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22019         are loading the correct data types (throws an exception if not).
22020         (TypeManager::InitCoreTypes): Use CoreLookupType
22021
22022         * expression.cs (Unary::ResolveOperator): return the child
22023         expression for expressions which are just +expr.
22024         (Unary::ResolveOperator): Return negative literals for -LITERAL
22025         expressions (otherwise they are Unary {Literal}).
22026         (Invocation::Badness): Take into account `Implicit constant
22027         expression conversions'.
22028
22029         * literal.cs (LongLiteral): Implement long literal class.
22030         (IntLiteral): export the `Value' of the intliteral. 
22031
22032 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22033
22034         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22035
22036         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22037         instead of 'Operator'
22038
22039         * expression.cs (Binary::ResolveOperator): Update accordingly.
22040         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22041         and 'Minus'
22042
22043         * cs-parser.jay (unary_expression): Update to use the new names.
22044
22045         * gen-treedump.cs (GetUnary): Same here.
22046
22047         * expression.cs (Unary::Resolve): Implement.
22048         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22049         operators are found instead of making noise ;-)
22050         (Unary::ResolveOperator): New method to do precisely the same thing which
22051         Binary::ResolveOperator does for Binary expressions.
22052         (Unary.method, .Arguments): Add.
22053         (Unary::OperName): Implement.   
22054         (Unary::ForceConversion): Copy and Paste !
22055
22056         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22057         a unary operator.
22058
22059         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22060         for the inbuilt operators. Only overloading works for now ;-)
22061
22062 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22063
22064         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22065         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22066
22067         * expression.cs (This::Emit): Implement. 
22068         (This::Resolve): Implement.
22069         (TypeOf:Resolve): Implement.
22070         (Expression::ResolveSimpleName): Add an implicit this to instance
22071         field references. 
22072         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22073         Bind instance variable to Field expressions.
22074         (FieldExpr::Instance): New field used to track the expression that
22075         represents the object instance.
22076         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22077         binding 
22078         (FieldExpr::Emit): Implement.
22079
22080         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22081         the last instruction contains a return opcode to avoid generating
22082         the last `ret' instruction (this generates correct code, and it is
22083         nice to pass the peverify output).
22084
22085         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22086         initializer for static and instance variables.
22087         (Constructor::Emit): Allow initializer to be null in the case of
22088         static constructors.  Only emit initializer for instance
22089         constructors. 
22090
22091         (TypeContainer::FindMembers): Return a null array if there are no
22092         matches.
22093
22094         Also fix the code for the MemberTypes.Method branch, as it was not
22095         scanning that for operators (or tried to access null variables before).
22096
22097         * assign.cs (Assign::Emit): Handle instance and static fields. 
22098
22099         * TODO: Updated.
22100
22101         * driver.cs: Stop compilation if there are parse errors.
22102
22103         * cs-parser.jay (constructor_declaration): Provide default base
22104         initializer for non-static constructors.
22105         (constructor_declarator): Do not provide a default base
22106         initializers if none was specified.
22107         Catch the fact that constructors should not have parameters.
22108
22109         * class.cs: Do not emit parent class initializers for static
22110         constructors, that should be flagged as an error.
22111
22112 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22113
22114         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22115         Move back code into TypeContainer::Populate.
22116
22117 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22118
22119         * class.cs (TypeContainer::AddConstructor): Fix the check to
22120         compare against Name, not Basename. 
22121         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22122
22123         * cs-parser.jay : Update accordingly.
22124
22125         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22126         for methods, don't forget to look into the operators too.
22127         (RegisterMethodBuilder): Helper method to take care of this for
22128         methods, constructors and operators.
22129         (Operator::Define): Completely revamp.
22130         (Operator.OperatorMethod, MethodName): New fields.
22131         (TypeContainer::Populate): Move the registering of builders into
22132         RegisterMethodBuilder.
22133         (Operator::Emit): Re-write.
22134
22135         * expression.cs (Binary::Emit): Comment out code path to emit method
22136         invocation stuff for the case when we have a user defined operator. I am
22137         just not able to get it right !
22138
22139 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22140
22141         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22142         argument. 
22143
22144         (Expression::MemberLookup): Provide a version that allows to
22145         specify the MemberTypes and BindingFlags. 
22146
22147         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22148         so it was not fetching variable information from outer blocks.
22149
22150         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22151         Beforefieldinit as it was buggy.
22152
22153         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22154         that Ravi put here.  
22155
22156         * class.cs (Constructor::Emit): Only emit if block is not null.
22157         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22158         deal with this by semantically definining it as if the user had
22159         done it.
22160
22161         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22162         constructors as we now "emit" them at a higher level.
22163
22164         (TypeContainer::DefineDefaultConstructor): Used to define the
22165         default constructors if none was provided.
22166
22167         (ConstructorInitializer): Add methods Resolve and Emit. 
22168
22169         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22170
22171 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22172
22173         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22174         the default constructor builder with our hashtable for methodbuilders
22175         to methodcores.
22176
22177         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22178         and argument_count is 0 in which case we have a match.
22179         (Binary::ResolveOperator): More null checking and miscellaneous coding
22180         style cleanup.
22181
22182 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22183
22184         * rootcontext.cs (IsNameSpace): Compare against null.
22185
22186         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22187
22188         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22189         and Unary::Operator.
22190
22191         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22192         accordingly.
22193
22194         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22195         we have overloaded operators.
22196         (Binary::ResolveOperator): Implement the part which does the operator overload
22197         resolution.
22198
22199         * class.cs (Operator::Emit): Implement.
22200         (TypeContainer::Emit): Emit the operators we have too.
22201
22202         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22203         the case when we have a user-defined operator.
22204
22205 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22206
22207         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22208
22209 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22210
22211         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22212         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22213         (Constructor::Emit): Implement.
22214         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22215         if we have no work to do. 
22216         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22217         Emit method.
22218
22219         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22220         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22221
22222         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22223         of parent.parent.
22224
22225 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22226
22227         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22228         in the source.
22229         (Tree::RecordNamespace): Method to do what the name says ;-)
22230         (Tree::Namespaces): Property to get at the namespaces hashtable.
22231
22232         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22233         keep track.
22234
22235         * rootcontext.cs (IsNamespace): Fixed it :-)
22236
22237 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22238
22239         * class.cs (TypeContainer::FindMembers): Add support for
22240         constructors. 
22241         (MethodCore): New class that encapsulates both the shared aspects
22242         of a Constructor and a Method.  
22243         (Method, Constructor): Factored pieces into MethodCore.
22244
22245         * driver.cs: Added --fatal which makes errors throw exceptions.
22246         Load System assembly as well as part of the standard library.
22247
22248         * report.cs: Allow throwing exceptions on errors for debugging.
22249
22250         * modifiers.cs: Do not use `parent', instead use the real type
22251         container to evaluate permission settings.
22252
22253         * class.cs: Put Ravi's patch back in.  He is right, and we will
22254         have to cope with the
22255
22256 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22257
22258         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22259         FamORAssem, not FamANDAssem.
22260
22261 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * driver.cs: Added --parse option that only parses its input files
22264         and terminates.
22265
22266         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22267         incorrect.  IsTopLevel is not used to tell whether an object is
22268         root_types or not (that can be achieved by testing this ==
22269         root_types).  But to see if this is a top-level *class* (not
22270         necessarly our "toplevel" container). 
22271
22272 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22273
22274         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22275         parent instead of a direct call to GetType.
22276
22277 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22278
22279         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22280         Modifiers.TypeAttr. This should just be a call to that method.
22281
22282         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22283         object so that we can determine if we are top-level or not.
22284
22285         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22286         TypeContainer too.
22287
22288         * enum.cs (Enum::Define): Ditto.
22289
22290         * modifiers.cs (FieldAttr): Re-write.
22291
22292         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22293         (TypeContainer::HaveStaticConstructor): New property to provide access
22294         to precisely that info.
22295
22296         * modifiers.cs (MethodAttr): Re-write.
22297         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22298
22299         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22300         of top-level types as claimed.
22301
22302 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22303
22304         * expression.cs (MemberLookup): Fruitless attempt to lookup
22305         constructors.  Maybe I need to emit default constructors?  That
22306         might be it (currently .NET emits this for me automatically).
22307         (Invocation::OverloadResolve): Cope with Arguments == null.
22308         (Invocation::EmitArguments): new function, shared by the new
22309         constructor and us.
22310         (Invocation::Emit): Handle static and instance methods.  Emit
22311         proper call instruction for virtual or non-virtual invocations.
22312         (New::Emit): Implement.
22313         (New::Resolve): Implement.
22314         (MemberAccess:Resolve): Implement.
22315         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22316         to track instances.
22317         (FieldExpr::Resolve): Set type.
22318
22319         * support.cs: Handle empty arguments.
22320                 
22321         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22322         SimpleLookup): Auxiliary routines to help parse a qualifier
22323         identifier.  
22324
22325         Update qualifier_identifier rule.
22326
22327         * codegen.cs: Removed debugging messages.
22328
22329         * class.cs: Make this a global thing, this acts just as a "key" to
22330         objects that we might have around.
22331
22332         (Populate): Only initialize method_builders_to_methods once.
22333
22334         * expression.cs (PropertyExpr): Initialize type from the
22335         PropertyType. 
22336
22337         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22338         Resolve pattern.  Attempt to implicitly convert value to boolean.
22339         Emit code.
22340
22341         * expression.cs: Set the type for the int32/int32 argument case.
22342         (Binary::ResolveOperator): Set the return type to boolean for
22343         comparission operators
22344
22345         * typemanager.cs: Remove debugging print code.
22346
22347         (Invocation::Resolve): resolve type.
22348
22349         * class.cs: Allocate a MemberInfo of the correct size, as the code
22350         elsewhere depends on the test to reflect the correct contents.
22351
22352         (Method::) Keep track of parameters, due to System.Reflection holes
22353
22354         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22355         mapping here.
22356
22357         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22358         of the exact size and return that.
22359
22360         (Class::LookupMethodByBuilder): New function that maps
22361         MethodBuilders to its methods.  Required to locate the information
22362         on methods because System.Reflection bit us again.
22363
22364         * support.cs: New file, contains an interface ParameterData and
22365         two implementations: ReflectionParameters and InternalParameters
22366         used to access Parameter information.  We will need to grow this
22367         as required.
22368
22369         * expression.cs (Invocation::GetParameterData): implement a cache
22370         and a wrapper around the ParameterData creation for methods. 
22371         (Invocation::OverloadResolve): Use new code.
22372
22373 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22374
22375         * class.cs (TypeContainer::EmitField): Remove and move into 
22376         (Field::Define): here and modify accordingly.
22377         (Field.FieldBuilder): New member.
22378         (TypeContainer::Populate): Update accordingly.
22379         (TypeContainer::FindMembers): Implement.
22380
22381 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22382
22383         * statement.cs: (VariableInfo::VariableType): New field to be
22384         initialized with the full type once it is resolved. 
22385
22386 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22387
22388         * parameter.cs (GetParameterInfo): Use a type cache to compute
22389         things only once, and to reuse this information
22390
22391         * expression.cs (LocalVariableReference::Emit): Implement.
22392         (OpcodeCast::Emit): fix.
22393
22394         (ParameterReference::Resolve): Implement.
22395         (ParameterReference::Emit): Implement.
22396
22397         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22398         that are expressions need to stay as Expressions.
22399
22400         * typemanager.cs (CSharpName): Returns the C# name of a type if
22401         possible. 
22402
22403         * expression.cs (Expression::ConvertImplicit): New function that
22404         implements implicit type conversions.
22405
22406         (Expression::ImplicitReferenceConversion): Implements implicit
22407         reference conversions.
22408
22409         (EmptyCast): New type for transparent casts.
22410
22411         (OpcodeCast): New type for casts of types that are performed with
22412         a sequence of bytecodes.
22413
22414         (BoxedCast): New type used for casting value types into reference
22415         types.  Emits a box opcode.
22416
22417         (Binary::DoNumericPromotions): Implements numeric promotions of
22418         and computation of the Binary::Type.
22419
22420         (Binary::EmitBranchable): Optimization.
22421
22422         (Binary::Emit): Implement code emission for expressions.
22423
22424         * typemanager.cs (TypeManager): Added two new core types: sbyte
22425         and byte.
22426
22427 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22428
22429         * class.cs (TypeContainer::FindMembers): Method which does exactly
22430         what Type.FindMembers does, only we don't have to use reflection. No
22431         implementation yet.
22432
22433         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22434         typecontainer objects as we need to get at them.
22435         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22436
22437         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22438         typecontainer object.
22439
22440         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22441         of just a Report object.
22442
22443 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22444
22445         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22446         "remove_"
22447         (TypeContainer::Populate): Now define the delegates of the type too.
22448         (TypeContainer.Delegates): Property to access the list of delegates defined
22449         in the type.
22450
22451         * delegates.cs (Delegate::Define): Implement partially.
22452
22453         * modifiers.cs (TypeAttr): Handle more flags.
22454
22455 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22456
22457         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22458         and not <=
22459         (Operator::Define): Re-write logic to get types by using the LookupType method
22460         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22461         (Indexer::Define): Ditto.
22462         (Event::Define): Ditto.
22463         (Property::Define): Ditto.
22464
22465 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22466
22467         * class.cs (TypeContainer::Populate): Now define operators too. 
22468         (TypeContainer.Operators): New property to access the list of operators
22469         in a type.
22470         (Operator.OperatorMethodBuilder): New member to hold the method builder
22471         for the operator we are defining.
22472         (Operator::Define): Implement.
22473
22474 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22475
22476         * class.cs (Event::Define): Make the prefixes of the accessor methods
22477         addOn_ and removeOn_ 
22478
22479         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22480         of the location being passed in too. Ideally, this should go later since all
22481         error reporting should be done through the Report object.
22482
22483         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22484         (Populate): Iterate thru the indexers we have and define them too.
22485         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22486         for the get and set accessors.
22487         (Indexer::Define): Implement.
22488
22489 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22490
22491         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22492         my previous implementation, did not work.
22493
22494         * typemanager.cs: Add a couple of missing types (the longs).
22495
22496         * literal.cs: Use TypeManager.bool_type instead of getting it.
22497
22498         * expression.cs (EventExpr): New kind of expressions.
22499         (Expressio::ExprClassFromMemberInfo): finish
22500
22501 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22502
22503         * assign.cs: Emit stores to static fields differently.
22504
22505 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22506
22507         * Merge in changes and adjust code to tackle conflicts. Backed out my
22508         code in Assign::Resolve ;-) 
22509
22510 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22511
22512         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22513         instead Report.Error and also pass in the location.
22514         (CSharpParser::Lexer): New readonly property to return the reference
22515         to the Tokenizer object.
22516         (declare_local_variables): Use Report.Error with location instead of plain 
22517         old error.
22518         (CheckDef): Ditto.
22519
22520         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22521         (Operator.CheckBinaryOperator): Ditto.
22522
22523         * cs-parser.jay (operator_declarator): Update accordingly.
22524
22525         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22526         (CheckBinaryOperator): Same here.
22527
22528         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22529         on the name without any prefixes of namespace names etc. This is because we
22530         already might have something already fully qualified like 
22531         'System.Console.WriteLine'
22532
22533         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22534
22535 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22536
22537         * cs-tokenizer.cs (location): Return a string which also contains
22538         the file name.
22539
22540         * expression.cs (ElementAccess): New class for expressions of the
22541         type 'element access.'
22542         (BaseAccess): New class for expressions of the type 'base access.'
22543         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22544         respectively.
22545
22546         * cs-parser.jay (element_access): Implement action.
22547         (base_access): Implement actions.
22548         (checked_expression, unchecked_expression): Implement.
22549
22550         * cs-parser.jay (local_variable_type): Correct and implement.
22551         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22552
22553         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22554
22555         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22556         name and the specifiers.
22557
22558         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22559
22560         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22561         making them all public ;-)
22562
22563         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22564         class anyways.
22565
22566 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22567
22568         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22569         PropertyExprs.
22570         (FieldExpr, PropertyExprs): New resolved expressions.
22571         (SimpleName::MemberStaticCheck): Perform static checks for access
22572         to non-static fields on static methods. Maybe this should be
22573         generalized for MemberAccesses. 
22574         (SimpleName::ResolveSimpleName): More work on simple name
22575         resolution. 
22576
22577         * cs-parser.jay (primary_expression/qualified_identifier): track
22578         the parameter index.
22579
22580         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22581         (EmitContext::EmitBoolExpression): Chain to expression generation
22582         instead of temporary hack.
22583         (::EmitStatementExpression): Put generic expression code generation.
22584
22585         * assign.cs (Assign::Emit): Implement variable assignments to
22586         local variables, parameters and fields.
22587
22588 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22589
22590         * statement.cs (Block::GetVariableInfo): New method, returns the
22591         VariableInfo for a variable name in a block.
22592         (Block::GetVariableType): Implement in terms of GetVariableInfo
22593
22594         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22595         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22596
22597 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22598
22599         * cs-parser.jay (operator_declaration): Continue on my quest : update
22600         to take attributes argument.
22601         (event_declaration): Ditto.
22602         (enum_declaration): Ditto.
22603         (indexer_declaration): Ditto.
22604
22605         * class.cs (Operator::Operator): Update constructor accordingly.
22606         (Event::Event): Ditto.
22607
22608         * delegate.cs (Delegate::Delegate): Same here.
22609
22610         * enum.cs (Enum::Enum): Same here.
22611
22612 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22613
22614         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22615
22616         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22617
22618         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22619         being passed around as an arraylist.
22620         (Attributes::AddAttribute): Method to add attribute sections.
22621
22622         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22623         (struct_declaration): Update accordingly.
22624         (constant_declaration): Update.
22625         (field_declaration): Update.
22626         (method_header): Update.
22627         (fixed_parameter): Update.
22628         (parameter_array): Ditto.
22629         (property_declaration): Ditto.
22630         (destructor_declaration): Ditto.
22631
22632         * class.cs (Struct::Struct): Update constructors accordingly.
22633         (Class::Class): Ditto.
22634         (Field::Field): Ditto.
22635         (Method::Method): Ditto.
22636         (Property::Property): Ditto.
22637         (TypeContainer::OptAttribute): update property's return type.
22638
22639         * interface.cs (Interface.opt_attributes): New member.
22640         (Interface::Interface): Update to take the extra Attributes argument.
22641
22642         * parameter.cs (Parameter::Parameter): Ditto.
22643
22644         * constant.cs (Constant::Constant): Ditto.
22645
22646         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22647         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22648         the attributes as a parameter.
22649         (InterfaceProperty): Update constructor call.
22650         (InterfaceEvent): Ditto.
22651         (InterfaceMethod): Ditto.
22652         (InterfaceIndexer): Ditto.
22653
22654         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22655         pass the attributes too.
22656         (interface_event_declaration): Ditto.
22657         (interface_property_declaration): Ditto.
22658         (interface_method_declaration): Ditto.
22659         (interface_declaration): Ditto.
22660
22661 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22662
22663         * class.cs (Method::Define): Track the "static Main" definition to
22664         create an entry point. 
22665
22666         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22667         EntryPoint if we find it. 
22668
22669         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22670         (EmitContext::ig): Make this variable public.
22671
22672         * driver.cs: Make the default output file be the first file name
22673         with the .exe extension.  
22674
22675         Detect empty compilations
22676
22677         Handle various kinds of output targets.  Handle --target and
22678         rename -t to --dumper.
22679
22680         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22681         methods inherited from Expression return now an Expression.  This
22682         will is used during the tree rewriting as we resolve them during
22683         semantic analysis.
22684
22685         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22686         the spec.  Missing entirely is the information about
22687         accessability of elements of it.
22688
22689         (Expression::ExprClassFromMemberInfo): New constructor for
22690         Expressions that creates a fully initialized Expression based on
22691         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22692         a Type.
22693
22694         (Invocation::Resolve): Begin implementing resolution of invocations.
22695
22696         * literal.cs (StringLiteral):  Implement Emit.
22697
22698 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22699
22700         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22701         member.
22702
22703 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22704
22705         * cs-parser.jay (attribute_arguments): Implement actions.
22706         (attribute): Fix bug in production. Implement action.
22707         (attribute_list): Implement.
22708         (attribute_target): Implement.
22709         (attribute_target_specifier, opt_target_specifier): Implement
22710         (CheckAttributeTarget): New method to check if the attribute target
22711         is valid.
22712         (attribute_section): Implement.
22713         (opt_attributes): Implement.
22714
22715         * attribute.cs : New file to handle attributes.
22716         (Attribute): Class to hold attribute info.
22717
22718         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22719         (attribute_section): Modify production to use 2 different rules to 
22720         achieve the same thing. 1 s/r conflict down !
22721         Clean out commented, useless, non-reducing dimension_separator rules.
22722
22723         * class.cs (TypeContainer.attributes): New member to hold list
22724         of attributes for a type.
22725         (Struct::Struct): Modify to take one more argument, the attribute list.
22726         (Class::Class): Ditto.
22727         (Field::Field): Ditto.
22728         (Method::Method): Ditto.
22729         (Property::Property): Ditto.
22730
22731         * cs-parser.jay (struct_declaration): Update constructor call to
22732         pass in the attributes too.
22733         (class_declaration): Ditto.
22734         (constant_declaration): Ditto.
22735         (field_declaration): Ditto.
22736         (method_header): Ditto.
22737         (fixed_parameter): Ditto.
22738         (parameter_array): Ditto.
22739         (property_declaration): Ditto.
22740
22741         * constant.cs (Constant::Constant): Update constructor similarly.
22742         Use System.Collections.
22743
22744         * parameter.cs (Parameter::Parameter): Update as above.
22745
22746 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22747
22748         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22749         (TypeContainer.delegates): New member to hold list of delegates.
22750
22751         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22752         this time as I seem to be on crack ;-)
22753
22754 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22755
22756         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22757         tell whether an identifier represents a namespace.
22758
22759         * expression.cs (NamespaceExpr): A namespace expression, used only
22760         temporarly during expression resolution.
22761         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22762         utility functions to resolve names on expressions.
22763
22764 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22765
22766         * codegen.cs: Add hook for StatementExpressions. 
22767
22768         * class.cs: Fix inverted test for static flag in methods.
22769
22770 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22771
22772         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22773         to make it coincide with MS' number.
22774         (Operator::CheckBinaryOperator): Ditto.
22775
22776         * ../errors/errors.txt : Remove error numbers added earlier.
22777
22778         * ../errors/cs1019.cs : Test case for error # 1019
22779
22780         * ../errros/cs1020.cs : Test case for error # 1020
22781
22782         * cs-parser.jay : Clean out commented cruft.
22783         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22784         used anywhere - non-reducing rule.
22785         (namespace_declarations): Non-reducing rule - comment out.
22786
22787         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22788         with TypeContainer::AddEnum.
22789
22790         * delegate.cs : New file for delegate handling classes.
22791         (Delegate): Class for declaring delegates.
22792
22793         * makefile : Update.
22794
22795         * cs-parser.jay (delegate_declaration): Implement.
22796
22797 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22798
22799         * class.cs (Event::Define): Implement.
22800         (Event.EventBuilder): New member.
22801
22802         * class.cs (TypeContainer::Populate): Update to define all enums and events
22803         we have.
22804         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22805         readonly fields for all these cases ?
22806
22807 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22808
22809         * class.cs (Property): Revamp to use the convention of making fields readonly.
22810         Accordingly modify code elsewhere.
22811
22812         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22813         the Define method of the Property class.
22814
22815         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22816         trivial bug.
22817         (TypeContainer::Populate): Update to define all the properties we have. Also
22818         define all enumerations.
22819
22820         * enum.cs (Define): Implement.
22821
22822 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22823
22824         * cs-parser.jay (overloadable_operator): The semantic value is an
22825         enum of the Operator class.
22826         (operator_declarator): Implement actions.
22827         (operator_declaration): Implement.
22828
22829         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22830         validity of definitions.
22831         (Operator::CheckBinaryOperator): Static method to check for binary operators
22832         (TypeContainer::AddOperator): New method to add an operator to a type.
22833
22834         * cs-parser.jay (indexer_declaration): Added line to actually call the
22835         AddIndexer method so it gets added ;-)
22836
22837         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22838         already taken care of by the MS compiler ?  
22839
22840 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22841
22842         * class.cs (Operator): New class for operator declarations.
22843         (Operator::OpType): Enum for the various operators.
22844
22845 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22846
22847         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22848         ostensibly handle this in semantic analysis.
22849
22850         * cs-parser.jay (general_catch_clause): Comment out
22851         (specific_catch_clauses, specific_catch_clause): Ditto.
22852         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22853         (catch_args, opt_catch_args): New productions.
22854         (catch_clause): Rewrite to use the new productions above
22855         (catch_clauses): Modify accordingly.
22856         (opt_catch_clauses): New production to use in try_statement
22857         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22858         and re-write the code in the actions to extract the specific and
22859         general catch clauses by being a little smart ;-)
22860
22861         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22862         Hooray, try and catch statements parse fine !
22863
22864 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22865
22866         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22867         string from the hashtable of variables.
22868
22869         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22870         I end up making that mistake ;-)
22871         (catch_clauses): Fixed gross error which made Key and Value of the 
22872         DictionaryEntry the same : $1 !!
22873
22874 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22875
22876         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22877
22878         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22879         when the add and remove accessors are specified. 
22880
22881 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22882
22883         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22884         information about indexer_declarator.
22885         (indexer_declarator): Implement actions.
22886         (parsing_indexer): New local boolean used to keep track of whether
22887         we are parsing indexers or properties. This is necessary because 
22888         implicit_parameters come into picture even for the get accessor in the 
22889         case of an indexer.
22890         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22891
22892         * class.cs (Indexer): New class for indexer declarations.
22893         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22894         (TypeContainer::indexers): New member to hold list of indexers for the
22895         type.
22896
22897 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22898
22899         * cs-parser.jay (add_accessor_declaration): Implement action.
22900         (remove_accessor_declaration): Implement action.
22901         (event_accessors_declaration): Implement
22902         (variable_declarators): swap statements for first rule - trivial.
22903
22904         * class.cs (Event): New class to hold information about event
22905         declarations.
22906         (TypeContainer::AddEvent): New method to add an event to a type
22907         (TypeContainer::events): New member to hold list of events.
22908
22909         * cs-parser.jay (event_declaration): Implement actions.
22910
22911 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22912
22913         * cs-parser.jay (dim_separators): Implement. Make it a string
22914         concatenating all the commas together, just as they appear.
22915         (opt_dim_separators): Modify accordingly
22916         (rank_specifiers): Update accordingly. Basically do the same
22917         thing - instead, collect the brackets here.
22918         (opt_rank_sepcifiers): Modify accordingly.
22919         (array_type): Modify to actually return the complete type string
22920         instead of ignoring the rank_specifiers.
22921         (expression_list): Implement to collect the expressions
22922         (variable_initializer): Implement. We make it a list of expressions
22923         essentially so that we can handle the array_initializer case neatly too.
22924         (variable_initializer_list): Implement.
22925         (array_initializer): Make it a list of variable_initializers
22926         (opt_array_initializer): Modify accordingly.
22927
22928         * expression.cs (New::NType): Add enumeration to help us
22929         keep track of whether we have an object/delegate creation
22930         or an array creation.
22931         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22932         members to hold data about array creation.
22933         (New:New): Modify to update NewType
22934         (New:New): New Overloaded contructor for the array creation
22935         case.
22936
22937         * cs-parser.jay (array_creation_expression): Implement to call
22938         the overloaded New constructor.
22939
22940 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22941
22942         * class.cs (TypeContainer::Constructors): Return member
22943         constructors instead of returning null.
22944
22945 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22946
22947         * typemanager.cs (InitCoreTypes): Initialize the various core
22948         types after we have populated the type manager with the user
22949         defined types (this distinction will be important later while
22950         compiling corlib.dll)
22951
22952         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22953         on Expression Classification.  Now all expressions have a method
22954         `Resolve' and a method `Emit'.
22955
22956         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22957         generation from working.     Also add some temporary debugging
22958         code. 
22959
22960 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * codegen.cs: Lots of code generation pieces.  This is only the
22963         beginning, will continue tomorrow with more touches of polish.  We
22964         handle the fundamentals of if, while, do, for, return.  Others are
22965         trickier and I need to start working on invocations soon.
22966
22967         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22968         s.InitStatement. 
22969
22970         * codegen.cs (EmitContext): New struct, used during code
22971         emission to keep a context.   Most of the code generation will be
22972         here. 
22973
22974         * cs-parser.jay: Add embedded blocks to the list of statements of
22975         this block.  So code generation proceeds in a top down fashion.
22976
22977 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22978
22979         * statement.cs: Add support for multiple child blocks.
22980
22981 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22982
22983         * codegen.cs (EmitCode): New function, will emit the code for a
22984         Block of code given a TypeContainer and its ILGenerator. 
22985
22986         * statement.cs (Block): Standard public readonly optimization.
22987         (Block::Block constructors): Link children. 
22988         (Block::Child): Child Linker.
22989         (Block::EmitVariables): Emits IL variable declarations.
22990
22991         * class.cs: Drop support for MethodGroups here, delay until
22992         Semantic Analysis.
22993         (Method::): Applied the same simplification that I did before, and
22994         move from Properties to public readonly fields.
22995         (Method::ParameterTypes): Returns the parameter types for the
22996         function, and implements a cache that will be useful later when I
22997         do error checking and the semantic analysis on the methods is
22998         performed.
22999         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23000         and made a method, optional argument tells whether this is a class
23001         or a structure to apply the `has-this' bit.
23002         (Method::GetCallingConvention): Implement, returns the calling
23003         convention. 
23004         (Method::Define): Defines the type, a second pass is performed
23005         later to populate the methods.
23006
23007         (Constructor::ParameterTypes): implement a cache similar to the
23008         one on Method::ParameterTypes, useful later when we do semantic
23009         analysis. 
23010
23011         (TypeContainer::EmitMethod):  New method.  Emits methods.
23012
23013         * expression.cs: Removed MethodGroup class from here.
23014
23015         * parameter.cs (Parameters::GetCallingConvention): new method.
23016
23017 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23018
23019         * class.cs (TypeContainer::Populate): Drop RootContext from the
23020         argument. 
23021
23022         (Constructor::CallingConvention): Returns the calling convention.
23023         (Constructor::ParameterTypes): Returns the constructor parameter
23024         types. 
23025
23026         (TypeContainer::AddConstructor): Keep track of default constructor
23027         and the default static constructor.
23028
23029         (Constructor::) Another class that starts using `public readonly'
23030         instead of properties. 
23031
23032         (Constructor::IsDefault): Whether this is a default constructor. 
23033
23034         (Field::) use readonly public fields instead of properties also.
23035
23036         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23037         track of static constructors;  If none is used, turn on
23038         BeforeFieldInit in the TypeAttributes. 
23039
23040         * cs-parser.jay (opt_argument_list): now the return can be null
23041         for the cases where there are no arguments. 
23042
23043         (constructor_declarator): If there is no implicit `base' or
23044         `this', then invoke the default parent constructor. 
23045
23046         * modifiers.cs (MethodAttr): New static function maps a set of
23047         modifiers flags into a MethodAttributes enum
23048         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23049         MethodAttr, TypeAttr to represent the various mappings where the
23050         modifiers are used.
23051         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23052
23053 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23054
23055         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23056         method arguments.
23057
23058         * interface.cs (PopulateIndexer): Implemented the code generator
23059         for interface indexers.
23060
23061 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23062
23063         * interface.cs (InterfaceMemberBase): Now we track the new status
23064         here.  
23065
23066         (PopulateProperty): Implement property population.  Woohoo!  Got
23067         Methods and Properties going today. 
23068
23069         Removed all the properties for interfaces, and replaced them with
23070         `public readonly' fields. 
23071
23072 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23075         initialize their hashtables/arraylists only when they are needed
23076         instead of doing this always.
23077
23078         * parameter.cs: Handle refs and out parameters.
23079
23080         * cs-parser.jay: Use an ArrayList to construct the arguments
23081         instead of the ParameterCollection, and then cast that to a
23082         Parameter[] array.
23083
23084         * parameter.cs: Drop the use of ParameterCollection and use
23085         instead arrays of Parameters.
23086
23087         (GetParameterInfo): Use the Type, not the Name when resolving
23088         types. 
23089
23090 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23091
23092         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23093         and instead use public readonly fields.
23094
23095         * class.cs: Put back walking code for type containers.
23096
23097 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23098
23099         * class.cs (MakeConstant): Code to define constants.
23100
23101         * rootcontext.cs (LookupType): New function.  Used to locate types 
23102
23103
23104 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23105
23106         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23107         this System.Reflection code is.  Kudos to Microsoft
23108
23109         * typemanager.cs: Implement a type cache and avoid loading all
23110         types at boot time.  Wrap in LookupType the internals.  This made
23111         the compiler so much faster.  Wow.  I rule!
23112
23113         * driver.cs: Make sure we always load mscorlib first (for
23114         debugging purposes, nothing really important).
23115
23116         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23117         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23118
23119         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23120         on namespaces that have been imported using the `using' keyword.
23121
23122         * class.cs (TypeContainer::TypeAttr): Virtualize.
23123         (Class::TypeAttr): Return attributes suitable for this bad boy.
23124         (Struct::TypeAttr): ditto.
23125         Handle nested classes.
23126         (TypeContainer::) Remove all the type visiting code, it is now
23127         replaced with the rootcontext.cs code
23128
23129         * rootcontext.cs (GetClassBases): Added support for structs. 
23130
23131 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23132
23133         * interface.cs, statement.cs, class.cs, parameter.cs,
23134         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23135         Drop use of TypeRefs, and use strings instead.
23136
23137 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23138
23139         * rootcontext.cs: 
23140
23141         * class.cs (Struct::Struct): set the SEALED flags after
23142         checking the modifiers.
23143         (TypeContainer::TypeAttr): new property, returns the
23144         TypeAttributes for a class.  
23145
23146         * cs-parser.jay (type_list): Oops, list production was creating a
23147         new list of base types.
23148
23149         * rootcontext.cs (StdLib): New property.
23150         (GetInterfaceTypeByName): returns an interface by type name, and
23151         encapsulates error handling here.
23152         (GetInterfaces): simplified.
23153         (ResolveTree): Encapsulated all the tree resolution here.
23154         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23155         types. 
23156
23157         * driver.cs: Add support for --nostdlib, to avoid loading the
23158         default assemblies.
23159         (Main): Do not put tree resolution here. 
23160
23161         * rootcontext.cs: Beginning of the class resolution.
23162
23163 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23164
23165         * rootcontext.cs: Provide better error reporting. 
23166
23167         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23168
23169         * rootcontext.cs (CreateInterface): Handle the case where there
23170         are no parent interfaces.
23171
23172         (CloseTypes): Routine to flush types at the end.
23173         (CreateInterface): Track types.
23174         (GetInterfaces): Returns an array of Types from the list of
23175         defined interfaces.
23176
23177         * typemanager.c (AddUserType): Mechanism to track user types (puts
23178         the type on the global type hash, and allows us to close it at the
23179         end). 
23180
23181 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23182
23183         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23184         RecordInterface instead.
23185
23186         * cs-parser.jay: Updated to reflect changes above.
23187
23188         * decl.cs (Definition): Keep track of the TypeBuilder type that
23189         represents this type here.  Not sure we will use it in the long
23190         run, but wont hurt for now.
23191
23192         * driver.cs: Smaller changes to accomodate the new code.
23193
23194         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23195         when done. 
23196
23197         * rootcontext.cs (CreateInterface):  New method, used to create
23198         the System.TypeBuilder type for interfaces.
23199         (ResolveInterfaces): new entry point to resolve the interface
23200         hierarchy. 
23201         (CodeGen): Property, used to keep track of the code generator.
23202
23203 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23204
23205         * cs-parser.jay: Add a second production for delegate_declaration
23206         with `VOID'.
23207
23208         (enum_body): Put an opt_comma here instead of putting it on
23209         enum_body or enum_member_declarations so we can handle trailing
23210         commas on enumeration members.  Gets rid of a shift/reduce.
23211
23212         (type_list): Need a COMMA in the middle.
23213
23214         (indexer_declaration): Tell tokenizer to recognize get/set
23215
23216         * Remove old targets.
23217
23218         * Re-add the parser target.
23219
23220 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23221
23222         * cs-parser.jay: Add precendence rules for a number of operators
23223         ot reduce the number of shift/reduce conflicts in the grammar.
23224
23225 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23226
23227         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23228         and put it here.
23229
23230         Get rid of old crufty code.
23231
23232         * rootcontext.cs: Use this to keep track of the parsed
23233         representation and the defined types available to the program. 
23234
23235         * gen-treedump.cs: adjust for new convention.
23236
23237         * type.cs: Split out the type manager, and the assembly builder
23238         from here. 
23239
23240         * typemanager.cs: the type manager will live here now.
23241
23242         * cil-codegen.cs: And the code generator here. 
23243
23244 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23245
23246         * makefile: Fixed up for easy making.
23247
23248 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23249
23250         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23251         the 
23252
23253         (unary_expression): Expand pre_increment_expression and
23254         post_decrement_expression to reduce a shift/reduce.
23255
23256 2001-07-11  Simon Cozens
23257
23258         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23259
23260         Improve allow_keyword_as_indent name.
23261
23262 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23263
23264         * Adjustments for Beta2. 
23265
23266 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23267
23268         * decl.cs: Added `Define' abstract method.
23269         (InTransit): new property, used to catch recursive definitions. 
23270
23271         * interface.cs: Implement `Define'. 
23272
23273         * modifiers.cs: Map Modifiers.constants to
23274         System.Reflection.TypeAttribute flags.
23275
23276         * class.cs: Keep track of types and user-defined types.
23277         (BuilderInit): New method for creating an assembly
23278         (ResolveType): New function to launch the resolution process, only
23279         used by interfaces for now.
23280
23281         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23282         that are inserted into the name space. 
23283
23284 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23285
23286         * ARGH.  I have screwed up my tree so many times due to the use of
23287         rsync rather than using CVS.  Going to fix this at once. 
23288
23289         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23290         load types.
23291
23292 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23293
23294         * Experiment successful: Use System.Type rather that our own
23295         version of Type.  
23296
23297 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23298
23299         * cs-parser.jay: Removed nsAliases from here.
23300
23301         Use new namespaces, handle `using XXX;' 
23302
23303         * namespace.cs: Reimplemented namespace handling, use a recursive
23304         definition of the class.  Now we can keep track of using clauses
23305         and catch invalid using clauses.
23306
23307 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23308
23309         * gen-treedump.cs: Adapted for all the renaming.
23310
23311         * expression.cs (Expression): this class now has a Type property
23312         which returns an expression Type.
23313
23314         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23315         `Type', as this has a different meaning now in the base
23316
23317 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * interface.cs, class.cs: Removed from all the sources the
23320         references to signature computation, as we can not do method
23321         signature computation during the parsing time, as we are not
23322         trying to solve at that point distinguishing:
23323
23324         class X {
23325                 void a (Blah x) {}
23326                 void a (NS.Blah x) {}
23327         }
23328
23329         Which depending on the context might be valid or not, as we do not
23330         know if Blah is the same thing as NS.Blah at that point.
23331
23332         * Redid everything so the code uses TypeRefs now instead of
23333         Types.  TypeRefs are just temporary type placeholders, that need
23334         to be resolved.  They initially have a pointer to a string and the
23335         current scope in which they are used.  This is used later by the
23336         compiler to resolve the reference to an actual Type. 
23337
23338         * DeclSpace is no longer a CIR.Type, and neither are
23339         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23340         are all DeclSpaces, but no Types. 
23341
23342         * type.cs (TypeRefManager): This implements the TypeRef manager,
23343         which keeps track of all the types that need to be resolved after
23344         the parsing has finished. 
23345
23346 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23347
23348         * ARGH.  We are going to have to store `foreach' as a class rather
23349         than resolving it, as we need to verify error 1579 after name
23350         resolution.   *OR* we could keep a flag that says `This request to
23351         IEnumerator comes from a foreach statement' which we can then use
23352         to generate the error.
23353
23354 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * class.cs (TypeContainer.AddMethod): we now add methods to the
23357         MethodGroup instead of the method hashtable.  
23358
23359         * expression.cs: Add MethodGroup abstraction, which gets us one
23360         step closer to the specification in the way we handle method
23361         declarations.  
23362
23363         * cs-parser.jay (primary_expression): qualified_identifier now
23364         tried to match up an identifier to a local variable reference or
23365         to a parameter reference.
23366
23367         current_local_parameters is now a parser global variable that
23368         points to the current parameters for the block, used during name
23369         lookup.
23370
23371         (property_declaration): Now creates an implicit `value' argument to
23372         the set accessor.
23373
23374 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23375
23376         * parameter.cs: Do not use `param' arguments as part of the
23377         signature, per the spec.
23378
23379 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23380
23381         * decl.cs: Base class for classes, structs and interfaces.  This
23382         is the "Declaration Space" 
23383
23384         * cs-parser.jay: Use CheckDef for checking declaration errors
23385         instead of having one on each function.
23386
23387         * class.cs: Factor out some code for handling error handling in
23388         accordance to the "Declarations" section in the "Basic Concepts"
23389         chapter in the ECMA C# spec.
23390
23391         * interface.cs: Make all interface member classes derive from
23392         InterfaceMemberBase.
23393
23394 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23395
23396         * Many things: all interfaces are parsed and generated in
23397         gen-treedump.  Support for member variables, constructors,
23398         destructors, properties, constants is there.
23399
23400         Beginning of the IL backend, but very little done, just there for
23401         testing purposes. 
23402
23403 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23404
23405         * cs-parser.jay: Fix labeled statement.
23406
23407         * cs-tokenizer.cs (escape): Escape " and ' always.
23408         ref_line, ref_name: keep track of the line/filename as instructed
23409         by #line by the compiler.
23410         Parse #line.
23411
23412 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23413
23414         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23415         to match the values in System.CodeDOM.
23416
23417         Divid renamed to Divide.
23418
23419         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23420         statements. 
23421         (Statements.set): remove.
23422
23423         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23424         statements. 
23425
23426         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23427         falseStatements always have valid values. 
23428
23429         * cs-parser.jay: Use System.CodeDOM now.
23430