In mcs:
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #76323.
4         * convert.cs (ImplicitConversionStandard): Move conversion of
5         void* to arbitrary pointer types ...
6         (ExplicitConversionStandard): .. here.
7         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8         error to always print typenames.
9
10 2005-10-07  Raja R Harinath  <rharinath@novell.com>
11
12         * convert.cs (GetConversionOperator): Rename from
13         GetConversionOperators.  Move operator selection code from ...
14         (UserDefinedConversion): ... here.
15
16 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
17
18         * convert.cs (ExplicitConversionCore): Removed duplicate enum
19         conversion.
20
21 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
22
23         * assign.cs (Assign.DoResolve): Error method changed.
24
25         * cfold.cs (DoConstantNumericPromotions): Error method changed.
26         
27         * const.cs (ResolveValue): Reset in_transit immediately.
28         
29         * constant.cs: Error method changed.
30         
31         * convert.cs: Removed useless location parameter.
32         (ExplicitNumericConversion): Don't do double enum check.
33         (ExplicitConversionCore): Renamed from ExplicitConversion.
34         (ExplicitUnsafe): Extracted from ExplicitConversion.
35         (ExplicitConversion): Uses for error reporting.
36         
37         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
38         error messages.
39         (ResolveBoolean): Uses common error method.
40         (CastToDecimal): Get rid of ec.
41         (CastFromDecimal): Optimized.
42         (ConvCast): Get rid of ec.
43         
44         * enum.cs (ResolveValue): Reset in_transit immediately.
45         (Emit): Return after first error.
46         
47         * expression.cs: Convert changes.
48         
49         * literal.cs: Error method changed.
50         
51         * statement.cs: Error method changed.
52
53 2005-10-03  Raja R Harinath  <rharinath@novell.com>
54
55         * support.cs (SeekableStreamReader.Position): Don't error out when
56         the requested position is just beyond the end of the current
57         buffered data.
58
59 2005-09-28  Raja R Harinath  <rharinath@novell.com>
60
61         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
62         try to keep in sync with the byte count of the underlying Stream.
63         However, this limits us to a window size of 2048 characters: i.e.,
64         the maximum lookahead of our lexer/parser can be 2048 characters.
65
66 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
67
68         Fix #76255.
69         * driver.cs: Fix compilation files with full root path.
70
71 2005-09-25  Miguel de Icaza  <miguel@novell.com>
72
73         * report.cs (SymbolRelatedToPreviousError): Format the output so
74         it does not use an open parenthesis that is never closed. 
75
76         * driver.cs: Follow coding guidelines
77
78 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
79
80         Fix #72930.
81         * const.cs (Const.ResolveValue): Check for assigning non-null
82         value to reference type.
83
84 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
85
86         * anonymous.cs: Implemented ExprClassName.
87         
88         * assign.cs (Assign.DoResolve): Don't chrash when type is not
89         delegate.
90         
91         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
92         check.
93         
94         * class.cs (StaticClass.DefineContainerMembers): Report protected
95         members as error.
96         
97         * codegen.cs: if(ed) PRODUCTION.
98         
99         * convert.cs (Error_CannotImplicitConversion): Better error
100         distinction.
101         
102         * cs-parser.jay: More error checks.
103         
104         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
105         
106         * driver.cs (CSCParseOption): Enabled wrong option check.
107         
108         * ecore.cs (Expression.ExprClassName): Turned to property.
109         (MemberExpr.CheckIntermediateModification): For checking boxed
110         value types     modification.
111         
112         * statement.cs (Fixed.Resolve): Expression type must be
113         convertible to fixed type.
114         (CollectionForeach.GetEnumeratorFilter,TryType):
115         Small refactoring for easier error checking.
116
117 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
118
119         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
120         attributes.
121         
122         * class.cs (GeneratedBaseInitializer): New class for customization
123         compiler generated initializers.
124         (MemberBase.DoDefine): Check Obsolete attribute here.
125         (FieldMember.DoDefine): Ditto.
126         
127         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
128         constants.
129         
130         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
131         (MemberCore.GetObsoleteAttribute): Removed argument.
132         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
133         (MemberCore.CheckObsoleteType): New helper.
134         
135         * delegate.cs,
136         * enum.cs,
137         * statement.cs: Updates after MemberCore changes.
138         
139         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
140         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
141         
142         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
143         obsolete attribute for compiler construct.
144         (As.DoResolve): Cache result.
145         
146         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
147
148 2005-09-26  Raja R Harinath  <rharinath@novell.com>
149
150         Fix #76133.
151         * expression.cs (This.VerifyFixed): In a value type T, the type of
152         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
153         value type R, 'this' is treated as a value parameter.
154
155 2005-09-22  Miguel de Icaza  <miguel@novell.com>
156
157         * statement.cs (Lock): Use the TemporaryVariable class instead of
158         manually using local variables as those do not work when variables
159         are captured.
160
161         * ecore.cs: Moved the TemporaryVariable class from being a nested
162         class inside Foreach to be a public class that can be employed in
163         other places. 
164
165 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
166
167         * cs-parser.jay: interface_accessors replaced by
168         accessor_declarations.
169
170         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
171         location.
172         
173         * statement.cs (GotoCase.Resolve): Convert null constant to
174         null case.
175         (SwitchLabel.ResolveAndReduce): Ditto.
176         (SwitchLabel.NullStringCase): Custom null stamp.
177         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
178         
179         typemanager.cs (CSharpSignature): Don't skip first argument
180         for full names.
181
182 2005-09-18  Miguel de Icaza  <miguel@novell.com>
183
184         * driver.cs: Set InEmacs based on the environment variable EMACS. 
185
186         * location.cs (InEmacs): in this mode, do not report column
187         location as it confuses Emacs.
188
189 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
190
191         * cfold.cs, constant.cs, convert.cs, ecore.cs,
192         expression.cs, iterators.cs, literal.cs: Store constants and
193         literals location.
194         
195         * class.cs (MemberBase.ShortName): Pass location.
196         
197         * cs-parser.jay: Some location fixes.
198         
199         * ecore.cs (Expression.Location): Made virtual.
200
201 2005-09-05  Miguel de Icaza  <miguel@novell.com>
202
203         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
204         if the underlying types are the same, otherwise we need to produce
205         code that will do the proper cast.
206
207         This was exposed by Marek's constant rewrite which produced
208         invalid code for the call site:
209
210         enum X : long { a }
211         void Method (X v) {}
212
213         Method ((X) 5)
214
215         This fixes test-49.cs
216
217 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
218
219         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
220           Type/Object should be allowed as well. Fixed bug #75968.
221
222 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
223
224         * expression.cs : (Binary.DoResolve): when one is enum constant and
225           another is constant 0, then return enum one *as enum type*.
226           Fixed bug 74846.
227
228 2005-09-02  Raja R Harinath  <rharinath@novell.com>
229
230         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
231         internal.
232
233         Fix #75941.
234         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
235         flow-branching for LocalVariableReferences in case we were invoked
236         from a MemberAccess.
237         * expression.cs (LocalVariableReference.VerifyAssigned): New.
238         Carved out of ...
239         (LocalVariableReference.DoResolveBase): ... this.
240         (MemberAccess.Resolve): Do the check that was disabled during
241         SimpleNameResolve.
242
243 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
244
245         * class.cs :
246           (PartialContainer.Create): check abstract/sealed/static strictly
247           but abstract/sealed can exist only at one side. Fixed bug #75883.
248
249 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
250
251         Fix #75945.
252         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
253         specified, don't default to UnmanagedType.I4.
254
255 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
256
257         * expression.cs : conditional operator should check possibly
258           incorrect assign expression. Fixed bug #75946.
259
260 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
261
262         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
263           Reverting the change. gmcs is much complex than mcs on this matter.
264
265 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
266
267         * cs-tokenizer.cs : To read another token ahead of the actual 
268           consumption, use new SavedToken and cache token instead of moving
269           back the stream with SeekableStreamReader (it seemed problematic).
270         * cs-parser.jay,
271           driver.cs : Thus use StreamReader directly.
272         * support.cs : Thus removed SeekableStreamReader.
273
274 2005-08-30  Raja R Harinath  <rharinath@novell.com>
275
276         Fix #75934.
277         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
278         (ScopeInfo.EmitScopeType): Use it to construct field names from
279         names of captured locals.
280
281         Fix #75929.
282         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
283         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
284         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
285         (ExplicitConversion): Remove enum cases already handled by
286         implicit conversion.  Move implicit conversion check to the beginning.
287         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
288         * expression.cs (ArrayCreation.EmitDynamicInitializers):
289         Don't treat System.Enum as a struct.
290
291 2005-08-30  Jb Evain  <jbevain@gmail.com>
292
293         * attribute.cs: handles as expression in parameters.
294
295 2005-08-30  Raja R Harinath  <rharinath@novell.com>
296
297         Fix #75802.
298         * class.cs (TypeContainer.VerifyClsName): Don't use a
299         PartialContainer when verifying CLS compliance.
300         (AbstractPropertyEventMethod): Set Parent here, ...
301         (PropertyMethod): ... not here.
302
303 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
304
305         * attribute.cs : escaped attribute name should not be allowed to be
306           resolved (e.g. @class as classAttribute). Fixed bug #75930.
307
308 2005-08-29  Raja R Harinath  <rharinath@novell.com>
309
310         Fix #75927.
311         * convert.cs (ImplicitStandardConversionExists): Allow zero also
312         when converting a long constant to unsigned long.
313         * expression.cs (Invocation.OverloadResolve): Add sanity check to
314         detect where IsApplicable and VerifyArgumentsCompat disagree.
315
316 2005-08-29  Raja R Harinath  <rharinath@novell.com>
317         and Carlos Alberto Cortez  <carlos@unixmexico.org>
318
319         Fix #75848.
320         * class.cs (TypeContainer.CanElideInitializer): New helper.
321         (TypeContainer.EmitFieldInitializers): Use it to determine if we
322         can safely emitting the initializer of a field.
323
324 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
325
326         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
327           allowed inside a switch (without loop). Fixed bug #75433.
328
329 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
330
331         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
332         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
333
334 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
335
336         * driver.cs : kinda reverting the default encoding changes (not exact 
337           revert since I noticed that "codepage:reset" might not work fine).
338
339 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
340
341         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
342           Location. Now getter and setter store location correctly.
343           (errors/cs0111-12.cs now reports the expected location.)
344
345 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
346
347         * driver.cs : Use default encoding on the environment.
348           Removed (now that) extra parameter for SeekableStreamReader.
349         * support.cs : (SeekableStreamReader) third .ctor() argument for
350           StreamReader is not required (always true). preamble size could
351           be acquired in simpler and safe way.
352
353 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
354
355         * cs-parser.jay: report CS0642 at warning level 3
356           and report CS0642 for an if else statement also
357           fixes bug #74745. Patch by John Luke (and a bit
358           modified by me).
359           Removed extra CS0642 warning check for "while",
360           "for" and "fixed".
361         * statement.cs: In Block.Resolve(), CS0642 check
362           is reimplemented to check a sequence of an empty
363           statement and a block.
364
365           Both fix bug #66777.
366
367 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
368
369         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
370         detection until I fix it.
371         
372         * cs-tokenizer.cs: Changed error message.
373         
374         * cs-parser.jay: Fixed 2 error locations.
375         
376         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
377         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
378         properties.
379         
380         * enum.cs (GetSignatureForError): Fixed.
381         
382         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
383         method detection.
384         
385         * class.cs,
386         * typemanager.cs (RegisterProperty): Removed.
387         
388         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
389
390 2005-08-24  Raja R Harinath  <rharinath@novell.com>
391
392         Fix #75874.
393         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
394         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
395
396 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
397
398         * expression.cs : tiny fix is required for not warning positive ulong.
399           See test-441.cs.
400
401 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
402
403         * expression.cs : add CS0652 check for constant and integral
404           expression. Fixed bug #53974.
405
406 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
407
408         * expression.cs : in DoNumericPromotions(), check if there is implicit
409           conversion overload for string (to check CS0034). Fixed bug #52492.
410
411 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
412
413         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
414
415 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
416
417         * ecore.cs : report location when it is *not* Null.
418
419 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
420
421         * codegen.cs,
422           ecore.cs,
423           flowanalysis.cs,
424           expression.cs:
425           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
426           correctly. Fixed bug #75721.
427
428 2005-08-23  Raja R Harinath  <rharinath@novell.com>
429
430         * support.cs (SeekableStreamReader.Position): Avoid an expensive
431         loop that performs 'min (pos, char_count)'.
432
433         Fix #75862.
434         * expression.cs (Unary.ResolveOperator): Don't discard implicit
435         converted value in Operator.OnesComplement.
436
437 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
438
439         * anonymous.cs: If the anon method is pulled into a helper class,
440         it needs to be `internal' not `private'. Fixes runtime behavior on
441         msft. bug #75704
442
443 2005-08-20  Martin Baulig  <martin@ximian.com>
444
445         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
446         scope if we don't already have it.
447
448         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
449         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
450         fixes #75867.
451
452 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
453
454         Fix #75803
455         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
456         is a partial class.
457
458 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
459
460         The big constants rewrite
461         Fix #75746, #75685 and more
462         As a side effect saved 1MB for MWF ;-)
463         
464         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
465         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
466         enum based for corlib compilation.
467         
468         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
469         subtractions.
470         
471         * class.cs (FixedField.Define): Use ResolveAsConstant.
472         
473         * const.cs (IConstant): Interface constants and enums.
474         (Const.ResolveValue): New method for constant resolvning.
475         (ExternalConstant): Constants from imported assemblies.
476         
477         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
478         conversion; like enums.
479         (Constant.ToType): Converts this constant to different type.
480         (Constant.Increment): Adds 1.
481         
482         * convert.cs (ImplicitConversionRequired): Simplified.
483         
484         * cs-parser.jay: Create EnumMember directly.
485         
486         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
487         
488         * doc.cs (GenerateEnumDocComment): Removed.
489         
490         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
491         (ConvertIntLiteral): Removed.
492         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
493         
494         * enum.cs (EnumMember): Implement IConstant.
495         (Enum.IsValidEnumConstant): Removed.
496         (Enum.GetNextDefaultValue): Removed.
497         (Enum.FindMembers): Updated.
498         (Enum.GenerateDocComment): Iterate enum members.
499         
500         * expression.cs (Cast.TryReduce): Handle enums correctly.
501         (New.Constantify): Made public.
502         (MemberAccess.DoResolve): Removed contant specific if(s).
503         
504         * literal.cs (NullLiteral): Implement new abstract methods.
505         
506         * statement.cs (GotoCase.Resolve): Use new constant methods.
507         (SwitchLabel.ResolveAndReduce): Use new constant methods.
508         
509         * typemanager.cs (LookupEnum): Removed.
510         (IsEnumType): Fixed to work with corlib.
511         (RegisterConstant): Removed.
512         (LookupConstant): Removed.
513         (GetConstant): Changed to work with IConstant.
514
515 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
516
517         * location.cs : Fixed overflown (>255) column number.
518
519 2005-08-03  Raja R Harinath  <rharinath@novell.com>
520
521         First cut of the qualified-alias-member feature.
522         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
523         token.
524         * cs-parser.jay (DOUBLE_COLON): New token.
525         (namespace_or_type_name): Add rule for recognizing
526         qualified-alias-members.
527         (primary_expression): Likewise.
528         (element_access): Allow QualifiedAliasMember as a possible
529         type-bearing expression.
530         (local_variable_type, local_variable_pointer_type): Likewise.
531         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
532         aliases in the current and enclosing namespace declarations.
533         (NamespaceEntry.UsingAlias): Add CS0440 warning.
534         * decl.cs (MemberName.is_double_colon): New.
535         (MemberName.MemberName): Add new constructor for alias-member.
536         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
537         * expression.cs (QualifiedAliasMember): New expression type.
538
539 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
540
541         * location.cs : it borked when no argument was specified.
542
543 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
544
545         * location.cs : tiny ToString() format fix.
546
547 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
548
549         * statement.cs : oops, it was missing.
550
551 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
552
553         A set of fixes for precise line/column location.
554
555         * location.cs :
556           "token" field now holds a file/line "delta", a line number offset 
557           from the segment, and a column number. See also:
558           http://lists.ximian.com/pipermail/mono-devel-list/2004-
559           December/009508.html
560           Removed static IsNull. Use instance IsNull property instead.
561         * cs-tokenizer.cs :
562           For some tokens it stores Location. For Identifier it stores
563           LocatedToken which is a pair of string name and location.
564           Column numbers are adjusted only at getChar().
565         * report.cs :
566           Use Location.ToString() for reporting (it now contains column).
567         * cs-parser.jay :
568           Largely modified to use LocatedToken instead of
569           string (IDENTIFIER), and to acquire Location from some tokens.
570         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
571           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
572           codegen.cs :
573           Now MemberName holds Location. DeclSpace.ctor() receives Location
574           as a parameter. Removed extra parameters to all derived classes.
575           Replaced Location.IsNull() with instance property.
576         * assign.cs, expression.cs :
577           Added .ctor() overload that omits Location.
578         * attribute.cs :
579           Added "nameEscaped" flag that indicates the identifier was escaped
580           in the source file. This fixes bug #57047.
581
582 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
583
584         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
585         New method, looking for lo-case imported cls type.
586
587         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
588         here.
589
590         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
591
592         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
593
594         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
595         all_imported_types.
596         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
597
598         Optimized to save 3.5 MB for SWF compilation.
599
600 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
601
602         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
603         (PartialContainer.Create): Moved logic AddToContainer.
604         (PartialContainer.MarkForDuplicationCheck): Shares name.
605         
606         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
607         place.
608         
609         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
610         initialization.
611         (Namespace.GetSignatureForError): New method.
612         
613         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
614         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
615
616 2005-08-01  Raja R Harinath  <rharinath@novell.com>
617
618         Fix #75669.
619         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
620         member lookup rather than qualifier_type, since qualifier_type can
621         be null.
622
623 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
624
625         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
626         enum member.
627
628 2005-07-31  Miguel de Icaza  <miguel@novell.com>
629
630         * statement.cs: Copy the local exception into the exception
631         captured local.  Fixes 75674
632
633 2005-07-31  Raja R Harinath  <harinath@gmail.com>
634
635         Fix #75658.
636         * expression.cs (Invocation.OverloadResolve): Don't report error
637         CS1501 if error CS1502 has been reported.
638         (New.DoResolve): Delegate CS1501 reporting to
639         Invocation.OverloadResolve.
640
641         Fix #75656.
642         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
643         invariant-meaning-in-block property in an enclosing block if
644         necessary.
645
646 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
647
648         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
649         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
650         (Switch.CheckSwitch): Just save 50kb for SWF.
651
652 2005-07-27  Martin Baulig  <martin@ximian.com>
653
654         * anonymous.cs (CaptureContext.AddField): Added
655         `AnonymousContainer am' argument; compute its toplevel scope if
656         it's not already computed.  Fixes #75649.
657
658 2005-07-26  Raja R Harinath  <rharinath@novell.com>
659
660         Fix #75628.
661         * class.cs (Constructor.Emit): Reset block to null if the block
662         resolve fails.
663
664 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
665
666         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
667
668 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
669
670         * class.cs (MethodData.Define): Check whether accessor implementing
671         interface is public.
672
673         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
674
675 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
676
677         Fix #57245
678         * namespace.cs (LookupType): Moved same type check to...
679         
680         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
681         with the same name.
682
683 2005-07-21  Raja R Harinath  <rharinath@novell.com>
684
685         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
686         already found a typebuilder.
687         * class.cs (MethodCore.IsDuplicateImplementation): Compare
688         MemberNames, not strings.
689
690         * const.cs (Error_ExpressionMustBeConst): 
691         Rename from Error_EpressionMustBeConst.
692         * const.cs, class.cs, statement.cd: Update.
693
694 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
695
696         Fix #65573
697
698         * const.cs (Const.LookupConstantValue): Report missing contant expression
699         everytime.
700         (Error_EpressionMustBeConstant): Only one error method.
701
702         * class.cs, statement.c: Updated.
703
704 2005-07-20  Raja R Harinath  <rharinath@novell.com>
705
706         * statement.cs (Block.Flags): Add back HasVarargs.
707         (Block.flags): Make protected.
708         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
709
710         * typemanager.cs (types, typecontainers, user_types): Remove.
711         (UserTypes, TypeContainers): Likewise.
712         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
713         (CleanUp, Reset): Update.
714         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
715         (GetNestedType): Use Type.GetNestedType.
716         (CoreLookupType): Take two arguments, the namespace and the
717         basename of the type.  Update to use the Namespace.Lookup
718         mechanism.
719         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
720         (RealMemberLookup): Use IsNestedChildOf instead of playing with
721         string concatenation and substring matches.
722         * class.cs, enum.cs, delegate.cs: Update to changes.
723
724 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
725
726         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
727         Expression and made virtual.
728
729         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
730         (ImplicitStandardConversionExists): Fixed `byte' typo ?
731
732         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
733
734         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
735         error message.
736
737         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
738         change.
739
740 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
741
742         Fix #57707
743         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
744         AssemblyCultureAttribute is not used on executable.
745
746         * rootcontext.cs,
747         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
748
749 2005-07-16  Raja R Harinath  <rharinath@novell.com>
750
751         Fix #60638.
752         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
753         New.  Reports CS0252/CS0253.
754         Mostly taken from preliminary patch by Duncak Mak.
755         (Binary.DoResolveOperator): Store results of operator lookup.
756         Use them to detect if we need to warn about unintended reference
757         comparisons.
758
759 2005-07-15  Raja R Harinath  <rharinath@novell.com>
760
761         Fix #72969.
762         * namespace.cs (Namespace.Lookup): Add back location parameter.
763         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
764         * delegate.cs, ecore.cs, expression.cs: Update to changes.
765
766         * codegen.cs (EmitContext.DeclSpace): Make readonly.
767         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
768         (Namespace.LookupType): ... this.
769         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
770         of namespaces.
771         * typemanager.cs (LookupTypeReflection): Remove buggy code that
772         purported to handle pointers.
773         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
774         CoreLookupType.
775
776 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
777
778         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
779         type as namespace.
780
781 2005-07-15  Raja R Harinath  <rharinath@novell.com>
782
783         * namespace.cs (Namespace.Lookup): Drop location parameter.
784         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
785         (NamespaceEntry.Lookup): ... this.
786         (NamespaceEntry.Error_AmbiguousTypeReference):
787         Move here from DeclSpace.
788         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
789         names ...
790         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
791         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
792         Move to NamespaceEntry.
793         * delegate.cs, expression.cs: Update to changes.
794
795 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
796
797         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
798         CheckAttributeType and refactored.
799         (Attribute.ResolvePossibleAttributeType): Changed to reuse
800         ResolveAsTypeTerminal error handling.
801         (ResolveAsTypeTerminal): Introduced because of global attributes extra
802         handling.
803         (GetSignatureForError): Print errors in same way.
804
805         * class.cs,
806         * codegen.cs: Reflect attribute GetSignatureForError change.
807
808         * ecore.cs,
809         * expression.cs: Add silent parameter to ResolveAsTypeStep.
810
811         * namespace.cs (UsingEntry): Refactored to make fields private.
812
813         * assign.cs,
814         statement.cs: Error_UnexpectedKind has extra parameter.
815
816 2005-07-14  Raja R Harinath  <rharinath@novell.com>
817
818         * ecore.cs (IAlias): Remove.
819         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
820         that implement the interface.
821         * namespace.cs (Namespace): Likewise.
822         (Namespace.declspaces): Renamed from 'defined_names'.
823         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
824         DeclSpace instead of an IAlias.
825         * tree.cs (Tree.AddDecl): Update.
826
827 2005-07-12  Raja R Harinath  <rharinath@novell.com>
828
829         * statement.cs (Block.Flags); Remove HasVarargs.
830         (Block.HasVarargs): Move to ToplevelBlock.
831         (Block.ThisVariable, Block.AddThisVariable): Likewise.
832         (Block.Variables): Make protected.  Initialize variable hashtable
833         if necessary.
834         (Block.AddVariable): Update.
835         (Block.Resolve): Update to changes.
836         (ToplevelBlock.HasVarargs): New boolean.
837         (ToplevelBlock.ThisVariable): Move here from Block.
838         (ToplevelBlock.AddThisVariable): Likewise.
839         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
840         * expression.cs (This.ResolveBase): Update to changes.
841         (ArglistAccess.DoResolve): Likewise.
842
843 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
844
845         Fix #75321
846         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
847
848         * class.cs (TypeContainer.VerifyMembers): Distinguish between
849         not used and not used & assigned.
850         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
851
852 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
853
854         Fix #75053
855         * expression.cs (Is.DoResolve): null is never provided type.
856
857 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
858
859         Fix #52496
860         * cs-parser.jay: Less strict event error rule to catch more errors.
861
862 2005-07-08  Martin Baulig  <martin@ximian.com>
863
864         Fix test-iter-10.cs - distinguish whether we `yield' in a property
865         gettter (allowed) or setter (not allowed).
866
867         * class.cs (Accessor): Implement IIteratorContainer.
868         (Accessor.Yields): New public field.
869         (PropertyBase.PropertyMethod.Define): Handle iterators on a
870         per-accessor basis.
871
872         * cs-parser.jay
873         (get_accessor_declaration, set_accessor_declaration): Set the
874         `yields' flag on the accessor, not the property.
875         (property_declaration): Do the iterators check on a per-accessor
876         basis and not for the whole property.
877
878 2005-07-08  Martin Baulig  <martin@ximian.com>
879
880         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
881         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
882
883 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
884
885         Fix #74975
886         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
887         (ExtractSecurityPermissionSet): Cope with self referencing security
888         attributes properly.
889
890         * driver.cs (SetOutputFile): Made public property OutputFile.
891
892 2005-07-07  Raja R Harinath  <rharinath@novell.com>
893
894         Fix #75486.
895         * class.cs (TypeContainer.first_nonstatic_field): Rename from
896         has_nonstatic_fields.  Make into a FieldBase pointer.
897         (TypeContainer.AddField): Add CS0282 check.
898         (TypeContainer.EmitType): Update.
899
900 2005-07-06  Miguel de Icaza  <miguel@novell.com>
901
902         * cs-tokenizer.cs (consume_identifier): Do not create strings to
903         compare if they start with __.
904
905 2005-07-06  Raja R Harinath  <rharinath@novell.com>
906
907         * statement.cs (Switch.SwitchGoverningType): Only look at
908         UserCasts that don't need implicit standard conversions to one of
909         the allowed switch types (Fixes test-322.cs).
910         (LocalInfo.Resolve): Re-enable sanity-test.
911
912 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
913
914         * cs-tokenizer.cs (consume_identifier): Detect double undescores
915         
916         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
917         
918         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
919
920 2005-07-06  Raja R Harinath  <rharinath@novell.com>
921
922         Fix #75472.
923         * ecore.cs (SimpleName.GetSignatureForError): Add.
924         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
925         (MemberAccess.GetSignatureForError): Add.
926
927 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
928  
929         The big error and warning messages review.
930         
931         * anonymous.cs,
932         * assign.cs,
933         * attribute.cs,
934         * class.cs,
935         * codegen.cs,
936         * convert.cs,
937         * cs-parser.jay,
938         * cs-tokenizer.cs,
939         * decl.cs,
940         * delegate.cs,
941         * doc.cs,
942         * driver.cs,
943         * ecore.cs,
944         * enum.cs,
945         * expression.cs,
946         * flowanalysis.cs,
947         * iterators.cs,
948         * literal.cs,
949         * location.cs,
950         * modifiers.cs,
951         * namespace.cs,
952         * parameter.cs,
953         * pending.cs,
954         * report.cs,
955         * rootcontext.cs,
956         * statement.cs,
957         * support.cs,
958         * tree.cs,
959         * typemanager.cs: Updated.
960         
961         * class.cs: (MethodCore.SetYields): Moved here to share.
962         (PropertyMethod.Define): Moved iterator setup here.
963         
964         * iterators.cs: Add orig_method to have full access to parent
965         container.
966
967 2005-07-05  Raja R Harinath  <rharinath@novell.com>
968
969         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
970         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
971         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
972         variable of struct type.
973         * expression.cs (Unary.ResolveOperator): Update to change.
974         (Indirection.VerifyFixed): Likewise.
975         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
976         (ParameterReference.VerifyFixed): Value parameters are fixed.
977         (This.VerifyFixed): Treat 'this' as a value parameter.
978         * statement.cs (LocalInfo.IsFixed): Remove.
979
980 2005-07-01  Martin Baulig  <martin@ximian.com>
981
982         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
983         `ec.EmitThis ()' to get the correct scope.
984
985 2005-07-01  Martin Baulig  <martin@ximian.com>
986
987         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
988         instance is a ParameterReference; fixes #75299.
989
990 2005-07-01  Martin Baulig  <martin@ximian.com>
991
992         Reverted Marek's latest patch (r46725):
993         - it contains structural changes which are neither mentioned in
994           the ChangeLog nor explained anywhere; for example the additional
995           argument of EmitContext's and Iterator's .ctor's and the
996           TypeContainer.DefineMembers() change.
997         - structural changes like this should go in in seperate patches
998           and not be hidden in a huge patch which just seems to affect
999           warnings and errors.
1000           a big and hard to understand patch.
1001         - it breaks iterators and causes regressions, for instance in
1002           test-iter-03.cs.      
1003
1004 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1005
1006         Fix #75412.
1007         * expression.cs (Indexers.map): Remove.
1008         (Indexers.Append): Filter out inaccessible setters and getters.
1009         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1010
1011         Fix #75283.
1012         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1013         Refactored from ...
1014         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1015         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1016         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1017         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1018
1019 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1020
1021         Fix #75322
1022         * class.cs (FieldBase.GetInitializerExpression): One more field
1023         for backup.
1024
1025 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1026
1027         * pending.cs: Do not define a proxy if the base method is virtual,
1028         it will be picked up by the runtime (bug 75270).
1029
1030 2005-06-08  Martin Baulig  <martin@ximian.com>
1031
1032         The big Iterators rewrite :-)
1033
1034         * iterators.cs: Rewrite this to use the anonymous methods framework.
1035
1036         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1037         before the TypeContainers; see 2test-21.cs.
1038
1039         * class.cs
1040         (TypeContainer.DefineType): Don't create a new EmitContext if we
1041         already have one (this only happens if we're an Iterator).
1042         (TypeContainer.Define): Also call Define() on all our iterators.
1043         (Method.CreateEmitContext): Added support for iterators.
1044
1045         * anonymous.cs
1046         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1047         (AnonymousContainer.CreateMethodHost): Moved here from
1048         AnonymousMethod and made abstract.
1049         (AnonymousContainer.CreateScopeType): New abstract method.
1050         (AnonymousContainer.IsIterator): New public property.
1051         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1052         get the ScopeTypeBuilder rather than manually defining it here. 
1053         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1054         iterators here.
1055
1056         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1057         before RootContext.DefineTypes().
1058
1059         * codegen.cs (EmitContext.RemapToProxy): Removed.
1060         (EmitContext.CurrentAnonymousMethod): Changed type from
1061         AnonymousMethod -> AnonymousContainer.
1062         (EmitContext.ResolveTopBlock): Protect from being called twice.
1063         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1064         (EmitContext.EmitThis): Removed the iterators hacks; use the
1065         anonymous methods framework for that.
1066
1067         * statement.cs
1068         (ToplevelBlock.Container): Make this a property, not a field.
1069         (ToplevelBlock.ReParent): New public method; move the
1070         ToplevelBlock into a new container.
1071         (Foreach.TemporaryVariable): Simplify.
1072
1073 2005-06-05  Martin Baulig  <martin@ximian.com>
1074
1075         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1076         (Block.AddTemporaryVariable): New public method; creates a new
1077         `LocalInfo' for a temporary variable.
1078         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1079         variables here.
1080         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1081         non-iterator variables.
1082
1083 2005-06-05  Martin Baulig  <martin@ximian.com>
1084
1085         * statement.cs (Foreach.TemporaryVariable): Create the
1086         LocalBuilder in the Emit phase and not in Resolve since in some
1087         situations, we don't have an ILGenerator during Resolve; see
1088         2test-19.cs for an example.
1089
1090 2005-06-04  Martin Baulig  <martin@ximian.com>
1091
1092         **** Merged r45395 from GCS ****
1093
1094         The big Foreach rewrite - Part II.
1095
1096         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1097         with `PropertyInfo ienumerator_getcurrent'.
1098
1099         * codegen.cs (VariableStorage): Removed.
1100
1101         * statement.cs
1102         (Foreach): Derive from Statement, not ExceptionStatement.
1103         (Foreach.CollectionForeach): New nested class.  Moved all the code
1104         dealing with collection foreach here.
1105         (Foreach.ForeachHelperMethods): Removed.
1106         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1107
1108 2005-05-23  Martin Baulig  <martin@ximian.com>
1109
1110         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1111         don't need to.  Fix #75014.
1112
1113 2005-05-20  Martin Baulig  <martin@ximian.com>
1114
1115         Merged r44808 from GMCS.
1116
1117         * class.cs (TypeContainer.CircularDepException): Removed.
1118         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1119         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1120         (CS0146) and interface (CS0529) dependencies here.
1121
1122 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1123
1124         * expression.cs (Invocation.EmitCall): Fix initialization
1125         'this_call' to reflect current behaviour.  Fix indentation.
1126
1127         * convert.cs (FindMostEncompassedType): Add two trivial special
1128         cases (number_of_types == 0 || number_of_types == 1).
1129         (FindMostEncompasingType): Likewise.
1130
1131 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1132
1133         Some cleanups preparing for the fix of #75283.
1134         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1135         error testing.
1136         (EventExpr.InstanceResolve): Likewise.
1137         (EventExpr.DoResolve): Remove redundant checks.
1138
1139 2005-06-10  Duncan Mak  <duncan@novell.com>
1140
1141         * cs-tokenizer.cs (process_directives): New flag for controlling
1142         the processing of preprocessor directives.
1143         (x_token): After seeing a '#', return Token.NONE instead of going
1144         to handle_preprocessing_directive() when not processing
1145         directives. This avoids unnecessary processing during the token peek in
1146         is_punct().
1147
1148         This fixes #74939.
1149
1150         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1151         the existing error reporting methods instead of Report.Error.
1152
1153         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1154         after Raja's rewrite.
1155
1156 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1157
1158         * class.cs: Small fix.
1159
1160 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1161
1162         Fix #75160.
1163         * class.cs (GetPartialBases): Fix return value check of
1164         part.GetClassBases.
1165
1166 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1167
1168         Ensure that partial classes are registered in their enclosing
1169         namespace.  Initial part of fix of #75160.
1170         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1171         Register declspace with namespace here, not in
1172         DeclSpace.RecordDecl.
1173         * cs-parser.jay: Pass namespace to RecordDecl.
1174         * class.cs (PartialContainer.Create): Likewise.
1175         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1176         called.
1177         * decl.cs (Declspace.RecordDecl): Remove.
1178         * namespace.cs (NamespaceEntry.DefineName): Remove.
1179
1180 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1181
1182         * rootcontext.cs: Reset TargetExt as well.
1183
1184 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1185
1186         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1187         -langversion:ISO-1.
1188
1189 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1190
1191         Fix #75080, cs0119.cs.
1192         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1193         of ...
1194         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1195         allowing ExprClass.Type and ExprClass.Namespace for
1196         ResolveFlags.VariableOrValue.
1197         (Expression.Resolve) [1-argument variant]: Change default resolve
1198         flags based on language version.
1199         (Expression.Error_UnexpectedKind): Use a simple string array
1200         rather than an ArrayList.
1201         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1202         not ExprClass.Type.
1203         (TypeOfVoid.DoResolve): Likewise.
1204         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1205         flags argument -- it always has the same value.
1206
1207 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1208
1209         Fix #75081.
1210         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1211         Use it in the error message.
1212         * assign.cs, expression.cs, statement.cs: Update.
1213
1214 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1215
1216         Fix #75088.
1217         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1218         the "almostMatchedMember" case too.
1219         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1220         that failed the accessibility checks to 'almost_match'.
1221
1222 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1223
1224         * attribute.cs: Use internal MethodBuilder methods to set
1225         ExactSpelling and SetLastError on PInvoke methods, instead
1226         of passing them via charset.  Fixes #75060.
1227
1228 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1229
1230         * parameter.cs (Parameter): Remove TODO comment.
1231         (Parameter.DefineParameter): Remove Location parameter.
1232         (Parameters.LabelParameters): Likewise.
1233         * class.cs (Constructor.Emit): Update to change.
1234         (MethodData.Emit): Likewise.
1235         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1236         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1237
1238 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1239
1240         * parameter.cs,
1241           Removed Parameters.Location and added Parameter.Location instead.
1242           Removed Location parameter from Emit() and GetSignature().
1243         * anonymous.cs,
1244           class.cs,
1245           cs-parser.jay,
1246           delegate.cs,
1247           iterators.cs,
1248           statement.cs :
1249           Modified all related calls.
1250
1251 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1252
1253         Improve user-defined conversion handling.
1254         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1255         applicable operators.
1256         (AddConversionOperators): New.  Helper for GetConversionOperators.
1257         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1258         there is only one most encompassed/encompassing type.
1259         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1260         "applicable operator" handling.
1261         (UserConversion): Move cache here from GetConversionOperators.
1262         Directly cache the chosen operator, rather than the whole
1263         MethodGroup.
1264         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1265         case.  Allow conversion of decimal to sbyte and byte too.
1266         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1267         New static methods.  Used to avoid allocating EmptyExpressions in
1268         convert.cs.
1269
1270 2005-05-24  Duncan Mak  <duncan@novell.com>
1271
1272         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1273         another class, used in Convert.ExplicitNumericConversion.
1274         (CastToDecimal): New class, similar to above, but casts to
1275         System.Decimal, used in Convert.ImplicitNumericConversion and also
1276         in explicit convesion from double/float to decimal.
1277
1278         * convert.cs (ImplicitNumericConversion): Handle implicit
1279         conversions to System.Decimal.
1280         (ExplicitNumericConversion): handle explicit conversions to
1281         System.Decimal.
1282
1283         This fixes #68711.
1284         
1285 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1286
1287         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1288         know the type at this stage, just break through.   Fixes #75008 
1289
1290 2005-05-19  Martin Baulig  <martin@ximian.com>
1291
1292         * delegate.cs
1293         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1294         to disable error reporting.
1295
1296         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1297         here since we don't want to report an error; see the new test-336.cs.
1298
1299 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1300
1301         * statement.cs (ToplevelBlock.GetParameterReference)
1302         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1303         Move here from class Block.
1304         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1305         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1306
1307 2005-05-18  Martin Baulig  <martin@ximian.com>
1308
1309         Fix #74978.
1310
1311         * flowanalysis.cs
1312         (FlowBranching.Reachability): Add non-static public And() and Or()
1313         methods.
1314         (FlowBranchingSwitch): New class; do the `break_origins' thing
1315         like in FlowBranchingLoop.
1316         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1317         reachability, not just locals and parameters.
1318         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1319         switch; MergeBreakOrigins() now takes care of that.
1320
1321 2005-05-18  Martin Baulig  <martin@ximian.com>
1322
1323         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1324         a loop and may leave it, reset the barrier; fixes #74974.
1325
1326 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1327         
1328         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1329         is back.
1330         
1331         * cs-parser.jay: Catch more lexical errors.
1332         
1333         * report.cs: Add one more Error method.
1334         
1335         * rootcontext.cs,
1336         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1337
1338 2005-05-17  Martin Baulig  <martin@ximian.com>
1339
1340         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1341         #70970. 
1342
1343 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1344
1345         Fix test-382.cs.  Emit values of decimal constants.
1346         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1347         Carved out of ...
1348         (TypeContainer.AddField): ... this.
1349         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1350         with initializers to include 'Const's.
1351         (ClassPart.RegisterFieldForInitialization): Forward to
1352         PartialContainer.
1353         * const.cs (Const.Const): Pass initializer to base class.
1354         (Const.Define): In case of decimal constants, register them for
1355         initialization in a static constructor.
1356
1357 2005-05-14  Martin Baulig  <martin@ximian.com>
1358
1359         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1360         do not call ResolveUnreachable() on unreachable statements in
1361         here, see the comment in the source code.
1362
1363 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1364
1365         Fix #74934.
1366         * expression.cs (BinaryResolveOperator): If one of the operands of
1367         an equality comparison is 'null' and the other is a pointer type,
1368         convert the null to a NullPointer.
1369         * convert.cs (ImplicitReferenceConversion): If the expression is a
1370         NullLiteral and the target type is a pointer type, return a
1371         NullPointer instead.
1372         (ImplicitConversionStandard): Likewise.
1373
1374 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1375         
1376         * cs-parser.jay: Set readonly context based on special constructs.
1377         
1378         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1379         readonly variable error handling.
1380         
1381         * rootcontext.cs (EmitCode): Don't verify members when error
1382         occurred.
1383         
1384         * statement.cs (LocalInfo): Add reaodnly context information.
1385         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1386
1387 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1388
1389         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1390         for #74041 to initialize 'resolved' to false only for explicit
1391         blocks.  Fixes #74873.
1392
1393 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1394
1395         Fix #74920.
1396         * typemanager.cs (unmanaged_enclosing_types): New.
1397         (IsUnmanagedType): Avoid infloops by using
1398         'unmanaged_enclosing_types' to talk with recursive invocations.
1399
1400 2005-05-13  Martin Baulig  <martin@ximian.com>
1401
1402         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1403         instance variable, not a local.  Fix #74873.
1404         (Block.ResolveUnreachable): Set it to true here.
1405
1406 2005-05-11  Duncan Mak  <duncan@novell.com>
1407
1408         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1409         continuing to process for 'arg'.
1410         (handle_preprocessing_directive): Check the argument of the #endif
1411         directive and report error CS1025 if there are any trailing
1412         characters.
1413
1414         According to the C# spec, having even whitespace after the #endif
1415         directive is illegal; however, because we call arg.TrimEnd ()
1416         beforehand, we have the same behavior as csc, allowing whitespace
1417         after the directive.
1418
1419         Fixes #74892.
1420
1421 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1422
1423         Fix #74863.
1424         
1425         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1426         (Constructor.GetObsoleteAttribute): Implemented correctly.
1427
1428 2005-05-10  Martin Baulig  <martin@ximian.com>
1429
1430         * support.cs (ReflectionParameters.ParameterModifier): Use
1431         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1432         and `ParameterAttributes.In'.  Fixes #74884.
1433
1434 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1435
1436         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1437         
1438         * expression.cs (Argument.GetParameterModifier): Turned to property.
1439         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1440         
1441         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1442         its C# equivalent.
1443         
1444 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1445
1446         Fix #74852.
1447         * decl.cs (MemberCache.AddMethods): Register override methods,
1448         rather than non-override methods.
1449         * typemanager.cs (RegisterOverride): New.
1450         (IsOverride): Update.
1451
1452 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1453
1454         Fix #73105.
1455         
1456         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1457         recursive declaration.
1458         
1459         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1460         
1461 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1462
1463         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1464         
1465         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1466
1467 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1468
1469         Fix #74797.
1470         * decl.cs (DeclSpace.FamilyAccessible): 
1471         Use TypeManager.IsNestedFamilyAccessible.
1472
1473         Fix reopened #64812.
1474         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1475         internal'.
1476
1477 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1478             Abin Thomas  <projectmonokochi@rediffmail.com>
1479             Anoob V E  <projectmonokochi@rediffmail.com>
1480             Harilal P R  <projectmonokochi@rediffmail.com>
1481
1482         Fix #64812.
1483         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1484         allow access to all static members.
1485
1486 2005-05-04  Martin Baulig  <martin@ximian.com>
1487
1488         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1489
1490 2005-05-04  Martin Baulig  <martin@ximian.com>
1491
1492         Fix #74655.
1493
1494         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1495         section at the end; make things work if `default' is not the last
1496         section.        
1497
1498 2005-05-04  Martin Baulig  <martin@ximian.com>
1499
1500         Fix #70400.
1501
1502         * statement.cs (Switch): Replaced the `got_default' field with a
1503         `default_section' one.
1504         (Switch.CheckSwitch): Set `default_section' here.
1505         (Switch.Resolve): If we're a constant switch and the constant is
1506         not found, use the default section.
1507
1508 2005-05-03  Martin Baulig  <martin@ximian.com>
1509
1510         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1511
1512         * statement.cs (Foreach.ArrayForeach): New nested class.
1513         (Foreach.TemporaryVariable): New nested class.
1514         (Foreach.EmitArrayForeach): Removed; this is now in the new
1515         ArrayForeach class.
1516
1517 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1518
1519         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1520         more conservative.
1521         (VerifyPendingMethods): Revert change below.
1522
1523         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1524         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1525         that used to trigger warning -28.  Remove warning -28.
1526         * expression.cs (Invocation.OverloadResolve): Use
1527         TypeManager.IsOverride to distinguish override methods.
1528
1529         Fix #74773.
1530         * pending.cs (VerifyPendingMethods): If a base type implements the
1531         requested interface, don't bother checking individual methods of
1532         the base type.  As a side-effect, this prevents the creation of
1533         unnecessary proxies.
1534
1535 2005-05-02  Martin Baulig  <martin@ximian.com>
1536
1537         Fix #70182.
1538
1539         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1540         Also `And' the locals if the old vector is null.
1541         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1542         null; in this case we basically reset all the variables.        
1543
1544 2005-05-02  Martin Baulig  <martin@ximian.com>
1545
1546         Fix #74529.
1547
1548         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1549         Added `FlowBranching branching' argument; always `and' the
1550         variables instead of `or'ing them unless we're an infinite loop.
1551
1552         * statement.cs (While.Resolve): Create a new sibling unless we're
1553         infinite.       
1554
1555 2005-05-02  Martin Baulig  <martin@ximian.com>
1556
1557         Fix #70140.
1558
1559         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1560         arguments; use it instead of creating a new TopLevelBlock.
1561         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1562         our ConstructorInitializer.
1563
1564         * statement.cs
1565         (TopLevelBlock.TopLevelBranching): New public property.
1566         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1567         and create our `TopLevelBranching'.
1568
1569         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1570         anonymous method host, use `block.TopLevelBranching' rather than
1571         creating a new branching.
1572
1573 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1574
1575         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1576         a ScopeInfo, if any of the current children is a child of the new
1577         entry, move those children there.
1578
1579 2005-04-30  Martin Baulig  <martin@ximian.com>
1580
1581         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1582         at the beginning of a SwitchSection.  Fix #73335.
1583
1584 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1585
1586         Fix #74378
1587         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1588         
1589         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1590         (FieldExpr.DoResolve): Obsolete members are ignored for field
1591         initializers.
1592         
1593 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1594
1595         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1596         of arrays detection.
1597
1598         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1599         verification.
1600         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1601
1602         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1603         arrays report.
1604
1605 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1606
1607         * cs-parser.jay: Use the prefered version of -unsafe in error
1608         message.
1609
1610 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1611
1612         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1613         circumstances.
1614
1615 2005-04-20  John Luke  <john.luke@gmail.com>
1616
1617         * driver.cs: fix typo in error message, --outout to --output
1618
1619 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1620
1621         * codegen.cs (InRefOutArgumentResolving): New field.
1622         
1623         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1624         fields outside contructor.
1625         
1626         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1627         
1628 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1629
1630         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1631         parameter code was not completed ever, so it was not as up-to-date
1632         as local variables.  Must finish it.
1633
1634         The bug fix was to compare the Toplevel of the block, not the
1635         current block.  Thanks for Ben for pointing this out. 
1636
1637 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1638
1639         * decl.cs (AddMethods): Use the declaring type of the problem
1640         method to determine if we want to squash a warning.
1641
1642 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1643
1644         * attribute.cs: Removed debug output.
1645
1646         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1647         
1648         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1649         Report.Stderr.
1650         
1651 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1652
1653         Fix #74481.
1654         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1655         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1656         all null comparisons against reference types.
1657
1658 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1659
1660         Fix# 74565
1661         * class.cs (TypeContainer.CircularDepException) New nested
1662         exception class.
1663         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1664         (TypeContainer.DefineType): Removed error, reset InTransit before
1665         exit.
1666         (Class.DefineType): Throw exception when is in Transit.
1667         Catch exception and report error.
1668         (Struct.DefineType): Throw exception when is in Transit.
1669         Catch exception and report error.
1670         (Interface.DefineType): Throw exception when is in Transit.
1671         Catch exception and report error.
1672
1673         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1674         handle nested exception handlers.
1675
1676         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1677         a catch.
1678
1679         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1680         InFinally and InCatch storage.
1681
1682         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1683         (Catch.Resolve): Set and Restore ec.InCatch.
1684         (Try.Resolve): Set and Restore ec.InFinally.
1685         (Try.HasCatch): True when try has catch.
1686
1687 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1688
1689         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1690           for the same event member, so exclude such cases from warning 419.
1691           Fixed bug #74633.
1692
1693 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1694
1695         * expression.cs (Binary.ResolveOperator): Apply patch from John
1696         Luke to fix bug 59864: operators &, | and ^ on enumerations
1697         require that the same enum type on both sides.
1698
1699         * driver.cs: Add warnings to old flag usage, this is to assist
1700         people who produce Makefiles and hope that the Makefiles will be
1701         used on Windows.
1702
1703         * class.cs (TypeContainer.EmitType): Moved the definition of the
1704         special $PRIVATE$ field from the resolve phase to the Emit phase.
1705         During resolve we do not know if we are a struct with
1706         HasExplicitLayout, we know this only after the attributes for the
1707         type are emitted.
1708
1709         Set the FieldOffset to zero on the dummy field that we create for
1710         the class.   Fixes 74590.
1711
1712 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1713
1714         Fix #73834.
1715         * ecore.cs (PropertyExpr.resolved): New.
1716         (DoResolve): Use it to handle a case of double resolution here.
1717         Handle a case of identical-name-and-type-name.
1718         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1719         resolution by storing the results of expression resolution back
1720         into the "probes" array.
1721
1722 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1723
1724         Fix cs0208-7.cs and cs0208-8.cs.
1725         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1726         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1727         error reporting to point out the reason a struct is not unmanaged.
1728
1729 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1730
1731         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1732           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1733
1734 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1735
1736         Fix #74528.
1737         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1738         IdenticalNameAndTypeName here.
1739         (EventExpr.InstanceResolve): Likewise.
1740
1741 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1742
1743         C# 2.0 DefaultCharSetAttribute implementation
1744         
1745         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1746         which allows us to set GlobalNamespace for every resolve.
1747         (Attribute.ResolveArguments): Cut from Resolve.
1748         (Attribute.GetCharSetValue): Returns CharSet named argument.
1749         (Attribute.DefinePInvokeMethod): Gets default charset from
1750         module settings.
1751         (GlobalAttribute.ResolveAsTypeStep): Override.
1752         (GlobalAttribute.ResolveArguments): Override.
1753         
1754         * class.cs (TypeAttr): Is protected.
1755         
1756         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1757         (ModuleClass.DefaultCharSetType): New memeber.
1758         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1759         
1760         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1761         charset from module.
1762         
1763         * delegate.cs (TypeAttr): Override.
1764         (Delegate.DefineType): Use this TypeAttr.
1765         
1766         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1767         at very early stage (before types are defined) to resolve model
1768         module attributes. It will probably not work with corlib but it
1769         should be ok.
1770         
1771         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1772         charset from module.
1773         
1774         * typemanager.cs (default_charset_type): New type.
1775
1776 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1777
1778         * decl.cs (MemberCache.AddMethods): Don't warn if
1779         System.Object.Finalize has buggy MethodAttributes.
1780
1781         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1782         removed below.
1783
1784 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1785
1786         * doc.cs : detect ambiguous reference to overloaded members.
1787           Fixed bug #71603. MS 1.1 csc does not detect it.
1788
1789 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1790
1791         * doc.cs : delegates must not be referenced with parameters.
1792           Fixed bug #71605.
1793
1794 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1795
1796         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1797
1798 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1799
1800         * driver.cs (MainDriver): Stop processing if the CLS stage found
1801         errors. 
1802
1803         (CompilerCallableEntryPoint.InvokeCompiler): Always
1804         reset after execution;   Take a TextWriter argument for the
1805         output.
1806
1807         * report.cs: Use the error stream instead of hardcoding stderr. 
1808
1809 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1810
1811         * class.cs: Reduce code paths to test, too small of an
1812         optimization to make it worth the extra testing.  Always perform
1813         it. 
1814
1815 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1816
1817         Fix #74510.
1818         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1819         operators that had errors reported on them.
1820
1821 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1824         argument types.
1825         (Attribute.Resolve): Add named argument type checking.
1826         
1827         * class.cs (FixedField.Define): Use IsPrimitiveType
1828         
1829         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1830         
1831         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1832         unsafe parameter types.
1833         
1834         * statement.cs (Using.ResolveExpression): Add better error description.
1835         
1836         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1837         
1838 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1839
1840         Fix #74484.
1841         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1842         AttributeUsageAttribute in the emitcontext of the attribute class,
1843         not in the emitcontext of the attributable entity it was attached to.
1844         * cs-parser.jay: Use 'current_class', not 'current_container',
1845         when creating a GlobalAttribute.
1846
1847 2005-04-08  Alp Toker  <alp@atoker.com>
1848
1849         * pending.cs: The fix to #58413 failed to compile methods implementing
1850         interfaces with/without params modifiers and vice versa, even though
1851         params modifiers aren't part of the signature. Make the modifier check
1852         less strict as in csc.
1853
1854 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1855             Anoob V E  <projectmonokochi@rediffmail.com>
1856             Harilal P R  <projectmonokochi@rediffmail.com>
1857
1858         Fix #58413.
1859         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1860         modifiers of pending methods.
1861         (PendingImplementation.PendingImplementation): Initialize it.
1862         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1863         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1864         with ParameterData.  Add check for modifiers.
1865         * class.cs (MethodData.Define): Update to changes.
1866
1867 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1868
1869         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1870
1871 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1872
1873         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1874         property.
1875         
1876         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1877         
1878         * rootcontext.cs,
1879         * typemanager.cs: Registered RequiredAttributeAttribute.
1880         
1881 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1882
1883         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1884         Warning CS0169 is back at level 3.
1885         (IMethodData.SetMemberIsUsed): New method.
1886         
1887         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1888         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1889         
1890         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1891
1892         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1893         contants.
1894         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1895         is used.
1896         
1897         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1898         is used.
1899         
1900         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1901         to avoid the problems with nested types.
1902
1903 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1904             Anoob V.E  <projectmonokochi@rediffmail.com>
1905             Harilal P.R  <projectmonokochi@rediffmail.com>
1906             Raja R Harinath  <rharinath@novell.com>
1907
1908         Fix #73820.
1909         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1910         attribute.
1911         * typemanager (GetConstructor): Make public.
1912
1913 2005-04-05  John Luke  <john.luke@gmail.com>
1914             Raja R Harinath  <rharinath@novell.com>
1915
1916         Fix #62232.
1917         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1918         struct too.  Return false quicker in a few cases.
1919         (VerifyUnManaged): Use it.
1920
1921 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1922
1923         Fix #74041.
1924         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1925         not 'unreachable_seen'.
1926
1927 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1928
1929         * attribute.cs (Attribute.GetValue): Removed unused.
1930         
1931         * codegen.cs (CodeGen.TrimExt): Removed unused.
1932         
1933         * cs-parser.jay (output): Removed unused.
1934         
1935         * cs-tokenizer.cs (hex_digits): Removed unused.
1936         
1937         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1938         
1939         * expression.cs (Indirection.LoadExprValue): Removed unused.
1940         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1941         
1942         * iterators.cs (Iterator.param_types): Removed unused.
1943         
1944         * statement.cs (Goto.block): Removed unused.
1945         (ToplevelBlock.did): Removed unused.
1946         (Switch.ResolveConstantSwitch): Removed unused.
1947
1948 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1949
1950         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1951         resetting thingy.
1952
1953 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1954
1955         Fix #74232 and cs0208-3.cs.
1956         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1957         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1958         unmanaged type.  Don't use FieldBuilders when 't' is a
1959         TypeBuilder.  Use ModFlags and MemberType fields.
1960         * class.cs (MemberBase.member_type): Rename from MemberType.
1961         (MemberBase.MemberType): New property.  Determines member_type on
1962         demand.
1963         (MemberBase.DoDefine): Don't initialize MemberType here.
1964         (FieldMember.Define): Likewise.
1965
1966 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1967
1968         Fix #74241
1969         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1970         Attributes are emitted there.
1971         
1972 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1973
1974         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1975         keyword in 'partial enum' too.
1976         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1977         is not allowed).
1978         Report from Kamil Skalski <nazgul@omega.pl>.
1979
1980         Fix #74309.
1981         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1982         have partial containers too.
1983
1984         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1985         in block' checks to Block.CheckInvariantMeaningInBlock.
1986         * statement.cs (Block.GetKnownVariableInfo): Make private.
1987         (Block.IsVariableUsedInChildBlock): Remove.
1988         (Block.IsVariableUsedInBlock): Likewise.
1989         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1990         conflicting declaration.
1991         (Block.AddVariable): Make error messages less long-winded and more
1992         specific.  Show location of conflicting declaration.
1993         * parameter.cs (Parameters.Location): New readonly property.
1994
1995 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1996
1997         Clean up semantics of invoking ResolveMemberAccess.
1998         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1999         can have an instance, ensure that we pass in a non-TypeExpression
2000         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2001         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2002         argument.  Update to changes and simplify.
2003         (FieldExpr.Emitinstance): Remove CS0120 check.
2004         (PropertyExpr.EmitInstance): Likewise.
2005         * expression.cs (Argument.Resolve): Likewise.
2006         (Invocation.DoResolve): Update to changes in semantics of
2007         InstanceExpression.
2008
2009 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2010
2011         Fix #74241
2012         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2013         customization.
2014         
2015         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2016
2017 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2018
2019         Fix difference in behaviour with commandline invocation.
2020         * driver.cs (Driver.Reset): New.
2021         (CompilerCallableEntryPoint): Call it.
2022
2023         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2024         variable" warnings if the boolean expression failed to resolve.
2025
2026 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2027
2028         * attribute.cs: Fix the union of several permissions when some of them
2029         are unrestricted (so the result isn't an unrestricted permission set).
2030         Fix #74036.
2031
2032 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2033
2034         * ecore.cs (MemberExpr): New class.  Convert from interface
2035         IMemberExpr.
2036         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2037         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2038         error checks.
2039         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2040         (MethodGroupExpr.IsExplicitImpl): Remove.
2041         (Expression.GetFieldFromEvent): Remove.
2042         (SimpleName.MemberStaticCheck): Remove.
2043         (SimpleName.DoSimpleNameResolve): Update to changes.
2044         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2045         (MemberAccess.IdenticalNameAndTypeName): Remove.
2046         (MemberAccess.error176): Move to MemberExpr.
2047         (MemberAccess.DoResolve): Update to changes.
2048         (BaseAccess.DoResolve): Likewise.
2049
2050 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2051
2052         C# 2.0 Conditional attribute class implementation
2053         
2054         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2055         Analyzes class whether it has attribute which has ConditionalAttribute
2056         and its condition is not defined.
2057         
2058         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2059         (Class.IsExcluded): New method. Search for at least one defined
2060         condition in ConditionalAttribute of attribute class.
2061
2062 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2063
2064         * ecore.cs (PropertyExpr): Derive from Expression, not
2065         ExpressionStatement.
2066         (PropertyExpr.EmitStatement): Remove.
2067
2068 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2069
2070         Fix #74060.
2071         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2072         internal field "value__" of an enum be private.  The examples for
2073         "value__" that I found on MSDN all used FieldAttributes.Private.
2074
2075         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2076         Don't mention IL method attribute names.
2077
2078         Fix #47991.  Remove a TODO.
2079         * statement.cs (Block.Toplevel): Make into a field.
2080         (Block.Parameters): Move into ToplevelBlock.
2081         (Block.known_variables): Rename from child_variable_names.
2082         (Block.Block): Remove variants that take Parameters.  Initialize
2083         'Toplevel' with the immediately surrounding toplevel block.
2084         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2085         LocalInfo parameter.
2086         (Block.GetKnownVariableInfo): New.
2087         (Block.IsVariableNameUsedInChildBlock): Update.
2088         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2089         the block, even though it may not be in scope.
2090         (Block.AddVariable): Remove Parameters parameter.  Use
2091         Toplevel.Parameters instead.
2092         (Block.AddConstant): Remove Parameters parameter.
2093         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2094         (Block.IsParamaterReference): Likewise.
2095         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2096         (ToplevelBlock.Parameters): New.  Moved from Block.
2097         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2098         initialize Parameters to a non-null value.
2099         * cs-parser.jay: Update to changes.
2100         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2101         simple names that mean different things in the same block.  Use
2102         Block.IsVariableNameUsedInBlock.
2103
2104 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2105
2106         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2107         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2108         GetTypeHandle.  It is possible for a reflected type to derive from
2109         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2110         System.Array during mscorlib compilation).
2111         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2112         contain a method_hash, don't create one either.  Don't create a
2113         deep copy of the base cache's method_hash.
2114         (MemberCache.SetupCache): Rename back from DeepCopy.
2115         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2116         already initialized.  If we see an override function, add its
2117         underlying base virtual function to the member_hash too.
2118
2119         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2120
2121 2005-03-26  Raja R Harinath  <harinath@acm.org>
2122
2123         Fix #73038.
2124         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2125         fails to resolve, ensure that the LHS is still resolved as an
2126         lvalue.
2127
2128 2005-03-25  Raja R Harinath  <harinath@acm.org>
2129
2130         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2131         ec.ContainerType.
2132         (Enum.current_ec): Remove.
2133         (Enum.LookupEnumValue): Remove EmitContext argument.
2134         Just uses the one created during DefineType.
2135         (Enum.FindMembers): Update.
2136         * expression.cs (MemberAccess.DoResolve): Update.
2137
2138 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2139
2140         * assign.cs (Assign.DoResolve): Check for CS1717 when
2141         source and target are same (uses Equals).
2142
2143         * expression.cs (LocalVariableReference, ParameterReference,
2144         This): Implemented Equals, GetHashCode.
2145
2146         * statement.cs (Block.GetParameterReference): Removed useless
2147         local variable.
2148
2149 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2150
2151         Fix cs0128.cs
2152         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2153         blocks before deciding whether the error is cs0136 or cs0128.
2154
2155         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2156         (using_alias_directive, using_namespace_directive): Pass
2157         MemberName, not an expression to Namespace.UsingAlias and
2158         Namespace.Using.
2159         (MakeName): Use the MemberName of the namespace.
2160         * namespace.cs (Namespace.MemberName): New.
2161         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2162         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2163         Likewise.
2164         * decl.cs (MemberName.Name): Make readonly.
2165         (MemberName.FromDotted): New "constructor".
2166         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2167         (MemberCore.Name): Compute from MemberName on demand.
2168         (MemberCore.SetMemberName): Provide a way to change the
2169         MemberName.
2170         (MemberCore.AddToContainer): Don't take a fullname parameter.
2171         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2172         fully qualified name of the container to the member name.
2173         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2174         only if the type is a member of the root container.
2175         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2176         MemberName.Left rather than searching for an embedded ".".
2177         (PartialContainer.CreatePart): Update to changes in RootContext.
2178         (MemberBase.ShortName): Turn into a property.  Use
2179         MemberCore.SetMemberName.
2180         (MemberBase.ExplicitInterfaceName): Remove.
2181         (MemberBase.UpdateMemberName): Remove.
2182         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2183         (PropertyBase.SetMemberName): New override.
2184         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2185         (Tree.GetDecl): New.
2186         (Tree.AllDecls): Rename from Decls.
2187         * attribute.cs, enum.cs, report.cs: Update to changes.
2188         * driver.cs (MainDriver): Use MemberName.FromDotted on
2189         RootContext.MainClass.
2190
2191 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2192
2193         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2194         checks.
2195
2196         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2197
2198 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2199
2200         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2201         property accessor modifiers.
2202
2203         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2204         fixed buffer attribute (CS1716).
2205         (PropertyMethod.HasCustomAccessModifier): When property accessor
2206         has custom modifier.
2207
2208         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2209         modifiers.
2210         (PropertyExpr.DoResolveLValue): Add CS0272.
2211
2212 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2213
2214         * convert.cs: When converting to a pointer, use the proper Conv.U
2215         or Conv.I depending on the source data type.
2216
2217         * cs-tokenizer.cs: Make the size for large decimal constants,
2218         fixes #72957.
2219
2220 2005-03-17  Martin Baulig  <martin@ximian.com>
2221
2222         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2223         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2224
2225 2005-03-17  Martin Baulig  <martin@ximian.com>
2226
2227         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2228         to bool so we can return an error condition.
2229         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2230         returned an error.
2231
2232 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2233
2234         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2235         attributes.
2236
2237 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2238
2239         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2240         Refactor to avoid traversing the list of assemblies, and to avoid
2241         string concatenation.
2242         * typemanager.cs (guid_attr_type): Remove.
2243         (negative_hits, pointers, references): Remove hashes.
2244         (type_hash): New.
2245         (GetConstructedType): New.  Uses type_hash to handle constructed
2246         types (arrays, references, pointers).
2247         (GetReferenceType, GetPointerType): Use it.
2248         (GetNestedType): New.  Uses type_hash to handle nested types of
2249         reflected types.
2250         (LookupType, LookupTypeDirect): Remove.
2251         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2252         'types' hash and LookupTypeReflection directly.
2253         (params_string, params_object): Use GetConstructedType.
2254         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2255         top-level types.
2256         (Namespace.Lookup): Use cached_types.
2257         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2258         provided by old TypeManager.LookupType.
2259         * rootcontext.cs (MakeFQN): Remove.
2260         * decl.cs (DeclSpace.MakeFQN): Likewise.
2261         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2262         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2263         TypeManager.GetConstructedType.
2264         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2265
2266 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2267
2268         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2269         indexers.
2270
2271         * cs-parser.jay: Reports CS1527 for any namespace element.
2272
2273         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2274         Added CS0407.
2275
2276         * expression.cs (ParameterReference.IsAssigned): Changed error to
2277         CS0269.
2278         (Error_WrongNumArguments): Moved CS0245 detection here.
2279
2280         * statement.cs (Return.Resolve): Add CS1622 report.
2281
2282 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2283
2284         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2285
2286 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2287
2288         * attribute.cs expression.cs: Get rid of some allocations.
2289
2290 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2291
2292         * doc.cs : just eliminate the latest change.
2293
2294 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2295
2296         * doc.cs : commented out the latest change. It breaks xml-030.cs
2297
2298 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2299
2300         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2301           fail. So invoke CreateType() in FindDocumentedType().
2302
2303 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2304
2305         * cs-tokenizer.cs : added IsKeyword().
2306         * doc.cs : Detect keyword incorrectly used as identifier.
2307           Allow identifiers prefixed by @.
2308
2309 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2310
2311         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2312         It caused exception in namespace resolving (again!).
2313         
2314         * class.cs (Class.ctor): Removed exit.
2315         (PropertyMethod.ctor): ditto.
2316         
2317         * codegen.cs (Codegen.Reset): Reset static data.
2318         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2319         
2320         * cs-tokenizer.cs (Cleanup): Removed.
2321         
2322         * driver.cs (GetSystemDir): Rewrote to one line command.
2323         It caused problem with unloaded dynamic modules.
2324         (UnixParseOption): Removed Exit.
2325         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2326         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2327         Now can be mcs used as library.
2328         
2329         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2330         empty location.
2331         
2332         * location.cs (Reset): Reset static data.
2333         
2334         * namespace.cs (Reset): Reset static data.
2335         
2336         * report.cs (Report.Reset): Reset static data.
2337         
2338         * rootcontext.cs (RootContext.Reset): Reset static data.
2339         
2340         * tree.cs (RootTypes.ctor): Use Location.Null
2341         
2342         * typemanager.cs (TypeManager.Reset): Reset static data.
2343         (CoreLookupType): Removed Exit.
2344         (TypeHandle.Reset): Reset static data.
2345         
2346 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2347
2348         Fix #73516.
2349         * typemanager.cs (ComputeNamespaces): Import namespaces from
2350         referenced modules too.
2351
2352 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2353
2354         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2355         than '.'.
2356
2357 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2358
2359         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2360         enclosing DeclSpace.  This ensures that a name-lookup populates
2361         more caches and there are fewer 'TypeExpression's.  Carve out
2362         nested type lookup into ...
2363         (LookupNestedTypeInHierarchy): ... this.
2364
2365 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2366
2367         Clean up a few partial-class semantics.  
2368         Fixes test-357.cs and cs1618-2.cs.
2369         * cs-parser.jay (struct_declaration): Use 'current_class' as
2370         parent of newly-created struct.  Remove call to Register ().
2371         Use 'pop_current_class' to complete handing the current struct.
2372         (interface_declaration): Likewise.
2373         (class_declaration): Likewise.
2374         (enum_declaration): Use 'current_class' as parent of newly created
2375         enum.
2376         (delegate_declaration): Likewise.
2377         (pop_current_class): New function.  This is used to handle closing
2378         up the 'current_class' and 'current_container', and pointing them
2379         to the enclosing class/container.
2380         (CSharpParser): Initialize 'current_class' too.
2381         * decl.cs (MemberCore): Add check for invariant: a partial
2382         container is not a parsed entity, and thus does not enclose any
2383         parsed members.
2384         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2385         (DeclSpace.BaseTypeExpr): Use it.
2386         (DeclSpace.LookupType): Add check for invariant.
2387         * class.cs (TypeContainer): Add check for invariant: a nested
2388         class should have the same NamespaceEntry as its enclosing class.
2389         (TypeContainer.EmitFieldInitializers): Make virtual.
2390         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2391         MemberCore.
2392         (TypeContainer.Register): Remove.
2393         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2394         null.  Use TypeResolveEmitContext for resolving base types and
2395         interfaces.  Move initialization of Parts.TypeBuilder here from
2396         ...
2397         (TypeContainer.DefineNestedTypes): ... here.
2398         (PartialContainer): Take a Namespace not a NamespaceEntry.
2399         (PartialContainer.Create): Don't use Register.  Call the
2400         appropriate Add... function directly.
2401         (ClassPart): Take both the PartialContainer and the enclosing
2402         class as constructor arguments.
2403         (ClassPart.EmitFieldInitializers): Override.
2404         (ClassPart.PartFindNestedTypes): Remove.
2405         (FieldBase.GetInitializerExpression): Resolve the initializer
2406         expression in the emit context of the enclosing class.
2407         * tree.cs (RootTypes): Remove Register ().
2408         
2409 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2410
2411         * cs-parser.jay: Removed CS0134.
2412         
2413         * driver.cs: Removed CS1901.
2414         
2415         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2416         for predefined types.
2417
2418 2005-03-07  Duncan Mak  <duncan@novell.com>
2419
2420         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2421         well. Fixes bug #73454.
2422
2423 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2424
2425         * cs-tokenizer.cs (xtoken): Add CS1035.
2426         
2427         * class.cs (MethodData.Define): Add CS0683.
2428         (FieldMember.ctor): Add CS0681.
2429
2430 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2431
2432         * ecore.cs (SimpleName.DoResolve): Rename from
2433         SimpleName.DoResolveAllowStatic.
2434         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2435         Pass 'intermediate' flag to MemberStaticCheck.
2436         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2437         of "intermediate" lookups via MemberAccess.
2438         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2439         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2440
2441 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2442
2443         Fix #73394.
2444         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2445         slipped in because of variable names that are identical to a
2446         builtin type's BCL equivalent ('string String;', 'int Int32;').
2447         (PropertyExpr.EmitInstance): Likewise.
2448
2449 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2450
2451         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2452         
2453         * report.cs (warning_ignore_table): Made public.
2454
2455 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2456
2457         Fix #73282.
2458         * class.cs (MethodData.Emit): Pass 'container' to
2459         container.GetObsoleteAttribute instead of 'container.Parent'.
2460
2461 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2462
2463         * cs-parser.jay: Add 1534 error test.
2464
2465         * iterators.cs (Yield.CheckContext): Add error 1629.
2466         (Iterator.ctor): Save unsafe modifier.
2467         (MoveNextMethod.DoEmit): Restore unsafe context.
2468
2469         * namespace.cs (UsingAlias): Better error message.
2470
2471 2005-03-03  Dan Winship  <danw@novell.com>
2472
2473         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2474         the warning message [#73219]
2475
2476 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2477
2478         Fix compile with MCS 1.0.0.0.
2479         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2480         w_restore to not depend on string constant folding.
2481
2482 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2483
2484         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2485         CS0246 check to users who passed 'silent = false'.
2486         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2487         check.
2488         (SimpleName.SimpleNameResolve): Update.
2489         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2490         (MemberAccess.IdenticalNameAndTypeName): Update.
2491         * doc.cs (FindDocumentedTypeNonArray): Update.
2492
2493 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2494
2495         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2496         * parameters.cs (ComputeAndDefineParameters): Remove.
2497         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2498         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2499         Use GetParameterInfo.
2500
2501 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2502
2503         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2504
2505 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2506
2507         Unify DeclSpace.LookupType and DeclSpace.FindType.
2508         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2509         is in charge of defining nested types on demand.
2510         (DeclSpace.LookupType): Use it when the current_type is a
2511         TypeBuilder.  Use LookupTypeDirect for reflected types.
2512         (DeclSpace.FindType): Remove.
2513         (DeclSpace.LookupInterfaceOrClass): Likewise.
2514         (DeclSpace.DefineTypeAndParents): Likewise.
2515         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2516         DeclSpace.LookupType.
2517         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2518         * typemanager.cs (LookupType): Simplify.
2519         (AddUserType): Remove type from negative_hits.
2520         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2521         * class.cs (TypeContainer.FindMembers): Move handling of nested
2522         types ...
2523         (TypeContainer.FindMembers_NestedTypes): ... here.
2524         (TypeContainer.FindNestedType): Implement override.
2525         (ClassPart.FindNestedType): Delegate to PartialContainer.
2526         (ClassPart.PartFindNestedType): Looks up the nested types of the
2527         part alone.
2528
2529 2005-03-02  Martin Baulig  <martin@ximian.com>
2530
2531         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2532         static constructor in static classes.
2533
2534 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2535
2536         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2537         sizeParamIndex is not specified.
2538
2539 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2540
2541         Fix #73117
2542         * report.cs (WarningMessage.IsEnabled): Missing null check.
2543
2544 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2545
2546         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2547         in the fields and not in the properties.
2548
2549 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2550
2551         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2552         fields as well.
2553
2554 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2555
2556         * attribute.cs: Small refactoring (improved robustness).
2557         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2558         (ValidateGuid): Removed.
2559         (Resolve): Removed referenced to above mentioned.
2560         (GetAttributeUsage): Made private and changed to work without
2561         class assistance.
2562         (GetIndexerAttributeValue): Don't crash.
2563         (GetConditionalAttributeValue): Ditto.
2564         (GetClsCompliantAttributeValue): Ditto.
2565         (ExtractSecurityPermissionSet): All attributes exceptions are
2566         error 648.
2567         (GetPropertyValue): New helper.
2568         (GetMethodImplOptions): New method.
2569         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2570         some missing properties.
2571         
2572         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2573         (Method.ApplyAttributeBuilder): Updated.
2574         
2575         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2576         exception.
2577
2578 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2579
2580         Fix #73052.
2581         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2582         non-simple types (array, pointer, reference).
2583
2584 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2587
2588         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2589         for operators.
2590         (Method.CheckBase): Catch wrong destructor here.
2591         (MethodData.Define): Add errors 550, 668.
2592
2593         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2594
2595         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2596
2597         * pending.cs (VerifyPendingMethods): Add error 551.
2598
2599         * typemanager.cs (CSharpName): Next error report helper.
2600
2601 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2602
2603         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2604         attributes. Removed useless attribute double check.
2605         It saves almost 2MBs for corlib.
2606
2607 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2608
2609         Fix #72924.
2610         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2611         called twice in case of error.
2612
2613 2005-02-23  Chris Toshok  <toshok@ximian.com>
2614
2615         Fix compiler portions of #72827.
2616         * statement.cs (Block.Emit): call Begin/EndScope on the
2617         EmitContext instead of the ILGenerator.
2618
2619         * codegen.cs (EmitContext.BeginScope): new method, call
2620         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2621         we have one.)
2622         (EmitContext.BeginScope): same, but EndScope and CloseScope
2623
2624         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2625         offset and call the superclass's OpenScope(int) with it.
2626         (SymbolWriter.CloseScope): get the current il
2627         offset and call superclass's CloseScope(int) with it.
2628
2629 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2630
2631         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2632         CS1677 for out and ref as well.
2633
2634         * class.cs (Method.Define): Add error CS1599 detection.
2635         
2636         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2637         
2638         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2639         
2640         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2641         
2642         * support.cs.cs (ModifierDesc): New helper method.
2643
2644 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2645             Abin Thomas  <projectmonokochi@rediffmail.com>
2646             Anoob V E  <projectmonokochi@rediffmail.com>
2647             Harilal P R  <projectmonokochi@rediffmail.com>
2648
2649         Fix #57851, #72718.
2650         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2651         MemberLookup (used for error reporting) actually returns a result.
2652         Fix error report number (122, not 112).
2653
2654 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2655             Anoob V E  <projectmonokochi@rediffmail.com>
2656             Harilal P R  <projectmonokochi@rediffmail.com>
2657
2658         Fix #71134.
2659         * pending.cs (PendingImplementation.GetAbstractMethods):
2660         Find NonPublic members too.
2661
2662 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2665         Fixed error 217.
2666         
2667         * class.cs (MethodCore.CheckMethodAgainstBase):
2668         Add error 239 report.
2669
2670 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2671
2672         Fix #68955.
2673         * expression.cs (Invocation.IsApplicable): Make public.
2674         (Invocation.IsParamsMethodApplicable): Likewise.
2675         * delegate.cs (Delegate.VerifyApplicability): Don't use
2676         Invocation.VerifyArgumentCompat for parameter applicability
2677         testing.  Use Invocation.IsApplicable and
2678         Invocation.IsParamsMethodApplicable.
2679
2680 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2681
2682         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2683         
2684         * class.cs (Operator.Define): Add error 217 report.
2685         
2686 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2687
2688         * namespace.cs (UsingEntry.Resolve): Undo change below.
2689
2690 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2691
2692         Fix #72756.
2693         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2694         disable the error message when the extended MemberLookup also
2695         fails.
2696         (Expression.MemberLookupFinal): Update.
2697         (SimpleName.DoSimpleNameResolve): Update.
2698         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2699         Don't use MemberLookupFinal.
2700         (New.DoResolve): Update.
2701         (BaseAccess.CommonResolve): Update.
2702
2703 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2704
2705         Fix #72732.
2706         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2707         occured previously, don't resolve again.
2708
2709 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2710
2711         Fix #69949
2712         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2713         argument. Call ResolveAttributeUsage for unresolved.
2714         when types doesn't match ctor arguments.
2715         
2716         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2717         for nested attribute classes.
2718         (Class.attribute_usage): Removed.
2719         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2720         for attribute class.
2721         
2722         * ecore.cs (IsAttribute): Removed.
2723         
2724         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2725         
2726         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2727         now normal types.
2728         (attribute_types): Removed.
2729         (EmitCode): Global attributes are emited as the latest.
2730
2731 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2732
2733         * class.cs (EmitFieldInitializers): Don't emit field initializer
2734         for default values when optimilization is on.
2735         
2736         * constant.cs (Constant.IsDefaultValue): New property.
2737         
2738         * driver.cs: Add /optimize handling.
2739         
2740         * constant.cs,
2741         * ecore.cs,
2742         * literal.cs: Implement new IsDefaultValue property.
2743         
2744         * rootcontext.cs (Optimize): New field, holds /optimize option.
2745
2746 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2747
2748         Fix crasher in re-opened #72347.
2749         * namespace.cs (Namespace.Lookup): Return null if
2750         DeclSpace.DefineType returns null.
2751
2752         Fix #72678.
2753         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2754
2755 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2756
2757         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2758         now returns null if it cannot resolve to an lvalue.
2759         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2760         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2761         returned null.  Remove check for SimpleName.
2762         (EventExpr.DoResolveLValue): New.
2763         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2764         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2765         error from ...
2766         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2767         avoid CS0131 error.
2768         (Unary.ResolveOperator): Move CS0211 check ...
2769         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2770         CS0131 error.
2771         (Unary.DoResolveLValue): Simplify.
2772         (AddressOf.DoResolveLValue): New.
2773         (ArrayAccess.DoResolveLValue): New.
2774
2775 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2776
2777         * attribute.cs (Attribute.Resolve): Add arguments casting for
2778         when types doesn't match ctor arguments.
2779
2780 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2781
2782         Fix parts of #63202.
2783         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2784         lookup of operator in base type.  Ensure that all checks happen
2785         when the operator resolves to an "op_..." method.
2786
2787 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2788
2789         Fix #71992.
2790         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2791         'ignore_cs0104' parameter.  Pass it to ...
2792         (NamespaceEntry.Lookup): ... this.
2793         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2794         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2795         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2796         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2797         Update.  Request that cs0104 errors be ignored.
2798         (ComposedCast.ResolveAsTypeStep): Update.
2799
2800 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2801
2802         Fix #59209.
2803         * expression.cs (Invocation.BetterFunction): Remove support for
2804         comparing virtual functions and their overrides.
2805         (Invocation.IsOverride): New.
2806         (Invocation.OverloadResolve): Don't consider 'override' functions
2807         during candidate selection.  Store them in a lookaside list.
2808         If the selected method is a 'virtual' function, use the list to
2809         find any overrides that are closer to the LHS type.
2810
2811 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2812
2813         * expression.cs (New.DoResolve): Add complex core type reduction.
2814         (New.Constantify): Converts complex core type syntax like 'new int ()'
2815         to simple constant.
2816         
2817 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2818
2819         * decl.cs (EntryType.EntryType): New constructor to create an
2820         updated copy of a cache entry.
2821         (MemberCache.AddMethods): Use it.
2822         (MemberCache.ClearDeclaredOnly): Remove.
2823         (MemberCache.MemberCache): Update.
2824
2825 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2826
2827         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2828         variable.  This one is represents the actual low-level declaration
2829         of the method, as opposed to the semantic level `IsStatic'.   
2830
2831         An anonymous method which is hosted into a static method might be
2832         actually an instance method.  IsStatic would reflect the
2833         container, while MethodIsStatic represents the actual code
2834         generated.
2835
2836         * expression.cs (ParameterReference): Use the new MethodIsStatic
2837         instead of IsStatic.
2838
2839         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2840         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2841         set on the current EmitContext. 
2842
2843         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2844         resolve our casted expression as an LValue.  This triggers the
2845         proper LValue processing that is later required by Assign.
2846
2847         This fixes 72347.
2848
2849         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2850
2851 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2852
2853         C# 2.0 Fixed buffer implementation
2854
2855         * anonymous.cs: Update after RegisterHelperClass renaming.
2856
2857         * attribute.cs (AttributeTester.fixed_buffer_cache):
2858         Cache of external fixed buffers.
2859         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2860         implementation if field is fixed buffer else null.
2861
2862         * class.cs
2863         (TypeContainer.AddField): Accept FieldMember instead of Field.
2864         (FieldBase.IsFieldClsCompliant): Extracted code from
2865         VerifyClsCompliance descendant customization.
2866         (FixedField): New class handles fixed buffer fields.
2867         (FixedFieldExternal): Keeps information about imported fixed
2868         buffer.
2869         (IFixedField): Make access to internal or external fixed buffer
2870         same.
2871
2872         * cs-parser.jay: Add fixed buffer parsing.
2873
2874         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2875         buffer.
2876
2877         * expression.cs (Indirection): Extended implementation to accept
2878         fixed buffer field.
2879         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2880         (ElementAccess.MakePointerAccess): Get type as parameter.
2881         (DoResolve): Add fixed buffer field expression conversion.
2882         (DoResolveLValue): Ditto.
2883         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2884         (ArrayPtr): Derives from FixedBufferPtr.
2885         (ArrayPtr.Emit): Add extra emit for array elements.
2886
2887         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2888
2889         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2890         for compiler generated types.
2891         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2892
2893         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2894         and consume less memory.
2895         (Fixed.Resolve): Add fixed buffer case.
2896
2897         * typemanager.cs (compiler_generated_attr_ctor,
2898         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2899         (HasElementType): Add our own implementation to work on every
2900         runtime.
2901
2902 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2903
2904         * anonymous.cs (CaptureContext): Track whether `this' has been
2905         referenced.   
2906
2907         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2908         only captured `this' if it was implicitly done (instance
2909         methods/variables were used). 
2910
2911         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2912         `this' must be captured.
2913
2914 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2915  
2916         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2917         is null it means that there has been no need to capture anything,
2918         so we just create a sibling.
2919
2920         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2921
2922         Just a partial fix.  The other half is fairly elusive.
2923         
2924 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2925
2926         Fix #52586, cs0121-4.cs.
2927         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2928         and return a hashtable.
2929         (MemberCache.ClearDeclaredOnly): New.
2930         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2931         the method_hash of a base type too.
2932         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2933         type methods.  Overwrite entries with the same MethodHandle so
2934         that the ReflectedType is correct.  The process leaves in base
2935         virtual functions and their overrides as distinct entries.
2936         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2937         matters since it was boxed in a ArrayList before.
2938         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2939         modifier.
2940         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2941         case of a virtual function and its override (choose the overload
2942         as better).
2943         (Invocation.OverloadResolve): Avoid 'override' members during
2944         'applicable_type' calculation.
2945
2946 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2947
2948         Combine two near-redundant caches.
2949         * typemanager.cs (method_params): Rename from method_internal_params.
2950         (TypeManager.GetParameterData): New.  Replace
2951         Invocation.GetParameterData.
2952         (TypeManager.LookupParametersByBuilder): Remove.
2953         * expression.cs (Invocation.method_parameter_cache): Remove.
2954         (Invocation.GetParameterData): Remove.
2955         Update to changes.
2956         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2957         Update to changes.
2958
2959 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2960
2961         Fix #72015.
2962         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2963         TypeManager.multicast_delegate_type is null, resolve it by looking
2964         up "System.MulticastDelegate".
2965         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2966
2967 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2968             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2969             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2970
2971         Fix cs0164.cs.
2972         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2973         (LabeledStatement.AddReference): New.  Set 'referenced'.
2974         (Goto.Resolve): Use it.
2975
2976 2005-02-05  John Luke  <john.luke@gmail.com>
2977
2978         * driver.cs: remove duplicate -doc line in Usage ()
2979
2980 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2981
2982         * location.cs (Location.AddFile): Fix CS2002 error report.
2983
2984 2005-02-02  Martin Baulig  <martin@ximian.com>
2985
2986         * delegate.cs (Delegate.DefineType): Report an internal error if
2987         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2988         details.        
2989
2990 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2991
2992         Fix a crasher in a variant of #31984.
2993         * const.cs (Constant.CheckBase): New override that defers the
2994         new-or-override check in case the base type hasn't been populated
2995         yet.
2996         (Constant.Define): Ensure the new-or-override check is performed.
2997
2998 2005-02-01  Duncan Mak  <duncan@ximian.com>
2999
3000         * const.cs (LookupConstantValue): Check that `ce' is not null
3001         before calling GetValue ().
3002
3003 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3004
3005         Fix test-334.cs (#69519).
3006         * cs-parser.jay (using_alias_directive): Pass in an expression to
3007         NamespaceEntry.UsingAlias.
3008         (using_namespace_directive): Pass in an expression to
3009         NamespaceEntry.Using.
3010         (namespace_name): Don't flatten to a string.
3011         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3012         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3013         ResolveAsTypeStep.
3014         (NamespaceEntry.UsingEntry): Likewise.
3015         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3016         changes.
3017         (NamespaceEntry.LookupForUsing): Remove.
3018         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3019         names.
3020         (NamespaceEntry.Lookup): Remove support for dotted names.
3021
3022 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3023
3024         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3025         split into two.
3026         (NamespaceEntry.ImplicitParent): Compute on demand.
3027         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3028         parallels the current.
3029         (NamespaceEntry.LookupForUsing): Use it.
3030         (NamespaceEntry.Lookup): If the current namespace-entry is
3031         implicit, don't search aliases and using tables.
3032
3033 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3034
3035         Fix #31984.
3036         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3037         BaseCache here.
3038         (TypeContainer.BaseCache): Compute on demand.
3039         (TypeContainer.FindMembers): Define constants and types if they're
3040         not already created.
3041         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3042         check.
3043         * const.cs (Constant.Define): Make idempotent.
3044
3045 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3046
3047         * pending.cs: Produce better code (no nops produced by using Ldarg
3048         + value).
3049         
3050         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3051         i - 1' it should be arg + 1.
3052
3053         Fixes bug #71819.
3054
3055 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3056
3057         * attribute.cs (Attribute.CheckAttributeType): Make private
3058         non-virtual.
3059         (Attribute.ResolveType): Make virtual.
3060         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3061         handling of RootContext.Tree.Types.
3062
3063 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3064
3065         Update attribute-handling to use the SimpleName/MemberAccess
3066         mechanisms.
3067         * cs-parser.jay (attribute): Pass in an expression to the
3068         constructors of Attribute and GlobalAttribute.
3069         * attribute.cs (Attribute): Take an expression for the name.
3070         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3071         passed in attribute name expression.
3072         (Attribute.CheckAttributeType): Use it.
3073         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3074         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3075         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3076         argument to prevent error messages if the lookup fails.
3077
3078 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3079
3080         * expression.cs (Indirection): Implemented IVariable interface
3081         to support indirection in AddressOf operator.
3082         (PointerArithmetic.Emit): Add optimalization for case where
3083         result can be precomputed.
3084
3085 2005-01-26  Martin Baulig  <martin@ximian.com>
3086
3087         * class.cs (TypeContainer.AttributeTargets): Return the correct
3088         AttributeTargets depending on our `Kind' instead of throwing an
3089         exception; fixes #71632.
3090
3091 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3092
3093         Fix #71257
3094         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3095         constant members.
3096
3097 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3098
3099         Fix #71602.
3100         * expression.cs (MemberAccess.DoResolve): Don't complain with
3101         cs0572 when the LHS of a member access has identical name and type
3102         name.
3103
3104 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3105
3106         Fix #71651, #71675
3107         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3108         CreatePermission.
3109         Create custom PermissionSet only for PermissionSetAttribute.
3110
3111 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3112
3113         Fix #71649
3114         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3115         delegates in static class.
3116
3117 2005-01-24  Martin Baulig  <martin@ximian.com>
3118
3119         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3120         merging an implicit block, just use its reachability.
3121
3122         * statement.cs (Block.Resolve): Make the unreachable code check
3123         work wrt. implicit blocks; see test-337 from #63842.
3124
3125 2005-01-21  Alp Toker  <alp@atoker.com>
3126  
3127         * cs-parser.jay: destructor_declaration's container is PartialContainer
3128         not Class when partial types are used, so use Kind prop instead of
3129         'is'.
3130         
3131 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3132
3133         * cs-parser.jay: Improve error reporting when an interface
3134         declares new types.
3135
3136 2005-01-20  Dick Porter  <dick@ximian.com>
3137
3138         * support.cs: SeekableStreamReader fix from Sandor Dobos
3139         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3140         chars are read.  Fixes bug 70369.
3141
3142 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3143
3144         * cs-parser.jay (catch_clause): Simplify current_block handling
3145         somewhat.
3146
3147 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3148
3149         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3150         code with ImplicitStandardConversion to handle the implicit
3151         conversion of method groups into valid delegate invocations. 
3152
3153         The problem is that in parameter handling we were using this code
3154         path.  Fixes bug #64698
3155
3156 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3157
3158         * cs-parser.jay: Fix several infelicities.
3159         - Avoid assigning to the parser value stack.  Code like 
3160           '$3 = null' is unclean.  Synthesize a value for the code block
3161           instead. 
3162         - Avoid using oob_stack for storing location information.  Use ...
3163         (_mark_): ... this.  New (empty) rule.  Saves the current location
3164         in $$.
3165         (foreach_statement): Avoid using oob_stack for current_block
3166         handling.  Use technique used in for_statement and
3167         using_statement.  Synthesize a value for the code block to store
3168         additional intermediate information.
3169
3170 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3171
3172         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3173         of a different type is only allowed to private fields of a
3174         containing type, not on fields of a base class.
3175
3176         See test-174.cs and error cs0122-9.cs
3177
3178 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3179
3180         Fix test-335.cs (bug #58126).
3181         * cs-parser.jay (argument): Split out non-expression parts of the
3182         rule into 'non_simple_argument'.
3183         (invocation_expression): Support parenthesized invocations with
3184         multiple arguments, and with single non-simple arguments.
3185
3186 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3187
3188         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3189         places.
3190
3191 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3192
3193         Fix cs0038-1.cs, cs1640-6.cs.
3194         * ecore.cs (Expression.Resolve): Remove special-case for
3195         SimpleName in error-handling.
3196         (Expression.almostMatchedMembers): Relax access permission to
3197         protected.
3198         (Expression.MemberLookupFailed): Handle duplicates in
3199         almostMatchedMembers list.
3200         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3201         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3202         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3203         overload if the passed in MemberInfo is a MethodBase.
3204
3205 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3206
3207         Fix #70749
3208         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3209         for non-CAS & merge permission sets properly.
3210
3211 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3212
3213         Improve standard-compliance of simple name and member access 
3214         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3215         * ecore.cs (FullNamedExpression): New abstract base class 
3216         for Namespaces and TypeExpressions.
3217         (ResolveFlags.SimpleName): Remove.
3218         (SimpleName): Remove support for dotted names.
3219         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3220         DeclSpace.FindType and DeclSpace.LookupType.
3221         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3222         (Expression.ExprClassName): Make member function.
3223         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3224         a namespace.  Remove creation of dotted "SimpleName"s.
3225         (MemberAccess.DoResolve): Likewise.
3226         * decl.cs (DeclSpace.Cache): Make private.
3227         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3228         (DeclSpace.FindType): Update.
3229         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3230         FullNamedExpression.
3231         * namespace.cs (Namespace): Derive from FullNamedExpression
3232         so that it can be part of expression resolution.
3233         (Namespace.Lookup): Return an FullNamedExpression.
3234         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3235         namespace.
3236         * rootcontext.cs (NamespaceLookup): Remove.
3237         (LookupType): Move to DeclSpace.
3238         * attribute.cs (CheckAttributeType): Update.
3239         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3240         (FindDocumentedTypeNonArray): Likewise.
3241
3242 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3243
3244         Fix cs0509.cs, cs1632.cs.
3245         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3246         is the same as IsInterface.
3247         (TypeContainer.GetClassBases): Likewise.
3248         * statement.cs (LabeledStatement.ig): New field.
3249         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3250         label.
3251         (LabeledStatement.DoEmit): Check that the label was created with
3252         the same ILGenerator.
3253
3254 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3255
3256         Fix #71058
3257         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3258         accessors to its properties.
3259
3260         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3261         from accessors to property.
3262         
3263 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3264
3265         Fix #70722
3266         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3267         only for overrides.
3268         
3269 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3270
3271         * attribute.cs: Check for null and empty strings.  
3272
3273         I have lost another battle to Paolo.
3274
3275 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3276
3277         Fix #70942
3278         * class.cs (PropertyMethod): Set Parent field in ctors.
3279         (SetMethod.InternalParameters): Add unsafe switch hack.
3280         Override MarkForDuplicationCheck where it is appropriate.
3281
3282         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3283         It says whether container allows members with the same name.
3284         Base default is no.
3285         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3286         Removed is_method parameter.
3287
3288 2005-01-06  Duncan Mak  <duncan@ximian.com>
3289
3290         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3291         because the previous change led to incorrect reporting of CS1032
3292         ("Cannot define/undefine preprocessor symbols after first token in
3293         file"). Instead of using `tokens_seen' as the only flag that
3294         triggers CS1040, introduce `comments_seen'. This new flag is used
3295         to signify having seen comments on the current line, so it is
3296         unset after a newline.
3297
3298 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3299
3300         * doc.cs : When searching for a type, find nested type too.
3301           This fixes bug #71040.
3302
3303 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3304
3305         * doc.cs :
3306           - Warn missing member comment on those classes which also does not
3307             have doc comments. Fixed bug #71041.
3308           - Don't warn missing doc comment on default constructor.
3309             Fixed bug #71042.
3310
3311 2005-01-06  Duncan Mak  <duncan@ximian.com>
3312
3313         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3314         comments, set `tokens_seen' to true. This allows us to detect
3315         misplaced preprocessor directives (i.e. not at the beginning of
3316         the a line, nor after whitespaces). In that case, report error
3317         CS1040. This fixes bug #56460.
3318
3319         * cs-parser.jay (interface_member_declaration): Add checks for
3320         IsExplicitImpl, and report CS0541 error if an interface member is
3321         defined as an explicit interface declaration.
3322
3323 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3324
3325         Fix #70817
3326         * class.cs (PropertyMethod): Set Parent field in ctors.
3327         (SetMethod.InternalParameters): Add unsafe switch hack.
3328         
3329         * decl.cs (MemberCore.Parent): Cannot be readonly.
3330
3331 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3332
3333         * decl.cs (DeclSpace.ResolveType): Remove.
3334         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3335         Merge in code from ...
3336         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3337         * class.cs, enum.cs: Update to changes.
3338
3339 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3340
3341         * anonymous.cs: Ensure that we init the scope of our parent if it
3342         has not been initialized yet.
3343
3344 2004-12-30  Duncan Mak  <duncan@ximian.com>
3345
3346         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3347         if field.FieldBuilder is null. Fixes #70758.
3348
3349         * convert.cs: Fixed some typos and updated some of the comments.
3350         (ImplicitStandardConversionExists):
3351         (TryImplicitIntConversion): If `target_type' is an interface and
3352         the type of `ic' implements this interface, return true or a new
3353         BoxedCast instead of null. This fixes #70468.
3354
3355 2004-12-29  Duncan Mak  <duncan@ximian.com>
3356
3357         * expression.cs (Argument.Emit): Check that Expr is
3358         IMemoryLocation before casting to it, and report CS1510 otherwise.
3359
3360         This fixes #70402.
3361
3362 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3363
3364         * statement.cs (Block.ThisVariable): remove the recursion here, to
3365         make the --profile more sane.
3366
3367 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3368
3369         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3370         assembly, by JB Evain.
3371
3372 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3373
3374         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3375           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3376         "parent" refers to enclosing type/class.  "base" refers to superclass.
3377
3378 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3379
3380         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3381         Ensure that we only have GlobalAttributes.
3382         * attribute.cs (Attribute.Emit): Make non-virtual.
3383         (GlobalAttribute.Emit): Remove.
3384         (Attribute.Resolve): Make virtual.
3385         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3386         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3387         the argument. Don't create one.
3388         (Attribute.GetObsoleteAttribute): Likewise.
3389         (Attribute.GetClsCompliantAttributeValue): Likewise.
3390         * class.cs, decl.cs: Update to changes.
3391
3392 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3393
3394         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3395         
3396         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3397         
3398         * statement.cs (Foreach.Resolve): Add error 186 report.
3399
3400 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3401
3402         * expression.cs (Conditional.DoResolve): Add warning 429.
3403         
3404         * statement.cs (If.Resolve): Add warning 665.
3405
3406 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3407
3408         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3409         except when in the parser, and in GlobalAttribute.
3410         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3411         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3412         RootContext.Tree.Types.NamespaceEntry once work is done.
3413         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3414         and resets RootContext.Tree.Types.NamespaceEntry.
3415
3416 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3417
3418         * cs-parser.jay: Don't create a block for every variable.
3419
3420 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3421
3422         * location.cs: Provide extra information.
3423
3424         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3425         variables from the captured environment, it is the ldarg_0.
3426
3427 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3428
3429         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3430         find a conclusion.
3431         
3432         * class.cs: Changed warning level for 169 to avoid developer
3433         displeasure from warning flooding. It will be changed back when they
3434         fix most of current BCL warnings.
3435         
3436         * RootContext.cs: Pushed default WarningLevel to 3.
3437         
3438         * statement.cs: Removed unused variable.
3439
3440 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3441
3442         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3443         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3444         Add error 502 report.
3445         (StaticClass.DefineType): Add error 441 report.
3446         (Class.AllowedModifiersProp): New virtual property as temporary
3447         extension to AllowedModifiers.
3448         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3449         to share implementation with StaticClass and don't call virtual
3450         methods from ctor.
3451         
3452         * driver.cs (MainDriver): Add error 1558 test.
3453
3454         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3455         report. Moved error 36 test here.
3456
3457         * statement.cs (Throw.Resolve): Add error 724 report.
3458
3459         * typemanager.cs: Add out_attribute_type core type.
3460         
3461 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3462
3463         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3464         3018 report.
3465         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3466
3467         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3468         3017 report.
3469         
3470         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3471
3472         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3473         Add error 3023 report.
3474         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3475
3476         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3477         implementation.
3478
3479 2004-12-12  John Luke  <john.luke@gmail.com>
3480
3481         * driver.cs (AddArgs): take -- into account when
3482         adding arguments, fixes bug 65710 
3483
3484 2004-12-12  Martin Baulig  <martin@ximian.com>
3485
3486         * expression.cs (Unary.TryReduceNegative): Added support for
3487         SByteConstant and ByteConstant.
3488         (Unary.Reduce): Check error values from TryReduceNegative().
3489
3490 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3491
3492         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3493         and report exception as error 182.
3494
3495 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3496
3497         * driver.cs (Main): Fix message when there are warnings.
3498
3499 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3500
3501         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3502
3503 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3504
3505         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3506         Reduced number of warnings.
3507         
3508         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3509
3510 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3511
3512         * driver.cs: Removed message.
3513
3514         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3515
3516 2004-12-08    <vargaz@freemail.hu>
3517
3518         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3519
3520 2004-12-08  Martin Baulig  <martin@ximian.com>
3521
3522         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3523         instead of a CS3002 for properties and indexer.
3524
3525 2004-12-08  Martin Baulig  <martin@ximian.com>
3526
3527         * decl.cs (MemberName.ToString): Make this work again.
3528
3529 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3530
3531         * attribute.cs (Resolve): Add error 591 detection.
3532
3533         * class.cs (FieldMember.Define): Add error 1547 detection.
3534         (Indexer.Define): Add error 620 detection.
3535         (Operator.Define): Add error 590 detection.
3536
3537         * ecore.cs: Missing argument for error 79.
3538
3539         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3540         detection.
3541
3542 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3543
3544         Fix #70106
3545         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3546         only.
3547
3548 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3549
3550         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3551           Some operator comments were suppressed.
3552         * doc.cs : Implicit/explicit operator name in doc comments are like
3553           "op_Explicit(type)~returnType", so added suffix handling.
3554
3555 2004-12-07  Martin Baulig  <martin@ximian.com>
3556
3557         * decl.cs
3558         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3559         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3560         (DeclSpace.ec): New protected field; store the EmitContext here.
3561         (DeclSpace.EmitContext): New public property; moved here from
3562         `TypeContainer'.
3563         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3564         EmitContext.
3565
3566         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3567         (Enum.Emit): Don't create a new EmitContext.
3568
3569         * delegate.cs (Delegate.DefineType): Always create the
3570         EmitContext.
3571
3572         * iterators.cs (Iterators.DefineIterator): Create a new
3573         EmitContext and store it in `ec'.
3574
3575 2004-08-24  Martin Baulig  <martin@ximian.com>
3576
3577         * typemanager.cs
3578         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3579         this for accessibility checks.
3580         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3581         IsNestedFamilyAccessible.
3582         (TypeManager.IsSubclassOf): New method, do what the name actually
3583         says.   
3584
3585 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3586
3587         Fix crash on cs0657-17.cs.
3588         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3589         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3590         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3591         the case where the NamespaceEntry gets overwritten.
3592
3593 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3594
3595         Fixed #69195, #56821
3596         * ecore.cs (ResolveBoolean): Tiny refactoring.
3597
3598         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3599         of right expression resolving when left is false constant and
3600         operator is LogicalAnd OR true constant and operator is LogicalOr.
3601
3602         * statement.cs (ResolveUnreachable): Always reports warning.
3603
3604 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3605
3606         * class.cs: Distinguish between 1721 and 1722 (just a little help
3607         for the programmer).
3608
3609 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3610
3611         * delegate.cs: Only allow this on new versions of the language. 
3612
3613 2004-12-02  Duncan Mak  <duncan@ximian.com>
3614
3615         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3616         Expression class.
3617         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3618         here as a static method. Take an additional bool out parameter
3619         `must_do_cs1540_check' for signaling to InstanceResolve.
3620         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3621         member field from PropertyExpr class and made it an argument of
3622         the method instead.
3623         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3624         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3625         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3626         and `remove_accessor' as well as InstanceResolve: report CS0122
3627         where applicable.
3628
3629         Fixes #70129.
3630
3631 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3632
3633         Fix test-327.cs, test-328.cs, and put in early infrastructure
3634         for eventually fixing #52697.
3635         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3636         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3637         from other methods.
3638         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3639         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3640         (VerifyUsing, error246): Update.
3641         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3642         'NamespaceEntry.LookupNamespaceOrType'.
3643
3644 2004-12-03  Martin Baulig  <martin@ximian.com>
3645
3646         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3647         method as our child, call AnonymousMethod.Compatible() on it.
3648
3649 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3650
3651         Disable XML documentation support in 'basic' profile.
3652         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3653         Redirect XmlElement to System.Object.
3654         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3655         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3656         * mcs.exe.sources: Add doc-bootstrap.cs.
3657         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3658         of doc.cs.
3659
3660 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3661
3662         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3663           comments are allowed.
3664
3665 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3666
3667         * delegate.cs: Add checks for subtypes in paramaters and return values
3668         in VerifyMethod () to add support for Covariance/Contravariance
3669         in delegates.
3670         
3671 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3672
3673         * report.cs: Remove extra closing parenthesis.
3674
3675         * convert.cs (Error_CannotImplicitConversion): If the name of the
3676         types are the same, provide some extra information.
3677
3678         * class.cs (FieldBase): Use an unused bit field from the field to
3679         encode the `has_offset' property from the FieldMember.  This saves
3680         a couple of Ks on bootstrap compilation.
3681
3682         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3683         method as our child, return the AnonymousMethod resolved
3684         expression.
3685
3686         * expression.cs (New.DoResolve): Allow return values from
3687         NewDelegate to also include AnonymousMethods.
3688
3689         Fixes #70150.
3690
3691 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3692
3693         Fix bug #70102
3694         * attribute.cs (Resolve): Improved implementation of params
3695         attribute arguments.
3696
3697         * support.cs (ParameterData): Add HasParams to be faster.
3698
3699 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3700
3701         all things are for /doc support:
3702
3703         * doc.cs: new file that supports XML documentation generation.
3704         * mcs.exe.sources: added doc.cs.
3705         * driver.cs:
3706           Handle /doc command line option.
3707           Report error 2006 instead of 5 for missing file name for /doc.
3708           Generate XML documentation when required, after type resolution.
3709         * cs-tokenizer.cs:
3710           Added support for picking up documentation (/// and /** ... */),
3711           including a new XmlCommentState enumeration.
3712         * cs-parser.jay:
3713           Added lines to fill Documentation element for field, constant,
3714           property, indexer, method, constructor, destructor, operator, event
3715           and class, struct, interface, delegate, enum.
3716           Added lines to warn incorrect comment.
3717         * rootcontext.cs :
3718           Added Documentation field (passed only when /doc was specified).
3719         * decl.cs:
3720           Added DocComment, DocCommentHeader, GenerateDocComment() and
3721           OnGenerateDocComment() and some supporting private members for
3722           /doc feature to MemberCore.
3723         * class.cs:
3724           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3725         * delegate.cs:
3726           Added overriden DocCommentHeader.
3727         * enum.cs:
3728           Added overriden DocCommentHeader and GenerateDocComment().
3729
3730 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3731
3732         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3733         unwrapping the enumeration values, chain to
3734         DoConstantNumericPromotions again, so we can promote things to the
3735         fundamental types (takes care of enums that are bytes, sbytes).
3736
3737         Fixes bug #62054.
3738
3739 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3740
3741         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3742         Fix long-standing bug in type-lookup.  Use FindType instead of
3743         LookupType when ec.ResolvingTypeTree.
3744         (Attribute.ResolveType, Attribute.Resolve)
3745         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3746         Update to changes.
3747         (Attributes.Search): Remove internal version.  Update.
3748         (Attributes.SearchMulti): Update.
3749         (Attributes.GetClsCompliantAttribute): Remove.
3750         (Attributes.GetIndexerNameAttribute): Remove.
3751         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3752         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3753         * class.cs (Indexer.Define): Likewise.
3754
3755 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3756
3757         Fix bug #68790
3758         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3759         MarshallByReference members access.
3760
3761         * expression.cs: Use CheckMarshallByRefAccess;
3762         Better error CS0197 message.
3763
3764         * report.cs: Print whole related error message.
3765
3766 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3767
3768         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3769         the current directory to help debugging.
3770
3771 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3772
3773         * class (GetClassBases): Better error 60 report.
3774         (EventProperty): Disabled warning 67 detection.
3775
3776 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3777
3778         Fix bug #60324
3779         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3780
3781         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3782         precise values.
3783
3784 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3785
3786         Fix bug #49488
3787         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3788
3789         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3790
3791 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3792
3793         * attribute.cs (Attribute.Resolve): Refine error reporting and
3794         report a cs0117 if the identifier does not exist, to distinguish
3795         from 0617 which is a miss-use of the actual identifier.
3796
3797         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3798         between cs0070 and cs0079.
3799
3800         * class.cs (MemberBase.DoDefine): When reporting a wrong
3801         accessibility level, we use MethodCore to compare instead of
3802         Method (this was a regression in some refactoring effort).
3803
3804         So now we correctly report cs0056 again.
3805
3806         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3807         testing the target_type (which was known to be object_type) and
3808         not the source type (which is anonymous_method).
3809
3810         Fixed reporting of error cs1660.
3811
3812         * expression.cs (UserCast.Source): Expose the underlying cast.
3813
3814         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3815         allowed types to find a match to int32 first (most common).
3816
3817         In addition, it ignores any ImplicitUserConversions that did an
3818         internal implicit conversion (as the switch statement allows only
3819         one integral conversion to exist).
3820
3821         * class.cs (PartialContainer.Create): rename `name' to
3822         `member_name' for clarity.  Then replace the string calls with a
3823         call to MemberName.GetPartialName, as now using
3824         MemberName.ToString is an error (this is due to the side effects
3825         it had, that were fixed in the past).
3826
3827         This will restore the error reporting on a number of partial class
3828         errors that were missusing this (and getting an exception as a
3829         results, which is now just a plain textual warning, because
3830         yyparse debug output would crash otherwise).
3831
3832 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3833
3834         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3835
3836 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3837
3838         * rootcontext.cs (LookupType): Make sure to cache lookups that
3839         don't give us a negative result. This saves about 5% of corlib
3840         compilation time.
3841
3842 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3843
3844         * report.cs (AbstractMessage.Print): messages are sent to stderr
3845
3846         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3847         non-interface in the list of interfaces (at this point, either
3848         parent was properly set, or a base class is being listed in the
3849         interfaces section).
3850
3851         This flags error 1722, and resolves the crash from bug 69259.
3852
3853 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3854
3855         * statement.cs (Using.EmitExpressionFinally): make this work right
3856         for valuetypes. Fixes 69926.
3857
3858 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3859
3860         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3861         converted to an enum" here, before we try to change the underlying
3862         type.  This code exists, but it is a different code path than the
3863         one used while encoding constants.
3864
3865         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3866         old bug: when converting from the null literal to a pointer,
3867         return an EmptyCast, not the NullLiteral.
3868
3869         This fixes #69921, the recent null_type changes probably made this
3870         bug more prominent.
3871
3872         (ImplicitReferenceConversionExists): In addition, resynchronized
3873         the code here, so it matches the same code in
3874         ImplicitReferenceConversionExists for the `from any class-type S
3875         to any interface-type T'.
3876         
3877
3878 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3879
3880         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3881
3882 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3883
3884         * cs-parser.jay: Use verbosity accordingly. 
3885
3886 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3887
3888         * expression.cs (Unary.ResolveOperator): Do not report warning;
3889         AddressOf reads from variable.
3890         
3891         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3892
3893 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3894
3895         Fix bug #69462
3896
3897         * attribute.cs (Attributable): Removed CheckTargets.
3898         (Attributes.Emit): Explicit attribute targets are tested here.
3899
3900         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3901         not enabled for interfaces.
3902
3903         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3904         (GetAssemblyName): Ouch next bug there.
3905
3906 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3907
3908         * expression.cs: Error 275 added.
3909         
3910 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3911
3912         Fix bug #69177 (Implemented decimal constant support)
3913
3914         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3915         (BinaryFold): Add DecimalConstant.
3916
3917         * const.cs (Define): Decimal constant 
3918         (is not constant.
3919         (ChangeType): Add decimal type handling.
3920         (LookupConstantValue): Don't set value for decimal type but
3921         emit DecimalConstantAttribute. Needed for constant optimization.
3922
3923         * constant.cs (ToDecimal): New method.
3924         (ConvertToDecimal): New method.
3925         (IntConstant): Implemented ConvertToDecimal.
3926         (DecimalConstant.Emit): Emit optimized version for decimals in
3927         int range.
3928
3929         * expression.cs (ResolveOperator): Changed order of constant
3930         reduction to work correctly with native types which have
3931         overloaded operators.
3932         (ResolveMemberAccess): Extract constant value from attribute
3933         for decimal type.
3934
3935         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3936
3937         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3938         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3939         (ChangeType): Decimal is special.
3940         (TypeToCoreType): Add decimal type.
3941
3942 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3943
3944         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3945         decimal types.
3946
3947 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3948
3949         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3950         test cs1667-5.cs.
3951
3952 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3955
3956         * pending.cs (PendingImplementation): Grab only interfaces.
3957
3958 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3959
3960         * statement.cs (ForeachHelperMethods): Add location member and
3961         error 202 detection.
3962
3963 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3964
3965         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3966         automatically handled by executable.make.
3967         (PROGRAM): Make profile-specific.
3968
3969 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3970
3971         * expression.cs (DoResolveBase): Fixed wrong warning for out
3972         variables.
3973
3974 2004-11-18  Martin Baulig  <martin@ximian.com>
3975
3976         Merged latest changes into gmcs.  Please keep this comment in
3977         here, it makes it easier for me to see what changed in MCS since
3978         the last time I merged.
3979
3980 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3981
3982         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3983         (TypeHandle.GetMemberCache): New.
3984         (TypeHandle.TypeHandle): Update.
3985         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3986         (TypeManager.LookupParentInterfacesCache):
3987         Rename from LookupInterfaceCache.  Optimize slightly.
3988         (TypeManager.MemberLookup_FindMembers): Update.
3989         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3990         multi-type variant.
3991         (AddCacheContents): Rename from AddHashtable.
3992         * class.cs (TypeContainer.parent_container): Remove.
3993         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3994         (TypeContainer.DoDefineMembers): Don't initialize it.
3995         Update to name changes.
3996         
3997 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3998
3999         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4000         that factors the code to check access modifiers on override.  
4001
4002         (PropertyBase): Use the code here.
4003
4004         Patch from Lluis S'anchez, fixes bug #69361.
4005
4006 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4007
4008         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4009         routine that is used to report the use of a captured variable
4010         whose address has been taken.
4011
4012         There are two checks: one when variables are being captured and
4013         the other check is when the address of a variable is taken. 
4014         
4015         (because an anonymous methods might be resolved before *or* after
4016         the address has been taken) and 
4017
4018         * expression.cs (Conditional.DoResolve): Remove the special
4019         casing that Martin added to trueExpr and falseExpr being both
4020         NullLiteral.  We get the right behavior now just by introducing
4021         the null_type into the compiler. 
4022
4023         * convert.cs (ExplicitConversion): Change the code to use
4024         null_type instead of testing `expr is NullLiteral'.
4025         (ImplicitConversionStandard): use null_type too.
4026         (ImplicitReferenceConversionExists): use null_type too.
4027         (ImplicitReferenceConversion): use null_type too.
4028
4029         * literal.cs: The type of `NullLiteral' is now null_type instead
4030         of object_type. 
4031         (Resolve): Set the type here.
4032
4033         * typemanager.cs: Introduce null_type.
4034
4035 2004-11-17  Martin Baulig  <martin@ximian.com>
4036
4037         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4038         direction, like FindMembers() does.  Fixes #69546, testcase is in
4039         test-315.cs.    
4040
4041 2004-11-16  Martin Baulig  <martin@ximian.com>
4042
4043         This is based on a patch from Marek Safar, see bug #69082.
4044         Fixes bugs #63705 and #67130.
4045
4046         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4047         method; create a MemberCache for an interface type and cache the
4048         result.
4049
4050         * decl.cs (IMemberContainer.ParentContainer): Removed.
4051         (IMemberContainer.ParentCache): New property.
4052         (MemberCache.SetupCacheForInterface): Removed.
4053         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4054         to create a cache for an interface's "parent".
4055
4056         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4057         interfaces too.
4058
4059 2004-11-16  Martin Baulig  <martin@ximian.com>
4060
4061         Merged back from gmcs; these changes already went into gmcs a
4062         couple of weeks ago.
4063
4064         * typemanager.cs
4065         (TypeManager.AddUserType): Removed the `ifaces' argument.
4066         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4067         `TypeExpr []'.
4068         (TypeManager.AddUserInterface): Removed.
4069         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4070         `TypeExpr []'.
4071         (TypeManager.GetInterfaces): Likewise.
4072         (TypeManager.GetExplicitInterfaces): Likewise.
4073
4074         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4075
4076         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4077         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4078
4079 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4080
4081         * statement.cs: Avoid adding bools to a hashtable.
4082
4083 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4084
4085         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4086         calling an unsafe method from a safe location.
4087
4088 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4089
4090         Fix #69167
4091         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4092
4093 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4094
4095         * namespace.cs (VerifyUsing): use GetPartialName instead of
4096         ToString. 
4097
4098 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4099
4100         * statement.cs (Return.Resolve): Fix regression in typo: if
4101         `in_exc', we have to request a NeedReturnLabel, this was a typo
4102         introduced in the anonymous method check-in.  Fixes #69131.
4103
4104         * Indexers were using the ShortName when defining themselves,
4105         causing a regression in the compiler bootstrap when applying the
4106         patch from 2004-11-02 (first part), now they use their full name
4107         and the bug is gone.
4108
4109 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4110
4111         * driver.cs: Strip the path from the names of embedded resources. Fixes
4112         #68519.
4113
4114 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4115
4116         Fix error message regression: cs0104-2.cs.
4117         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4118         (AliasEntry.Resolve): Update.
4119         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4120         'silent' flag.
4121         (RootContext.LookupType): Update.
4122
4123 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4124
4125         * cs-parser.jay: Add support for handling accessor modifiers
4126         * class: Add support port accessor modifiers and error checking,
4127         define PropertyMethod.Define as virtual (not abstract anymore)
4128         * ecore.cs: Add checking for proeprties access with access modifiers
4129         * iterators.cs: Modify Accessor constructor call based in the modified
4130         constructor
4131 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4132
4133         * expression.cs (StringConcat): Handle being called twice,
4134         as when we have a concat in a field init with more than two
4135         ctors in the class
4136
4137 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4138
4139         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4140         special case explicit implementations, we should always produce
4141         the .property or .event declaration.
4142         
4143         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4144         since it will not return correct data if people use this
4145         unresolved in the presence of using statements (see test-313).
4146
4147         * class.cs (MethodData.Define): If we are an explicit interface
4148         implementation, set the method name to the full name of the
4149         interface plus the name of the method.  
4150
4151         Notice that using the method.MethodName.GetFullName() does not
4152         work, as it will only contain the name as declared on the source
4153         file (it can be a shorthand in the presence of using statements)
4154         and not the fully qualifed type name, for example:
4155
4156         using System;
4157
4158         class D : ICloneable {
4159                 object ICloneable.Clone ()  {
4160                 }
4161         }
4162
4163         Would produce a method called `ICloneable.Clone' instead of
4164         `System.ICloneable.Clone'.
4165
4166         * namespace.cs (Alias.Resolve): Use GetPartialName.
4167         
4168 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4169
4170         * cs-parser.jay: Add error 1055 report.
4171
4172 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4173
4174         * assign.cs (Assign.DoResolve): Only do the transform of
4175         assignment into a New if the types are compatible, if not, fall
4176         through and let the implicit code deal with the errors and with
4177         the necessary conversions. 
4178
4179 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4180
4181         * cs-parser.jay: Add error 1031 report.
4182
4183         * cs-tokenizer.cs: Add location for error 1038.
4184
4185 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4186
4187         * cs-parser.jay: Add error 1016 report.
4188
4189 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4190
4191         * cs-parser.jay: Add errors 1575,1611 report.
4192
4193 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4194
4195         * cs-parser.jay: Add error 1001 report.
4196
4197 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4198
4199         Fix #68850
4200         * attribute.cs (GetMarshal): Add method argument for
4201         caller identification.
4202
4203         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4204         agument for GetMarshal and RuntimeMissingSupport.
4205
4206 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4207
4208         * attribute.cs (ExtractSecurityPermissionSet): Removed
4209         TypeManager.code_access_permission_type.
4210
4211         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4212
4213 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4214
4215         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4216         for obsolete use of a variable here.   Fixes regression on errors
4217         cs0619-25 and cs0619-26.
4218
4219 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4220
4221         Fix #62358, implemented security attribute encoding.
4222
4223         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4224         Tests permitted SecurityAction for assembly or other types.
4225         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4226         data from SecurityPermissionAttribute to PermisionSet class.
4227
4228         * class.cs (ApplyAttributeBuilder): Added special handling
4229         for System.Security.Permissions.SecurityAttribute based types.
4230
4231         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4232         special handling for System.Security.Permissions.SecurityAttribute
4233         based types.
4234
4235         * enum.cs (ApplyAttributeBuilder): Added special handling
4236         for System.Security.Permissions.SecurityAttribute based types.
4237
4238         * parameter.cs (ApplyAttributeBuilder): Added special handling
4239         for System.Security.Permissions.SecurityAttribute based types.
4240
4241         * rootcontext.cs: Next 2 core types.
4242
4243         * typemanager.cs (TypeManager.security_permission_attr_type):
4244         Built in type for the SecurityPermission Attribute.
4245         (code_access_permission_type): Build in type.
4246
4247 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4248
4249         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4250         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4251         all of this information into
4252         EmitContext.EmitCapturedVariableInstance.
4253         
4254         * codegen.cs (EmitCapturedVariableInstance): move here the
4255         funcionality of emitting an ldarg.0 in the presence of a
4256         remapping.   This centralizes the instance emit code.
4257
4258         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4259         then emit a load of this: it means that we have reached the
4260         topmost ScopeInfo: the one that contains the pointer to the
4261         instance of the class hosting the anonymous method.
4262
4263         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4264         captures to the topmost CaptureContext.
4265
4266 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4267
4268         * expression.cs (LocalVariableReference): Move the knowledge about
4269         the iterators into codegen's EmitCapturedVariableInstance.
4270
4271 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4272
4273         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4274         all code paths return a value from an anonymous method (it is the
4275         same as the 161 error, but for anonymous methods).
4276
4277 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4278
4279         The introduction of anonymous methods in the compiler changed
4280         various ways of doing things in the compiler.  The most
4281         significant one is the hard split between the resolution phase
4282         and the emission phases of the compiler.
4283
4284         For instance, routines that referenced local variables no
4285         longer can safely create temporary variables during the
4286         resolution phase: they must do so from the emission phase,
4287         since the variable might have been "captured", hence access to
4288         it can not be done with the local-variable operations from the runtime.
4289         
4290         * statement.cs 
4291
4292         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4293         is a toplevel block.
4294
4295         (ToplevelBlock): A new kind of Block, these are the blocks that
4296         are created by the parser for all toplevel method bodies.  These
4297         include methods, accessors and anonymous methods.
4298
4299         These contain some extra information not found in regular blocks:
4300         A pointer to an optional CaptureContext (for tracking captured
4301         local variables and parameters).  A pointer to the parent
4302         ToplevelBlock.
4303         
4304         (Return.Resolve): Catch missmatches when returning a value from an
4305         anonymous method (error 1662).
4306         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4307         phase.
4308
4309         (Break.Resolve): ditto.
4310
4311         (SwitchLabel): instead of defining the labels during the
4312         resolution phase, we now turned the public ILLabel and ILLabelCode
4313         labels into methods called GetILLabelCode() and GetILLabel() that
4314         only define the label during the Emit phase.
4315
4316         (GotoCase): Track the SwitchLabel instead of the computed label
4317         (its contained therein).  Emit the code by using
4318         SwitchLabel.GetILLabelCode ().
4319
4320         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4321         whether the Local has been captured or not.
4322
4323         (LocalInfo.IsCaptured): New property, used to tell whether the
4324         local has been captured.
4325         
4326         * anonymous.cs: Vastly updated to contain the anonymous method
4327         support.
4328
4329         The main classes here are: CaptureContext which tracks any
4330         captured information for a toplevel block and ScopeInfo used to
4331         track the activation frames for various local variables.   
4332
4333         Each toplevel block has an optional capture context associated
4334         with it.  When a method contains an anonymous method both the
4335         toplevel method and the anonymous method will create a capture
4336         context.   When variables or parameters are captured, they are
4337         recorded on the CaptureContext that owns them, for example:
4338
4339         void Demo () {
4340              int a;
4341              MyDelegate d = delegate {
4342                  a = 1;
4343              }
4344         }
4345
4346         Here `a' will be recorded as captured on the toplevel
4347         CapturedContext, the inner captured context will not have anything
4348         (it will only have data if local variables or parameters from it
4349         are captured in a nested anonymous method.
4350
4351         The ScopeInfo is used to track the activation frames for local
4352         variables, for example:
4353
4354         for (int i = 0; i < 10; i++)
4355                 for (int j = 0; j < 10; j++){
4356                    MyDelegate d = delegate {
4357                         call (i, j);
4358                    }
4359                 }
4360
4361         At runtime this captures a single captured variable `i', but it
4362         captures 10 different versions of the variable `j'.  The variable
4363         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4364         recorded on a child.  
4365
4366         The toplevel ScopeInfo will also track information like the `this'
4367         pointer if instance variables were referenced (this is necessary
4368         as the anonymous method lives inside a nested class in the host
4369         type of the method). 
4370
4371         (AnonymousMethod): Expanded to track the Toplevel, implement
4372         `AnonymousMethod.Compatible' to tell whether an anonymous method
4373         can be converted to a target delegate type. 
4374
4375         The routine now also produces the anonymous method content
4376
4377         (AnonymousDelegate): A helper class that derives from
4378         DelegateCreation, this is used to generate the code necessary to
4379         produce the delegate for the anonymous method that was created. 
4380
4381         * assign.cs: API adjustments for new changes in
4382         Convert.ImplicitStandardConversionExists.
4383
4384         * class.cs: Adjustments to cope with the fact that now toplevel
4385         blocks are of type `ToplevelBlock'. 
4386
4387         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4388         insteda of standard blocks.
4389
4390         Flag errors if params arguments are passed to anonymous methods.
4391
4392         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4393         `CurrentAnonymousMethod' which points to the current Anonymous
4394         Method.  The variable points to the AnonymousMethod class that
4395         holds the code being compiled.  It is set in the new EmitContext
4396         created for the anonymous method.
4397
4398         (EmitContext.Phase): Introduce a variable and an enumeration to
4399         assist in enforcing some rules about when and where we are allowed
4400         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4401         only one that enfonces this right now).
4402
4403         (EmitContext.HaveCaptureInfo): new helper method that returns
4404         whether we have a CapturedContext initialized.
4405
4406         (EmitContext.CaptureVariable): New method used to register that a
4407         LocalInfo must be flagged for capturing. 
4408
4409         (EmitContext.CapturedParameter): New method used to register that a
4410         parameters must be flagged for capturing. 
4411         
4412         (EmitContext.CapturedField): New method used to register that a
4413         field must be flagged for capturing. 
4414
4415         (EmitContext.HaveCapturedVariables,
4416         EmitContext.HaveCapturedFields): Return whether there are captured
4417         variables or fields. 
4418
4419         (EmitContext.EmitMethodHostInstance): This is used to emit the
4420         instance for the anonymous method.  The instance might be null
4421         (static methods), this (for anonymous methods that capture nothing
4422         and happen to live side-by-side with the current method body) or a
4423         more complicated expression if the method has a CaptureContext.
4424
4425         (EmitContext.EmitTopBlock): Routine that drives the emission of
4426         code: it will first resolve the top block, then emit any metadata
4427         and then emit the code.  The split is done so that we can extract
4428         any anonymous methods and flag any captured variables/parameters.
4429         
4430         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4431         during this phase, the ILGenerator should not be used as labels
4432         and local variables declared here might not be accessible to any
4433         code that is part of an anonymous method.  
4434
4435         Exceptions to this include the temporary variables that are
4436         created by some statements internally for holding temporary
4437         variables. 
4438         
4439         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4440         metadata for a cb
4441
4442         (EmitContext.TemporaryReturn): This method is typically called
4443         from the Emit phase, and its the only place where we allow the
4444         ReturnLabel to be defined other than the EmitMeta.  The reason is
4445         that otherwise we would have to duplicate a lot of logic in the
4446         Resolve phases of various methods that today is on the Emit
4447         phase. 
4448
4449         (EmitContext.NeedReturnLabel): This no longer creates the label,
4450         as the ILGenerator is not valid during the resolve phase.
4451
4452         (EmitContext.EmitThis): Extended the knowledge in this class to
4453         work in anonymous methods in addition to iterators. 
4454
4455         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4456         code is necessary on the stack to access the instance to a local
4457         variable (the variable will be accessed as a field).
4458
4459         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4460         EmitContext.EmitAddressOfParameter): Routines to support
4461         parameters (not completed at this point). 
4462         
4463         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4464         will also remove the parameters.
4465
4466         * convert.cs (Convert): Define a `ConstantEC' which points to a
4467         null.  This is just to prefity some code that uses
4468         ImplicitStandardConversion code and do not have an EmitContext
4469         handy.
4470
4471         The idea is to flag explicitly that at that point in time, it is
4472         known that the conversion will not trigger the delegate checking
4473         code in implicit conversions (which requires a valid
4474         EmitContext). 
4475
4476         Everywhere: pass new EmitContext parameter since
4477         ImplicitStandardConversionExists now requires it to check for
4478         anonymous method conversions. 
4479
4480         (Convert.ImplicitStandardConversionExists): If the type of an
4481         expression is the anonymous_method_type, and the type is a
4482         delegate, we invoke the AnonymousMethod.Compatible method to check
4483         whether an implicit conversion is possible. 
4484
4485         (Convert.ImplicitConversionStandard): Only do implicit method
4486         group conversions if the language level is not ISO_1.
4487
4488         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4489         MethodInfo for the Invoke method.  used by Delegate and
4490         AnonymousDelegate.
4491
4492         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4493         method conversions if the target type is a delegate.
4494
4495         Removed extra debugging nops.
4496
4497         (LocalVariableReference): Turn the `local_info' into a public
4498         field. 
4499
4500         Add `prepared' field, the same hack used for FieldExprs to cope
4501         with composed assignments, as Local variables do not necessarily
4502         operate purely on the stack as they used to: they can be captured
4503         fields. 
4504
4505         Add `temp' for a temporary result, like fields.
4506
4507         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4508
4509         It now copes with Local variables that are captured and emits the
4510         proper instance variable to load it from a field in the captured
4511         case. 
4512
4513         (ParameterReference.DoResolveBase): During the resolve phase,
4514         capture parameters if we are in an anonymous method.
4515
4516         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4517         anonymous method, use the EmitContext helper routines to emit the
4518         parameter reference.
4519
4520         * iterators.cs: Set RemapToProxy to true/false during the
4521         EmitDispose class.
4522
4523         * parameters.cs (GetParameterByName): New helper method. 
4524
4525         * typemanager.cs (anonymous_method_type) a new type that
4526         represents an anonyous method.  This is always an internal type,
4527         used as a fencepost to test against the anonymous-methodness of an
4528         expression. 
4529         
4530 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4531
4532         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4533         561 report.
4534         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4535
4536 2004-10-18  Martin Baulig  <martin@ximian.com>
4537
4538         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4539         `Type' directly, but call ResolveType() on it.
4540         (Catch.Resolve): Likewise.
4541         (Foreach.Resolve): Likewise.
4542
4543 2004-10-18  Martin Baulig  <martin@ximian.com>
4544
4545         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4546         `Type' directly, but call ResolveType() on it.
4547         (Probe.DoResolve): Likewise.
4548         (ArrayCreation.LookupType): Likewise.
4549         (TypeOf.DoResolve): Likewise.
4550         (SizeOf.DoResolve): Likewise.
4551
4552 2004-10-18  Martin Baulig  <martin@ximian.com>
4553
4554         * expression.cs (Invocation.BetterFunction): Put back
4555         TypeManager.TypeToCoreType().
4556
4557 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4558
4559         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4560         the ResolveType.
4561
4562 2004-10-18  Martin Baulig  <martin@ximian.com>
4563
4564         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4565         `Type' directly, but call ResolveType() on it.
4566
4567 2004-10-18  Martin Baulig  <martin@ximian.com>
4568
4569         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4570         `Type' directly, but call ResolveType() on it.
4571         (MemberBase.DoDefine): Likewise.
4572
4573         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4574         `Type' directly, but call ResolveType() on it.
4575         (ComposedCast.DoResolveAsTypeStep): Likewise.
4576
4577         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4578         `Type' directly, but call ResolveType() on it.
4579
4580 2004-10-17  John Luke  <john.luke@gmail.com>
4581
4582         * class.cs (Operator.GetSignatureForError): use CSharpName
4583
4584         * parameter.cs (Parameter.GetSignatureForError): Returns
4585         correct name even if was not defined.
4586
4587 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4588
4589         Fix #65816.
4590         * class.cs (TypeContainer.EmitContext): New property.
4591         (DefineNestedTypes): Create an emitcontext for each part.
4592         (MethodCore.DoDefineParameters): Use container's emitcontext.
4593         Pass type array to InternalParameters.
4594         (MemberBase.DoDefine): Use container's emitcontext.
4595         (FieldMember.Define): Likewise.
4596         (Event.Define): Likewise.
4597         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4598         Pass type array to InternalParameters.
4599         (SetIndexerMethod.GetParameterInfo): Likewise.
4600         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4601         * delegate.cs (Define): Pass emitcontext to
4602         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4603         array to InternalParameters.
4604         * expression.cs (ParameterReference.DoResolveBase): Pass
4605         emitcontext to GetParameterInfo.
4606         (ComposedCast.DoResolveAsTypeStep): Remove check on
4607         ec.ResolvingTypeTree.
4608         * parameter.cs (Parameter.Resolve): Change argument to
4609         EmitContext.  Use ResolveAsTypeTerminal.
4610         (Parameter.GetSignature): Change argument to EmitContext.
4611         (Parameters.ComputeSignature): Likewise.
4612         (Parameters.ComputeParameterTypes): Likewise.
4613         (Parameters.GetParameterInfo): Likewise.
4614         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4615         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4616         * support.cs (InternalParameters..ctor): Remove variant that takes
4617         a DeclSpace.
4618         * typemanager.cs (system_intptr_expr): New.
4619         (InitExpressionTypes): Initialize it.
4620
4621 2004-10-12  Chris Toshok  <toshok@ximian.com>
4622
4623         * cs-parser.jay: fix location for try_statement and catch_clause.
4624
4625 2004-10-11  Martin Baulig  <martin@ximian.com>
4626
4627         * report.cs: Don't make --fatal abort on warnings, we have
4628         -warnaserror for that.
4629
4630 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4631
4632         More DeclSpace.ResolveType avoidance.
4633         * decl.cs (MemberCore.InUnsafe): New property.
4634         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4635         with newly created EmitContext.
4636         (FieldMember.Define): Likewise.
4637         * delegate.cs (Delegate.Define): Likewise.
4638         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4639         only if normal name-lookup fails.
4640         (TypeExpr.DoResolve): Enable error-checking.
4641         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4642         (SizeOf.DoResolve): Likewise.
4643         (ComposedCast.DoResolveAsTypeStep): Likewise.
4644         (StackAlloc.DoResolve): Likewise.
4645         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4646         (Block.Unsafe): New property.
4647         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4648         (Unsafe): Set 'unsafe' flag of contained block.
4649         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4650         (Fixed.Resolve): Likewise.
4651         (Catch.Resolve): Likewise.
4652         (Using.ResolveLocalVariableDecls): Likewise.
4653         (Foreach.Resolve): Likewise.
4654
4655 2004-10-05  John Luke <john.luke@gmail.com>
4656
4657         * cs-parser.jay: add location to error CS0175
4658
4659 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4660
4661         * ecore.cs (Expression.Constantity): Add support for turning null
4662         into a constant.
4663
4664         * const.cs (Const.Define): Allow constants to be reference types
4665         as long as the value is Null.
4666
4667 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4668
4669         * namespace.cs (NamespaceEntry.Using): No matter which warning
4670         level is set, check if this namespace name has already been added.
4671
4672 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4673
4674         * expression.cs: reftype [!=]= null should always use br[true,false].
4675         # 67410
4676
4677 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4678
4679         Fix #67108
4680         * attribute.cs: Enum conversion moved to 
4681         GetAttributeArgumentExpression to be applied to the all
4682         expressions.
4683
4684 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4685
4686         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4687         * class.c (TypeContainer.DefineType): Flag error if
4688         base types aren't accessible due to access permissions.
4689         * decl.cs (DeclSpace.ResolveType): Move logic to
4690         Expression.ResolveAsTypeTerminal.
4691         (DeclSpace.ResolveTypeExpr): Thin layer over
4692         Expression.ResolveAsTypeTerminal.
4693         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4694         Refactor code into NestedAccess.  Use it.
4695         (DeclSpace.NestedAccess): New.
4696         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4697         argument to silence errors.  Check access permissions.
4698         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4699         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4700         (Cast.DoResolve): Likewise.
4701         (New.DoResolve): Likewise.
4702         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4703         (TypeOf.DoResolve): Likewise.
4704
4705         * expression.cs (Invocation.BetterConversion): Return the Type of
4706         the better conversion.  Implement section 14.4.2.3 more faithfully.
4707         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4708         section 14.4.2.2 explicit.
4709         (Invocation.OverloadResolve): Update.
4710         (Invocation): Remove is_base field.
4711         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4712         (Invocation.Emit): Likewise.
4713
4714 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4715
4716         * README: Update to changes.
4717
4718 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4719
4720         * cs-parser.jay: Reverted 642 warning fix.
4721
4722 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4723
4724         Fix bug #66615
4725         * decl.cs (FindMemberWithSameName): Indexer can have more than
4726         1 argument.
4727
4728 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4729
4730         * expression.cs (LocalVariableReference.DoResolveLValue):
4731         Do not report warning 219 for out values.
4732         (EmptyExpression.Null): New member to avoid extra allocations.
4733
4734 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4735
4736         * cs-parser.jay: Fix wrong warning 642 report.
4737
4738         * cs-tokenizer.cs (CheckNextToken): New helper;
4739         Inspect next character if is same as expected.
4740
4741 2004-09-23  Martin Baulig  <martin@ximian.com>
4742
4743         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4744         (Convert.ImplicitReferenceConversionExists): Likewise.
4745
4746 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4747
4748         * class.cs (Operator.Define): Add error 448 and 559 report.
4749
4750 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4751
4752         * class.cs (MemberBase.IsTypePermitted): New protected
4753         method for checking error CS0610.
4754
4755 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * class.cs (TypeContainer.HasExplicitLayout): New property
4758         Returns whether container has StructLayout attribute set Explicit.
4759         (FieldMember): New abstract class for consts and fields.
4760         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4761         (Field): Reuse FieldMember.
4762
4763         * const.cs (Const): Reuse FieldMember.
4764
4765         * rootcontext.cs: EmitConstants call moved to class.
4766
4767 2004-09-22  Martin Baulig  <martin@ximian.com>
4768
4769         Thanks to Peter Sestoft for this bug report.
4770
4771         * expression.cs (Conditional): If both the `trueExpr' and the
4772         `falseExpr' is a NullLiteral, return a NullLiteral.
4773
4774 2004-09-22  Martin Baulig  <martin@ximian.com>
4775
4776         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4777         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4778         for the "get_Current" call.
4779
4780 2004-09-22  Martin Baulig  <martin@ximian.com>
4781
4782         Marek and me just fixed one of our oldest bugs: #28562 :-)
4783
4784         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4785
4786         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4787         we're an EnumConstant, just return that.
4788         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4789         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4790         to get the value which'll actually be written into the attribute.
4791         However, we have to use GetValue() to access the attribute's value
4792         in the compiler.        
4793
4794 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4795
4796         * constant.cs (Constant.IsNegative): New abstract property
4797         IsNegative.
4798
4799         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4800         (StackAlloc.DoResolve): Reused IsNegative.
4801
4802 2004-09-21  Martin Baulig  <martin@ximian.com>
4803
4804         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4805         if we're used in an iterator, we may be called from different
4806         methods.
4807
4808         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4809         we actually have an exception block.
4810
4811 2004-09-20  John Luke <jluke@cfl.rr.com>
4812
4813         * class.cs, cs-parser.jay: Improve the error report for 1520:
4814         report the actual line where the error happens, not where the
4815         class was declared.
4816
4817         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4818         Pass location information that was available elsewhere.
4819
4820 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4821
4822         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4823         runtime to delay sign assemblies.
4824
4825 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4826
4827         * cs-parser.jay: Do not report the stack trace, this is barely
4828         used nowadays.
4829
4830 2004-08-22  John Luke  <john.luke@gmail.com>
4831  
4832         * driver.cs : check that a resource id is not already used
4833         before adding it, report CS1508 if it is, bug #63637
4834
4835 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4836
4837         * ecore.cs: Removed dead code.
4838
4839 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4840
4841         * class.cs: Do not report warning CS0067 on the interfaces.
4842
4843 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4844
4845         * cs-parser.jay: Add error 504 report.
4846
4847 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4848
4849         * rootcontext.cs: WarningLevel is 4 by default now.
4850
4851         * statement.cs (Fixed.Resolve): Do not null
4852         VariableInfo.
4853
4854 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4855
4856         Fixed bug #55780
4857         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4858         deep search when property is not virtual.
4859         (PropertyExpr.ResolveAccessors): Make one call for both
4860         accessors.
4861
4862 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4863
4864         Fixed bug #65766
4865         * statement.cs: Error 152 report constains also location.
4866
4867 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4868
4869         Fixed bug #65766
4870         * const.cs: Explicitly set constant as static.
4871
4872 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4873
4874         Fixed bug #64226
4875         * cs-parser.jay: Add error 1017 report.
4876
4877 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4878
4879         Fixed bug #59980, #64224
4880         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4881
4882         * typemanager.cs (IsSpecialMethod): Simplified
4883
4884 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4885
4886         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4887         condition with better params.
4888
4889 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4890
4891         Fixed bug #65238
4892         * attribute.cs (Resolve): Property has to have both
4893         accessors.
4894
4895 2004-09-14  Martin Baulig  <martin@ximian.com>
4896
4897         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4898
4899 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4900
4901         Fixed bug #61902
4902         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4903         called and is obsolete then this member suppress message
4904         when call is inside next [Obsolete] method or type.
4905
4906         * expression.cs: Use TestObsoleteMethodUsage member.
4907
4908 2004-09-14  Martin Baulig  <martin@ximian.com>
4909
4910         * cs-parser.jay: Sync a bit with the GMCS version.
4911
4912 2004-09-14  Martin Baulig  <martin@ximian.com>
4913
4914         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4915         (CSharpParser.yacc_verbose_flag): New public field.
4916
4917         * genericparser.cs: Removed.
4918
4919 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4920
4921         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4922
4923 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4924
4925         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4926
4927 2004-09-10  Martin Baulig  <martin@ximian.com>
4928
4929         Backported my MemberName changes from GMCS into MCS.
4930
4931         - we are now using a special `MemberName' class instead of using
4932         strings; in GMCS, the `MemberName' also contains the type
4933         arguments.
4934
4935         - changed the grammar rules a bit:
4936           * the old `member_name' is now a `namespace_or_type_name':
4937             The rule is that we use `namespace_or_type_name' everywhere
4938             where we expect either a "member name" (GetEnumerator) or a
4939             "member name" with an explicit interface name
4940             (IEnumerable.GetEnumerator).
4941             In GMCS, the explicit interface name may include type arguments
4942             (IEnumerable<T>.GetEnumerator).
4943           * we use `member_name' instead of just `IDENTIFIER' for
4944             "member names":
4945             The rule is that we use `member_name' wherever a member may
4946             have type parameters in GMCS.       
4947
4948         * decl.cs (MemberName): New public class.
4949         (MemberCore.MemberName): New public readonly field.
4950         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4951         (DeclSpace): Likewise.
4952
4953         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4954         * enum.cs (Enum.ctor): Likewise.
4955
4956         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4957         MemberName.     
4958         (AliasEntry.ctor): Take a MemberName, not an Expression.
4959         (AliasEntry.UsingAlias): Likewise.
4960
4961         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4962         (IMethodData.MemberName): Changed type from string to MemberName.
4963         (MemberBase.ExplicitInterfaceName): Likewise.
4964         (AbstractPropertyEventMethod.SetupName): Make this private.
4965         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4966         argument; compute the member name here.
4967         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4968         on the `member.MemberName' and the `prefix'.
4969
4970         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4971         not `type_name'.
4972         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4973         thus, we get a `MemberName' instead of a `string'.  These
4974         declarations may have type parameters in GMCS.
4975         (interface_method_declaration, delegate_declaration): Likewise.
4976         (class_declaration, interface_declaration): Likewise.
4977         (method_header): Use `namespace_or_type_name' instead of
4978         `member_name'.  We may be an explicit interface implementation.
4979         (property_declaration, event_declaration): Likewise.
4980         (member_name): This is now just an `IDENTIFIER', not a
4981         `namespace_or_type_name'.
4982         (type_name, interface_type): Removed.
4983         (namespace_or_type_name): Return a MemberName, not an Expression.
4984         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4985         call GetTypeExpression() on the MemberName to get an expression.
4986         (IndexerDeclaration.interface_type): Changed type from string to
4987         MemberName.
4988         (MakeName): Operate on MemberName's instead of string's.
4989
4990 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4991
4992         Fix bug #55770.
4993         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4994         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4995         lookup to avoid symbols introduced by 'using'.
4996         * rootcontext.cs (NamespaceLookup): Update.
4997
4998 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4999
5000         * class.cs (TypeContainer.DoDefineMembers): Do not call
5001         DefineDefaultConstructor for static classes.
5002
5003 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5004
5005         * attribute.cs (Attribute.Resolve): Add error 653 report.
5006
5007         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5008         report.
5009         (Method.ApplyAttributeBuilder): Add error 685 report.
5010         (Operator.Define): Add error 564 report.
5011
5012         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5013
5014         * expression.cs (Invocation.DoResolve): Add error
5015         245 and 250 report.
5016
5017         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5018         error 674 report.
5019
5020 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5021
5022         * class.cs (ConstructorInitializer.Resolve):
5023         Wrong error number (515->516).
5024
5025 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5026
5027         * class.cs (Indexer.Define): Add error 631 report.
5028
5029 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5030
5031         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5032
5033 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5036
5037 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * cs-parser.jay: Added error CS0241 report.
5040
5041 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5042
5043         * cs-parser.jay (fixed_statement): Introduce a scope for the
5044         declaration in the 'fixed' statement.
5045
5046 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5047
5048         * cs-parser.jay: Added CS0230 error report.
5049
5050 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5053
5054 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * expression.cs (Argument.Resolve): Added error CS0192 and
5057         CS0199 report.
5058
5059 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5060
5061         C# 2.0 #pragma warning feature
5062
5063         * cs-tokenizer.cs (PreProcessPragma): New method; 
5064         Handles #pragma directive.
5065
5066         * report.cs (WarningRegions): New class; Support
5067         class for #pragma warning directive. It tests whether
5068         warning is enabled for a given line.
5069
5070 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5071
5072         * const.cs: Add more descriptive error report, tahnks to
5073         Sebastien. 
5074
5075 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5078
5079 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5080
5081         * expression.cs: Apply patch from Ben: Remove dead code from
5082         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5083         as that code just threw an exception anwyays.
5084
5085         * const.cs: Remove the call to the turnintoconstant, for details
5086         see bug: #63144
5087         
5088         * literal.cs: The type of the null-literal is the null type;  So
5089         we use a placeholder type (literal.cs:System.Null, defined here)
5090         for it.
5091
5092         * expression.cs (Conditional.DoResolve): Remove some old code that
5093         is no longer needed, conversions have been fixed.
5094
5095         (ArrayCreationExpression.DoResolve): Return false if we fail to
5096         resolve the inner expression.
5097
5098 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5099
5100         Fix test-290.cs.
5101         * cs-parser.jay (delegate_declaration): Record a delegate
5102         declaration as a type declaration.
5103         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5104
5105 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5106
5107         * parameter.cs: Do not crash if the type can not be resolved. 
5108
5109         * expression.cs: Report errors with unsafe pointers, fixes #64896
5110
5111 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5112
5113         * expression.cs: Pointer arith always needs to do a conv.i
5114         if the operand is a long. fix 65320
5115
5116 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5117
5118         Fixed cs0619-37.cs, cs0619-38.cs
5119
5120         * enum.cs (GetObsoleteAttribute): Removed.
5121
5122         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5123         on Enum member is double staged. The first is tested member
5124         and then enum.
5125
5126 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5127
5128         Fixed #56986, #63631, #65231
5129
5130         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5131         adds member to name container.
5132         (TypeContainer.AddToTypeContainer): New method, adds type to
5133         name container.
5134         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5135         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5136         AddOperator): Simplified by reusing AddToMemberContainer.
5137         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5138         instead of field.
5139         (Method.CheckForDuplications): Fixed implementation to test all
5140         possibilities.
5141         (MemberBase): Detection whether member is explicit interface
5142         implementation is now in constructor.
5143         (MemberBase.UpdateMemberName): Handles IndexerName.
5144         (Accessor): Changed to keep also location information.
5145         (AbstractPropertyEventMethod): Is derived from MemberCore.
5146         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5147         will be emited or not.
5148         (PropertyBase.AreAccessorsDuplicateImplementation):
5149         Tests whether accessors are not in collision with some method.
5150         (Operator): Is derived from MethodCore to simplify common
5151         operations.
5152
5153         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5154         must be performed.
5155         (DeclSpace.AddToContainer): Adds the member to defined_names
5156         table. It tests for duplications and enclosing name conflicts.
5157
5158         * enum.cs (EnumMember): Clean up to reuse the base structures
5159
5160 2004-09-03  Martin Baulig  <martin@ximian.com>
5161
5162         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5163         into TypeContainer, to make partial classes work again.
5164
5165 2004-09-03  Martin Baulig  <martin@ximian.com>
5166
5167         * rootcontext.cs (RootContext.V2): Removed.
5168
5169 2004-03-23  Martin Baulig  <martin@ximian.com>
5170
5171         * expression.cs (Invocation.OverloadResolve): Added `bool
5172         may_fail' argument and use it instead of the Location.IsNull() hack.
5173
5174 2004-09-03  Martin Baulig  <martin@ximian.com>
5175
5176         Merged latest changes into gmcs.  Please keep this comment in
5177         here, it makes it easier for me to see what changed in MCS since
5178         the last time I merged.
5179
5180 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5181
5182         Fix #61128.
5183         * expression.cs (BetterConversion): Don't allow either conversion 
5184         to be null.  Remove redundant implicit conversion test when 'q ==
5185         null' -- when this function is invoked, we already know that the
5186         implicit conversion exists.
5187         (BetterFunction): Assume that 'best' is non-null.  Remove
5188         redundant reimplementation of IsApplicable when 'best' is null.
5189         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5190         number of arguments.
5191         (IsAncestralType): Extract from OverloadResolve.
5192         (OverloadResolve): Make robust to the MethodGroupExpr being
5193         unsorted.  Implement all the logic of Section 14.5.5.1, and
5194         support overloading of methods from multiple applicable types.
5195         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5196
5197         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5198         (RealError, Warning): Append type of report to related symbol.
5199
5200 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5201
5202         * enum.cs: Fixed CLS-Compliance checks for enum members.
5203         Error tests cs3008-8.cs, cs3014-8.cs
5204
5205 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5206
5207         Fixed bug #62342, #63102
5208         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5209         like ImplementMethod.
5210
5211 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5212
5213         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5214         Fixed bug #65170.
5215
5216 2004-09-02  Martin Baulig  <martin@ximian.com>
5217
5218         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5219         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5220         on the MethodBase.
5221
5222 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5223
5224         C# 2.0 Static classes implemented
5225
5226         * class.cs (TypeContainer): instance_constructors,
5227         initialized_fields, initialized_static_fields,
5228         default_constructor, base_inteface_types are protected to be
5229         accessible from StaticClass.
5230         (TypeContainer.DefineDefaultConstructor): New virtual method
5231         for custom default constructor generating
5232         (StaticClass): New class to handle "Static classes" feature.
5233
5234         * cs-parser.jay: Handle static keyword on class like instance
5235         of StaticClass.
5236
5237         * driver.cs: Added "/langversion" command line switch with two
5238         options (iso-1, default).
5239
5240 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5241
5242         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5243
5244 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5245
5246         * delegate.cs: Style.
5247
5248 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5249
5250         * delegate.cs: Add seperate instance expr field for miguel.
5251
5252 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5253
5254         * PointerArithmetic (Resolve): make sure we are not doing
5255         pointer arith on void*. Also, make sure we are resolved
5256         by not setting eclass until resolve.
5257
5258         All callers: Make sure that PointerArithmetic gets resolved.
5259
5260 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5261
5262         * ArrayCreation (LookupType): If the type does not resolve 
5263         to an array, give an error.
5264
5265 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5266
5267         * statement.cs (Try.Resolve): Fixed bug #64222
5268
5269 2004-08-27  Martin Baulig  <martin@ximian.com>
5270
5271         * class.cs
5272         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5273         crash here.     
5274
5275 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5276
5277         * ecore.cs (Constantify): Get underlying type via
5278         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5279         Windows in special cases.
5280
5281 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5282
5283         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5284         for obtaining also private methods.
5285         (GetRemoveMethod): Used GetRemoveMethod (true)
5286         for obtaining also private methods.
5287
5288 2004-08-24  Martin Baulig  <martin@ximian.com>
5289
5290         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5291         MethodAttributes.HideBySig for operators.
5292
5293 2004-08-23  Martin Baulig  <martin@ximian.com>
5294
5295         Back to the old error reporting system :-)
5296
5297         * report.cs (Message): Removed.
5298         (Report.MessageData, ErrorData, WarningData): Removed.
5299         (Report.Error, Warning): Back to the old system.
5300
5301 2004-08-23  Martin Baulig  <martin@ximian.com>
5302
5303         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5304
5305         * class.cs (TypeContainer.ParentContainer): New public virtual
5306         method; replaces the explicit interface implementation.
5307         (ClassPart.ParentContainer): Override.
5308
5309 2004-08-23  Martin Baulig  <martin@ximian.com>
5310
5311         * statement.cs (Switch): Added support for constant switches; see
5312         #59428 or test-285.cs.
5313
5314 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5315
5316         Fixed bug #62740.
5317         * statement.cs (GetEnumeratorFilter): Removed useless
5318         logic because C# specs is strict. GetEnumerator must be
5319         public.
5320
5321 2004-08-22  Martin Baulig  <martin@ximian.com>
5322
5323         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5324         a switch and may break, reset the barrier.  Fixes #59867.
5325
5326 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5327
5328         CLS-Compliance speed up (~5% for corlib)
5329
5330         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5331         New method. Tests container for CLS-Compliant names
5332
5333         * class.cs (TypeContainer.VerifyClsName): New method.
5334         Checks whether container name is CLS Compliant.
5335         (Constructor): Implements IMethodData.
5336
5337         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5338         low-case table for CLS Compliance test.
5339         (MemberCache.VerifyClsParameterConflict): New method.
5340         Checks method parameters for CS3006 error.
5341
5342         * enum.cs (EnumMember): Is derived from MemberCore.
5343         (Enum.VerifyClsName): Optimized for better performance.
5344
5345 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * report.cs: Renamed Error_T to Error and changed all
5348         references.
5349
5350 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * class.cs (TypeContainer.IndexerArrayList): New inner class
5353         container for indexers.
5354         (TypeContainer.DefaultIndexerName): New constant for default
5355         indexer name. Replaced all "Item" with this constant.
5356         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5357
5358         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5359         DefaultMemberAttribute constructor.
5360
5361 2004-08-05  Martin Baulig  <martin@ximian.com>
5362
5363         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5364         Fix bug #59429.
5365
5366 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5367
5368         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5369         multi platforms problem.
5370
5371         * compiler.csproj: Included shared files.
5372
5373 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5374
5375         Fix bug 60333, 55971 in the more general way
5376         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5377         Added arg_type argument for constant conversion.
5378         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5379
5380 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5381
5382         Fix bug #59760
5383         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5384         OperatorArrayList, MethodCoreArrayList for typecontainer
5385         containers. Changed class member types to these new types.
5386         (MethodArrayList.DefineMembers): Added test for CS0659.
5387
5388 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5389
5390         * cfold.cs: Synchronize the folding with the code in expression.cs
5391         Binary.DoNumericPromotions for uint operands.
5392
5393         * attribute.cs: Revert patch from Raja, it introduced a regression
5394         while building Blam-1.2.1 (hard to isolate a test case).
5395
5396 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5397
5398         Fix for #55382
5399         * class.cs:
5400         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5401         name collision.
5402         (MethodCore.parent_method): New member. The method we're overriding
5403         if this is an override method.
5404         (MethodCore.CheckBase): Moved from Method class and made common.
5405         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5406         private.
5407         (MethodCore.CheckForDuplications): New abstract method. For custom
5408         member duplication search in a container
5409         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5410         method and its return type.
5411         (Event.conflict_symbol): New member. Symbol with same name in the
5412         parent class.
5413
5414         * decl.cs:
5415         (MemberCache.FindMemberWithSameName): New method. The method
5416         is looking for conflict with inherited symbols.
5417
5418 2004-08-04  Martin Baulig  <martin@ximian.com>
5419
5420         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5421
5422         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5423
5424 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5425
5426         * report.cs (Message): New enum for better error, warning reference in
5427         the code.
5428         (MessageData): New inner abstract class. It generally handles printing of
5429         error and warning messages.
5430         Removed unused Error, Warning, Message methods.
5431
5432 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5433
5434         Fix for cs0592-8.cs test
5435         * attribute.cs
5436         (Attributable.ValidAttributeTargets): Made public.
5437         (Attribute.ExplicitTarget): New member for explicit target value.
5438         (Attribute.CheckTargets): Now we translate explicit attribute
5439         target to Target here.
5440
5441 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5442
5443         * ecore.cs (MethodGroupExpr): new IsBase property.
5444
5445         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5446
5447         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5448         rather than an instance expr.
5449
5450         (DelegateCreation.Emit): Use the method group rather than
5451         the instance expression. Also, if you have base.Foo as the
5452         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5453
5454         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5455
5456         (NewDelegate.DoResolve): Only check for the existance of Invoke
5457         if the method is going to be needed. Use MethodGroupExpr.
5458
5459         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5460
5461         * expression.cs: For pointer arith., make sure to use
5462         the size of the type, not the size of the pointer to
5463         the type.
5464
5465 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5466
5467         Fix for #60722
5468         * class.cs (Class): Added error CS0502 test.
5469
5470 2004-08-03  John Luke  <jluke@cfl.rr.com>
5471             Raja R Harinath  <rharinath@novell.com>
5472
5473         Fix for #60997.
5474         * attribute.cs (Attribute.complained_before): New flag.
5475         (Attribute.ResolveType, Attribute.Resolve),
5476         (Attribute.DefinePInvokeMethod): Set it.
5477         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5478         
5479 2004-08-03  Martin Baulig  <martin@ximian.com>
5480
5481         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5482         use a user-defined operator; we still need to do numeric
5483         promotions in case one argument is a builtin type and the other
5484         one has an implicit conversion to that type.  Fixes #62322.
5485
5486 2004-08-02  Martin Baulig  <martin@ximian.com>
5487
5488         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5489         (LocalInfo.IsThis): New public property.
5490         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5491
5492 2004-08-01  Martin Baulig  <martin@ximian.com>
5493
5494         * class.cs (TypeContainer.GetClassBases): Don't set the default
5495         here since we may get called from GetPartialBases().
5496         (TypeContainer.DefineType): If GetClassBases() didn't return a
5497         parent, use the default one.
5498
5499 2004-07-30  Duncan Mak  <duncan@ximian.com>
5500
5501         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5502
5503 2004-07-30  Martin Baulig  <martin@ximian.com>
5504
5505         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5506
5507         * class.cs (SourceMethod): New public class, derive from the
5508         symbol writer's ISourceMethod.
5509         (Method): Use the new symbol writer API.
5510
5511         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5512         as argument and use the new symbol writer.
5513
5514         * location.cs
5515         (SourceFile): Implement the symbol writer's ISourceFile.
5516         (Location.SymbolDocument): Removed.
5517         (Location.SourceFile): New public property.
5518
5519         * symbolwriter.cs: Use the new symbol writer API.
5520
5521 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5522
5523         * Makefile (install-local): Remove.  Functionality moved to
5524         executable.make.
5525
5526 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5527
5528         * Makefile: Install mcs.exe.config file together with mcs.exe.
5529         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5530         correct runtime version.
5531         
5532 2004-07-25  Martin Baulig  <martin@ximian.com>
5533
5534         * class.cs
5535         (TypeContainer.RegisterOrder): Removed, this was unused.
5536         (TypeContainer, interface_order): Removed.
5537         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5538         TypeContainer as argument since we can also be called with a
5539         `PartialContainer' for a partial class/struct/interface.
5540         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5541         of checking whether we're an `Interface' - we could be a
5542         `PartialContainer'.
5543         (PartialContainer.Register): Override; call
5544         AddClass()/AddStruct()/AddInterface() on our parent.
5545
5546         * cs-parser.jay (interface_member_declaration): Add things to the
5547         `current_container', not the `current_class'.
5548
5549         * rootcontext.cs (RegisterOrder): The overloaded version which
5550         takes an `Interface' was unused, removed.
5551
5552         * typemanager.cs (TypeManager.LookupInterface): Return a
5553         `TypeContainer', not an `Interface'.
5554         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5555         contain a `PartialContainer' for an interface, so check it's
5556         `Kind' to figure out what it is.
5557
5558 2004-07-25  Martin Baulig  <martin@ximian.com>
5559
5560         * class.cs (Class.DefaultTypeAttributes): New public constant.
5561         (Struct.DefaultTypeAttributes): Likewise.
5562         (Interface.DefaultTypeAttributes): Likewise.
5563         (PartialContainer.TypeAttr): Override this and add the
5564         DefaultTypeAttributes.
5565
5566 2004-07-25  Martin Baulig  <martin@ximian.com>
5567
5568         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5569         we can just use the `Parent' field instead.
5570
5571 2004-07-25  Martin Baulig  <martin@ximian.com>
5572
5573         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5574
5575 2004-07-25  Martin Baulig  <martin@ximian.com>
5576
5577         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5578         our parts before defining any methods.
5579         (TypeContainer.VerifyImplements): Make this virtual.
5580         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5581         on our PartialContainer.
5582
5583 2004-07-25  Martin Baulig  <martin@ximian.com>
5584
5585         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5586
5587         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5588         argument, we can just use the `Parent' field instead.
5589
5590         * class.cs
5591         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5592         (MemberBase.DoDefine): Likewise.
5593
5594 2004-07-24  Martin Baulig  <martin@ximian.com>
5595
5596         * decl.cs (MemberCore.Parent): New public field.
5597         (DeclSpace.Parent): Moved to MemberCore.
5598
5599         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5600         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5601         parent's .ctor.
5602         (FieldBase, Field, Operator): Likewise.
5603         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5604         (EventField, Event): Likewise.
5605
5606 2004-07-23  Martin Baulig  <martin@ximian.com>
5607
5608         * class.cs (PartialContainer): New public class.
5609         (ClassPart): New public class.
5610         (TypeContainer): Added support for partial classes.
5611         (TypeContainer.GetClassBases): Splitted some of the functionality
5612         out into GetNormalBases() and GetPartialBases().
5613
5614         * cs-tokenizer.cs (Token.PARTIAL): New token.
5615         (Tokenizer.consume_identifier): Added some hacks to recognize
5616         `partial', but only if it's immediately followed by `class',
5617         `struct' or `interface'.
5618
5619         * cs-parser.jay: Added support for partial clases.
5620
5621 2004-07-23  Martin Baulig  <martin@ximian.com>
5622
5623         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5624         a `DeclSpace' and also made it readonly.
5625         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5626         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5627         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5628
5629         * cs-parser.jay: Pass the `current_class', not the
5630         `current_container' (at the moment, this is still the same thing)
5631         to a new Method, Property, Event, Indexer or Constructor.
5632
5633 2004-07-23  Martin Baulig  <martin@ximian.com>
5634
5635         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5636         and removed the `current_interface' one.
5637         (struct_declaration, class_declaration, interface_declaration):
5638         Set `current_class' to the newly created class/struct/interface;
5639         set their `Bases' and call Register() before parsing their body.
5640
5641 2004-07-23  Martin Baulig  <martin@ximian.com>
5642
5643         * class.cs (Kind): New public enum.
5644         (TypeContainer): Made this class abstract.
5645         (TypeContainer.Kind): New public readonly field.
5646         (TypeContainer.CheckDef): New public method; moved here from
5647         cs-parser.jay.
5648         (TypeContainer.Register): New public abstract method.
5649         (TypeContainer.GetPendingImplementations): New public abstract
5650         method.
5651         (TypeContainer.GetClassBases): Removed the `is_class' and
5652         `is_iface' parameters.
5653         (TypeContainer.DefineNestedTypes): Formerly known as
5654         DoDefineType().
5655         (ClassOrStruct): Made this class abstract.
5656
5657         * tree.cs (RootTypes): New public type. 
5658
5659 2004-07-20  Martin Baulig  <martin@ximian.com>
5660
5661         * tree.cs (Tree.RecordNamespace): Removed.
5662         (Tree.Namespaces): Removed.
5663
5664         * rootcontext.cs (RootContext.IsNamespace): Removed.
5665
5666         * cs-parser.jay (namespace_declaration): Just create a new
5667         NamespaceEntry here.
5668
5669 2004-07-20  Martin Baulig  <martin@ximian.com>
5670
5671         * statement.cs (ExceptionStatement): New abstract class.  This is
5672         now used as a base class for everyone who's using `finally'.
5673         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5674         our local variables before using them.
5675
5676         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5677         virtual method.  This is used by Yield.Resolve() to "steal" an
5678         outer block's `finally' clauses.
5679         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5680         argument.
5681
5682         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5683         version which takes an ExceptionStatement.  This version must be
5684         used to create exception branchings.
5685
5686         * iterator.cs
5687         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5688         (Iterator.EmitMoveNext): Added exception support; protect the
5689         block with a `fault' clause, properly handle 'finally' clauses.
5690         (Iterator.EmitDispose): Run all the `finally' clauses here.
5691
5692 2004-07-20  Martin Baulig  <martin@ximian.com>
5693
5694         * iterator.cs: This is the first of a set of changes in the
5695         iterator code.  Match the spec more closely: if we're an
5696         IEnumerable, then GetEnumerator() must be called.  The first time
5697         GetEnumerator() is called, it returns the current instance; all
5698         subsequent invocations (if any) must create a copy.
5699
5700 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5701
5702         * expression.cs: Resolve the constant expression before returning
5703         it. 
5704
5705 2004-07-19  Martin Baulig  <martin@ximian.com>
5706
5707         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5708         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5709         the return type of the new EmitContext.
5710
5711 2004-07-18  Martin Baulig  <martin@ximian.com>
5712
5713         * class.cs (Property.Define): Fix iterators.
5714
5715         * iterators.cs (Iterator.Define): Moved the
5716         `container.AddInterator (this)' call here from the .ctor; only do
5717         it if we resolved successfully.
5718
5719 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5720
5721         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5722         `true' for preprocessing directives that we parse.  The return
5723         value indicates whether we should return to regular tokenizing or
5724         not, not whether it was parsed successfully.
5725
5726         In the past if we were in: #if false ... #line #endif, we would
5727         resume parsing after `#line'.  See bug 61604.
5728
5729         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5730         building: IsEnumType should return true only for enums, not for
5731         enums or System.Enum itself.  This fixes #61593.
5732
5733         Likely what happened is that corlib was wrong: mcs depended on
5734         this bug in some places.  The bug got fixed, we had to add the
5735         hack, which caused bug 61593.
5736
5737         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5738         that was a workaround for the older conditions.
5739
5740 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5741
5742         * assign.cs: IAssignMethod has a new interface, as documented
5743         inline. All assignment code now uses this new api.
5744
5745         * ecore.cs, expression.cs: All classes which implement
5746         IAssignMethod now use the new interface.
5747
5748         * expression.cs (Invocation): add a hack to EmitCall so that
5749         IndexerAccess can be the target of a compound assignment without
5750         evaluating its arguments twice.
5751
5752         * statement.cs: Handle changes in Invocation api.
5753
5754 2004-07-16  Martin Baulig  <martin@ximian.com>
5755
5756         * iterators.cs: Rewrote this.  We're now using one single Proxy
5757         class for both the IEnumerable and the IEnumerator interface and
5758         `Iterator' derives from Class so we can use the high-level API.
5759
5760         * class.cs (TypeContainer.AddIterator): New method.
5761         (TypeContainer.DoDefineType): New protected virtual method, which
5762         is called from DefineType().
5763         (TypeContainer.DoDefineMembers): Call DefineType() and
5764         DefineMembers() on all our iterators.
5765         (TypeContainer.Emit): Call Emit() on all our iterators.
5766         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5767
5768         * codegen.cs (EmitContext.CurrentIterator): New public field.
5769
5770 2004-07-15  Martin Baulig  <martin@ximian.com>
5771
5772         * typemanager.cs
5773         (TypeManager.not_supported_exception_type): New type.   
5774
5775 2004-07-14  Martin Baulig  <martin@ximian.com>
5776
5777         * iterators.cs: Use real error numbers.
5778
5779 2004-07-14  Martin Baulig  <martin@ximian.com>
5780
5781         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5782         requires this to be a System.Collection.IEnumerable and not a
5783         class implementing that interface.
5784         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5785
5786 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * class.cs: Fixed previous fix, it broke some error tests.
5789
5790 2004-07-12  Martin Baulig  <martin@ximian.com>
5791
5792         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5793         Fixes #61293.
5794
5795 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5796
5797         * assign.cs (LocalTemporary): Add new argument: is_address,If
5798         `is_address' is true, then the value that we store is the address
5799         to the real value, and not the value itself.
5800         
5801         * ecore.cs (PropertyExpr): use the new local temporary
5802         stuff to allow us to handle X.Y += z (where X is a struct)
5803
5804 2004-07-08  Martin Baulig  <martin@ximian.com>
5805
5806         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5807         not always return, just like we're doing in Using.Resolve().
5808
5809 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5810
5811         * cs-parser.jay (fixed_statement): flag this as Pinned.
5812
5813 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5814
5815         * typemanager.cs (TypeManager): Removed MakePinned method, this
5816         mechanism is replaced with the .NET 2.x compatible mechanism of
5817         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5818
5819         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5820         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5821         `IsFixed' property which has a different meaning.
5822
5823 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5824
5825         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5826         visible from inside a nested class, not just the names of the
5827         immediately enclosing class.
5828         Fix for bug #60730.
5829
5830 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5831
5832         * expression.cs (BetterConversion): Remove buggy special-case
5833         handling of "implicit constant expression conversions".  At this
5834         point, we already know that the conversion is possible -- we're
5835         only checking to see which is better.
5836
5837 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5838
5839         * cs-parser.jay: Added error CS0210 test.
5840
5841 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5842
5843         * cs-parser.jay: Added error CS0134 test.
5844
5845 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5846
5847         Fix bug #52507
5848         * cs-parser.jay: Added error CS0145 test.
5849
5850 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5851
5852         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5853
5854 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5855         
5856         * expression.cs (StackAlloc.Resolve): The argument may not
5857         be a constant; deal with this case.
5858         
5859 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5860
5861         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5862         GetIndexerAttributeValue.
5863         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5864
5865         * class.cs (Indexer.Define): Added error tests for CS0415,
5866         CS0609.
5867
5868 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5869
5870         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5871         property code.
5872
5873 2004-06-23  Martin Baulig  <martin@ximian.com>
5874
5875         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5876         neither return nor throw, reset the barrier as well.  Fixes #60457.
5877
5878 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5879
5880         * class.cs : EventAttributes is now set to None by default.
5881           This fixes bug #60459.
5882
5883 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5884
5885         Fix bug #60219
5886         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5887         Don't throw exception but return null (it's sufficient now).
5888
5889 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5890
5891         * typemanager.cs (GetArgumentTypes): Faster implementation.
5892
5893 2004-06-18  Martin Baulig  <martin@ximian.com>
5894
5895         * attribute.cs (Attribute.Resolve): Check whether we're an
5896         EmptyCast which a Constant child.  Fixes #60333.
5897
5898 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5899
5900         * statement.cs (EmitCollectionForeach): Account for the fact that
5901         not all valuetypes are in areas which we can take the address of.
5902         For these variables, we store to a temporary variable. Also, make
5903         sure that we dont emit a `callvirt' on a valuetype method.
5904
5905 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * expression.cs (StackAlloc.DoReSolve): Added test for
5908         negative parameter (CS0247).
5909
5910 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5911
5912         Fix bug #59792
5913         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5914
5915 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5916
5917         Fix bug #59781
5918         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5919         ulong.
5920
5921 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5922
5923         Fix bug #58254 & cs1555.cs, cs1556.cs
5924         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5925
5926 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5927
5928         * cs-parser.jay: Added error CS1669 test for indexers.
5929
5930 2004-06-11  Martin Baulig  <martin@ximian.com>
5931
5932         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5933         call this twice: for params and varargs methods.
5934
5935 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5936
5937         * class.cs:
5938         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5939
5940 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5941
5942         * attribute.cs (Attribute.GetValidTargets): Made public.
5943
5944         * class.cs: 
5945         (AbstractPropertyEventMethod): New class for better code sharing.
5946         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5947         CS1667 report.
5948         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5949
5950 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5951
5952         Fix bug #59477.
5953         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5954         that the call to Resolve is part of a MemberAccess.
5955         (Expression.Resolve): Use it for SimpleName resolution.
5956         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5957         Add 'intermediate' boolean argument.
5958         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5959         error message when the SimpleName can be resolved ambiguously
5960         between an expression and a type.
5961         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5962         public.
5963         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5964         call on the left-side.
5965
5966 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5967
5968         * class.cs:
5969         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5970
5971 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5972
5973         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5974
5975 2004-06-11  Martin Baulig  <martin@ximian.com>
5976
5977         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5978         varargs methods if applicable.
5979
5980 2004-06-11  Martin Baulig  <martin@ximian.com>
5981
5982         * expression.cs (Invocation.EmitCall): Don't use
5983         `method.CallingConvention == CallingConventions.VarArgs' since the
5984         method could also have `CallingConventions.HasThis'.
5985
5986 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * class.cs (Event.GetSignatureForError): Implemented.
5989         Fixed crash in error test cs3010.cs
5990
5991 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5992
5993         * cs-tokenizer.cs: Change the way we track __arglist to be
5994         consistent with the other keywords.
5995
5996 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5997
5998         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5999         tomorrow.
6000
6001 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6002
6003         * codegen.cs: Check that all referenced assemblies have a strongname
6004         before strongnaming the compiled assembly. If not report error CS1577.
6005         Fix bug #56563. Patch by Jackson Harper.
6006         * typemanager.cs: Added a method to return all referenced assemblies.
6007         Fix bug #56563. Patch by Jackson Harper.
6008
6009 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6010
6011         * class.cs:
6012         (Method.ApplyAttributeBuilder): Moved and added conditional
6013         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6014
6015         * delegate.cs:
6016         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6017
6018 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6019
6020         Fixed #59640
6021         * class.cs: (EventField.attribute_targets): Changed default target.
6022
6023 2004-06-08  Martin Baulig  <martin@ximian.com>
6024
6025         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6026
6027 2004-06-08  Martin Baulig  <martin@ximian.com>
6028
6029         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6030
6031 2004-06-07  Martin Baulig  <martin@ximian.com>
6032
6033         Added support for varargs methods.
6034
6035         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6036         keyword.
6037
6038         * cs-parser.jay: Added support for `__arglist'.
6039
6040         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6041
6042         * expression.cs (Argument.AType): Added `ArgList'.
6043         (Invocation): Added support for varargs methods.
6044         (ArglistAccess): New public class.
6045         (Arglist): New public class.
6046
6047         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6048
6049         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6050         a method's top-level block if the method has varargs.
6051
6052         * support.cs (ReflectionParameters, InternalParameters): Added
6053         support for varargs methods.    
6054
6055 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6056
6057         * class.cs: Provide location in indexer error report.
6058
6059         * driver.cs: Use standard names.
6060
6061         * namespace.cs: Catch the use of using after a namespace has been
6062         declared also on using aliases.
6063
6064 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6065
6066         Bug #50820.
6067         * typemanager.cs (closure_private_ok, closure_invocation_type)
6068         (closure_qualifier_type, closure_invocation_assembly)
6069         (FilterWithClosure): Move to ...
6070         (Closure): New internal nested class.
6071         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6072         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6073         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6074         (MemberLookup, MemberLookupFailed): Use it.
6075         * expression.cs (New.DoResolve): Treat the lookup for the
6076         constructor as being qualified by the 'new'ed type.
6077         (Indexers.GetIndexersForTypeOrInterface): Update.
6078
6079 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6080
6081         * attribute.cs
6082         (GetConditionalAttributeValue): New method. Returns
6083         condition of ConditionalAttribute.
6084         (SearchMulti): New method.  Returns all attributes of type 't'.
6085         Use it when attribute is AllowMultiple = true.
6086         (IsConditionalMethodExcluded): New method.
6087
6088         * class.cs
6089         (Method.IsExcluded): Implemented. Returns true if method has conditional
6090         attribute and the conditions is not defined (method is excluded).
6091         (IMethodData): Extended interface for ConditionalAttribute support.
6092         (PropertyMethod.IsExcluded): Implemented.
6093
6094         * decl.cs
6095         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6096
6097         * expression.cs
6098         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6099         on the method.
6100
6101 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6102
6103         * expression.cs (ArrayCreationExpression): Make this just an
6104         `expression'. It can't be a statement, so the code here was
6105         dead.
6106
6107 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6108
6109         Fixed #59072
6110         * typemanager.cs (GetFullNameSignature): New method for
6111         MethodBase types.
6112
6113 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6114
6115         Fixed #56452
6116         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6117         Use this method when MethodBuilder is null.
6118         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6119         Added test for error CS0626 (MONO reports error for this situation).
6120         (IMethodData.GetSignatureForError): Extended interface.
6121
6122 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6123
6124         * attribute.cs
6125         (AttributeTester.GetObsoleteAttribute): Returns instance of
6126         ObsoleteAttribute when type is obsolete.
6127
6128         * class.cs
6129         (TypeContainer.VerifyObsoleteAttribute): Override.
6130         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6131         (MethodCode.VerifyObsoleteAttribute): Override.
6132         (MemberBase.VerifyObsoleteAttribute): Override.
6133
6134         * decl.cs
6135         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6136         and report proper error.
6137
6138         *delegate.cs
6139         Delegate.VerifyObsoleteAttribute): Override.
6140
6141         * ecore.cs
6142         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6143         and report proper error.
6144         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6145
6146         * enum.cs
6147         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6148         and enum member.
6149
6150         * expression.cs
6151         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6152         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6153         Added test for ObsoleteAttribute.
6154
6155         * statement.cs
6156         (Catch): Derived from Statement.
6157
6158 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6159  
6160         Fixed bug #59071 & cs0160.cs
6161  
6162         * statement.cs (Try.Resolve): Check here whether order of catch
6163         clauses matches their dependencies.
6164
6165 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6166
6167         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6168         caused a regression: #59343.  Referencing nested classes from an
6169         assembly stopped working.
6170
6171 2004-05-31  Martin Baulig  <martin@ximian.com>
6172
6173         MCS is now frozen for beta 2.
6174
6175 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6176
6177         * convert.cs: add a trivial cache for overload operator resolution.
6178
6179 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6180
6181         * decl.cs: If possible, use lookuptypedirect here. We can only do
6182         this if there is no `.' after the namespace. Avoids using
6183         LookupType, which does lots of slow processing.
6184         (FindNestedType) New method, does what it says :-).
6185         * namespace.cs: use LookupTypeDirect.
6186         * rootcontext.cs: use membercache, if possible.
6187         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6188
6189 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6190
6191         * expression.cs:
6192         According to the spec, 
6193
6194         In a member access of the form E.I, if E is a single identifier,
6195         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6196         field, property, localvariable, or parameter with the same type as
6197         the meaning of E as a type-name (§3.8), then both possible
6198         meanings of E are permitted.
6199
6200         We did not check that E as a simple-name had the same type as E as
6201         a type name.
6202
6203         This trivial check gives us 5-7% on bootstrap time.
6204
6205 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6206
6207         * expression.cs (Invocation.OverloadResolve): Avoid the
6208         use of hashtables and boxing here by allocating on demand.
6209
6210 2004-05-30  Martin Baulig  <martin@ximian.com>
6211
6212         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6213         we're doing a silent lookup.  Don't try to lookup nested types in
6214         TypeManager.object_type (thanks to Ben Maurer).
6215
6216 2004-05-30  Martin Baulig  <martin@ximian.com>
6217
6218         Committing a patch from Ben Maurer.
6219
6220         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6221
6222 2004-05-29  Martin Baulig  <martin@ximian.com>
6223
6224         * class.cs (IMethodData.ShouldIgnore): New method.
6225
6226         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6227         `Location' argument, we don't need it anywhere.  Use
6228         `IMethodData.ShouldIgnore ()' instead of
6229         `MethodData.GetMethodFlags ()'.
6230         (TypeManager.AddMethod): Removed.
6231         (TypeManager.AddMethod2): Renamed to AddMethod.
6232
6233 2004-05-29  Martin Baulig  <martin@ximian.com>
6234
6235         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6236
6237         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6238         converting from a class type S to an interface type and we already
6239         have an object on the stack, don't box it again.  Fixes #52578.
6240
6241 2004-05-29  Martin Baulig  <martin@ximian.com>
6242
6243         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6244         Added support for `params' parameters.  Fixes #59267.
6245
6246 2004-05-29  Martin Baulig  <martin@ximian.com>
6247
6248         * literal.cs (NullPointer): Provide a private .ctor which sets
6249         `type' to TypeManager.object_type.  Fixes #59048.
6250
6251 2004-05-29  Martin Baulig  <martin@ximian.com>
6252
6253         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6254         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6255
6256         * ecore.cs (EventExpr.instance_expr): Make the field private.
6257
6258 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6259
6260         Fixed bug #50080 & cs0214-2.cs
6261         * expression.cs (Cast.DoResolve): Check unsafe context here.
6262         
6263         * statement.cs (Resolve.DoResolve): Likewise.
6264
6265 2004-05-26  Martin Baulig  <martin@ximian.com>
6266
6267         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6268
6269         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6270         (RootContext.LookupType): Pass down the `silent' flag.
6271
6272 2004-05-25  Martin Baulig  <martin@ximian.com>
6273
6274         * expression.cs
6275         (MethodGroupExpr.IdenticalTypeName): New public property.
6276         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6277         expression actually refers to a type.
6278
6279 2004-05-25  Martin Baulig  <martin@ximian.com>
6280
6281         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6282         for #56176 and made it actually work.
6283
6284 2004-05-25  Martin Baulig  <martin@ximian.com>
6285
6286         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6287         (FieldExpr, PropertyExpr): Override and implement
6288         CacheTemporaries.  Fixes #52279.
6289
6290 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6291
6292         * location.cs: In the new compiler listing a file twice is a
6293         warning, not an error.
6294
6295 2004-05-24  Martin Baulig  <martin@ximian.com>
6296
6297         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6298         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6299
6300 2004-05-24  Martin Baulig  <martin@ximian.com>
6301
6302         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6303         walking the `using' list.  Fixes #53921.
6304
6305 2004-05-24  Martin Baulig  <martin@ximian.com>
6306
6307         * const.cs (Const.LookupConstantValue): Added support for
6308         EmptyCast's; fixes #55251.
6309
6310 2004-05-24  Martin Baulig  <martin@ximian.com>
6311
6312         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6313         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6314         which does the CS0135 check.  The reason is that we first need to
6315         check whether the variable actually exists.
6316
6317 2004-05-24  Martin Baulig  <martin@ximian.com>
6318
6319         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6320         than RootContext.LookupType() to find the explicit interface
6321         type.  Fixes #58584.
6322
6323 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6324
6325         * Makefile: Simplify.  Use executable.make.
6326         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6327
6328 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6329
6330         * decl.cs:
6331         * enum.cs:
6332         Use the invariant culture when doing String.Compare for CLS case
6333         sensitivity.
6334         
6335 2004-05-23  Martin Baulig  <martin@ximian.com>
6336
6337         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6338         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6339
6340         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6341         
6342 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * class.cs (MemberBase.Define): Reuse MemberType member for 
6345         resolved type. Other methods can use it too.
6346
6347 2004-05-23  Martin Baulig  <martin@ximian.com>
6348
6349         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6350         the variable also exists in the current block (otherwise, we need
6351         to report a CS0103).  Fixes #58670.
6352
6353 2004-05-23  Martin Baulig  <martin@ximian.com>
6354
6355         * flowanalysis.cs (Reachability.Reachable): Compute this
6356         on-the-fly rather than storing it as a field.
6357
6358 2004-05-23  Martin Baulig  <martin@ximian.com>
6359
6360         * flowanalysis.cs (Reachability.And): Manually compute the
6361         resulting `barrier' from the reachability.      
6362        
6363 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6364
6365         Fix bug #57835
6366         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6367         instance of ObsoleteAttribute when symbol is obsolete.
6368
6369         * class.cs
6370         (IMethodData): Extended interface for ObsoleteAttribute support.
6371
6372 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6373
6374         * attribute.cs: Fix bug #55970
6375
6376 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6377
6378         Fix bug #52705
6379         * attribute.cs
6380         (GetObsoleteAttribute): New method. Creates the instance of
6381         ObsoleteAttribute.
6382         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6383         ObsoleteAttribute when member is obsolete.
6384         (AttributeTester.Report_ObsoleteMessage): Common method for
6385         Obsolete error/warning reporting.
6386
6387         * class.cs
6388         (TypeContainer.base_classs_type): New member for storing parent type.
6389
6390         * decl.cs
6391         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6392         for this MemberCore.
6393
6394 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6395
6396         * attribute.cs, const.cs: Fix bug #58590
6397
6398 2004-05-21  Martin Baulig  <martin@ximian.com>
6399
6400         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6401         out parameters if the end of the method is unreachable.  Fixes
6402         #58098. 
6403
6404 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6407         Hari was right, why extra method.
6408
6409 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6412
6413 2004-05-20  Martin Baulig  <martin@ximian.com>
6414
6415         Merged this back from gmcs to keep the differences to a minumum.
6416
6417         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6418         instead of a Declspace.
6419         (Attribute.ResolveType): Likewise.
6420         (Attributes.Search): Likewise.
6421         (Attributes.Contains): Likewise.
6422         (Attributes.GetClsCompliantAttribute): Likewise.
6423
6424         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6425         argument.
6426         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6427         DeclSpace.
6428
6429 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6430
6431         Fix bug #58688 (MCS does not report error when the same attribute
6432         is assigned twice)
6433
6434         * attribute.cs (Attribute.Emit): Distinction between null and default.
6435
6436 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6437
6438         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6439         of a top-level attribute without an attribute target.
6440         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6441         Make non-static.
6442         (Attribute.Conditional_GetConditionName), 
6443         (Attribute.Obsolete_GetObsoleteMessage): Update.
6444         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6445         part of ScanForIndexerName.
6446         (Attribute.CanIgnoreInvalidAttribute): New function.
6447         (Attribute.ScanForIndexerName): Move to ...
6448         (Attributes.ScanForIndexerName): ... here.
6449         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6450         (Attributes.Search): New internal variant that can choose not to
6451         complain if types aren't resolved.  The original signature now
6452         complains.
6453         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6454         complaints suppressed.
6455         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6456         only if it not useful.
6457         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6458         top-level for attributes that are shared between the assembly
6459         and a top-level class.
6460         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6461         * class.cs: Update to reflect changes.
6462         (DefineIndexers): Fuse loops.
6463         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6464         a couple more variants of attribute names.
6465
6466 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6467
6468         Fix bug #52585 (Implemented explicit attribute declaration)
6469
6470         * attribute.cs:
6471         (Attributable.ValidAttributeTargets): New abstract method. It gets
6472         list of valid attribute targets for explicit target declaration.
6473         (Attribute.Target): It holds target itself.
6474         (AttributeSection): Removed.
6475         (Attribute.CheckTargets): New method. It checks whether attribute
6476         target is valid for the current element.
6477
6478         * class.cs:
6479         (EventProperty): New class. For events that are declared like
6480         property (with add and remove accessors).
6481         (EventField): New class. For events that are declared like field.
6482         class.cs
6483
6484         * cs-parser.jay: Implemented explicit attribute target declaration.
6485
6486         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6487         Override ValidAttributeTargets.
6488
6489         * parameter.cs:
6490         (ReturnParameter): Class for applying custom attributes on 
6491         the return type.
6492         (ParameterAtribute): New class. Class for applying custom
6493         attributes on the parameter type.
6494
6495 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6496
6497         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6498         definitions. 
6499
6500         (Method): Allow UNSAFE here.
6501
6502         * modifiers.cs: Support unsafe reporting.
6503
6504 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6505
6506         * decl.cs: Fix bug #58478.
6507
6508 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6509
6510         * statement.cs: When checking for unreachable code on an EmptyStatement,
6511         set the location. Fixes bug #58488.
6512
6513 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6514
6515         * driver.cs: Add -pkg handling.
6516
6517         From Gonzalo: UseShelLExecute=false
6518
6519 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6520
6521         * attribute.cs:
6522         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6523         for attribute.
6524         (Attribute.IsClsCompliaceRequired): Moved to base for better
6525         accesibility.
6526         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6527         when attribute is AttributeUsageAttribute.
6528         (Attribute.GetValidTargets): Simplified.
6529         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6530         attribute for this type.
6531         (Attribute.ApplyAttributes): Method renamed to Emit and make
6532         non-static.
6533         (GlobalAttributeSection): New class for special handling of global
6534         attributes (assembly, module).
6535         (AttributeSection.Emit): New method.
6536
6537         * class.cs: Implemented Attributable abstract methods.
6538         (MethodCore.LabelParameters): Moved to Parameter class.
6539         (Accessor): Is back simple class.
6540         (PropertyMethod): Implemented Attributable abstract class.
6541         (DelegateMethod): Implemented Attributable abstract class.
6542         (Event): New constructor for disctintion between normal Event
6543         and Event with accessors.
6544
6545         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6546
6547         * codegen.cs, const.cs, decl.cs, delegate.cs:
6548         (CommonAssemblyModulClass): Implemented Attributable abstract class
6549         and simplified.
6550
6551         * enum.cs: Implement IAttributeSupport interface.
6552         (EnumMember): New class for emum members. Implemented Attributable
6553         abstract class
6554
6555         * parameter.cs:
6556         (ParameterBase): Is abstract.
6557         (ReturnParameter): New class for easier [return:] attribute handling.
6558
6559         * typemanager.cs: Removed builder_to_attr.
6560
6561 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6562
6563         Fix bug #57151.
6564         * attribute.cs (Attribute.GetPositionalValue): New function.
6565         * class.cs (TypeContainer.VerifyMembers): New function.
6566         (TypeContainer.Emit): Use it.
6567         (ClassOrStruct): New base class for Class and Struct.
6568         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6569         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6570         class.
6571         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6572         then each non-static field should have a FieldOffset attribute.
6573         Otherwise, none of the fields should have a FieldOffset attribute.
6574         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6575         and FieldOffset attributes.
6576         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6577         (TypeManager.field_offset_attribute_type): New core types.
6578         (TypeManager.InitCoreTypes): Initialize them.
6579
6580 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6581
6582         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6583         Return correct type.
6584         From bug #58270.
6585
6586 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6589         be implicitly converted to ulong.
6590         
6591         * expression.cs: The logic for allowing operator &, | and ^ worked
6592         was wrong, it worked before because we did not report an error in
6593         an else branch.  Fixes 57895.
6594
6595         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6596         allow volatile fields to be reference types.
6597
6598 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6599
6600         * driver.cs: Add support for /debug-
6601
6602 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6603
6604         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6605         Add a 'complain' parameter to silence errors.
6606         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6607         silently overlooked type-resolutions.
6608         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6609         to reflect changes.
6610         (Attributes.Search): New function.
6611         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6612         (Attributes.GetAttributeFullName): Remove hack.
6613         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6614         Update to reflect changes.
6615         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6616         Use Attributes.Search instead of nested loops.
6617
6618 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6619
6620         * decl.cs:
6621         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6622         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6623         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6624
6625         * report.cs: (Report.Warning): Renamed to Warning_T because of
6626         parameter collision.
6627
6628 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6629
6630         * expression.cs (MemberAccess.ResolveMemberAccess):
6631         Exit with non-zero status after Report.Error.
6632         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6633         Likewise.
6634         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6635
6636 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6637
6638         * support.cs: Don't hang when the file is empty.
6639
6640 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6641
6642         * support.cs: In SeekableStreamReader, compute the preamble size of the
6643           underlying stream. Position changes should take into account that initial
6644           count of bytes.
6645
6646 2004-05-03  Todd Berman  <tberman@sevenl.net>
6647
6648         * driver.cs: remove unused GetSysVersion function.
6649
6650 2004-05-03  Todd Berman  <tberman@sevenl.net>
6651
6652         * driver.cs: Remove the hack from saturday, as well as the hack
6653         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6654         link_paths to get that bit proper.
6655
6656 2004-05-01  Todd Berman  <tberman@sevenl.net>
6657
6658         * driver.cs: Try a LoadFrom before a Load, this checks the current
6659         path. This is currently a bug in mono that is be fixed, however, this
6660         provides a workaround for now. This will be removed when the bug
6661         is fixed.
6662
6663 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6664
6665         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6666         incomplete key pairs (#57941).
6667
6668 2004-05-01  Todd Berman  <tberman@sevenl.net>
6669
6670         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6671         from the GAC
6672
6673 2004-04-30  Jackson Harper  <jackson@ximian.com>
6674
6675         * codegen.cs: Open keys readonly.
6676         
6677 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6678
6679         * typemanager.cs: don't report cyclic struct layout when a struct
6680         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6681         which has 2 Pango.Rectangle fields.
6682
6683 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6684
6685         * expression.cs: Handle IntPtr comparisons with IL code
6686         rather than a method call.
6687
6688 2004-04-29  Martin Baulig  <martin@ximian.com>
6689
6690         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6691         the list of PropertyInfo's in class hierarchy and find the
6692         accessor.  Fixes #56013.
6693
6694 2004-04-29  Martin Baulig  <martin@ximian.com>
6695
6696         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6697
6698 2004-04-29  Martin Baulig  <martin@ximian.com>
6699
6700         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6701
6702         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6703
6704 2004-04-29  Martin Baulig  <martin@ximian.com>
6705
6706         * class.cs (ConstructorInitializer.Resolve): Check whether the
6707         parent .ctor is accessible.  Fixes #52146.
6708
6709 2004-04-29  Martin Baulig  <martin@ximian.com>
6710
6711         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6712
6713         * statement.cs (Using.EmitLocalVariableDecls): Use
6714         TypeManager.idisposable_type, not typeof (IDisposable).
6715         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6716
6717 2004-04-29  Martin Baulig  <martin@ximian.com>
6718
6719         * class.cs (Event.Define): Don't emit the field and don't set
6720         RTSpecialName and SpecialName for events on interfaces.  Fixes
6721         #57703. 
6722
6723 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6724
6725         Refactor Attribute.ApplyAttributes.
6726         * attribute.cs (Attributable): New base class for objects that can
6727         have Attributes applied on them.
6728         (Attribute): Make AttributeUsage fields public.
6729         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6730         (Attribute.IsInternalCall): New property.
6731         (Attribute.UsageAttr): Convert to a public read-only property.
6732         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6733         (Attribute.ResolveType, Attribute.Resolve)
6734         (Attribute.ScanForIndexerName): Update to reflect changes.
6735         (Attribute.CheckAttributeTarget): Re-format.
6736         (Attribute.ApplyAttributes): Refactor, to various
6737         Attributable.ApplyAttributeBuilder methods.
6738         * decl.cs (MemberCore): Make Attributable.
6739         * class.cs (Accessor): Make Attributable.
6740         (MethodData.ApplyAttributes): Use proper attribute types, not
6741         attribute names.
6742         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6743         (TypeContainer.ApplyAttributeBuilder)
6744         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6745         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6746         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6747         (Operator.ApplyAttributeBuilder): New factored-out methods.
6748         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6749         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6750         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6751         * parameter.cs (ParameterBase): New Attributable base class
6752         that can also represent Return types.
6753         (Parameter): Update to the changes.
6754
6755 2004-04-29  Jackson Harper  <jackson@ximian.com>
6756
6757         * driver.cs: Prefer the corlib system version when looking for
6758         assemblies in the GAC. This is still a hack, but its a better hack
6759         now.
6760         
6761 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6762
6763         * decl.cs, enum.cs: Improved error 3005 reporting.
6764   
6765         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6766         (related_symbols): New private member for list of symbols
6767         related to reported error/warning.
6768         
6769         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6770
6771 2004-04-29  Martin Baulig  <martin@ximian.com>
6772
6773         * ecore.cs (Expression.Constantify): If we're an enum and
6774         TypeManager.TypeToCoreType() doesn't give us another type, use
6775         t.UnderlyingSystemType.  Fixes #56178.  
6776
6777 2004-04-29  Martin Baulig  <martin@ximian.com>
6778
6779         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6780         interfaces and for each interface, only add members directly
6781         declared in that interface.  Fixes #53255.
6782
6783 2004-04-28  Martin Baulig  <martin@ximian.com>
6784
6785         * expression.cs (ConditionalLogicalOperator): Use a temporary
6786         variable for `left' to avoid that we evaluate it more than once;
6787         bug #52588.
6788
6789 2004-04-28  Martin Baulig  <martin@ximian.com>
6790
6791         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6792         `void[]' (CS1547).
6793
6794 2004-04-28  Martin Baulig  <martin@ximian.com>
6795
6796         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6797         void (CS1547).
6798
6799         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6800         whether the type is not void (CS1547).
6801
6802 2004-04-28  Martin Baulig  <martin@ximian.com>
6803
6804         * expression.cs (Unary.DoResolveLValue): Override this and report
6805         CS0131 for anything but Operator.Indirection.
6806
6807 2004-04-28  Martin Baulig  <martin@ximian.com>
6808
6809         Committing a patch from Ben Maurer; see bug #50820.
6810
6811         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6812         check for classes.
6813
6814         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6815         classes.        
6816
6817 2004-04-28  Martin Baulig  <martin@ximian.com>
6818
6819         Committing a patch from Ben Maurer; see bug #50820.
6820
6821         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6822         check for classes.
6823
6824         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6825         classes.        
6826
6827 2004-04-28  Martin Baulig  <martin@ximian.com>
6828
6829         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6830         (Block.AddLabel): Call DoLookupLabel() to only search in the
6831         current block.
6832
6833 2004-04-28  Martin Baulig  <martin@ximian.com>
6834
6835         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6836         comparing StringConstants and NullLiterals in Equality and Inequality.
6837
6838 2004-04-28  Jackson Harper  <jackson@ximian.com>
6839
6840         * driver.cs: Attempt to load referenced assemblies from the
6841         GAC. This is the quick and dirty version of this method that
6842         doesnt take into account versions and just takes the first
6843         canidate found. Will be good enough for now as we will not have more
6844         then one version installed into the GAC until I update this method.
6845
6846 2004-04-28  Martin Baulig  <martin@ximian.com>
6847
6848         * typemanager.cs (TypeManager.CheckStructCycles): New public
6849         static method to check for cycles in the struct layout.
6850
6851         * rootcontext.cs (RootContext.PopulateTypes): Call
6852         TypeManager.CheckStructCycles() for each TypeContainer.
6853         [Note: We only need to visit each type once.]
6854
6855 2004-04-28  Martin Baulig  <martin@ximian.com>
6856
6857         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6858
6859         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6860         success and added `out object value'.  Use a `bool resolved' field
6861         to check whether we've already been called rather than
6862         `ConstantValue != null' since this breaks for NullLiterals.
6863
6864 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6865
6866         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6867         setting of this flag, since the 'set' method may be non-public.
6868
6869 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6870
6871         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6872         check on current_vector.Block.
6873
6874 2004-04-27  Martin Baulig  <martin@ximian.com>
6875
6876         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6877         a field initializer.  Fixes #56459.
6878
6879 2004-04-27  Martin Baulig  <martin@ximian.com>
6880
6881         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6882         we're not attempting to use an indexer.  Fixes #52154.
6883
6884 2004-04-27  Martin Baulig  <martin@ximian.com>
6885
6886         * statement.cs (Return): Don't create a return label if we don't
6887         need it; reverts my change from January 20th.  Thanks to Ben
6888         Maurer for this.
6889
6890 2004-04-27  Martin Baulig  <martin@ximian.com>
6891
6892         According to the spec, `goto' can only leave a nested scope, but
6893         never enter it.
6894
6895         * statement.cs (Block.LookupLabel): Only lookup in the current
6896         block, don't recurse into parent or child blocks.
6897         (Block.AddLabel): Check in parent and child blocks, report
6898         CS0140/CS0158 if we find a duplicate.
6899         (Block): Removed this indexer for label lookups.
6900         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6901         this already does the error reporting for us.
6902
6903         * flowanalysis.cs
6904         (FlowBranching.UsageVector.Block): New public variable; may be null.
6905         (FlowBranching.CreateSibling): Added `Block' argument.
6906         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6907         label for the target of a `goto' and check whether we're not
6908         leaving a `finally'.
6909
6910 2004-04-27  Martin Baulig  <martin@ximian.com>
6911
6912         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6913         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6914         just for returns).
6915
6916 2004-04-27  Martin Baulig  <martin@ximian.com>
6917
6918         * statement.cs (Block.AddLabel): Also check for implicit blocks
6919         and added a CS0158 check.
6920
6921 2004-04-27  Martin Baulig  <martin@ximian.com>
6922
6923         * flowanalysis.cs (FlowBranchingLoop): New class.
6924         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6925         UsageVector's instead of an ArrayList.
6926         (FlowBranching.Label): Likewise.
6927         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6928         (FlowBranching.AddBreakVector): New method.
6929
6930 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6931
6932         * attribute.cs: Small regression fix: only convert the type if we
6933         the type is different, fixes System.Drawing build.
6934
6935 2004-04-27  Martin Baulig  <martin@ximian.com>
6936
6937         * attribute.cs (Attribute.Resolve): If we have a constant value
6938         for a named field or property, implicity convert it to the correct
6939         type.
6940
6941 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6942
6943         * statement.cs (Block.Block): Implicit blocks share
6944         'child_variable_names' fields with parent blocks.
6945         (Block.AddChildVariableNames): Remove.
6946         (Block.AddVariable): Mark variable as "used by a child block" in
6947         every surrounding block.
6948         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6949         been used in a child block, complain about violation of "Invariant
6950         meaning in blocks" rule.
6951         * cs-parser.jay (declare_local_variables): Don't use
6952         AddChildVariableNames.
6953         (foreach_statement): Don't create an implicit block: 'foreach'
6954         introduces a scope.
6955
6956 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6957
6958         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6959         converting from 0L to ulong.  Fixes 57522.
6960
6961 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6962
6963         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6964         derived class hides via 'new' keyword field from base class (test-242.cs).
6965         TODO: Handle this in the more general way.
6966         
6967         * class.cs (CheckBase): Ditto.
6968
6969 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6970
6971         * decl.cs (caching_flags): New member for storing cached values
6972         as bit flags.
6973         (MemberCore.Flags): New enum where bit flags for caching_flags
6974         are defined.
6975         (MemberCore.cls_compliance): Moved to caching_flags.
6976         (DeclSpace.Created): Moved to caching_flags.
6977
6978         * class.cs: Use caching_flags instead of DeclSpace.Created
6979         
6980 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6981
6982         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6983         if we are only a derived class, not a nested class.
6984
6985         * typemanager.cs: Same as above, but do this at the MemberLookup
6986         level (used by field and methods, properties are handled in
6987         PropertyExpr).   Allow for the qualified access if we are a nested
6988         method. 
6989
6990 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6991
6992         * class.cs: Refactoring.
6993         (IMethodData): New inteface; Holds links to parent members
6994         to avoid member duplication (reduced memory allocation).
6995         (Method): Implemented IMethodData interface.
6996         (PropertyBase): New inner classes for get/set methods.
6997         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6998         (Event): New inner classes for add/remove methods.
6999         (Event.DelegateMethod): Implemented IMethodData interface.
7000
7001         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7002         EmitContext (related to class.cs refactoring).
7003
7004 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7005
7006         * delegate.cs (Delegate.VerifyApplicability): If the number of
7007         arguments are the same as the number of parameters, first try to
7008         verify applicability ignoring  any 'params' modifier on the last
7009         parameter.
7010         Fixes #56442.
7011
7012 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7013
7014         * class.cs (TypeContainer.AddIndexer): Use
7015         'ExplicitInterfaceName' to determine if interface name was
7016         explicitly specified.  'InterfaceType' is not initialized at this time.
7017         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7018         Indexers array is already in the required order.  Initialize
7019         'IndexerName' only if there are normal indexers.
7020         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7021         (TypeContainer.Emit): Emit DefaultMember attribute only if
7022         IndexerName is initialized.
7023         Fixes #56300.
7024
7025 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7026
7027         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7028         Fixes #57007
7029
7030 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7031
7032         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7033         attributes.
7034         Fix for #56456.
7035
7036         * attribute.cs (Attribute.Resolve): Check for duplicate named
7037         attributes.
7038         Fix for #56463.
7039
7040 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7041
7042         * iterators.cs (MarkYield): track whether we are in an exception,
7043         and generate code accordingly.  Use a temporary value to store the
7044         result for our state.
7045
7046         I had ignored a bit the interaction of try/catch with iterators
7047         since their behavior was not entirely obvious, but now it is
7048         possible to verify that our behavior is the same as MS .NET 2.0
7049
7050         Fixes 54814
7051
7052 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7053
7054         * iterators.cs: Avoid creating temporaries if there is no work to
7055         do. 
7056
7057         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7058         Enumerations, use TypeManager.EnumToUnderlying and call
7059         recursively. 
7060
7061         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7062         bug #57013
7063
7064         (This.Emit): Use EmitContext.EmitThis to emit our
7065         instance variable.
7066
7067         (This.EmitAssign): Ditto.
7068
7069         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7070         codepaths, we will move all the functionality into
7071         Mono.CSharp.This 
7072
7073         (FieldExpr.EmitAssign): Ditto.
7074
7075         This fixes several hidden bugs that I uncovered while doing a code
7076         review of this today.
7077
7078         * codegen.cs (EmitThis): reworked so the semantics are more clear
7079         and also support value types "this" instances.
7080
7081         * iterators.cs: Changed so that for iterators in value types, we
7082         do not pass the value type as a parameter.  
7083
7084         Initialization of the enumerator helpers is now done in the caller
7085         instead of passing the parameters to the constructors and having
7086         the constructor set the fields.
7087
7088         The fields have now `assembly' visibility instead of private.
7089
7090 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7091
7092         * expression.cs (Argument.Resolve): Check if fields passed as ref
7093         or out are contained in a MarshalByRefObject.
7094
7095         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7096         another compiler type.
7097
7098 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7099
7100         * class.cs (Indexer.Define): use the new name checking method.
7101         Also, return false on an error.
7102         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7103         (is_identifier_[start/part]_character): make static.
7104
7105 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7106
7107         * expression.cs (Binary.ResolveOperator): Do no append strings
7108         twice: since we can be invoked more than once (array evaluation)
7109         on the same concatenation, take care of this here.  Based on a fix
7110         from Ben (bug #56454)
7111
7112 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7113
7114         * codegen.cs: Fix another case where CS1548 must be reported (when 
7115         delay-sign isn't specified and no private is available #56564). Fix
7116         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7117         error when MCS is used on the MS runtime and we need to delay-sign 
7118         (which seems unsupported by AssemblyBuilder - see #56621).
7119
7120 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7121
7122         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7123         (TypeManager.ComputeNamespaces): Faster implementation for
7124         Microsoft runtime.
7125
7126         * compiler.csproj: Updated AssemblyName to mcs.
7127
7128 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7129
7130         * rootcontext.cs: Add new types to the boot resolution.
7131
7132         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7133         MulticastDelegate is not allowed.
7134
7135         * typemanager.cs: Add new types to lookup: System.TypedReference
7136         and ArgIterator.
7137
7138         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7139         check for TypedReference or ArgIterator, they are not allowed. 
7140
7141         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7142         makes us properly catch 1510 in some conditions (see bug 56016 for
7143         details). 
7144
7145 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7146
7147         * CryptoConvert.cs: update from corlib version
7148         with endian fixes.
7149
7150 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7151
7152         * class.cs (Indexer.Define): Check indexername declaration
7153
7154 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7155
7156         * attribute.cs (IsClsCompliant): Fixed problem with handling
7157         all three states (compliant, not-compliant, undetected).
7158
7159 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7160
7161         * attribute.cs (Attribute): Location is now public.
7162         (Resolve): Store resolved arguments (pos_values) in attribute class.
7163         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7164         (GetClsCompliantAttributeValue): New method that gets
7165         CLSCompliantAttribute value.
7166         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7167         if exists else null.
7168         (AttributeTester): New class for CLS-Compliant verification routines.
7169
7170         * class.cs (Emit): Add CLS-Compliant verification.
7171         (Method.GetSignatureForError): Implemented.
7172         (Constructor.GetSignatureForError): Implemented
7173         (Constructor.HasCompliantArgs): Returns if constructor has
7174         CLS-Compliant arguments.
7175         (Constructor.Emit): Override.
7176         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7177         is needed to test only parameters.
7178         (FieldBase.GetSignatureForError): Implemented.
7179         (TypeContainer): New member for storing base interfaces.
7180         (TypeContainer.FindMembers): Search in base interfaces too.
7181
7182         * codegen.cs (GetClsComplianceAttribute): New method that gets
7183         assembly or module CLSCompliantAttribute value.
7184         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7185         for assembly.
7186         (ModuleClass.Emit): Add error 3012 test.
7187
7188         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7189
7190         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7191         state for all decl types.
7192         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7193         if CLS-Compliant tests are required.
7194         (IsClsCompliaceRequired): New method. Analyze whether code
7195         must be CLS-Compliant.
7196         (IsExposedFromAssembly): New method. Returns true when MemberCore
7197         is exposed from assembly.
7198         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7199         value or gets cached value.
7200         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7201         is explicitly marked with CLSCompliantAttribute.
7202         (IsIdentifierClsCompliant): New abstract method. This method is
7203         used to testing error 3005.
7204         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7205         for identifier and parameters CLS-Compliant testing.
7206         (VerifyClsCompliance): New method. The main virtual method for
7207         CLS-Compliant verifications.
7208         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7209         null. I don't know why is null (too many public members !).
7210         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7211         and get value of first CLSCompliantAttribute that found.
7212
7213         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7214         (VerifyClsCompliance): Override and add extra tests.
7215
7216         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7217         clscheck- disable CLS-Compliant verification event if assembly is has
7218         CLSCompliantAttribute(true).
7219
7220         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7221         ApllyAttribute is now called in emit section as in the other cases.
7222         Possible future Emit integration.
7223         (IsIdentifierClsCompliant): New override.
7224         (VerifyClsCompliance): New override.
7225         (GetEnumeratorName): Returns full enum name.
7226
7227         * parameter.cs (GetSignatureForError): Implemented.
7228
7229         * report.cs (WarningData): New struct for Warning message information.
7230         (LocationOfPreviousError): New method.
7231         (Warning): New method. Reports warning based on the warning table.
7232         (Error_T): New method. Reports error based on the error table.
7233
7234         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7235         verifications are done here.
7236
7237         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7238
7239         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7240         CLSCompliantAttribute.
7241         (all_imported_types): New member holds all imported types from other
7242         assemblies.
7243         (LoadAllImportedTypes): New method fills static table with exported types
7244         from all referenced assemblies.
7245         (Modules): New property returns all assembly modules.
7246
7247 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7248
7249         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7250         throwing a parser error.
7251
7252         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7253         which removes the hardcoded get_/set_ prefixes for properties, as
7254         IL allows for the properties to be named something else.  
7255
7256         Bug #56013
7257
7258         * expression.cs: Do not override operand before we know if it is
7259         non-null.  Fix 56207
7260
7261 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7262
7263         * typemanager.cs: support for pinned variables.
7264
7265 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7266
7267         * decl.cs, typemanager.cs: Avoid using an arraylist
7268         as a buffer if there is only one result set.
7269
7270 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7271
7272         * expression.cs: Make sure you cant call a static method
7273         with an instance expression, bug #56174.
7274
7275 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7276
7277         * class.cs (IsDuplicateImplementation): Improve error reporting to
7278         flag 663 (method only differs in parameter modifier).
7279
7280         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7281         in preprocessor directives.
7282
7283         * location.cs (LookupFile): Allow for the empty path.
7284
7285         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7286         better approach for some of that patch, but its failing with the
7287         CharSet enumeration.  For now try/catch will do.
7288
7289         * typemanager.cs: Do not crash if a struct does not have fields.
7290         Fixes 56150.
7291
7292 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7293
7294         * expression.cs: cs0213, cant fix a fixed expression.
7295         fixes 50231.
7296
7297 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7298
7299         * cs-parser.jay: detect invalid embeded statements gracefully.
7300         bug #51113.
7301
7302 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7303
7304         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7305         As a regex:
7306         s/
7307         the invocation type may not be a subclass of the tye of the item/
7308         The type of the item must be a subclass of the invocation item.
7309         /g
7310
7311         Fixes bug #50820.
7312
7313 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7314
7315         * attribute.cs: Added methods to get a string and a bool from an
7316         attribute. Required to information from AssemblyKeyFileAttribute,
7317         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7318         * codegen.cs: Modified AssemblyName creation to include support for
7319         strongnames. Catch additional exceptions to report them as CS1548.
7320         * compiler.csproj: Updated include CryptoConvert.cs.
7321         * compiler.csproj.user: Removed file - user specific configuration.
7322         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7323         Mono.Security assembly. The original class is maintained and tested in
7324         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7325         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7326         like CSC 8.0 (C# v2) supports.
7327         * Makefile: Added CryptoConvert.cs to mcs sources.
7328         * rootcontext.cs: Added new options for strongnames.
7329
7330 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7331
7332         * driver.cs: For --expect-error, report error code `2'
7333         if the program compiled with no errors, error code `1' if
7334         it compiled with an error other than the one expected.
7335
7336 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7337
7338         * compiler.csproj: Updated for Visual Studio .NET 2003.
7339         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7340         * compiler.sln: Updated for Visual Studio .NET 2003.
7341
7342 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7343
7344         * expression.cs: Fix bug #47234. We basically need to apply the
7345         rule that we prefer the conversion of null to a reference type
7346         when faced with a conversion to 'object' (csc behaviour).
7347
7348 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7349
7350         * statement.cs: Shorter form for foreach, eliminates
7351         a local variable. r=Martin.
7352
7353 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7354
7355         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7356         checks if we can use brtrue/brfalse to test for 0.
7357         * expression.cs: use the above in the test for using brtrue/brfalse.
7358         cleanup code a bit.
7359
7360 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7361
7362         * expression.cs: Rewrite string concat stuff. Benefits:
7363
7364         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7365         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7366         rather than a concat chain.
7367
7368         * typemanager.cs: Add lookups for more concat overloads.
7369
7370 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7371
7372         * expression.cs: Emit shorter il code for array init.
7373
7374         newarr
7375         dup
7376         // set 1
7377
7378         // set 2
7379
7380         newarr
7381         stloc.x
7382
7383         ldloc.x
7384         // set 1
7385
7386         ldloc.x
7387         // set 2
7388
7389 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7390
7391         * statement.cs: Before, two switch blocks would be merged if the
7392         total size of the blocks (end_item - begin_item + 1) was less than
7393         two times the combined sizes of the blocks.
7394
7395         Now, it will only merge if after the merge at least half of the
7396         slots are filled.
7397
7398         fixes 55885.
7399
7400 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7401
7402         * class.cs : csc build fix for GetMethods(). See bug #52503.
7403
7404 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7405
7406         * expression.cs: Make sure fp comparisons work with NaN.
7407         This fixes bug #54303. Mig approved this patch a long
7408         time ago, but we were not able to test b/c the runtime
7409         had a related bug.
7410
7411 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7414
7415 2004-03-19  Martin Baulig  <martin@ximian.com>
7416
7417         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7418         error here and not in our caller.
7419
7420 2004-03-19  Martin Baulig  <martin@ximian.com>
7421
7422         * interface.cs: Completely killed this file.
7423         (Interface): We're now a TypeContainer and live in class.cs.
7424
7425         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7426         argument; we're now also called for interfaces.
7427         (TypeContainer.DefineMembers): Allow this method being called
7428         multiple times.
7429         (TypeContainer.GetMethods): New public method; formerly known as
7430         Interface.GetMethod().  This is used by PendingImplementation.
7431         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7432         it's now private and non-static.
7433         (Interface): Moved this here; it's now implemented similar to
7434         Class and Struct.
7435         (Method, Property, Event, Indexer): Added `bool is_interface'
7436         argument to their .ctor's.
7437         (MemberBase.IsInterface): New public field.
7438
7439         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7440         instances instead of InterfaceMethod, InterfaceProperty, etc.
7441         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7442         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7443
7444 2004-03-19  Martin Baulig  <martin@ximian.com>
7445
7446         * class.cs (MethodCore.IsDuplicateImplementation): New private
7447         method which does the CS0111 checking.
7448         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7449         Use IsDuplicateImplementation().
7450
7451 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7452
7453         * decl.cs (FindMemberToOverride): New method to find the correct
7454         method or property to override in the base class.
7455         * class.cs
7456             - Make Method/Property use the above method to find the
7457               version in the base class.
7458             - Remove the InheritableMemberSignatureCompare as it is now
7459               dead code.
7460
7461         This patch makes large code bases much faster to compile, as it is
7462         O(n) rather than O(n^2) to do this validation.
7463
7464         Also, it fixes bug 52458 which is that nested classes are not
7465         taken into account when finding the base class member.
7466
7467         Reviewed/Approved by Martin.
7468
7469 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7470
7471         * interface.cs: In all interface classes removed redundant
7472         member initialization.
7473
7474 2004-03-16  Martin Baulig  <martin@ximian.com>
7475
7476         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7477
7478 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7479
7480         * decl.cs (DefineTypeAndParents): New helper method to define a
7481         type's containers before the type itself is defined;  This is a
7482         bug exposed by the recent changes to Windows.Forms when an
7483         implemented interface was defined inside a class that had not been
7484         built yet.   
7485
7486         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7487
7488         (Check): Loop correctly to report errors modifiers
7489         (UNSAFE was not in the loop, since it was the same as TOP).
7490
7491         * interface.cs: Every interface member now takes a ModFlags,
7492         instead of a "is_new" bool, which we set on the base MemberCore. 
7493
7494         Every place where we called "UnsafeOk" in the interface, now we
7495         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7496         the unsafe settings from the member declaration instead of the
7497         container interface. 
7498
7499         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7500
7501         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7502         `set_indexer_name' to the pending bits (one per type).
7503
7504         We fixed a bug today that was picking the wrong method to
7505         override, since for properties the existing InterfaceMethod code
7506         basically ignored the method name.  Now we make sure that the
7507         method name is one of the valid indexer names.
7508
7509 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7510  
7511         * support.cs (SeekableStreamReader): Keep track of stream byte
7512         positions and don't mix them with character offsets to the buffer.
7513
7514         Patch from Gustavo Giráldez
7515
7516 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7517
7518         * interface.cs (InterfaceSetGetBase): Removed double member
7519         initialization, base class does it as well.
7520
7521 2004-03-13  Martin Baulig  <martin@ximian.com>
7522
7523         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7524         when compiling corlib.
7525
7526 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7527
7528         * convert.cs (ExplicitConversion): We were reporting an error on
7529         certain conversions (object_type source to a value type, when the
7530         expression was `null') before we had a chance to pass it through
7531         the user defined conversions.
7532
7533         * driver.cs: Replace / and \ in resource specifications to dots.
7534         Fixes 50752
7535
7536         * class.cs: Add check for duplicate operators.  Fixes 52477
7537
7538 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7539
7540         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7541         that are in the middle of the statements, not only at the end.
7542         Fixes #54987
7543
7544         * class.cs (TypeContainer.AddField): No longer set the
7545         `HaveStaticConstructor' flag, now we call it
7546         `UserDefineStaticConstructor' to diferentiate the slightly
7547         semantic difference.
7548
7549         The situation is that we were not adding BeforeFieldInit (from
7550         Modifiers.TypeAttr) to classes that could have it.
7551         BeforeFieldInit should be set to classes that have no static
7552         constructor. 
7553
7554         See:
7555
7556         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7557
7558         And most importantly Zoltan's comment:
7559
7560         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7561
7562         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7563          before its static fields are used', i.e. initialization does not need
7564          to be triggered by the first access to the type. Setting this flag
7565          helps the JIT to compile better code, since it can run the static
7566          constructor at JIT time, and does not need to generate code to call it
7567          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7568          this flag for lots of classes like String. 
7569          
7570          csc sets this flag if the type does not have an explicit static 
7571          constructor. The reasoning seems to be that if there are only static
7572          initalizers for a type, and no static constructor, then the programmer
7573          does not care when this initialization happens, so beforefieldinit
7574          can be used.
7575          
7576          This bug prevents the AOT compiler from being usable, since it 
7577          generates so many calls to mono_runtime_class_init that the AOT code
7578          is much slower than the JITted code. The JITted code is faster, 
7579          because it does not generate these calls if the vtable is type is
7580          already initialized, which is true in the majority of cases. But the
7581          AOT compiler can't do this."
7582
7583 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7584
7585         * class.cs (MethodData.Emit): Refactor the code so symbolic
7586         information is generated for destructors;  For some reasons we
7587         were taking a code path that did not generate symbolic information
7588         before. 
7589
7590 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7591
7592         * class.cs: Create a Constructor.CheckBase method that
7593         takes care of all validation type code. The method
7594         contains some code that was moved from Define.
7595
7596         It also includes new code that checks for duplicate ctors.
7597         This fixes bug #55148.
7598
7599 2004-03-09  Joshua Tauberer <tauberer@for.net>
7600
7601         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7602         a { ... }-style array creation invokes EmitStaticInitializers
7603         which is not good for reference-type arrays.  String, decimal
7604         and now null constants (NullCast) are not counted toward
7605         static initializers.
7606
7607 2004-03-05  Martin Baulig  <martin@ximian.com>
7608
7609         * location.cs (SourceFile.HasLineDirective): New public field;
7610         specifies whether the file contains or is referenced by a "#line"
7611         directive.
7612         (Location.DefineSymbolDocuments): Ignore source files which
7613         either contain or are referenced by a "#line" directive.        
7614
7615 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7616
7617         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7618         direct access to our parent, so check the method inline there.
7619
7620 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7621
7622         * expression.cs (Invocation.EmitCall): Miguel's last commit
7623         caused a regression. If you had:
7624
7625             T t = null;
7626             t.Foo ();
7627
7628         In Foo the implict this would be null.
7629
7630 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * expression.cs (Invocation.EmitCall): If the method is not
7633         virtual, do not emit a CallVirt to it, use Call.
7634
7635         * typemanager.cs (GetFullNameSignature): Improve the method to
7636         cope with ".ctor" and replace it with the type name.
7637
7638         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7639         as an argument the ConstructorBuilder where it is being defined,
7640         to catch the recursive constructor invocations.
7641
7642 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7643
7644         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7645         routines to check if a type is an enumerable/enumerator allow
7646         classes that implement the IEnumerable or IEnumerator interfaces.
7647
7648         * class.cs (Property, Operator): Implement IIteratorContainer, and
7649         implement SetYields.
7650
7651         (Property.Define): Do the block swapping for get_methods in the
7652         context of iterators.   We need to check if Properties also
7653         include indexers or not.
7654
7655         (Operator): Assign the Block before invoking the
7656         OperatorMethod.Define, so we can trigger the Iterator code
7657         replacement. 
7658
7659         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7660         Property and Operator classes are not created when we parse the
7661         declarator but until we have the block completed, so we use a
7662         singleton SimpleIteratorContainer.Simple to flag whether the
7663         SetYields has been invoked.
7664
7665         We propagate this setting then to the Property or the Operator to
7666         allow the `yield' to function.
7667
7668 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7669
7670         * codegen.cs: Implemented attribute support for modules.
7671         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7672         Assembly/Module functionality.
7673
7674         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7675         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7676         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7677
7678 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7679
7680         * interface.cs (FindMembers): The operation is performed on all base
7681         interfaces and not only on the first. It is required for future CLS Compliance patch.
7682
7683 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7684
7685         * statement.cs, codegen.cs:
7686         This patch deals with patterns such as:
7687
7688         public class List : IEnumerable {
7689
7690                 public MyEnumerator GetEnumerator () {
7691                         return new MyEnumerator(this);
7692                 }
7693
7694                 IEnumerator IEnumerable.GetEnumerator () {
7695                         ...
7696                 }
7697                 
7698                 public struct MyEnumerator : IEnumerator {
7699                         ...
7700                 }
7701         }
7702
7703         Before, there were a few things we did wrong:
7704         1) we would emit callvirt on a struct, which is illegal
7705         2) we emited ldarg when we needed to emit ldarga
7706         3) we would mistakenly call the interface methods on an enumerator
7707         type that derived from IEnumerator and was in another assembly. For example:
7708
7709         public class MyEnumerator : IEnumerator
7710
7711         Would have the interface methods called, even if there were public impls of the
7712         method. In a struct, this lead to invalid IL code.
7713
7714 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7715
7716         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7717           renamed to Emit.
7718
7719         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7720
7721 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7722
7723         * cs-parser.jay: Fix small regression: we were not testing V2
7724         compiler features correctly.
7725
7726         * interface.cs: If the emit context is null, then create one
7727
7728 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7729
7730         * decl.cs (GetSignatureForError): New virtual method to get full name
7731           for error messages.
7732
7733         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7734           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7735
7736         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7737           Duplicated members and code in these classes has been removed.
7738           Better encapsulation in these classes.
7739
7740 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7741
7742         * assign.cs (Assign.DoResolve): When dealing with compound
7743         assignments, there is a new rule in ECMA C# 2.4 (might have been
7744         there before, but it is documented here) that states that in:
7745
7746         a op= b;
7747
7748         If b is of type int, and the `op' is a shift-operator, then the
7749         above is evaluated as:
7750
7751         a = (int) a op b 
7752
7753         * expression.cs (Binary.ResolveOperator): Instead of testing for
7754         int/uint/long/ulong, try to implicitly convert to any of those
7755         types and use that in pointer arithmetic.
7756
7757         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7758         method to print information for from the type, not from the
7759         null-method we were given.
7760
7761 2004-02-01  Duncan Mak  <duncan@ximian.com>
7762
7763         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7764         parsing for cmd, fixes bug #53694.
7765
7766 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7767
7768         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7769         in the member name duplication tests. Property and operator name duplication
7770         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7771
7772 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7773
7774         * interface.cs (PopulateMethod): Fixed crash when interface method
7775         returns not existing type (error test cs0246-3.cs).
7776
7777 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7778
7779         * cs-parser.jay (interface_accessors): Re-write actions to also
7780         store attributes attached to get and set methods. Fix spelling
7781         while at it.
7782
7783         (inteface_property_declaration): Modify accordingly.
7784
7785         (InterfaceAccessorInfo): New helper class to store information to pass
7786         around between rules that use interface_accessors.
7787
7788         * interface.cs (Emit): Apply attributes on the get and set
7789         accessors of properties and indexers too.
7790
7791         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7792         right MethodBuilder when applying attributes to the get and set accessors.
7793
7794 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7795
7796         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7797
7798 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7799
7800         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7801
7802 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7803
7804         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7805         changes that treat `yield' specially when present before `break'
7806         or `return' tokens.
7807
7808         * cs-tokenizer.cs: yield is no longer a keyword.
7809
7810 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7811
7812         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7813         setting for default constructors.
7814         For default constructors are almost every time set wrong Modifier. The
7815         generated IL code has been alright. But inside mcs this values was
7816         wrong and this was reason why several of my CLS Compliance tests
7817         failed.
7818
7819 2004-01-22  Martin Baulig  <martin@ximian.com>
7820
7821         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7822         not a QualifiedIdentifier.  This is what `type_name_expression'
7823         was previously doing.
7824         (type_name_expression): Removed; the code is now in
7825         `namespace_or_type_name'.
7826         (qualified_identifier): Removed, use `namespace_or_type_name'
7827         instead.
7828         (QualifiedIdentifier): Removed this class.      
7829
7830 2004-01-22  Martin Baulig  <martin@ximian.com>
7831
7832         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7833         not a string as alias name.
7834
7835 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7836
7837         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7838         #52730 bug, and instead compute correctly the need to use a
7839         temporary variable when requesting an address based on the
7840         static/instace modified of the field and the constructor.
7841  
7842 2004-01-21  Martin Baulig  <martin@ximian.com>
7843
7844         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7845         class and namespace before looking up aliases.  Fixes #52517.
7846
7847 2004-01-21  Martin Baulig  <martin@ximian.com>
7848
7849         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7850         assinged in a 'try'; fixes exception4.cs.
7851
7852 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7853         * class.cs : Implemented parameter-less constructor for TypeContainer
7854
7855         * decl.cs: Attributes are now stored here. New property OptAttributes
7856
7857         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7858
7859         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7860
7861 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7862
7863         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7864           (CSharpSignature): New method for indexer and property signature.
7865
7866 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7867
7868         * pending.cs (IsVirtualFilter): Faster implementation.
7869
7870 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7871
7872         * typemanager.cs: Avoid inclusion of same assembly more than once.
7873
7874 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7875
7876         * cs-parser.jay: Fixed problem where the last assembly attribute
7877           has been applied also to following declaration (class, struct, etc.)
7878           
7879 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7880
7881         * class.cs: Added error CS0538, CS0539 reporting.
7882         Fixed crash on Microsoft runtime when field type is void.
7883
7884         * cs-parser.jay: Added error CS0537 reporting.
7885
7886         * pending.cs: Added error CS0535 reporting.
7887         Improved error report for errors CS0536, CS0534.
7888
7889 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7890
7891         Merge a few bits from the Anonymous Method MCS tree.
7892
7893         * statement.cs (ToplevelBlock): New class for toplevel methods,
7894         will hold anonymous methods, lifted variables.
7895
7896         * cs-parser.jay: Create toplevel blocks for delegates and for
7897         regular blocks of code. 
7898
7899 2004-01-20  Martin Baulig  <martin@ximian.com>
7900
7901         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7902         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7903         and `NeedExplicitReturn'; added `IsLastStatement'.
7904         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7905         have a `ReturnLabel' or we're not unreachable.
7906
7907         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7908         child's reachability; don't just override ours with it.  Fixes
7909         #58058 (lluis's example).
7910         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7911         InFinally(), InLoop(), InSwitch() and
7912         BreakCrossesTryCatchBoundary() methods.
7913
7914         * statement.cs (Return): Do all error checking in Resolve().
7915         Unless we are the last statement in a top-level block, always
7916         create a return label and jump to it.
7917         (Break, Continue): Do all error checking in Resolve(); also make
7918         sure we aren't leaving a `finally'.
7919         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7920         statement in a top-level block.
7921         (Block.Flags): Added `IsDestructor'.
7922         (Block.IsDestructor): New public property.
7923
7924 2004-01-20  Martin Baulig  <martin@ximian.com>
7925
7926         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7927
7928 2004-01-20  Martin Baulig  <martin@ximian.com>
7929
7930         * statement.cs (Statement.ResolveUnreachable): New public method.
7931         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7932         (Block.Resolve): Resolve unreachable statements.
7933
7934 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7935
7936         * expression.cs: We need to fix the case where we do
7937         not have a temp variable here.
7938
7939         * assign.cs: Only expression compound assignments need
7940         temporary variables.
7941
7942 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7943
7944         * flowanalysis.cs: Reduce memory allocation in a few ways:
7945           - A block with no variables should not allocate a bit
7946             vector for itself.
7947           - A method with no out parameters does not need any tracking
7948             for assignment of the parameters, so we need not allocate
7949             any data for it.
7950           - The arrays:
7951                 public readonly Type[] VariableTypes;
7952                 public readonly string[] VariableNames;
7953             Are redundant. The data is already stored in the variable
7954             map, so we need not allocate another array for it.
7955           - We need to add alot of checks for if (params | locals) == null
7956             due to the first two changes.
7957
7958 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7959
7960         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7961         implement IMemoryLocation, we store a copy on a local variable and
7962         take the address of it.  Patch from Benjamin Jemlich
7963
7964         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7965         to use a special "type_name_expression" rule which reduces the
7966         number of "QualifiedIdentifier" classes created, and instead
7967         directly creates MemberAccess expressions.
7968
7969 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7970
7971         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7972         that fixes #52853.  Null literal assignment to ValueType
7973
7974         * class.cs (MethodData.Emit): Instead of checking the name of the
7975         method to determine if its a destructor, create a new derived
7976         class from Method called Destructor, and test for that.  
7977
7978         * cs-parser.jay: Create a Destructor object instead of a Method.  
7979
7980         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7981
7982         Fixes: 52933
7983
7984 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7985
7986         * expression.cs (Binary.ResolveOperator): Perform an implicit
7987         conversion from MethodGroups to their delegate types on the
7988         Addition operation.
7989
7990         * delegate.cs: Introduce a new class DelegateCreation that is the
7991         base class for `NewDelegate' and `ImplicitDelegateCreation',
7992         factor some code in here.
7993
7994         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7995         conversion from MethodGroups to compatible delegate types. 
7996
7997         * ecore.cs (Expression.Resolve): Do not flag error 654
7998         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7999         we allow conversions from MethodGroups to delegate types now.
8000
8001         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8002         assignments in v2 either.
8003
8004 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8005
8006         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8007         static read-only fields in ctors.
8008
8009         Applied patch from Benjamin Jemlich 
8010
8011         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8012
8013 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8014
8015         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8016         here to return true, as they can be used like this:
8017
8018                 (XXX) int.MEMBER ()
8019
8020         Fixed 49836 and all the other dups
8021
8022 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8023
8024         * driver.cs: Implement /win32res and /win32icon.
8025
8026 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8027
8028         * cs-parser.jay: Add a rule to improve error handling for the
8029         common mistake of placing modifiers after the type.
8030
8031 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8032
8033         * cs-parser.jay (interface_event_declaration): Catch
8034         initialization of events on interfaces, and report cs0068
8035
8036         * cs-parser.jay (interface_event_declaration): Catch
8037         initialization of events. 
8038
8039         * ecore.cs: Better report missing constructors.
8040
8041         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8042         the error reporting done in the wrong place.  Fix.
8043
8044         * expression.cs (Binary.ResolveOperator): Catch the 
8045         operator + (E x, E y) error earlier, and later allow for implicit
8046         conversions in operator +/- (E e, U x) from U to the underlying
8047         type of E.
8048
8049         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8050         52596, if the container class is abstract, the default constructor
8051         is protected otherwise its public (before, we were always public).
8052
8053         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8054         fixed statement.
8055
8056         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8057         Jemlich that fixes bug #52597, MCS was generating invalid code for
8058         idisposable structs.   Thanks to Ben for following up with this
8059         bug as well.
8060
8061 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8062
8063         * driver.cs: Allow assemblies without code to be generated, fixes
8064         52230.
8065
8066 2004-01-07  Nick Drochak <ndrochak@gol.com>
8067
8068         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8069
8070 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8071
8072         * cs-parser.jay: Add rules to improve error reporting if fields or
8073         methods are declared at the namespace level (error 116)
8074
8075         * Add rules to catch event add/remove
8076
8077 2004-01-04  David Sheldon <dave-mono@earth.li>
8078
8079   * expression.cs: Added matching ")" to error message for 
8080   CS0077
8081
8082 2004-01-03 Todd Berman <tberman@gentoo.org>
8083
8084         * ecore.cs, attribute.cs:
8085         Applying fix from #52429.
8086
8087 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8088
8089         * ecore.cs, expression.cs, statement.cs:
8090         Total rewrite of how we handle branching. We
8091         now handle complex boolean expressions with fewer
8092         jumps. As well if (x == 0) no longer emits a ceq.
8093
8094         if (x is Foo) is much faster now, because we generate
8095         better code.
8096
8097         Overall, we get a pretty big improvement on our benchmark
8098         tests. The code we generate is smaller and more readable.
8099
8100         I did a full two-stage bootstrap. The patch was reviewed
8101         by Martin and Miguel.
8102
8103 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8104
8105         * cs-parser.jay: Make primary_expression not take a QI.
8106         we dont need this because the member_access rule covers
8107         us here. So we replace the rule with just IDENTIFIER.
8108
8109         This has two good effects. First, we remove a s/r conflict.
8110         Second, we allocate many fewer QualifiedIdentifier objects.
8111
8112 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8113
8114         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8115         set the correct information via SRE. This prevents
8116         hanging on the MS runtime. Fixes #29374.
8117
8118 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8119
8120         * convert.cs: correctly handle conversions to value types
8121         from Enum and ValueType as unboxing conversions.
8122
8123         Fixes bug #52569. Patch by Benjamin Jemlich.
8124
8125 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8126
8127         * expression.cs (BetterConversion): Prefer int -> uint
8128         over int -> ulong (csc's behaviour). This fixed bug #52046.
8129
8130 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8131
8132         * decl.cs (MemberCache.FindMembers): now returns a
8133         MemberInfo [].
8134
8135         * typemanager.cs: In general, go with with ^^.
8136         (CopyNewMethods): take an IList.
8137         (RealMemberLookup): Only allocate an arraylist
8138         if we copy from two sets of methods.
8139
8140         This change basically does two things:
8141         1) Fewer array lists allocated due to CopyNewMethods.
8142         2) the explicit cast in MemberList costed ALOT.
8143
8144 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8145
8146         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8147         a hashtable to avoid needless string allocations when an identifier is
8148         used more than once (the common case).
8149
8150 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8151
8152         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8153         is broken, it will not return anything. So, we
8154         have to use the information we have in mcs to
8155         do the task.
8156
8157         * typemanager.cs: Add a cache for GetInterfaces,
8158         since this will now be used more often (due to ^^)
8159
8160         (GetExplicitInterfaces) New method that gets the
8161         declared, not effective, interfaces on a type
8162         builder (eg, if you have interface IFoo, interface
8163         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8164         { IBar }.
8165
8166         This patch makes MCS able to bootstrap itself on
8167         Windows again.
8168
8169 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8170
8171         * expression.cs: Remove the Nop's that Miguel put
8172         in by mistake.
8173
8174 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8175
8176         * report.cs, codegen.cs: Give the real stack trace to
8177         the error when an exception is thrown.
8178
8179 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8180
8181         * decl.cs: only allocate hashtables for ifaces if 
8182         it is an iface!
8183
8184 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8185
8186         * expression.cs: fix the error from cs0121-2.cs
8187         (a parent interface has two child interfaces that
8188         have a function with the same name and 0 params
8189         and the function is called through the parent).
8190
8191 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8192
8193         * class.cs, rootcontext.cs, typmanager.cs: do not
8194         leak pointers.
8195
8196 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8197
8198         * codegen.cs: remove stack for the ec flow branching.
8199         It is already a linked list, so no need.
8200
8201 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8202
8203         * Makefile: Allow custom profiler here.
8204
8205 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8206
8207         * typemanager.cs (LookupType):
8208           - Use a static char [], because split takes
8209             a param array for args, so it was allocating
8210             every time.
8211           - Do not store true in a hashtable, it boxes.
8212
8213 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8214
8215         * flowanalysis.cs: bytify common enums.
8216
8217 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8218
8219         * modifiers.cs: Add a new set of flags for the
8220         flags allowed on explicit interface impls.
8221         * cs-parser.jay: catch the use of modifiers in
8222         interfaces correctly.
8223         * class.cs: catch private void IFoo.Blah ().
8224
8225         All related to bug #50572.
8226
8227 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8228
8229         * decl.cs: Rewrite the consistant accessability checking.
8230         Accessability is not linear, it must be implemented in
8231         a tableish way. Fixes #49704.
8232
8233 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8234
8235         * expression.cs: Handle negation in a checked context.
8236         We must use subtraction from zero. Fixes #38674.
8237
8238 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8239
8240         * class.cs: Ignore static void main in DLLs.
8241         * rootcontext.cs: Handle the target type here,
8242         since we are have to access it from class.cs
8243         * driver.cs: account for the above.
8244
8245 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8246
8247         * report.cs: Give line numbers and files if available.
8248
8249 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8250
8251         * driver.cs: Implement /addmodule.
8252
8253         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8254         ModuleBuilders.
8255
8256 2003-12-20  Martin Baulig  <martin@ximian.com>
8257
8258         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8259         (FieldBase.IsAssigned): Removed this field.
8260         (FieldBase.SetAssigned): New public method.
8261         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8262
8263 2003-12-20  Martin Baulig  <martin@ximian.com>
8264
8265         * expression.cs (LocalVariableReference.DoResolve): Don't set
8266         `vi.Used' if we're called from DoResolveLValue().
8267
8268         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8269         returns the usage vector it just merged into the current one -
8270         pass this one to UsageWarning().
8271         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8272         of the `EmitContext', don't call this recursively on our children.
8273
8274 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8275
8276         * driver.cs: Implement /target:module.
8277
8278 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8279
8280         * support.cs (CharArrayHashtable): New helper class.
8281
8282         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8283         char arrays, not strings, so we can avoid creating a string in
8284         consume_identifier if the identifier is a keyword.
8285
8286 2003-12-16  Martin Baulig  <martin@ximian.com>
8287
8288         * statement.cs (LocalInfo.Assigned): Removed this property.
8289         (LocalInfo.Flags): Removed `Assigned'.
8290         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8291         and uses flow analysis.
8292         (Block.UsageWarning): Made this method private.
8293         (Block.Resolve): Call UsageWarning() if appropriate.
8294
8295         * expression.cs (LocalVariableReference.DoResolve): Always set
8296         LocalInfo.Used here.
8297
8298 2003-12-13  Martin Baulig  <martin@ximian.com>
8299
8300         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8301         any value here; we're now using flow analysis to figure out
8302         whether a statement/block returns a value.
8303
8304 2003-12-13  Martin Baulig  <martin@ximian.com>
8305
8306         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8307         working again.
8308         (FlowBranching.MergeFinally): Don't call
8309         `branching.CheckOutParameters()' here, this is called in
8310         MergeTopBlock().
8311         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8312         when adding the `finally' vector.       
8313
8314 2003-12-13  Martin Baulig  <martin@ximian.com>
8315
8316         * flowanalysis.cs
8317         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8318         actually work and also fix #48962.
8319
8320 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8321
8322         * decl.cs: Do not check System.Object for nested types,
8323         since we know it does not have any. Big bang for buck:
8324
8325         BEFORE:
8326            Run 1:   8.35 seconds
8327            Run 2:   8.32 seconds
8328            corlib:  17.99 seconds
8329         AFTER:
8330            Run 1:   8.17 seconds
8331            Run 2:   8.17 seconds
8332            corlib:  17.39 seconds
8333
8334 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8335
8336         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8337         time we are returning 0 members, so we save alot here.
8338
8339 2003-12-11  Martin Baulig  <martin@ximian.com>
8340
8341         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8342         `MergeChild()', also just take the `FlowBranching' as argument;
8343         call Merge() on it and return the result.
8344         (FlowBranching.Merge): We don't need to do anything if we just
8345         have one sibling.
8346
8347 2003-12-11  Martin Baulig  <martin@ximian.com>
8348
8349         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8350         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8351         Maurer for this idea.
8352
8353 2003-12-11  Martin Baulig  <martin@ximian.com>
8354
8355         * flowanalysis.cs (MergeResult): This class is now gone; we now
8356         use the `UsageVector' for this.  The reason for this is that if a
8357         branching just has one sibling, we don't need to "merge" them at
8358         all - that's the next step to do.
8359         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8360         `MergeResult'.
8361
8362 2003-12-11  Martin Baulig  <martin@ximian.com>
8363
8364         Reworked flow analyis and made it more precise and bug-free.  The
8365         most important change is that we're now using a special `Reachability'
8366         class instead of having "magic" meanings of `FlowReturns'.  I'll
8367         do some more cleanups and optimizations and also add some more
8368         documentation this week.
8369
8370         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8371         largely reworked this class.
8372         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8373         the new `Reachability' class instead of having "magic" values here.
8374         (FlowBranching): We're now using an instance of `Reachability'
8375         instead of having separate `Returns', `Breaks' etc. fields.
8376
8377         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8378         based on flow analysis; ignore the return value of block.Emit ().
8379
8380 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8381
8382         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8383         if they are private.
8384
8385 2003-12-09  Martin Baulig  <martin@ximian.com>
8386
8387         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8388         call them directly on the UsageVector.
8389
8390 2003-12-09  Martin Baulig  <martin@ximian.com>
8391
8392         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8393         Changed return type from `FlowReturns' to `Reachability'.
8394
8395 2003-12-09  Martin Baulig  <martin@ximian.com>
8396
8397         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8398         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8399         `Reachable' fields with a single `Reachability' one.
8400
8401 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8402
8403         * class.cs (FindMembers): Remove foreach's.
8404
8405         Bootstrap times:
8406
8407         BEFORE
8408                 Run 1:   8.74 seconds
8409                 Run 2:   8.71 seconds
8410
8411         AFTER
8412                 Run 1:   8.64 seconds
8413                 Run 2:   8.58 seconds
8414
8415
8416 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8417
8418         * cs-parser.jay:
8419         * gen-treedump.cs:
8420         * statement.cs:
8421         This patch does a few things:
8422                 1. EmptyStatement is now a singleton, so it is never reallocated.
8423                 2. All blah is EmptyStatement constructs have been changed to
8424                    blah == EmptyStatement.Value, which is much faster and valid
8425                    now that EmptyStatement is a singleton.
8426                 3. When resolving a block, rather than allocating a new array for
8427                    the non-empty statements, empty statements are replaced with
8428                    EmptyStatement.Value
8429                 4. Some recursive functions have been made non-recursive.
8430         Mainly the performance impact is from (3), however (1) and (2) are needed for
8431         this to work. (4) does not make a big difference in normal situations, however
8432         it makes the profile look saner.
8433
8434         Bootstrap times:
8435
8436         BEFORE
8437         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8438         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8439         Total memory allocated: 56397 KB
8440
8441         AFTER
8442         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8443         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8444         Total memory allocated: 55666 KB
8445
8446 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8447
8448         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8449         than the hashtable in a hashtable version
8450
8451         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8452         we always end up concating a string. This results in a huge perf
8453         loss, because many strings have to be tracked by the GC. In this
8454         patch, we first use a hashtable that works with two keys, so that
8455         the strings do not need to be concat'ed.
8456
8457         Bootstrap times:
8458         BEFORE
8459                 Run 1:   8.74 seconds
8460                 Run 2:   8.71 seconds
8461
8462         AFTER
8463                 Run 1:   8.65 seconds
8464                 Run 2:   8.56 seconds
8465
8466 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8467
8468         * Makefile: Add a new target `do-time' that does a quick and simple
8469         profile, leaving easy to parse output.
8470
8471 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8472
8473         * codegen.cs (Init): Create the dynamic assembly with 
8474         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8475
8476 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8477
8478         * support.cs: Make the PtrHashtable use only one
8479         instance of its comparer.
8480
8481 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8482
8483         * typemanager.cs: Fix lookup of GetNamespaces.
8484
8485 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8486
8487         * expression.cs: Removed redundant line.
8488
8489         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8490         ArrayLists, use for loops with bounds.  
8491
8492         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8493         arraylist.
8494
8495         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8496         arraylists, use for loop with bounds.
8497
8498         The above three changes give us a 0.071 second performance
8499         improvement out of 3.294 seconds down to 3.223.  On my machine
8500         the above changes reduced the memory usage by 1,387 KB during
8501         compiler bootstrap.
8502
8503         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8504         QualifiedIdentifiers.  Before we created a new string through
8505         concatenation, and mostly later on, the result would be
8506         manipulated by DecomposeQI through string manipulation.
8507
8508         This reduced the compiler memory usage for bootstrapping from
8509         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8510         compile times in 0.05 seconds.
8511
8512 2003-11-28  Dick Porter  <dick@ximian.com>
8513
8514         * support.cs: Do string compares with the Invariant culture.
8515
8516         * rootcontext.cs: 
8517         * gen-treedump.cs: 
8518         * expression.cs: 
8519         * driver.cs: 
8520         * decl.cs: 
8521         * codegen.cs: 
8522         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8523         the comparison is done with the Invariant culture.
8524
8525 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8528         GetEnumerator method.
8529
8530         (ProbeCollectionType): Iterate starting at the most specific type
8531         upwards looking for a GetEnumerator
8532
8533         * expression.cs: Shift count can be up to 31 for int/uint and 63
8534         for long/ulong.
8535
8536 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8537
8538         * statement.cs (Block.LookupLabel): Also look for the label on the
8539         children blocks.  Use a hash table to keep track of visited
8540         nodes. 
8541
8542         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8543         we actually did transform the other operand, otherwise fall back
8544         to the common codepath that casts to long.
8545
8546         * cs-tokenizer.cs: Use the same code pattern as the int case.
8547         Maybe I should do the parsing myself, and avoid depending on the
8548         Parse routines to get this done.
8549
8550 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8551
8552         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8553         which fixes bug 51347.  This time test it.
8554
8555         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8556         attributes for example can not tell the difference between these.
8557         The difference was only a syntax feature of the language. 
8558
8559         * attribute.cs: Apply attributes to delegates.
8560
8561         * delegate.cs: Call the apply attributes method.
8562
8563 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8564
8565         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8566         comparing 0 vs Byte.MinValue, not the value
8567
8568         (ImplicitConversionRequired): When reporting a conversion error,
8569         use error 31 to print out the constant error instead of the
8570         simpler 29.
8571
8572         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8573         which fixes bug 51347.
8574
8575 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8576
8577         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8578         which fixes the -warnaserror command line option.
8579
8580 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8581
8582         * cfold.cs (DoNumericPromotions): During constant folding of
8583         additions on UIntConstant, special case intconstants with
8584         IntConstants like we do on the expression binary operator. 
8585
8586 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8587
8588         * convert.cs (ImplicitReferenceConversion): We were missing a case
8589         (System.Enum are not value types or class types, so we need to
8590         classify them separatedly).
8591
8592         * driver.cs: We do not support error 2007.
8593
8594 2003-11-12 Jackson Harper <jackson@ximian.com>
8595
8596         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8597         system directory. Also use the full file name so users can
8598         libraries names mscorlib-o-tron.dll in a non system dir.
8599
8600 2003-11-10  Martin Baulig  <martin@ximian.com>
8601
8602         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8603         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8604         calling `ResolveType()' on them, directly assign their `Type'.
8605
8606 2003-11-08  Martin Baulig  <martin@ximian.com>
8607
8608         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8609         return value and the `out parent' parameter.
8610         (TypeContainer.DefineType): Moved the CS0644 check into
8611         GetClassBases().  Don't pass the interface types to the
8612         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8613         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8614
8615         * ecore.cs (TypeExpr.IsAttribute): New property.
8616         (TypeExpr.GetInterfaces): New method.
8617
8618         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8619         TypeExpr instead of a Type.
8620         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8621         (Interface.DefineType): Don't pass the interface types to the
8622         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8623         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8624
8625         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8626         instead of a `Type[]'.
8627         (TypeManager.RegisterBuilder): Likewise.
8628         (TypeManager.AddUserInterface): Likewise.
8629         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8630         `Type[]' and also return a `TypeExpr[]'.
8631         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8632
8633 2003-11-08  Martin Baulig  <martin@ximian.com>
8634
8635         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8636         Expression.     
8637
8638 2003-11-08  Martin Baulig  <martin@ximian.com>
8639
8640         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8641         TypeManager.ResolveExpressionTypes().
8642
8643         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8644         instead of an Expression.
8645         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8646         (TypeExpression): New public class; formerly known as `TypeExpr'.
8647
8648         * expression.cs (ComposedCast): Derive from TypeExpr.
8649
8650         * typemanager.cs (TypeManager.system_*_expr): These are now
8651         TypExpr's instead of Expression's.
8652         (TypeManager.ResolveExpressionTypes): New public static function;
8653         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8654         of them.        
8655
8656 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8657
8658         * expression.cs (New.DoResolve): Do not dereference value that
8659         might be a null return.
8660
8661         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8662         sure that the constant value has the right type.  Fixes an
8663         unreported bug, similar to 50425.
8664
8665         * const.cs (Const.LookupConstantValue): Call
8666         ImplicitStandardConversionExists before doing a conversion to
8667         avoid havng the TypeManager.ChangeType do conversions.
8668
8669         Reduced the number of casts used
8670
8671         (Const.ChangeType): New routine to enable reuse of the constant
8672         type changing code from statement.
8673
8674         * typemanager.cs (ChangeType): Move common initialization to
8675         static global variables.
8676
8677         Fixes #50425.
8678
8679         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8680         every value type to go through, even if it was void.  Fix that. 
8681
8682         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8683         character of the define, and the is_identifier_part_character for
8684         the rest of the string.
8685
8686 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8687
8688         * expression.cs (UnaryMutator.EmitCode): When I updated
8689         LocalVariableReference.DoResolve, I overdid it, and dropped an
8690         optimization done on local variable references.
8691
8692 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * ecore.cs: Convert the return from Ldlen into an int.
8695
8696 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8697
8698         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8699         the accessibility, this is a special case for toplevel non-public
8700         classes (internal for instance).
8701
8702 2003-10-20  Nick Drochak <ndrochak@gol.com>
8703
8704         * ecore.cs: Fix typo and build.  Needed another right paren.
8705
8706 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8707
8708         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8709         `internal' case regular and protected, but not allowing protected
8710         to be evaluated later.  Bug 49840
8711
8712 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8713
8714         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8715         to kb.Nlast, and not the kb.nFirst to isolate the switch
8716         statement.
8717
8718         Extract the underlying type, so enumerations of long/ulong are
8719         treated like long/ulong.
8720
8721 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8722
8723         * expression.cs (New): Overload the meaning of RequestedType to
8724         track the possible creation of the NewDelegate type, since
8725         DoResolve is invoked more than once for new constructors on field
8726         initialization.
8727
8728         See bugs: #48800 and #37014
8729
8730         * cs-parser.jay (declare_local_constants): Take an arraylist
8731         instead of a single constant.
8732
8733         (local_constant_declaration): It should take a
8734         constant_declarators, not a constant_declarator.  Fixes 49487
8735
8736         * convert.cs: Fix error report.
8737
8738 2003-10-13 Jackson Harper <jackson@ximian.com>
8739
8740         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8741         bug #49611
8742
8743 2003-10-09  Martin Baulig  <martin@ximian.com>
8744
8745         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8746         to the .ctor.
8747         (MethodCore.DoDefineParameters): Removed the TypeContainer
8748         argument; use the DeclSpace which was passed to the .ctor instead.
8749         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8750         TypeContainer; we only need a DeclSpace here.
8751
8752 2003-10-09  Martin Baulig  <martin@ximian.com>
8753
8754         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8755         to the .ctor.
8756         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8757         EmitContext's .ctor.    
8758
8759 2003-10-09  Martin Baulig  <martin@ximian.com>
8760
8761         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8762         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8763         AsAccessible(), moved them as well.
8764
8765         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8766
8767 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8768
8769         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8770
8771 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8772
8773         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8774         generation for >=, as spotted by Paolo, bug 48679.  
8775         Patch from David Waite.
8776
8777         * cs-tokenizer.cs: Add handling for #pragma.
8778
8779         * cs-parser.jay: Allow for both yield and yield return in the
8780         syntax.  The anti-cobolization of C# fight will go on!
8781
8782         * class.cs (TypeBuilder.DefineType): Catch error condition here
8783         (Parent.DefineType erroring out and returning null).
8784
8785         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8786         coping with enumerations variables, we were mistakenly processing
8787         them as a regular value type instead of built-in types.  Fixes the
8788         bug #48063
8789
8790         * typemanager.cs (IsBuiltinOrEnum): New method.
8791
8792 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8793
8794         * cs-parser.jay: Upgrade: yield now needs the return clause.
8795
8796 2003-09-19  Martin Baulig  <martin@ximian.com>
8797
8798         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8799         `MemberCache parent' argument.  Normally, an interface doesn't
8800         have a parent type except System.Object, but we use this in gmcs
8801         for generic type parameters.
8802
8803 2003-09-18  Martin Baulig  <martin@ximian.com>
8804
8805         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8806         on `type.IsInterface'; don't check whether the type has a parent
8807         to determine whether it's an interface.
8808
8809 2003-09-15  Martin Baulig  <martin@ximian.com>
8810
8811         * class.cs (TypeContainer.DefineType): Added an error flag to
8812         avoid reporting duplicate CS0146's ("class definition is
8813         circular.").
8814
8815         * driver.cs (Driver.MainDriver): Abort if
8816         RootContext.ResolveTree() reported any errors.
8817
8818 2003-09-07  Martin Baulig  <martin@ximian.com>
8819
8820         * report.cs (Error, Warning): Added overloaded versions which take
8821         a `params object[] args' and call String.Format().
8822
8823 2003-09-07  Martin Baulig  <martin@ximian.com>
8824
8825         * decl.cs (DeclSpace..ctor): Don't call
8826         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8827         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8828         (DeclSpace.RecordDecl): New method.
8829
8830         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8831
8832 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8833
8834         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8835         value attributes to be applied to ParameterBuilders.
8836
8837         * class.cs (MethodCore.LabelParameters): Make static and more
8838         generic so that it can be used from other places - like interface
8839         methods, for instance.
8840
8841         * interface.cs (Interface.Emit): Call LabelParameters before
8842         emitting attributes on the InterfaceMethod.
8843
8844 2003-08-26  Martin Baulig  <martin@ximian.com>
8845
8846         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8847         resolving aliases; fixes #47927.
8848
8849 2003-08-26  Martin Baulig  <martin@ximian.com>
8850
8851         * statement.cs (Using.DoResolve): This is internally emitting a
8852         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8853         do not always return.  Fixes #47681.
8854
8855 2003-08-26  Martin Baulig  <martin@ximian.com>
8856
8857         * decl.cs (MemberCore): Moved WarningNotHiding(),
8858         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8859         into MemberBase.
8860         (AdditionResult): Make this nested in DeclSpace.
8861         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8862         argument; call NamespaceEntry.Define() unless we're nested in a
8863         class or struct.
8864
8865         * namespace.cs (Namespace.DefineName): New public function.  This
8866         is called from DeclSpace's .ctor to add 
8867         (Namespace.Lookup): Include DeclSpaces in the lookup.
8868
8869         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8870
8871         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8872
8873 2003-08-25  Martin Baulig  <martin@ximian.com>
8874
8875         * convert.cs (Convert.ExplicitReferenceConversion): When
8876         converting from an interface type to a class, unbox if the target
8877         type is a struct type.  Fixes #47822.
8878
8879 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8880
8881         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8882         #47854.
8883
8884 2003-08-22  Martin Baulig  <martin@ximian.com>
8885
8886         * class.cs (TypeManager.DefineType): When defining a nested type,
8887         call DefineType() on our parent; fixes #47801.
8888
8889 2003-08-22  Martin Baulig  <martin@ximian.com>
8890
8891         * class.cs (MethodData.Define): While checking if a method is an
8892         interface implementation, improve the test a bit more to fix #47654.
8893
8894 2003-08-22  Martin Baulig  <martin@ximian.com>
8895
8896         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8897         correctly; fixes #47722.
8898
8899 2003-08-22  Martin Baulig  <martin@ximian.com>
8900
8901         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8902         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8903
8904         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8905
8906 2003-08-22  Martin Baulig  <martin@ximian.com>
8907
8908         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8909         can only be assigned in static constructors.  Fixes #47161.
8910
8911 2003-08-22  Martin Baulig  <martin@ximian.com>
8912
8913         Rewrote and improved the flow analysis code.
8914
8915         * flowbranching.cs (FlowBranching): Make this class abstract.
8916         (FlowBranching.CreateBranching): New static function to create a
8917         new flow branching.
8918         (FlowBranchingBlock, FlowBranchingException): New classes.
8919         (FlowBranching.UsageVector.Type): New public readonly field.
8920         (FlowBranching.UsageVector.Breaks): Removed the setter.
8921         (FlowBranching.UsageVector.Returns): Removed the setter.
8922         (FlowBranching.UsageVector): Added Break(), Return(),
8923         NeverReachable() and Throw() methods to modify the reachability.
8924         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8925         done by FlowBranching.Merge().
8926         (FlowBranching.UsageVector.MergeChild): New method; merges the
8927         merge result into the current vector.
8928         (FlowBranching.Merge): New abstract method to merge a branching.
8929
8930 2003-08-12  Martin Baulig  <martin@ximian.com>
8931
8932         * expression.cs (Indirection.CacheTemporaries): Create the
8933         LocalTemporary with the pointer type, not its element type.
8934
8935 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8936
8937         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8938         token was a keyword or not.
8939
8940         Add `error' options where an IDENTIFIER was expected;  Provide
8941         CheckToken and CheckIdentifierToken convenience error reporting
8942         functions. 
8943
8944         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8945
8946         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8947         NameSpaceEntry NameSpaceEntry.
8948
8949         (LookupInterfaceOrClass): Avoid creating a full qualified name
8950         from namespace and name: avoid doing lookups when we know the
8951         namespace is non-existant.   Use new Tree.LookupByNamespace which
8952         looks up DeclSpaces based on their namespace, name pair.
8953
8954         * driver.cs: Provide a new `parser verbose' to display the
8955         exception thrown during parsing.  This is turned off by default
8956         now, so the output of a failure from mcs is more graceful.
8957
8958         * namespace.cs: Track all the namespaces defined in a hashtable
8959         for quick lookup.
8960
8961         (IsNamespace): New method
8962
8963 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8964
8965         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8966         we know that we need to concatenate (full typename can never be
8967         null). 
8968
8969         * class.cs: ditto.
8970
8971         * statement.cs: Use a bitfield;  Do not initialize to null things
8972         which are done by the constructor by default.
8973
8974         * cs-parser.jay: bug fix, parameter was 4, not 3.
8975
8976         * expression.cs: Just use the property;
8977
8978         * statement.cs: No need for GetVariableInfo method.
8979
8980 2003-08-08  Martin Baulig  <martin@ximian.com>
8981
8982         * flowanalysis.cs (FlowReturns): This is now nested in the
8983         `FlowBranching' class.
8984         (MyBitVector): Moved this here from statement.cs.
8985         (FlowBranching.SiblingType): New enum type.
8986         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8987
8988 2003-08-07  Martin Baulig  <martin@ximian.com>
8989
8990         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8991         `FlowBranching' class and called `BranchingType'.
8992
8993 2003-08-07  Martin Baulig  <martin@ximian.com>
8994
8995         * flowanalysis.cs: Moved all the control flow analysis code into
8996         its own file.
8997
8998 2003-08-07  Martin Baulig  <martin@ximian.com>
8999
9000         * assign.cs (Assign.DoResolve): `target' must either be an
9001         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9002         #37319.
9003
9004 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9005
9006         * expression.cs (BinaryMethod): This kind of expression is created by the
9007         Binary class if it determines that the operator has to be handled
9008         by a method.
9009
9010         (BinaryDelegate): This kind of expression is created if we are
9011         dealing with a + or - operator on delegates.
9012
9013         (Binary): remove method, argumetns, and DelegateOperator: when
9014         dealing with methods, 
9015
9016         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9017
9018         * statement.cs (Block): use bitfields for the three extra booleans
9019         we had in use.   Remove unused topblock parameter.
9020
9021         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9022
9023         * assign.cs: Drop extra unneeded tests.
9024
9025 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9028
9029         * statement.cs (Foreach): Use VariableStorage instead of
9030         LocalBuilders.   
9031
9032         * codegen.cs (VariableStorage): New class used by clients that
9033         require a variable stored: locals or fields for variables that
9034         need to live across yield.
9035
9036         Maybe provide a convenience api for EmitThis+EmitLoad?
9037
9038         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9039         these bad boys.
9040
9041 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9042
9043         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9044         RemapParameterLValue): New methods that are used to turn a
9045         precomputed FieldInfo into an expression like this:
9046
9047                 instance.FieldInfo
9048
9049         The idea is to use this instead of making LocalVariableReference
9050         have more than one meaning.
9051
9052         * cs-parser.jay: Add error production to BASE.
9053
9054         * ecore.cs: Deal with TypeManager.GetField returning null, which
9055         is now a valid return value.
9056
9057         (FieldExprNoAddress): New expression for Fields whose address can
9058         not be taken.
9059
9060         * expression.cs (LocalVariableReference): During the resolve
9061         phases, create new expressions if we are in a remapping context.
9062         Remove code that dealt with remapping here.
9063
9064         (ParameterReference): same.
9065
9066         (ProxyInstance): New expression, like the `This' expression, but
9067         it is born fully resolved.  We know what we are doing, so remove
9068         the errors that are targeted to user-provided uses of `this'.
9069
9070         * statement.cs (Foreach): our variable is now stored as an
9071         Expression;  During resolution, follow the protocol, dont just
9072         assume it will return this.
9073
9074 2003-08-06  Martin Baulig  <martin@ximian.com>
9075
9076         * support.cs (SeekableStreamReader.cs): New public class.
9077
9078         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9079         SeekableStreamReader instead of the normal StreamReader.
9080
9081 2003-08-04  Martin Baulig  <martin@ximian.com>
9082
9083         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9084         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9085         deambiguate casts and delegate invocations.
9086         (parenthesized_expression): Use the new tokens to ensure this is
9087         not a cast of method invocation.
9088
9089         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9090         when reading a `)' and Deambiguate_CloseParens () was previously
9091         called.
9092
9093         * expression.cs (ParenthesizedExpression): New class.  This is
9094         just used for the CS0075 test.
9095         (Binary.DoResolve): Check for CS0075.   
9096
9097 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9098
9099         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9100         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9101         reference comparison.
9102
9103         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9104         examine the ReturnType for equality - this is necessary in the
9105         cases of implicit and explicit operators whose signature also
9106         includes the return type.
9107
9108 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9109
9110         * namespace.cs: Cache the result of the namespace computation,
9111         instead of computing it every time.
9112
9113 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9114
9115         * decl.cs: Use a global arraylist that we reuse over invocations
9116         to avoid excesive memory consumption.  Reduces memory usage on an
9117         mcs compile by one meg (45 average).
9118
9119         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9120         private, work around that.
9121
9122 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9123
9124         * literal.cs (IntLiteral): Define Zero and One static literals. 
9125
9126         * cs-parser.jay (integer_literal): use static literals to reduce
9127         memory usage for the most used literals (0, 1 and -1).  211kb
9128         reduced in memory usage.
9129
9130         Replace all calls to `new ArrayList' with `new
9131         ArrayList(4)' which is a good average number for most allocations,
9132         and also requires only 16 bytes of memory for its buffer by
9133         default. 
9134
9135         This reduced MCS memory usage in seven megabytes for the RSS after
9136         bootstrapping.
9137
9138 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9139
9140         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9141         handle params methods the correct way by forming only one
9142         applicable set with params and normal methods in them. Earlier we
9143         were looking at params methods only if we found no normal methods
9144         which was not the correct thing to do.
9145
9146         (Invocation.BetterFunction): Take separate arguments indicating
9147         when candidate and the best method are params methods in their
9148         expanded form.
9149
9150         This fixes bugs #43367 and #46199.
9151
9152         * attribute.cs: Documentation updates.
9153
9154         (CheckAttribute): Rename to CheckAttributeTarget.
9155         (GetValidPlaces): Rename to GetValidTargets.
9156
9157         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9158         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9159
9160         Fixes bug #44468.
9161
9162 2003-07-28  Martin Baulig  <martin@ximian.com>
9163
9164         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9165         name when looking up the base class of a nested class.  Fixes #46977.
9166
9167 2003-07-26  Martin Baulig  <martin@ximian.com>
9168
9169         * expression.cs (Indexers.Indexer): New nested struct; contains
9170         getter, setter and the indexer's type.
9171         (Indexers.Properties): This is now an ArrayList of
9172         Indexers.Indexer's.
9173         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9174         indexer doesn't have any getters.
9175
9176         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9177         for embedded property and indexer assignments.
9178
9179 2003-07-26  Martin Baulig  <martin@ximian.com>
9180
9181         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9182         preprocessor directive is not the first non-whitespace character
9183         on a line.
9184
9185 2003-07-26  Martin Baulig  <martin@ximian.com>
9186
9187         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9188         namespace parsing, follow the spec more closely.
9189
9190         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9191         NamespaceEntry.Lookup().
9192
9193 2003-07-25  Martin Baulig  <martin@ximian.com>
9194
9195         * MethodCore.cs (OverridesSomething): New public field; it's set
9196         from TypeContainer.DefineMembers if this method overrides
9197         something (which doesn't need to be a method).  Fix #39462.
9198
9199 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9200
9201         * typemanager.cs (GetMembers): Ensure that the list of members is
9202         reversed. This keeps things in sync.
9203
9204         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9205         find an AttributeUsage attribute.
9206
9207         * expression.cs (Invocation.OverloadResolve): Perform the check
9208         which disallows Invoke to be directly called on a Delegate.
9209
9210         (Error_InvokeOnDelegate): Report error cs1533.
9211
9212 2003-07-25  Martin Baulig  <martin@ximian.com>
9213
9214         * expression.cs (Indexers.GetIndexersForType): Only look in the
9215         interface hierarchy if the requested type is already an
9216         interface.  Fixes #46788 while keeping #46502 fixed.
9217
9218 2003-07-25  Martin Baulig  <martin@ximian.com>
9219
9220         * class.cs (TypeContainer.DefineMembers): Check whether all
9221         readonly fields have been assigned and report warning CS0649 if
9222         not.
9223
9224         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9225         a valuetype.
9226
9227 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9228
9229         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9230         returned from GetMethods to make things consistent with the
9231         assumptions MCS makes about ordering of methods.
9232
9233         This should comprehensively fix bug #45127 and it does :-)
9234
9235         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9236         ordering is actually reverse.
9237
9238         * Clean up some debug messages I left lying around.
9239
9240         * interface.cs (Populate*): Get rid of code which emits attributes
9241         since the stage in which we emit attributes is the 'Emit' stage,
9242         not the define stage.
9243
9244         (Emit): Move attribute emission for interface members here.
9245
9246 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9247
9248         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9249         closely: we eliminate methods in base types when we have an
9250         applicable method in a top-level type.
9251
9252         Please see section 14.5.5.1 for an exact description of what goes
9253         on. 
9254
9255         This fixes bug #45127 and a host of other related to corlib compilation.
9256
9257         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9258         array is the method corresponding to the top-level type (this is
9259         because of the changes made to icall.c) so we change this
9260         accordingly.
9261
9262         (MethodGroupExpr.Name): This too.
9263
9264         * typemanager.cs (GetElementType): New method which does the right
9265         thing when compiling corlib. 
9266
9267         * everywhere: Make use of the above in the relevant places.
9268
9269 2003-07-22  Martin Baulig  <martin@ximian.com>
9270
9271         * cs-parser.jay (invocation_expression): Moved
9272         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9273         `cast_expression', but create a InvocationOrCast which later
9274         resolves to either an Invocation or a Cast.
9275
9276         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9277         method; call this before EmitStatement() to make sure that this
9278         expression can be used as a statement.
9279
9280         * expression.cs (InvocationOrCast): New class; resolves to either
9281         an Invocation or a Cast.
9282
9283         * statement.cs (StatementExpression): Call ResolveStatement() on
9284         the ExpressionStatement before emitting it.
9285
9286 2003-07-21  Martin Baulig  <martin@ximian.com>
9287
9288         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9289         `ref' and `out' attributes match; fixes #46220.
9290         (MemberAccess.ResolveMemberAccess): You can't reference a type
9291         through an expression; fixes #33180.
9292         (Indexers.GetIndexersForType): Don't return the indexers from
9293         interfaces the class implements; fixes #46502.
9294
9295 2003-07-21  Martin Baulig  <martin@ximian.com>
9296
9297         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9298         CS0661 checks; fixes bug #30442.
9299
9300 2003-07-21  Martin Baulig  <martin@ximian.com>
9301
9302         * decl.cs (AdditionResult): Added `Error'.
9303
9304         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9305
9306         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9307         makes cs0031.cs actually work.
9308
9309 2003-07-20  Martin Baulig  <martin@ximian.com>
9310
9311         * namespace.cs: Fixed that bug which caused a crash when compiling
9312         the debugger's GUI.
9313
9314 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9315
9316         * typemanager.cs (LookupTypeReflection): Never expose types which
9317         are NotPublic, NestedPrivate, NestedAssembly, or
9318         NestedFamANDAssem.  We used to return these, and later do a check
9319         that would report a meaningful error, but the problem is that we
9320         would not get the real match, if there was a name override.
9321
9322 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9323
9324         * namespace.cs (Namespace, Name): Do not compute the namespace
9325         name dynamically, compute it in the constructor.  This reduced
9326         memory usage by 1697 KB.
9327
9328         * driver.cs: Use --pause to pause at the end.
9329
9330 2003-07-17  Peter Williams  <peter@newton.cx>
9331
9332         * Makefile: Change the name of the test target so that it doesn't
9333         conflict with the recursive test target.
9334
9335 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9338         AddressOf): Do not use EmitThis, that was wrong, use the actual
9339         this pointer.
9340
9341 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9342
9343         * class.cs (MethodData.Define): While checking if a method is an
9344         interface implementation, improve the test: If we are not public
9345         (use new test here: use the computed MethodAttributes directly,
9346         instead of the parsed modifier flags) check if the `implementing'
9347         method comes from an interface or not.
9348
9349         * pending.cs (VerifyPendingMethods): Slightly better error
9350         message.
9351
9352         * makefile: add test target that does the mcs bootstrap.
9353
9354 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9355
9356         * interface.cs (Define): Do nothing here since there are no
9357         members to populate etc. Move the attribute emission out of here
9358         since this was just totally the wrong place to put it. Attribute
9359         application happens during the 'Emit' phase, not in the 'Define'
9360         phase.
9361
9362         (Emit): Add this method and move the attribute emission here
9363
9364         * rootcontext.cs (EmitCode): Call the Emit method on interface
9365         types too.
9366
9367 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9368
9369         * expression.cs (OverloadResolve): Report error only if Location
9370         is not 'Null' which means that there was a probe going on.
9371
9372 2003-07-14  Martin Baulig  <martin@ximian.com>
9373
9374         * expression.cs (ConditionalLogicalOperator): New public class to
9375         implement user defined conditional logical operators.
9376         This is section 14.11.2 in the spec and bug #40505.
9377
9378 2003-07-14  Martin Baulig  <martin@ximian.com>
9379
9380         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9381
9382 2003-07-14  Martin Baulig  <martin@ximian.com>
9383
9384         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9385
9386         * ecore.cs (IVariable.VerifyFixed): New interface method.
9387
9388         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9389         operator, check whether the variable is actually fixed.  Fixes bug
9390         #36055.  Set a variable definitely assigned when taking its
9391         address as required by the spec.
9392
9393         * statement.cs (LocalInfo.IsFixed): New field.
9394         (LocalInfo.MakePinned): Set `IsFixed' to true.
9395
9396 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9397
9398         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9399         for .ctors, ensure that we only ask for members declared in the
9400         attribute type (BindingFlags.DeclaredOnly).
9401
9402         Fixes bug #43632.
9403
9404         * expression.cs (Error_WrongNumArguments): Report error 1501
9405         correctly the way CSC does.
9406
9407 2003-07-13  Martin Baulig  <martin@ximian.com>
9408
9409         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9410         lookup on the fully qualified name, to make things like "X.X" work
9411         where "X.X" is a fully qualified type name, but we also have a
9412         namespace "X" in the using list.  Fixes #41975.
9413
9414 2003-07-13  Martin Baulig  <martin@ximian.com>
9415
9416         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9417         function. If we're a CompoundAssign, we need to create an embedded
9418         CompoundAssign, not an embedded Assign.
9419         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9420         Fixes #45854.
9421
9422 2003-07-13  Martin Baulig  <martin@ximian.com>
9423
9424         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9425         work to fix bug #46088.
9426
9427 2003-07-13  Ravi Pratap <ravi@ximian.com>
9428
9429         * class.cs (Operator.Emit): Do not emit attributes here - it is
9430         taken care of by the Method class that we delegate too. This takes
9431         care of bug #45876.
9432
9433 2003-07-10  Martin Baulig  <martin@ximian.com>
9434
9435         * expression.cs (TypeOfVoid): New class.
9436         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9437
9438 2003-07-10  Martin Baulig  <martin@ximian.com>
9439
9440         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9441         bug #35957.
9442
9443 2003-07-10  Martin Baulig  <martin@ximian.com>
9444
9445         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9446         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9447
9448         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9449
9450         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9451
9452 2003-07-10  Martin Baulig  <martin@ximian.com>
9453
9454         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9455         of decimal.  Fixes #42850.
9456
9457         NOTE: I also fixed the created byte blob, but this doesn't work on
9458         the MS runtime and csc never produces any byte blobs for decimal
9459         arrays.
9460
9461 2003-07-10  Martin Baulig  <martin@ximian.com>
9462
9463         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9464         structs; fixes #32068.
9465         (Block.AddChildVariableNames): Fixed #44302.
9466
9467 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9468
9469         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9470
9471 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9472
9473         * attribute.cs: And this test is onger needed.
9474
9475 2003-07-08  Martin Baulig  <martin@ximian.com>
9476
9477         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9478         inaccessible types.  Fixes #36313.
9479
9480         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9481
9482         * namespace.cs (NamespaceEntry): Create implicit entries for all
9483         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9484         implicit entries for N1.N2 and N1.
9485
9486 2003-07-08  Martin Baulig  <martin@ximian.com>
9487
9488         Rewrote the handling of namespaces to fix a lot of the issues
9489         wrt. `using' aliases etc.
9490
9491         * namespace.cs (Namespace): Splitted this class into a
9492         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9493
9494         * typemanager.cs (TypeManager.IsNamespace): Removed.
9495         (TypeManager.ComputeNamespaces): Only compute namespaces from
9496         loaded assemblies here, not the namespaces from the assembly we're
9497         currently compiling.
9498
9499 2003-07-08  Martin Baulig  <martin@ximian.com>
9500
9501         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9502
9503 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9504
9505         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9506         already fixed it.  
9507
9508         I thought about the memory savings here, but LookupTypeReflection
9509         is used under already very constrained scenarios.  Compiling
9510         corlib or mcs only exposes one hit, so it would not really reduce
9511         any memory consumption.
9512
9513 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9514
9515         * typemanager.cs: fixes bug #45889 by only adding public types from
9516         other assemblies to the list of known types.
9517
9518 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9521         on the type we resolved.
9522
9523 2003-07-05  Martin Baulig  <martin@ximian.com>
9524
9525         * pending.cs (PendingImplementation.ParentImplements): Don't
9526         create the proxy if the parent is abstract.
9527
9528         * class.cs (TypeContainer.DefineIndexers): Process explicit
9529         interface implementations first.  Fixes #37714.
9530
9531 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9534         defined recursively;  but since we modify the input parameters
9535         (left is set to `this' temporarily), we reset this value if the
9536         left_is_explicit is false, which gives the original semantics to
9537         the code.  
9538
9539         * literal.cs (NullPointer): new class used to represent a null
9540         literal in a pointer context.
9541
9542         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9543         type is a pointer, use a NullPointer object instead of a
9544         NullLiteral.   Closes 43687
9545
9546         (ExplicitConversion): Convert pointer values using
9547         the conv opcode to the proper type.
9548
9549         * ecore.cs (New): change ValueTypeVariable property into a method,
9550         that returns whether the valuetype is suitable for being used.
9551
9552         * expression.cs (Binary.DoNumericPromotions): Only return if we
9553         the int constant was a valid uint, and we can return both left and
9554         right as uints.  If not, we continue processing, to trigger the
9555         type conversion.  This fixes 39018.
9556
9557         * statement.cs (Block.EmitMeta): During constant resolution, set
9558         the CurrentBlock property on the emitcontext, so that we resolve
9559         constants propertly.
9560
9561 2003-07-02  Martin Baulig  <martin@ximian.com>
9562
9563         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9564         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9565
9566         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9567         than emitting it here.
9568
9569         * statement.cs: Fixed some more flow analysis bugs.
9570
9571 2003-07-02  Martin Baulig  <martin@ximian.com>
9572
9573         * class.cs (MethodData.Define): When implementing interface
9574         methods, set Final unless we're Virtual.
9575
9576         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9577         check work for interface methods.
9578
9579 2003-07-01  Martin Baulig  <martin@ximian.com>
9580
9581         * ecore.cs (EmitContext.This): Replaced this property with a
9582         GetThis() method which takes a Location argument.  This ensures
9583         that we get the correct error location for a CS0188.
9584
9585 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9586
9587         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9588         ImplicitStandardConversion.
9589
9590         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9591
9592 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9593
9594         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9595         optimization.
9596
9597 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9600         constructors.
9601
9602         (MethodData.Define): Turn off initlocals for unsafe methods.
9603
9604 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9605
9606         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9607         complete;  Fixes #37521.
9608
9609         * delegate.cs: Use Modifiers.TypeAttr to compute the
9610         TypeAttributes, instead of rolling our own.  This makes the flags
9611         correct for the delegates.
9612
9613 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * class.cs (Constructor.Define): Set the private flag for static
9616         constructors as well.
9617
9618         * cs-parser.jay (statement_expression): Set the return value to
9619         null, to avoid a crash when we catch an error.
9620
9621 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9622
9623         * cs-parser.jay: Applied patch from Jackson that adds support for
9624         extern and unsafe modifiers to destructor declarations.
9625
9626         * expression.cs: Report error 21 if the user is trying to index a
9627         System.Array.
9628
9629         * driver.cs: Add an error message, suggested by the bug report.
9630
9631         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9632         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9633
9634 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * namespace.cs: Add some information to reduce FAQs.
9637
9638 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9641         underlying enumeration types.  Fixes #43915.
9642
9643         * expression.cs: Treat ushort/short as legal values to be used in
9644         bitwise operations.
9645
9646 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9647
9648         * delegate.cs: transfer custom attributes for paramenters from
9649         the delegate declaration to Invoke and BeginInvoke.
9650
9651 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9652
9653         * attribute.cs: handle custom marshalers and emit marshal info
9654         for fields, too.
9655
9656 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9657
9658         * makefile.gnu: Added anonymous.cs to the compiler sources.
9659
9660 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * iterators.cs: Change the name of the proxy class to include two
9663         underscores.
9664
9665         * cs-parser.jay: Update grammar to include anonymous methods.
9666
9667         * anonymous.cs: new file.
9668
9669 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9670
9671         * class.cs (Field.Define): Add missing test for pointers and
9672         safety. 
9673
9674 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9675
9676         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9677         we use the stobj opcode.
9678
9679         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9680         since it wasn't the correct fix. 
9681
9682         It still is puzzling that we are required to use stobj for IntPtr
9683         which seems to be a ValueType.
9684
9685 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9686
9687         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9688         during regular simple name resolution.   Now, the trick is that
9689         instead of returning for processing the simplename, we do a
9690         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9691         contextual lookup type).   If a match is found, return that, if
9692         not, return for further composition.
9693
9694         This fixes long-standing 30485.
9695
9696         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9697         using the address to initialize an object, do an Stobj instead of
9698         using the regular Stelem.
9699
9700         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9701         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9702         Because if we are a BaseIndexerAccess that value will be true.
9703         Fixes 43643.
9704
9705         * statement.cs (GotoCase.Resolve): Return after reporting an
9706         error, do not attempt to continue. 
9707
9708         * expression.cs (PointerArithmetic.Emit): If our operand is a
9709         long, convert our constants to match the operand before
9710         multiplying.  Convert to I type before adding.   Fixes 43670.
9711
9712 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9713
9714         * enum.cs (ImplicitConversionExists) : Rename to
9715         ImplicitEnumConversionExists to remove ambiguity. 
9716
9717         * ecore.cs (NullCast): New type of cast expression class which
9718         basically is very similar to EmptyCast with the difference being
9719         it still is a constant since it is used only to cast a null to
9720         something else
9721         (eg. (string) null)
9722
9723         * convert.cs (ImplicitReferenceConversion): When casting a null
9724         literal, we return a NullCast.
9725
9726         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9727         should be around anymore.
9728
9729         The renaming (reported was slightly wrong). Corrections:
9730
9731         ConvertImplicitStandard -> ImplicitConversionStandard
9732         ConvertExplicitStandard -> ExplicitConversionStandard
9733
9734         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9735         before passing them in !
9736
9737         * convert.cs (ImplicitConversionStandard): When comparing for
9738         equal expr and target types, ensure that expr is not a
9739         NullLiteral.
9740
9741         In general, we must not be checking (expr_type ==
9742         target_type) in the top level conversion methods
9743         (ImplicitConversion, ExplicitConversion etc). This checking is
9744         done in the methods that they delegate to.
9745
9746 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9747
9748         * convert.cs: Move Error_CannotConvertType,
9749         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9750         ImplicitNumericConversion, ImplicitConversionExists,
9751         ImplicitUserConversionExists, StandardConversionExists,
9752         FindMostEncompassedType, FindMostSpecificSource,
9753         FindMostSpecificTarget, ImplicitUserConversion,
9754         ExplicitUserConversion, GetConversionOperators,
9755         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9756         TryImplicitIntConversion, Error_CannotConvertImplicit,
9757         ConvertImplicitRequired, ConvertNumericExplicit,
9758         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9759         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9760         its own file.
9761
9762         Perform the following renames:
9763
9764         StandardConversionExists -> ImplicitStandardConversionExists
9765         ConvertImplicit -> ImplicitConversion
9766         ConvertImplicitStandard -> ImplicitStandardConversion
9767         TryImplicitIntConversion -> ImplicitIntConversion
9768         ConvertImplicitRequired -> ImplicitConversionRequired
9769         ConvertNumericExplicit -> ExplicitNumericConversion
9770         ConvertReferenceExplicit -> ExplicitReferenceConversion
9771         ConvertExplicit -> ExplicitConversion
9772         ConvertExplicitStandard -> ExplicitStandardConversion
9773
9774 2003-05-19  Martin Baulig  <martin@ximian.com>
9775
9776         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9777         (TypeInfo): Added support for structs having structs as fields.
9778
9779         * ecore.cs (FieldExpr): Implement IVariable.
9780         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9781         VariableInfo for the field.
9782
9783 2003-05-18  Martin Baulig  <martin@ximian.com>
9784
9785         * expression.cs (This.DoResolve): Report a CS0027 if we're
9786         emitting a field initializer.
9787
9788 2003-05-18  Martin Baulig  <martin@ximian.com>
9789
9790         * expression.cs (This.ResolveBase): New public function.
9791         (This.DoResolve): Check for CS0188.
9792
9793         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9794         This.Resolve().
9795
9796         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9797         `instance_expression' to null if we don't have any non-static
9798         methods.
9799
9800 2003-05-18  Martin Baulig  <martin@ximian.com>
9801
9802         Reworked the way how local variables and parameters are handled by
9803         the flow analysis code.
9804
9805         * statement.cs (TypeInfo, VariableMap): New public classes.
9806         (VariableInfo): New public class.  This is now responsible for
9807         checking whether a variable has been assigned.  It is used for
9808         parameters and local variables.
9809         (Block.EmitMeta): Take the InternalParameters as argument; compute
9810         the layout of the flow vectors here.
9811         (Block.LocalMap, Block.ParameterMap): New public properties.
9812         (FlowBranching): The .ctor doesn't get the InternalParameters
9813         anymore since Block.EmitMeta() now computes the layout of the flow
9814         vector.
9815         (MyStructInfo): This class is now known as `StructInfo' and nested
9816         in `TypeInfo'; we don't access this directly anymore.
9817
9818         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9819         property and removed IsAssigned(), IsFieldAssigned(),
9820         SetAssigned() and SetFieldAssigned(); we now call them on the
9821         VariableInfo so we don't need to duplicate this code everywhere.
9822
9823         * expression.cs (ParameterReference): Added `Block block' argument
9824         to the .ctor.
9825         (LocalVariableReference, ParameterReference, This): The new
9826         VariableInfo class is now responsible for all the definite
9827         assignment stuff.
9828
9829         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9830         IsParameterAssigned, SetParameterAssigned): Removed.
9831
9832 2003-05-18  Martin Baulig  <martin@ximian.com>
9833
9834         * typemanager.cs (InitCoreTypes): Try calling
9835         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9836         the 3-args-version.  Corlib now also needs our `void_type'.
9837         (GetMethod): Added overloaded version which takes an optional
9838         `bool report_errors' to allow lookups of optional methods.
9839
9840 2003-05-12  Martin Baulig  <martin@ximian.com>
9841
9842         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9843         only used for locals and not for parameters.
9844
9845 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9846
9847         * support.cs (InternalParameters.ParameterType): Return the
9848         ExternalType of the parameter.
9849
9850         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9851         they were unused.
9852
9853 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * class.cs (MethodData.Define): Do not set the `newslot' on
9856         interface members, if they are also flagged as "override".
9857
9858         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9859         better code for ++i and i++.  This only works for static fields
9860         and local variables.
9861
9862         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9863         want to pull the DeclSpace out of the builder_to_declspace instead
9864         of the TypeBuilder (like in TypeContainer.FindMembers).
9865
9866         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9867         instead of LookupTypeContainer.  Fixes the crash on .NET for
9868         looking up interface members.
9869
9870         * const.cs: Create our own emit context during the Definition
9871         stage, so that constants are evaluated in the proper context, when
9872         a recursive definition happens.
9873
9874 2003-05-11  Martin Baulig  <martin@ximian.com>
9875
9876         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9877         new block for a switch section.
9878         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9879         the adding/lookup in the switch block.  Fixes #39828.
9880
9881 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9882
9883         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9884         functionality: I needed to convert the data after I had performed
9885         the add/sub operation into the operands type size.
9886
9887         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9888         pass the type for the box operation, otherwise the resulting
9889         object would have been of type object.
9890
9891         (BoxedCast): Add constructor to specify the type to box as.
9892
9893 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9894
9895         * iterators.cs: I was reusing the `count' variable inadvertently,
9896         take steps to not allow this to happen.
9897
9898 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9899
9900         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9901         by creating an array at the point where the params starts and
9902         putting all those arguments there, then adjusting the size of the
9903         array.
9904
9905 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9906
9907         * expression.cs (New.AddressOf): Implement interface
9908         IMemoryLocation.  This is used when the `new' operator is used in
9909         the context of an invocation to a method on a value type.
9910
9911         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9912         example. 
9913
9914         * namespace.cs: Also check the using aliases here.
9915
9916         * driver.cs: Move the test for using validity after the types have
9917         been entered, so we do a single pass that also includes the using
9918         aliases. 
9919
9920         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9921         in the regular case.   CreateSiblingForFinally is doing extra
9922         error checking.
9923
9924         * attribute.cs (GetAttributeArgumentExpression): Store the result
9925         on an out value, and use the return value to indicate failure
9926         instead of using null (which is a valid return for Constant.GetValue).
9927
9928         * statement.cs: Perform the analysis flow for the increment
9929         portion after the statement, because this will be the real flow of
9930         execution.  Fixes #42385
9931
9932         * codegen.cs (EmitContext.EmitArgument,
9933         EmitContext.EmitStoreArgument): New helper functions when the
9934         RemapToProxy flag is set.
9935
9936         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9937         function.
9938
9939         Add support for remapping parameters. 
9940
9941         * iterators.cs: Propagate parameter values;  Store parameter
9942         values in the proxy classes.
9943
9944 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9947         need a proxy reference;  I do not know what I was thinking
9948
9949         * cs-parser.jay (constructor_initializer): catch another error,
9950         and display nice message.
9951
9952         (field_declaration): catch void field declaration
9953         to flag a better error. 
9954
9955         * class.cs (MemberBase.CheckBase): Report an error instead of a
9956         warning if a new protected member is declared in a struct. 
9957         (Field.Define): catch the error of readonly/volatile.
9958
9959         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9960
9961         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9962         volatile variable is taken
9963
9964 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * statement.cs (Fixed.Resolve): Report an error if we are not in
9967         an unsafe context.
9968
9969 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * typemanager.cs: reuse the code that handles type clashes for
9972         delegates and enumerations.
9973
9974         * class.cs (Report28): Always report.
9975
9976         * expression.cs (EncodeAsAttribute): Allow nulls here.
9977
9978 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9979
9980         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9981         the functionality for testing whether an expression is valid for
9982         an attribute here.  Also handle the case of arrays of elements
9983         being stored. 
9984
9985         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9986         encoding a linear array into an array of objects that are suitable
9987         to be passed to an CustomAttributeBuilder.
9988
9989         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9990
9991         * ecore.cs: (FieldExpr): Handle field remapping here.
9992
9993         * iteratators.cs: Pass the instance variable (if the method is an
9994         instance method) to the constructors, so we can access the field
9995         variables on the class.
9996
9997         TODO: Test this with structs.  I think the THIS variable on
9998         structs might have to be a pointer, and not a refenrece
9999
10000 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10001
10002         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10003         local variables to fields in a proxy class.
10004
10005         * iterators.cs (PopulateProxy): Rename our internal fields to
10006         <XXX>.  
10007         Create a <THIS> field if we are an instance method, so we can
10008         reference our parent container variables.
10009         (MapVariable): Called back from the EmitContext code to enter a
10010         new variable to field mapping into the proxy class (we just create
10011         a FieldBuilder).
10012
10013         * expression.cs
10014         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10015         for using the remapped locals to fields.
10016
10017         I placed the code here, because that gives the same semantics to
10018         local variables, and only changes the Emit code.
10019
10020         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10021         statements inside iterators.
10022         (VariableInfo): Add a FieldBuilder for the cases when we are
10023         remapping local variables to fields in a proxy class
10024
10025         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10026         current_block != null.
10027
10028         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10029         not cope with strings, as it has been moved to the
10030         TableSwitchEmit.  Fixed bug in switch generation.
10031
10032         * expression.cs (New.DoResolve): Provide more context for the user
10033         when reporting an error.
10034
10035         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10036         pointers. 
10037
10038         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10039         check the permissions for it.  Note than in a type-resolution
10040         context the check was already present in DeclSpace.ResolveType,
10041         but was missing from the MemberAccess.
10042
10043         (ArrayCreation.CheckIndices): warn if the user has
10044         more nested levels of expressions, but there are no more
10045         dimensions specified.  Avoids crash on bug 41906.
10046
10047 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10048
10049         * statement.cs (Block): replace Implicit bool, for a generic
10050         flags.   
10051         New flag: `Unchecked'.  This is used during the EmitMeta phase
10052         (which is out-of-line with the regular Resolve/Emit process for a
10053         statement, as this is done ahead of time, but still gets a chance
10054         to call constant resolve).
10055
10056         (Block.Flags): new enum for adding a new flag.
10057
10058         (Block.EmitMeta): track the state of unchecked.
10059
10060         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10061         to enable constant resolution to work there as well.
10062
10063 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10064
10065         * typemanager.cs (ienumerable_type): Also look up
10066         System.Collections.IEnumerable. 
10067
10068 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10069
10070         TODO: Test more than one conditional per method.
10071
10072         * class.cs (Indexer.Define): Report the location where the user is
10073         referencing the unsupported feature.
10074
10075         (MethodData): Overload the use of `conditionals' to
10076         minimize the creation of needless ArrayLists.   This saves roughly
10077         212kb on my machine.
10078
10079         (Method): Implement the new IIteratorContainer interface.
10080         (Method.SetYields): Implement the method by setting the ModFlags
10081         to contain METHOD_YIELDS.
10082
10083         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10084         which just got set to null.
10085
10086         * iterators.cs: New file.
10087
10088         (Yield, YieldBreak): New statements.
10089
10090         * statement.cs (Return.Resolve): Flag an error if we are used in
10091         an iterator method.
10092
10093         * codegen.cs (InIterator): New flag set if the code is being
10094         compiled in an iterator method.
10095
10096         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10097         internal modifier, and we just use it to avoid adding extra
10098         fields, as this is seldom used.  
10099
10100         * cs-parser.jay: Add yield_statement (yield and yield break).
10101
10102         * driver.cs: New flag -v2 to turn on version 2 features. 
10103
10104         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10105         hashtable when v2 is enabled.
10106
10107 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10110         there is already a namespace defined with this name.
10111
10112         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10113         people upgraded their corlibs.
10114
10115         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10116         always use fully qualified types, no need to use the compiler
10117         front end.
10118
10119         (TypeManager.IsNamespace): Use binarysearch.
10120
10121         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10122         AddDelegate): I did not quite use the new IsValid API properly: I
10123         have to pass the short-name and the fullname.  I was passing only
10124         the basename instead of the fullname sometimes. 
10125
10126         (TypeContainer.DefineType): call NamespaceClash.
10127
10128         * interface.cs (Interface.DefineType): use NamespaceClash before
10129         defining the type.
10130
10131         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10132         defining the type.
10133
10134         * enum.cs: (Enum.DefineType): use NamespaceClash before
10135         defining the type.
10136
10137         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10138         speed increase.  First, use the negative_hits cache when we get a
10139         negative.  Second, add the type with its full original name
10140         instead of the new . and + encoded name (reflection uses + to
10141         separate type from a nested type).  Use LookupTypeReflection
10142         directly which bypasses the type->name hashtable (that we already
10143         know does not contain the type.
10144
10145         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10146         location/container type. 
10147
10148         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10149
10150 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10151
10152         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10153
10154         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10155         method is being referenced in the method group from a static
10156         context, and report error 120 if so.
10157
10158         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10159         Error118. 
10160
10161         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10162         is created, we create the A namespace).
10163
10164         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10165         Fixes #41591
10166
10167 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10168
10169         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10170         invocation to ModuleBuilder.GetType with the same values will
10171         return a new type instance, so we need to cache its return
10172         values. 
10173
10174         * expression.cs (Binary.ResolveOperator): Only allow the compare
10175         operators on enums if they are of the same type.
10176
10177         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10178         types of ValueType on their own case.  Before we were giving them
10179         the same treatment as objects.
10180
10181         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10182         fullname.  Short name is used to compare against container name.
10183         Fullname is used to check against defined namespace names.
10184
10185         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10186         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10187
10188         (Method.CheckBase): Call parent.
10189         (MemberBase.CheckBase): Check for protected members on sealed
10190         classes.
10191         (PropertyBase.CheckBase): Call parent.
10192         (Field.Define): Call parent.
10193
10194         * report.cs: Negative error codes are now mapped to 8000 - code,
10195         so that the display is render more nicely.
10196
10197         * typemanager.cs: Do not use try/catch, instead report a regular
10198         error. 
10199
10200         (GetPointerType, GetReferenceType): These methods provide
10201         mechanisms to obtain the T* and T& from a T.  We had the code
10202         previously scattered around the code base, and it also used
10203         TypeManager.LookupType that would go through plenty of caches.
10204         This one goes directly to the type source.
10205
10206         In some places we did the Type.GetType followed by
10207         ModuleBuilder.GetType, but not in others, so this unifies the
10208         processing as well.
10209
10210         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10211         statements now that we have namespace information.
10212
10213         * typemanager.cs (IsNamespace): New method, returns whether the
10214         string presented is a namespace or not.
10215
10216         (ComputeNamespaces): New public entry point, computes the list of
10217         available namespaces, using the GetNamespaces API call in Mono, or
10218         the slower version in MS.NET.   
10219
10220         Now before we start the semantic analysis phase, we have a
10221         complete list of namespaces including everything that the user has
10222         provided.
10223
10224         Deleted old code to cache namespaces in .nsc files.
10225
10226 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10229         class/struct location definition Location for the implicit
10230         constructor location.
10231
10232         (Operator.Define): Use the location of the operator for the
10233         implicit Method definition.
10234
10235         (Constructor.Emit): use the constructor location for the implicit
10236         base initializer constructor.
10237
10238         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10239         and the Expression class now contains two new methods:
10240
10241         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10242         isolate type lookup from the rest of the resolution process.
10243
10244         Since we use Expressions to hold type definitions due to the way
10245         we parse the input we have historically overloaded Resolve to
10246         perform the Type lookups if a special flag is passed.  Now this is
10247         eliminated and two methods take their place. 
10248
10249         The differences in the two methods between xStep and xTerminal is
10250         that xStep is involved in our current lookup system that uses
10251         SimpleNames to compose a name, while xTerminal is used just to
10252         catch the case where the simplename lookup failed.
10253
10254 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10255
10256         * expression.cs (ResolveMemberAccess): Remove redundant code.
10257         TypeExpr expressions are always born fully resolved.
10258
10259         * interface.cs (PopulateMethod): Do not lookup the types twice.
10260         We were doing it once during SemanticAnalysis and once during
10261         PopulateMethod.
10262
10263         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10264         in local variable type definitions, were being returned as a
10265         SimpleName (we decomposed everything into a string), that is
10266         because primary_expression was being used instead of a type in the
10267         grammar (reduce/reduce conflicts).
10268
10269         The part that was wrong is that we converted the expression into a
10270         string (an oversimplification in one hand, compounded with primary
10271         expressions doing string concatenation).
10272
10273         So things like:
10274
10275         A.B.C [] x;
10276
10277         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10278         using clauses from working on this particular context.  And a type
10279         was being matched directly against "A.B.C[]".
10280
10281         We now use the correct approach, and allow for ComposedCast to be
10282         part of the unary expression.  So the "A.B.C []" become a composed
10283         cast of "A.B.C" (as a nested group of MemberAccess with a
10284         SimpleName at the end) plus the rank composition "[]". 
10285
10286         Also fixes 35567
10287
10288 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10289
10290         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10291         for the access level checking.
10292
10293         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10294         `TypeContainer container', because I kept getting confused when I
10295         was debugging this code.
10296
10297         * expression.cs (Indexers): Instead of tracking getters/setters,
10298         we now track them in parallel.  We create one arraylist less, but
10299         most importantly it is possible now for the LValue code to find a
10300         matching get for a set.
10301
10302         (IndexerAccess.DoResolveLValue): Update the code.
10303         GetIndexersForType has been modified already to extract all the
10304         indexers from a type.  The code assumed it did not.
10305
10306         Also make the code set the correct return type for the indexer.
10307         This was fixed a long time ago for properties, but was missing for
10308         indexers.  It used to be void_type.
10309
10310         (Binary.Emit): Test first for doubles instead of
10311         floats, as they are more common.
10312
10313         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10314         when dealing with floats and the <=, >= operators.  This fixes bug
10315         #39314 
10316
10317         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10318         to load the array value by emitting a load on the foreach variable
10319         type.  This was incorrect.  
10320
10321         We now emit the code to load an element using the the array
10322         variable type, and then we emit the conversion operator.
10323
10324         Fixed #40176
10325
10326 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10327
10328         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10329
10330 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10331
10332         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10333         test for protection before we test for signatures. 
10334
10335         (MethodSignature.ToString): implement.
10336
10337         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10338         to the case where we reduced into a LongConstant.
10339
10340         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10341         depend on whether the information is acurrate, because the
10342         Microsoft runtime will always claim that the array type is public,
10343         regardless of the real state.
10344
10345         If the type is a pointer, another problem happens: the type is
10346         reported as non-public in Microsoft.  
10347
10348         In both cases we have to call CheckAccessLevel recursively with
10349         the underlying type as the argument to be tested.
10350
10351 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10352
10353         * assign.cs (Assign.Emit): If we are dealing with a compound
10354         assignment expression, we should use the code path that stores the
10355         intermediate result in a temporary value.  This fixes #40903.
10356
10357         *expression.cs (Indirection.ToString): Provide ToString method for
10358         debugging. 
10359
10360 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10361
10362         * class.cs: Null out fields holding references to Block objects so
10363         they can be garbage collected.
10364
10365         * expression.cs (OverloadResolve): Remove unused local.
10366
10367 2003-04-07  Martin Baulig  <martin@ximian.com>
10368
10369         * codegen.cs (EmitContext.CurrentFile): New public field.
10370         (EmitContext.Mark): Use the CurrentFile to check whether the
10371         location is in the correct file.
10372         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10373
10374 2003-04-07  Martin Baulig  <martin@ximian.com>
10375
10376         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10377
10378         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10379         location.  [FIXME: The location argument which gets passed to this
10380         method is sometimes wrong!]
10381
10382 2003-04-07  Nick Drochak <ndrochak@gol.com>
10383
10384         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10385
10386 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10387
10388         * expression.cs (Indirection.EmitAssign): We were using the
10389         temporary, but returning immediately instead of continuing the
10390         EmitAssing flow.
10391
10392 2003-04-06  Martin Baulig  <martin@ximian.com>
10393
10394         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10395         if it's a nested child, but also deriving from the outer class.
10396         See test 190.cs.
10397
10398         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10399         nested child, but also deriving from the outer class.  See
10400         test-190.cs.
10401         (FilterWithClosure): We may access private members of the outer
10402         class if we're a nested child and deriving from the outer class.
10403         (RealMemberLookup): Only set `closure_private_ok' if the
10404         `original_bf' contained BindingFlags.NonPublic.
10405
10406 2003-04-05  Martin Baulig  <martin@ximian.com>
10407
10408         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10409
10410 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10411
10412         * class.cs (Event.Define): Do not allow abstract events to have
10413         initializers. 
10414
10415 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10416
10417         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10418         block in event declarations.
10419
10420         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10421         value type, get its address.
10422
10423         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10424         leaving a class on the stack instead of a boolean value (int
10425         0/1).  Change the code so we compare against null, and then the
10426         result against zero.
10427
10428         * class.cs (TypeContainer.GetClassBases): We were checking for the
10429         parent class being sealed too late.
10430
10431         * expression.cs (Binary.Emit): For <= and >= when dealing with
10432         floating point values, use cgt.un and clt.un instead of cgt and
10433         clt alone.
10434
10435 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10436
10437         * statement.cs: Apply the same optimization as MS: skip the 
10438         GetEnumerator returning an IEnumerator, and use the one returning a 
10439         CharEnumerator instead. This allows us to avoid the try-finally block 
10440         and the boxing.
10441
10442 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10443
10444         * cs-parser.jay: Attributes cannot be applied to
10445                          namespaces. Fixes #40473
10446
10447 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10448
10449         * class.cs:
10450         (Add*): check if the name is valid using the full name for constants,
10451         fields, properties and events.
10452
10453 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10456         char constants to be part of the enumeration.
10457
10458         * expression.cs (Conditional.DoResolve): Add support for operator
10459         true. Implements the missing functionality from 14.12
10460
10461         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10462         operator true/false as required by the spec.
10463
10464         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10465         implicit conversion to boolean.
10466
10467         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10468         also one where the type implements `operator true'. 
10469
10470         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10471         get an expression that will invoke operator true based on an
10472         expression.  
10473
10474         (GetConversionOperators): Removed the hack that called op_True
10475         here.  
10476
10477         (Expression.ResolveBoolean): Move this from Statement.
10478
10479 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10480
10481         * ecore.cs (FieldExpr): do not allow initialization of initonly
10482         fields on derived classes
10483
10484 2003-03-13  Martin Baulig  <martin@ximian.com>
10485
10486         * statement.cs (Block.Emit): Call ig.BeginScope() and
10487         ig.EndScope() when compiling with debugging info; call
10488         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10489
10490 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * expression.cs (Indexers): Do not construct immediately, allow
10493         for new members to be appended as we go.  Fixes 38143
10494
10495 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10496
10497         * expression.cs: save/restore context when resolving an unchecked
10498         expression.
10499
10500 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10501
10502         * cfold.cs: Catch division by zero in modulus operator during
10503         constant folding.
10504
10505 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * interface.cs (Interface.DefineMembers): Avoid defining members
10508         twice. 
10509
10510 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * driver.cs: handle the +/- options for -noconfig
10513
10514         * statement.cs (Unckeched.Resolve): Also track the state of
10515         unchecked in the Resolve phase.
10516
10517 2003-02-27  Martin Baulig  <martin@ximian.com>
10518
10519         * ecore.cs (Expression.MemberLookup): Don't create a
10520         MethodGroupExpr for something which is not a method.  Fixes #38291.
10521
10522 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * class.cs (MemberBase.CheckParameters): Also check that the type
10525         is unmanaged if it is a pointer.
10526
10527         * expression.cs (SizeOf.Resolve): Add location information.
10528
10529         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10530         a managed type is declared.
10531
10532         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10533         parameter modifiers as well.  Fixes bug 38606
10534
10535         * class.cs: Very sad.  Am backing out the speed up changes
10536         introduced by the ArrayList -> Array in the TypeContainer, as they
10537         were not actually that much faster, and introduced a bug (no error
10538         reports on duplicated methods).
10539
10540         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10541         source first, this will guarantee that we have a valid expression
10542         before calling in lower levels functions that will require a
10543         resolved object.  Then use this original_source in the
10544         target.ResolveLValue instead of the original source that was
10545         passed to us.
10546
10547         Another change.  Use target.Resolve instead of LValueResolve.
10548         Although we are resolving for LValues, we will let the Assign code
10549         take care of that (it will be called again from Resolve).  This
10550         basically allows code like this:
10551
10552         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10553         class Y { void A (X x) { x [0] += o; }
10554
10555         The problem was that the indexer was trying to resolve for
10556         set_Item (idx, object o) and never finding one.  The real set_Item
10557         was set_Item (idx, X).  By delaying the process we get the right
10558         semantics. 
10559
10560         Fixes bug 36505
10561
10562 2003-02-23  Martin Baulig  <martin@ximian.com>
10563
10564         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10565         while calling DoEmit ().
10566
10567         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10568         source files; if you use the #line directive inside a method, the
10569         compiler stops emitting line numbers for the debugger until it
10570         reaches the end of the method or another #line directive which
10571         restores the original file.
10572
10573 2003-02-23  Martin Baulig  <martin@ximian.com>
10574
10575         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10576
10577 2003-02-23  Martin Baulig  <martin@ximian.com>
10578
10579         * statement.cs (Block.AddChildVariableNames): We need to call this
10580         recursively, not just for our immediate children.
10581
10582 2003-02-23  Martin Baulig  <martin@ximian.com>
10583
10584         * class.cs (Event.Define): Always make the field private, like csc does.
10585
10586         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10587         actually work, fixes bug #37521.
10588
10589 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10590
10591         * delegate.cs: When creating the various temporary "Parameters"
10592         classes, make sure that we call the ComputeAndDefineParameterTypes
10593         on those new parameters (just like we do with the formal ones), to
10594         allow them to be resolved in the context of the DeclSpace.
10595
10596         This fixes the bug that Dick observed in Bugzilla #38530.
10597
10598 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10599
10600         * expression.cs (ResolveMemberAccess): When resolving a constant,
10601         do not attempt to pull a constant if the value was not able to
10602         generate a valid constant.
10603
10604         * const.cs (LookupConstantValue): Do not report more errors than required.
10605
10606 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10607
10608         * expression.cs: fixes bug #38328.
10609
10610 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10611
10612         * class.cs: Changed all the various members that can be part of a
10613         class from being an ArrayList to be an Array of the right type.
10614         During the DefineType type_list, interface_list, delegate_list and
10615         enum_list are turned into types, interfaces, delegates and enums
10616         arrays.  
10617
10618         And during the member population, indexer_list, event_list,
10619         constant_list, field_list, instance_constructor_list, method_list,
10620         operator_list and property_list are turned into their real arrays.
10621
10622         Although we could probably perform this operation earlier, for
10623         good error reporting we need to keep the lists and remove the
10624         lists for longer than required.
10625
10626         This optimization was triggered by Paolo profiling the compiler
10627         speed on the output of `gen-sample-program.pl' perl script. 
10628
10629         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10630         not crash in methods like MemberLookupFailed that use this field.  
10631
10632         This problem arises when the compiler fails to resolve a type
10633         during interface type definition for example.
10634
10635 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10636
10637         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10638         inherit from System.Object, so we have to stop at null, not only
10639         when reaching System.Object.
10640
10641 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10642
10643         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10644         DeclaredOnly because the parent indexer might have had a different
10645         name, but did not loop until the top of the hierarchy was reached.
10646
10647         The problem this one fixes is 35492: when a class implemented an
10648         indexer from an interface, we were getting the interface method
10649         (which was abstract) and we were flagging an error (can not invoke
10650         abstract method).
10651
10652         This also keeps bug 33089 functioning, and test-148 functioning.
10653
10654         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10655         out if a method is special is to see if it is declared in a
10656         property or event, or whether it is one of the predefined operator
10657         names.   This should fix correctly #36804.
10658
10659 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10660
10661         The goal here is to remove the dependency on EmptyCast.Peel ().
10662         Killing it completely.
10663
10664         The problem is that currently in a number of places where
10665         constants are expected, we have to "probe" for an EmptyCast, and
10666         Peel, which is not the correct thing to do, as this will be
10667         repetitive and will likely lead to errors. 
10668
10669         The idea is to remove any EmptyCasts that are used in casts that
10670         can be reduced to constants, so we only have to cope with
10671         constants. 
10672
10673         This bug hunt was triggered by Bug 37363 and the desire to remove
10674         the duplicate pattern where we were "peeling" emptycasts to check
10675         whether they were constants.  Now constants will always be
10676         constants.
10677
10678         * ecore.cs: Use an enumconstant here instead of wrapping with
10679         EmptyCast.  
10680
10681         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10682         throwing me off.  By handling this we can get rid of a few hacks.
10683
10684         * statement.cs (Switch): Removed Peel() code.
10685
10686 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10687
10688         * class.cs: Location information for error 508
10689
10690         * expression.cs (New.DoResolve): Add a guard against double
10691         resolution of an expression.  
10692
10693         The New DoResolve might be called twice when initializing field
10694         expressions (see EmitFieldInitializers, the call to
10695         GetInitializerExpression will perform a resolve on the expression,
10696         and later the assign will trigger another resolution
10697
10698         This leads to bugs (#37014)
10699
10700         * delegate.cs: The signature for EndInvoke should contain any ref
10701         or out parameters as well.  We were not doing this in the past. 
10702
10703         * class.cs (Field.Define): Do not overwrite the type definition
10704         inside the `volatile' group.  Turns out that volatile enumerations
10705         were changing the type here to perform a validity test, which
10706         broke conversions. 
10707
10708 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10711         and structs, we do not want to load the instance variable
10712
10713         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10714         enum_type has to be handled like an object reference (implicit
10715         conversions exists from this to object), but the regular IsClass
10716         and IsValueType tests will never return true for this one.
10717
10718         Also we use TypeManager.IsValueType instead of type.IsValueType,
10719         just for consistency with the rest of the code (this is only
10720         needed if we ever use the construct exposed by test-180.cs inside
10721         corlib, which we dont today).
10722
10723 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10724
10725         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10726         just InternalCall.
10727
10728 2003-02-09  Martin Baulig  <martin@ximian.com>
10729
10730         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10731         (Namespace.DefineNamespaces): New static public method; this is
10732         called when we're compiling with debugging to add all namespaces
10733         to the symbol file.
10734
10735         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10736         pass it to the Namespace's .ctor.
10737
10738         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10739         and MethodBase arguments; pass the namespace ID to the symwriter;
10740         pass the MethodBase instead of the token to the symwriter.
10741         (SymbolWriter.DefineNamespace): New method to add a namespace to
10742         the symbol file.
10743
10744 2003-02-09  Martin Baulig  <martin@ximian.com>
10745
10746         * symbolwriter.cs: New file.  This is a wrapper around
10747         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10748         methods here in near future.
10749
10750 2003-02-09  Martin Baulig  <martin@ximian.com>
10751
10752         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10753         ILGenerator.MarkSequencePoint() which are actually used by the
10754         symbol writer.
10755
10756 2003-02-09  Martin Baulig  <martin@ximian.com>
10757
10758         * location.cs (SourceFile): New public sealed class.  This
10759         contains the name and an index which is used in the location's token.
10760         (Location): Reserve an appropriate number of bits in the token for
10761         the source file instead of walking over that list, this gives us a
10762         really huge performance improvement when compiling with debugging.
10763
10764         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10765         `SourceFile' argument instead of a string.
10766         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10767         but don't parse/tokenize here, we need to generate the list of all
10768         source files before we do that.
10769         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10770         the files.
10771
10772         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10773         instead of a string.
10774
10775         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10776         of a string.
10777
10778 2003-02-09  Martin Baulig  <martin@ximian.com>
10779
10780         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10781         filename on `#line default'.
10782
10783 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10784
10785         * statement.cs: don't clear the pinned var when the fixed statement
10786         returns from the method (fixes bug#37752).
10787
10788 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10789
10790         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10791         to IsValueType.
10792
10793 2003-02-07  Martin Baulig  <martin@ximian.com>
10794
10795         * driver.cs: Removed the `--debug-args' command line argument.
10796
10797         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10798         automatically by the AsssemblyBuilder.
10799         (CodeGen.InitializeSymbolWriter): We don't need to call any
10800         initialization function on the symbol writer anymore.  This method
10801         doesn't take any arguments.
10802
10803 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10804
10805         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10806         from referenced assemblies as well.
10807
10808 2003-02-02  Martin Baulig  <martin@ximian.com>
10809
10810         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10811
10812 2003-02-02  Martin Baulig  <martin@ximian.com>
10813
10814         * class.cs (Constructor.Emit): Open the symbol writer before
10815         emitting the constructor initializer.
10816         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10817         single-stepping through constructor initializers.
10818
10819 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10820
10821         * class.cs: Handle error 549: do not allow virtual methods in
10822         sealed classes. 
10823
10824 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10825
10826         * decl.cs: Check access levels when resolving types
10827
10828 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10829
10830         * statement.cs: Add parameters and locals set in catch blocks that might 
10831         return to set vector
10832
10833 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10834
10835         * class.cs (Operator): Set the SpecialName flags for operators.
10836
10837         * expression.cs (Invocation.DoResolve): Only block calls to
10838         accessors and operators on SpecialName methods.
10839
10840         (Cast.TryReduce): Handle conversions from char constants.
10841
10842
10843 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10844
10845         * statement.cs: small memory and time optimization in FlowBranching.
10846
10847 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10848
10849         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10850         problem that the last fix but in the other sid (Set).
10851
10852         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10853         access when there is no indexer in the hierarchy.
10854
10855 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10856
10857         * class.cs: Combine some if statements.
10858
10859 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10860
10861         * driver.cs: fixed bug #37187.
10862
10863 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10864
10865         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10866         any indexer, it's needed to build a list with all the indexers in the
10867         hierarchy (AllGetters), else we have problems. Fixes #35653.
10868
10869 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10870
10871         * class.cs (MethodData.Define): It is wrong for an interface
10872         implementation to be static in both cases: explicit and implicit.
10873         We were only handling this in one case.
10874
10875         Improve the if situation there to not have negations.
10876
10877         * class.cs (Field.Define): Turns out that we do not need to check
10878         the unsafe bit on field definition, only on usage.  Remove the test.
10879
10880 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10881
10882         * driver.cs: use assembly.Location instead of Codebase (the latest
10883         patch made mcs fail when using MS assemblies).
10884
10885 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10886
10887         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10888         get the path to *corlib.dll.
10889
10890 2003-01-21  Nick Drochak <ndrochak@gol.com>
10891
10892         * cs-tokenizer.cs:
10893         * pending.cs:
10894         * typemanager.cs: Remove compiler warnings
10895
10896 2003-01-20  Duncan Mak  <duncan@ximian.com>
10897
10898         * AssemblyInfo.cs: Bump the version number to 0.19.
10899
10900 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10901
10902         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10903
10904 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10905
10906         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10907
10908 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10909
10910         * cs-parser.jay: Small fix: we were not comparing the constructor
10911         name correctly.   Thanks to Zoltan for the initial pointer.
10912
10913 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10914
10915         * cs-tokenizer.cs: Set file name when specified with #line
10916
10917 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * cs-parser.jay: Only perform the constructor checks here if we
10920         are named like the class;  This will help provider a better
10921         error.  The constructor path is taken when a type definition is
10922         not found, but most likely the user forgot to add the type, so
10923         report that rather than the constructor error.
10924
10925 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10926
10927         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10928         allocations.
10929
10930 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10931
10932         * cs-parser.jay: Add cleanup call.
10933
10934 2003-01-13  Duncan Mak  <duncan@ximian.com>
10935
10936         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10937         consistent with other methods.
10938
10939 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10940
10941         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10942
10943 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10944
10945         * attribute.cs: only set GuidAttr to true when we have a
10946         GuidAttribute.
10947
10948 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10949
10950         * ecore.cs:
10951         * expression.cs:
10952         * typemanager.cs: fixes to allow mcs compile corlib with the new
10953         Type.IsSubclassOf fix.
10954
10955 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10956
10957         * expression.cs (LocalVariableReference.DoResolve): Classify a
10958         constant as a value, not as a variable.   Also, set the type for
10959         the variable.
10960
10961         * cs-parser.jay (fixed_statement): take a type instead of a
10962         pointer_type, so we can produce a better error message later.
10963
10964         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10965         as an error.  
10966
10967         (For.DoEmit): Make inifinite loops have a
10968         non-conditional branch back.
10969
10970         (Fixed.DoEmit): First populate the pinned variables, then emit the
10971         statement, then clear the variables.  Before I was emitting the
10972         code once for each fixed piece.
10973
10974
10975 2003-01-08  Martin Baulig  <martin@ximian.com>
10976
10977         * statement.cs (FlowBranching.MergeChild): A break in a
10978         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10979
10980 2003-01-08  Martin Baulig  <martin@ximian.com>
10981
10982         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10983         lives in the same number space than `param_map'.  Fixes #36154.
10984
10985 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10986
10987         * cs-parser.jay (constructor_declaration): Set the
10988         Constructor.ModFlags before probing for it.  This makes the
10989         compiler report 514, 515 and 132 (the code was there, but got
10990         broken). 
10991
10992         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10993         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10994         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10995
10996 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10997
10998         * enum.cs: create the enum static fields using the enum type.
10999
11000 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11001
11002         * class.cs: don't try to create the ParamBuilder for the return
11003         type if it's not needed (and handle it breaking for the ms runtime
11004         anyway).
11005
11006 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11007
11008         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11009
11010 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11013         the command.   This showed up while compiling the JANET source
11014         code, which used \r as its only newline separator.
11015
11016 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11017
11018         * class.cs (Method.Define): If we are an operator (because it
11019         reuses our code), then set the SpecialName and HideBySig.  #36128
11020
11021 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11022
11023         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11024         exception, report error 120 `object reference required'.
11025
11026         * driver.cs: Add --pause option, used during to measure the size
11027         of the process as it goes with --timestamp.
11028
11029         * expression.cs (Invocation.DoResolve): Do not allow methods with
11030         SpecialName to be invoked.
11031
11032 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11033
11034         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11035         number before adding it.
11036
11037 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11038
11039         * ecore.cs (StandardImplicitConversion): When in an unsafe
11040         context, we allow conversion between void * to any other pointer
11041         type. This fixes bug #35973.
11042
11043 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11044
11045         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11046         is not thrown when extensionless outputs are used 
11047
11048 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11049
11050         * rootcontext.cs: fixed compilation of corlib.
11051
11052 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * attribute.cs (Attributes.Contains): Add new method.
11055
11056         * class.cs (MethodCore.LabelParameters): if the parameter is an
11057         `out' parameter, check that no attribute `[In]' has been passed.
11058
11059         * enum.cs: Handle the `value__' name in an enumeration.
11060
11061 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11062
11063         * decl.cs: Added special case to allow overrides on "protected
11064         internal" methods
11065
11066 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11067
11068         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11069         since it makes much more sense.
11070
11071         (Attributes.ctor): Don't require a Location parameter.
11072
11073         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11074
11075         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11076         since we already have that information per attribute.
11077
11078         * everywhere : make appropriate changes.
11079
11080         * class.cs (LabelParameters): Write the code which actually
11081         applies attributes to the return type. We can't do this on the MS
11082         .NET runtime so we flag a warning in the case an exception is
11083         thrown.
11084
11085 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11086
11087         * const.cs: Handle implicit null conversions here too.
11088
11089 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11090
11091         * class.cs (MethodCore.LabelParameters): Remove the extra
11092         Type [] parameter since it is completely unnecessary. Instead
11093         pass in the method's attributes so that we can extract
11094         the "return" attribute.
11095
11096 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11097
11098         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11099         of ignoring it and letting the compile continue.
11100
11101         * typemanager.cs (ChangeType): use an extra argument to return an
11102         error condition instead of throwing an exception.
11103
11104 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * expression.cs (Unary.TryReduce): mimic the code for the regular
11107         code path.  Perform an implicit cast in the cases where we can
11108         implicitly convert to one of the integral types, and then reduce
11109         based on that constant.   This fixes bug #35483.
11110
11111 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11112
11113         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11114
11115 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11116
11117         * namespace.cs: fixed bug #35489.
11118
11119 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11120
11121         * class.cs: Remove some dead code.
11122
11123         * cs-parser.jay: Estimate the number of methods needed
11124         (RootContext.MethodCount);
11125
11126         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11127         numbers instead of StringBuilders.
11128
11129         * support.cs (PtrHashtable): Add constructor with initial size;
11130         We can now reduce reallocations of the method table.
11131
11132 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11133
11134         * attribute.cs (ApplyAttributes): Keep track of the emitted
11135         attributes on a per-target basis. This fixes bug #35413.
11136
11137 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11138
11139         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11140         default to the Windows 1252 encoding.
11141
11142         (UnixParseOption): Support version, thanks to Alp for the missing
11143         pointer. 
11144
11145         * AssemblyInfo.cs: Add nice assembly information.
11146
11147         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11148         (bug 35169).
11149
11150         * cs-parser.jay: Allow a trailing comma before the close bracked
11151         in the attribute_section production.
11152
11153         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11154         address of the instance was being taken, I will take this out,
11155         because we take the address of the object immediately here.
11156
11157 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11158
11159         * typemanager.cs (AreMultipleAllowed): Take care of the most
11160         obvious case where attribute type is not in the current assembly -
11161         stupid me ;-)
11162
11163 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11166         definitions, instead of doing that afterwards.  
11167
11168         Also we use a nice little hack, depending on the constructor, we
11169         know if we are a "composed" name or a simple name.  Hence, we
11170         avoid the IndexOf test, and we avoid 
11171
11172         * codegen.cs: Add code to assist in a bug reporter to track down
11173         the source of a compiler crash. 
11174
11175 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11176
11177         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11178         types have been emitted for a given element and flag an error
11179         if something which does not have AllowMultiple set is used more
11180         than once.
11181
11182         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11183         attribute types and their corresponding AllowMultiple properties
11184
11185         (AreMultipleAllowed): Check the property for a given type.
11186
11187         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11188         property in the case we have a TypeContainer.
11189
11190         (Attributes.AddAttribute): Detect duplicates and just skip on
11191         adding them. This trivial fix catches a pretty gross error in our
11192         attribute emission - global attributes were being emitted twice!
11193
11194         Bugzilla bug #33187 is now fixed.
11195
11196 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11197
11198         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11199         instead of pp_and).
11200
11201         * expression.cs (Binary.ResolveOperator): I can only use the
11202         Concat (string, string, string) and Concat (string, string,
11203         string, string) if the child is actually a concatenation of
11204         strings. 
11205
11206 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11207
11208         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11209         context where we need a 2-character lookahead.
11210
11211         * pending.cs (PendingImplementation): Rework so we can keep track
11212         of interface types all the time, and flag those which were
11213         implemented by parents as optional.
11214
11215 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11216
11217         * expression.cs (Binary.ResolveOperator): Use
11218         String.Concat(string,string,string) or
11219         String.Concat(string,string,string,string) when possible. 
11220
11221         * typemanager: More helper methods.
11222
11223
11224 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11225
11226         * pending.cs: remove the bogus return from GetMissingInterfaces()
11227         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11228
11229 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11230
11231         * namespace.cs: avoid duplicated 'using xxx' being added to
11232         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11233         when we get more than one 'using' statement for the same namespace.
11234         Report a CS0105 warning for it.
11235
11236 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11237
11238         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11239         of calling getChar/putback, uses internal knowledge of it.    
11240
11241         (xtoken): Reorder tokenizer so most common patterns are checked
11242         first.  This reduces the compilation time in another 5% (from 8.11s
11243         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11244
11245         The parsing time is 22% of the compilation in mcs, and from that
11246         64% is spent on the tokenization process.  
11247
11248         I tried using a binary search for keywords, but this is slower
11249         than the hashtable.  Another option would be to do a couple of
11250         things:
11251
11252                 * Not use a StringBuilder, instead use an array of chars,
11253                   with a set value.  Notice that this way we could catch
11254                   the 645 error without having to do it *afterwards*.
11255
11256                 * We could write a hand-parser to avoid the hashtable
11257                   compares altogether.
11258
11259         The identifier consumption process takes 37% of the tokenization
11260         time.  Another 15% is spent on is_number.  56% of the time spent
11261         on is_number is spent on Int64.Parse:
11262
11263                 * We could probably choose based on the string length to
11264                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11265                   computations. 
11266
11267         Another 3% is spend on wrapping `xtoken' in the `token' function.
11268
11269         Handle 0xa0 as whitespace (#34752)
11270
11271 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * typemanager.cs (IsCLRType): New routine to tell whether a type
11274         is one of the builtin types.  
11275
11276         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11277         typecode in more places instead of doing pointer comparissions.
11278         We could leverage some knowledge about the way the typecodes are
11279         laid out.
11280
11281         New code to cache namespaces in assemblies, it is currently not
11282         invoked, to be used soon.
11283
11284         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11285
11286         * expression.cs (Binary.ResolveOperator): specially handle
11287         strings, and do not perform user-defined operator overloading for
11288         built-in types.
11289
11290 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11291
11292         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11293         internalcall as it is a pretty simple operation;  Avoid whenever
11294         possible to call Char.IsLetter.
11295
11296         (consume_identifier): Cut by half the number of
11297         hashtable calls by merging the is_keyword and GetKeyword behavior.
11298
11299         Do not short-circuit, because if we do, we
11300         report errors (ie, #if false && true would produce an invalid
11301         directive error);
11302
11303
11304 2002-11-24  Martin Baulig  <martin@ximian.com>
11305
11306         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11307         check constant ranges and report a CS0221.  Fixes #33186.
11308
11309 2002-11-24  Martin Baulig  <martin@ximian.com>
11310
11311         * cs-parser.jay: Make this work for uninitialized variable
11312         declarations in the `for' initializer.  Fixes #32416.
11313
11314 2002-11-24  Martin Baulig  <martin@ximian.com>
11315
11316         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11317         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11318
11319 2002-11-24  Martin Baulig  <martin@ximian.com>
11320
11321         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11322         argument; if true, we also check for user-defined conversions.
11323         This is only needed if both arguments are of a user-defined type.
11324         Fixes #30443, added test-175.cs.
11325         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11326
11327         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11328
11329 2002-11-24  Martin Baulig  <martin@ximian.com>
11330
11331         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11332         function to get the store opcode.
11333         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11334         only emit the Ldelema if the store opcode is Stobj.  You must run
11335         both test-34 and test-167 to test this.  Fixes #34529.
11336
11337 2002-11-23  Martin Baulig  <martin@ximian.com>
11338
11339         * ecore.cs (Expression.MemberLookup): Added additional
11340         `qualifier_type' argument which is used when we're being called
11341         from MemberAccess.DoResolve() and null if we're called from a
11342         SimpleName lookup.
11343         (Expression.MemberLookupFailed): New method to report errors; this
11344         does the CS1540 check and reports the correct error message.
11345
11346         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11347         argument for the CS1540 check and redone the way how we're dealing
11348         with private members.  See the comment in the source code for details.
11349         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11350         `closure_start_type' to `closure_qualifier_type' and check whether
11351         it's not null.  It was not this filter being broken, it was just
11352         being called with the wrong arguments.
11353
11354         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11355         and pass it the correct `qualifier_type'; this also does the error
11356         handling for us.
11357
11358 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11359
11360         * expression.cs (Invocation.EmitParams): If the we are dealing
11361         with a non-built-in value type, load its address as well.
11362
11363         (ArrayCreation): Use a a pretty constant instead
11364         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11365         static initializers.  
11366
11367         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11368         because they are not really value types, just glorified integers. 
11369
11370         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11371
11372         * ecore.cs: Remove redundant code for enumerations, make them use
11373         the same code path as everything else, fixes the casting issue
11374         with enumerations in Windows.Forms.
11375
11376         * attribute.cs: Do only cast to string if it is a string, the
11377         validation happens later.
11378
11379         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11380         people upgrade their corlibs.
11381
11382         * ecore.cs: Oops, enumerations were not following the entire code path
11383
11384 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11385
11386         * typemanager.cs (FilterWithClosure): Commented out the test for
11387         1540 in typemanager.cs, as it has problems when accessing
11388         protected methods from a parent class (see test-174.cs). 
11389
11390         * attribute.cs (Attribute.ValidateGuid): new method.
11391         (Attribute.Resolve): Use above.
11392
11393 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11394
11395         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11396
11397         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11398         handling for enumerations, as we only needed the TypeContainer
11399         functionality to begin with (this is required for the fix below to
11400         work for enums that reference constants in a container class for
11401         example). 
11402
11403         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11404
11405         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11406         a valid TypeBuilder to perform lookups on.o
11407
11408         * class.cs (InheritableMemberSignatureCompare): Use true in the
11409         call to GetGetMethod and GetSetMethod, because we are comparing
11410         the signature, and we need to get the methods *even* if they are
11411         private. 
11412
11413         (PropertyBase.CheckBase): ditto.
11414
11415         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11416         GotoCase.Resolve): Use Peel on EmpytCasts.
11417
11418         * ecore.cs (EmptyCast): drop child, add Peel method.
11419
11420 2002-11-17  Martin Baulig  <martin@ximian.com>
11421
11422         * ecore.cs (EmptyCast.Child): New public property.
11423
11424         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11425         label resolved to an EmptyCast.  Fixes #34162.
11426         (GotoCase.Resolve): Likewise.
11427         (Block.EmitMeta): Likewise.
11428
11429 2002-11-17  Martin Baulig  <martin@ximian.com>
11430
11431         * expression.cs (Invocation.BetterConversion): Prefer int over
11432         uint; short over ushort; long over ulong for integer literals.
11433         Use ImplicitConversionExists instead of StandardConversionExists
11434         since we also need to check for user-defined implicit conversions.
11435         Fixes #34165.  Added test-173.cs.
11436
11437 2002-11-16  Martin Baulig  <martin@ximian.com>
11438
11439         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11440         with the `true' and `false' literals.  Fixes #33151.
11441
11442 2002-11-16  Martin Baulig  <martin@ximian.com>
11443
11444         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11445         October 22nd; don't do the cs1540 check for static members.
11446
11447         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11448         now using our own filter here and doing the cs1540 check again.
11449
11450 2002-11-16  Martin Baulig  <martin@ximian.com>
11451
11452         * support.cs (InternalParameters): Don't crash if we don't have
11453         any fixed parameters.  Fixes #33532.
11454
11455 2002-11-16  Martin Baulig  <martin@ximian.com>
11456
11457         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11458         when looking up static methods to make this work on Windows.
11459         Fixes #33773.
11460
11461 2002-11-16  Martin Baulig  <martin@ximian.com>
11462
11463         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11464         a setter rather than using PropertyInfo.CanWrite.
11465
11466 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11467
11468         * class.cs: Allow acces to block member by subclasses. Fixes build
11469         breaker.
11470
11471 2002-11-14  Martin Baulig  <martin@ximian.com>
11472
11473         * class.cs (Constructor.Emit): Added the extern/block check.
11474         Fixes bug #33678.
11475
11476 2002-11-14  Martin Baulig  <martin@ximian.com>
11477
11478         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11479         iteration while looking for indexers, this is needed because the
11480         indexer may have a different name in our base classes.  Fixed the
11481         error reporting (no indexers at all, not get accessor, no
11482         overloaded match).  Fixes bug #33089.
11483         (IndexerAccess.DoResolveLValue): Likewise.
11484
11485 2002-11-14  Martin Baulig  <martin@ximian.com>
11486
11487         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11488         indexers.  Fixes the first part of bug #33089.
11489         (MethodSignature.InheritableMemberSignatureCompare): Added support
11490         for properties.
11491
11492 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11493
11494         * attribute.cs (Attribute.Resolve): Catch the
11495         NullReferenceException and report it since it isn't supposed to
11496         happen. 
11497
11498 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11499
11500         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11501         LogicalOr and LogicalAnd that can benefit from recursively
11502         handling EmitBranchable.  The code now should be nice for Paolo.
11503
11504 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11507         the Type lookups, as we perform quite a number of lookups on
11508         non-Types.  This can be removed once we can deterministically tell
11509         whether we have a type or a namespace in advance.
11510
11511         But this might require special hacks from our corlib.
11512
11513         * TODO: updated.
11514
11515         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11516         and double which avoids a conversion from an integer to a double.
11517
11518         * expression.cs: tiny optimization, avoid calling IsConstant,
11519         because it effectively performs the lookup twice.
11520
11521 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11522
11523         But a bogus return here to keep the semantics of the old code
11524         until the Mono runtime is fixed.
11525
11526         * pending.cs (GetMissingInterfaces): New method used to remove all
11527         the interfaces that are already implemented by our parent
11528         classes from the list of pending methods. 
11529
11530         * interface.cs: Add checks for calls after ResolveTypeExpr.
11531
11532 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * class.cs (Class.Emit): Report warning 67: event not used if the
11535         warning level is beyond 3.
11536
11537         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11538         being a NullLiteral.
11539
11540         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11541         specifiers. 
11542
11543         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11544         path that might fail if a type can not be resolved.
11545
11546         * expression.cs (Binary.Emit): Emit unsigned versions of the
11547         operators. 
11548
11549         * driver.cs: use error 5.
11550
11551 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11552
11553         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11554
11555 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11556
11557         * cs-parser.jay (switch_section): A beautiful patch from Martin
11558         Baulig that fixed 33094.
11559
11560 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11561
11562         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11563         Check whether the base is abstract and report an error if so.
11564
11565         * expression.cs (IndexerAccess.DoResolveLValue,
11566         IndexerAccess.DoResolve): ditto. 
11567
11568         (Invocation.DoResolve): ditto.
11569
11570         (Invocation.FullMethodDesc): Improve the report string.
11571
11572         * statement.cs (Block): Eliminate IsVariableDefined as it is
11573         basically just a wrapper for GetVariableInfo.
11574
11575         * ecore.cs (SimpleName): Use new 
11576
11577         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11578         type, as we return the actual parameter ref/unref state on a
11579         different call.
11580
11581 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11582
11583         * support.cs: Return proper flags REF/OUT fixing the previous
11584         commit.  
11585
11586         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11587         not used to mean `ref' but `ref or out' in ParameterReference
11588
11589         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11590         full type signature instead of calling TypeManger.CSharpName
11591         ourselves. 
11592
11593         * support.cs (InternalParameters.ParameterDesc): Do not compare
11594         directly to the modflags, because REF/OUT will actually be bitsets
11595         if set. 
11596
11597         * delegate.cs (VerifyMethod): Check also the modifiers.
11598
11599         * cs-tokenizer.cs: Fix bug where floating point values with an
11600         exponent where a sign was missing was ignored.
11601
11602         * driver.cs: Allow multiple assemblies to be specified in a single
11603         /r: argument
11604
11605 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11608         because identifiers after a parenthesis would end up in this kind
11609         of production, and we needed to desamiguate it for having casts
11610         like:
11611
11612                 (UserDefinedType *) xxx
11613
11614 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11615
11616         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11617         we should set on the Bindingflags.NonPublic, but not turn on
11618         private_ok.  private_ok controls whether a Private member is
11619         returned (this is chekced on the filter routine), while the
11620         BindingFlags.NonPublic just controls whether private/protected
11621         will be allowed.   This fixes the problem part of the problem of
11622         private properties being allowed to be used in derived classes.
11623
11624         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11625         so we can call the children DoResolveLValue method (this will
11626         properly signal errors on lvalue assignments to base properties)
11627
11628         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11629         getter are null, and we have a property info, we know that this
11630         happened because the lookup failed, so we report an error 122 for
11631         protection level violation.
11632
11633         We also silently return if setter and getter are null in the
11634         resolve functions, this condition only happens if we have flagged
11635         the error before.  This is the other half of the problem. 
11636
11637         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11638         not have accessibility information, that is why we were returning
11639         true in the filter function in typemanager.cs.
11640
11641         To properly report 122 (property is inaccessible because of its
11642         protection level) correctly, we report this error in ResolveAccess
11643         by failing if both the setter and the getter are lacking (ie, the
11644         lookup failed). 
11645
11646         DoResolve and DoLResolve have been modified to check for both
11647         setter/getter being null and returning silently, the reason being
11648         that I did not want to put the knowledge about this error in upper
11649         layers, like:
11650
11651         int old = Report.Errors;
11652         x = new PropertyExpr (...);
11653         if (old != Report.Errors)
11654                 return null;
11655         else
11656                 return x;
11657
11658         So the property expr is returned, but it is invalid, so the error
11659         will be flagged during the resolve process. 
11660
11661         * class.cs: Remove InheritablePropertySignatureCompare from the
11662         class, as we no longer depend on the property signature to compute
11663         whether it is possible to implement a method or not.
11664
11665         The reason is that calling PropertyInfo.GetGetMethod will return
11666         null (in .NET, in Mono it works, and we should change this), in
11667         cases where the Get Method does not exist in that particular
11668         class.
11669
11670         So this code:
11671
11672         class X { public virtual int A { get { return 1; } } }
11673         class Y : X { }
11674         class Z : Y { public override int A { get { return 2; } } }
11675
11676         Would fail in Z because the parent (Y) would not have the property
11677         defined.  So we avoid this completely now (because the alternative
11678         fix was ugly and slow), and we now depend exclusively on the
11679         method names.
11680
11681         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11682         reference method, instead of using the property.
11683
11684         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11685         routines are gone now.
11686
11687         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11688         names, they were incorrectly named.
11689
11690         * cs-tokenizer.cs: Return are more gentle token on failure. 
11691
11692         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11693         had an out-of-sync index variable, which caused it to remove from
11694         the list of pending methods the wrong method sometimes.
11695
11696 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11697
11698         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11699         CanWrite, because those refer to this particular instance of the
11700         property, and do not take into account the fact that we can
11701         override single members of a property.
11702
11703         Constructor requires an EmitContext.  The resolution process does
11704         not happen here, but we need to compute the accessors before,
11705         because the resolution does not always happen for properties.
11706
11707         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11708         subclass, before we did not update this flag, but we did update
11709         bindingflags. 
11710
11711         (GetAccessors): Drop this routine, as it did not work in the
11712         presence of partially overwritten set/get methods. 
11713
11714         Notice that this broke the cs1540 detection, but that will require
11715         more thinking. 
11716
11717 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11718
11719         * class.cs:
11720         * codegen.cs:
11721         * driver.cs: issue a warning instead of an error if we don't support
11722         debugging for the platform. Also ignore a couple of errors that may
11723         arise when trying to write the symbols. Undo my previous patch.
11724
11725 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11726
11727         * driver.cs: ignore /debug switch except for Unix platforms.
11728
11729 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11730
11731         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11732
11733 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11734
11735         * driver.cs: Do not make mcs-debug conditional, so we do not break
11736         builds that use it.
11737
11738         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11739         review this patch.  But basically after all the children variables
11740         have been merged, the value of "Breaks" was not being set to
11741         new_breaks for Switch blocks.  I think that it should be set after
11742         it has executed.  Currently I set this to the value of new_breaks,
11743         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11744         conservative, but I do not understand this code very well.
11745
11746         I did not break anything in the build, so that is good ;-)
11747
11748         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11749
11750 2002-10-20  Mark Crichton  <crichton@gimp.org>
11751
11752         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11753
11754 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11755
11756         * cfold.cs: Fixed compile blocker.
11757
11758 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11759
11760         * driver.cs: I was chekcing the key, not the file.
11761
11762 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11763
11764         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11765         message that we were generating - we just need to silently return
11766         a null.
11767
11768 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11769
11770         * class.cs (Event.Define): Change my previous commit, as this
11771         breaks the debugger.  This is a temporary hack, as it seems like
11772         the compiler is generating events incorrectly to begin with.
11773
11774         * expression.cs (Binary.ResolveOperator): Added support for 
11775         "U operator - (E x, E y)"
11776
11777         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11778         y)".
11779
11780         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11781         init-only variables, but this path did not take into account that
11782         there might be also instance readonly variables.  Correct this
11783         problem. 
11784
11785         This fixes bug 32253
11786
11787         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11788         delegates as well.
11789
11790         * driver.cs: Change the extension for modules to `netmodule'
11791
11792         * cs-parser.jay: Improved slightly the location tracking for
11793         the debugger symbols.
11794
11795         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11796         modifiers that were specified instead of the hardcoded value
11797         (FamAndAssem).  This was basically ignoring the static modifier,
11798         and others.  Fixes 32429.
11799
11800         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11801         fixed a bug in the process (32476)
11802
11803         * expression.cs (ArrayAccess.EmitAssign): Patch from
11804         hwang_rob@yahoo.ca that fixes bug 31834.3
11805
11806 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11807
11808         * driver.cs: Make the module extension .netmodule.
11809
11810 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11811
11812         * driver.cs: Report an error if the resource file is not found
11813         instead of crashing.
11814
11815         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11816         false, like Emit does.
11817
11818 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11819
11820         * typemanager.cs: Remove unused private member.  Also reported mcs
11821         bug to report this as a warning like csc.
11822
11823 2002-10-15  Martin Baulig  <martin@gnome.org>
11824
11825         * statement.cs (Statement.Emit): Made this a virtual method; emits
11826         the line number info and calls DoEmit().
11827         (Statement.DoEmit): New protected abstract method, formerly knows
11828         as Statement.Emit().
11829
11830         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11831
11832 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11833
11834         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11835         have fixed a remaining problem: not every AddXXXX was adding a
11836         fully qualified name.  
11837
11838         Now everyone registers a fully qualified name in the DeclSpace as
11839         being defined instead of the partial name.  
11840
11841         Downsides: we are slower than we need to be due to the excess
11842         copies and the names being registered this way.  
11843
11844         The reason for this is that we currently depend (on the corlib
11845         bootstrap for instance) that types are fully qualified, because
11846         we dump all the types in the namespace, and we should really have
11847         types inserted into the proper namespace, so we can only store the
11848         basenames in the defined_names array.
11849
11850 2002-10-10  Martin Baulig  <martin@gnome.org>
11851
11852         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11853         from bug #31834, see the bug report for a testcase which is
11854         miscompiled.
11855
11856 2002-10-10  Martin Baulig  <martin@gnome.org>
11857
11858         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11859         flow analysis code for this.
11860
11861         * statement.cs (Do, While, For): Tell the flow analysis code about
11862         infinite loops.
11863         (FlowBranching.UsageVector): Added support for infinite loops.
11864         (Block.Resolve): Moved the dead code elimination here and use flow
11865         analysis to do it.
11866
11867 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11868
11869         * class.cs (Field.Define): Catch cycles on struct type
11870         definitions. 
11871
11872         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11873         fields if the fields are static.  We only need to check instance
11874         fields. 
11875
11876         * expression.cs (As.DoResolve): Test for reference type.
11877
11878         * statement.cs (Using.ResolveExpression): Use
11879         ConvertImplicitRequired, not ConvertImplicit which reports an
11880         error on failture
11881         (Using.ResolveLocalVariableDecls): ditto.
11882
11883         * expression.cs (Binary.ResolveOperator): Report errors in a few
11884         places where we had to.
11885
11886         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11887
11888 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * expression.cs: Use StoreFromPtr instead of extracting the type
11891         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11892
11893         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11894         an enumeration value to a System.Enum, but System.Enum is not a
11895         value type, but an class type, so we need to box.
11896
11897         (Expression.ConvertExplicit): One codepath could return
11898         errors but not flag them.  Fix this.  Fixes #31853
11899
11900         * parameter.cs (Resolve): Do not allow void as a parameter type.
11901
11902 2002-10-06  Martin Baulig  <martin@gnome.org>
11903
11904         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11905         if it's a class type and not a struct.  Fixes #31815.
11906
11907 2002-10-06  Martin Baulig  <martin@gnome.org>
11908
11909         * statement.cs: Reworked the flow analysis code a bit to make it
11910         usable for dead code elimination.
11911
11912 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11913
11914         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11915
11916 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11919         to fix the test 165, will investigate deeper.
11920
11921 2002-10-04  Martin Baulig  <martin@gnome.org>
11922
11923         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11924         finally blocks actually work.
11925         (Try.Resolve): We don't need to create a sibling for `finally' if
11926         there is no finally block.
11927
11928 2002-10-04  Martin Baulig  <martin@gnome.org>
11929
11930         * class.cs (Constructor.Define): The default accessibility for a
11931         non-default constructor is private, not public.
11932
11933 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11934
11935         * class.cs (Constructor): Make AllowedModifiers public, add
11936         EXTERN.
11937
11938         * cs-parser.jay: Perform the modifiers test here, as the
11939         constructor for the Constructor class usually receives a zero
11940         because of the way we create it (first we create, later we
11941         customize, and we were never checking the modifiers).
11942
11943         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11944         is a version of LookupTypeReflection that includes the type-name
11945         cache.  This can be used as a fast path for functions that know
11946         the fully qualified name and are only calling into *.GetType() to
11947         obtain a composed type.
11948
11949         This is also used by TypeManager.LookupType during its type
11950         composition.
11951
11952         (LookupType): We now also track the real type name, as sometimes
11953         we can get a quey for the real type name from things like
11954         ComposedCast.  This fixes bug 31422.
11955
11956         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11957         complete type fullname, it does not have to go through the type
11958         resolution system to obtain the composed version of the type (for
11959         obtaining arrays or pointers).
11960
11961         (Conditional.Emit): Use the EmitBoolExpression to
11962         generate nicer code, as requested by Paolo.
11963
11964         (ArrayCreation.CheckIndices): Use the patch from
11965         hwang_rob@yahoo.ca to validate the array initializers. 
11966
11967 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11968
11969         * class.cs (ConstructorInitializer.Emit): simplify code by using
11970         Invocation.EmitCall, and at the same time, fix the bugs in calling
11971         parent constructors that took variable arguments. 
11972
11973         * ecore.cs (Expression.ConvertNumericExplicit,
11974         Expression.ImplicitNumericConversion): Remove the code that
11975         manually wrapped decimal (InternalTypeConstructor call is now gone
11976         as well).
11977
11978         * expression.cs (Cast.TryReduce): Also handle decimal types when
11979         trying to perform a constant fold on the type.
11980
11981         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11982
11983         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11984         that only turned off an error report, and did nothing else. 
11985
11986 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11987
11988         * driver.cs: Handle and ignore /fullpaths
11989
11990 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11991
11992         * expression.cs (Binary.ResolveOperator): Catch the case where
11993         DoNumericPromotions returns true, 
11994
11995         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11996
11997 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11998
11999         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12000         report error 70.
12001
12002 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12003
12004         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12005         conversion exists, but it is also required that the conversion be
12006         performed.  This manifested in "(Type64Enum) 2".  
12007
12008         * class.cs (TypeManager.AddMethod): The fix is not to change
12009         AddEnum, because that one was using a fully qualified name (every
12010         DeclSpace derivative does), but to change the AddMethod routine
12011         that was using an un-namespaced name.  This now correctly reports
12012         the duplicated name.
12013
12014         Revert patch until I can properly fix it.  The issue
12015         is that we have a shared Type space across all namespaces
12016         currently, which is wrong.
12017
12018         Options include making the Namespace a DeclSpace, and merge
12019         current_namespace/current_container in the parser.
12020
12021 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12022
12023         * cs-parser.jay: Improve error reporting when we get a different
12024         kind of expression in local_variable_type and
12025         local_variable_pointer_type. 
12026
12027         Propagate this to avoid missleading errors being reported.
12028
12029         * ecore.cs (ImplicitReferenceConversion): treat
12030         TypeManager.value_type as a target just like object_type.   As
12031         code like this:
12032
12033         ValueType v = 1;
12034
12035         Is valid, and needs to result in the int 1 being boxed before it
12036         is assigned to the value type v.
12037
12038         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12039         to validate the enumeration name.
12040
12041         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12042         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12043         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12044
12045         * ecore.cs (TryImplicitIntConversion): When doing an
12046         implicit-enumeration-conversion, check if the type is 64-bits and
12047         perform a conversion before passing to EnumConstant.
12048
12049 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12052         report ambiguous type references.  Unlike the MS version, we
12053         report what the ambiguity is.   Innovation at work ;-)
12054
12055         (DeclSpace.FindType): Require a location argument to
12056         display when we display an ambiguous error.
12057
12058         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12059
12060         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12061
12062         * expression.cs (EmitDynamicInitializers): Apply patch from
12063         hwang_rob@yahoo.ca that fixes the order in which we emit our
12064         initializers. 
12065
12066 2002-09-21  Martin Baulig  <martin@gnome.org>
12067
12068         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12069         delegate takes no arguments.
12070
12071 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12072
12073         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12074         from integers.
12075
12076         * expression.cs: Extract the underlying type.
12077
12078         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12079
12080         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12081
12082 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12083
12084         * class.cs (TypeContainer.DefineType): We can not use the nice
12085         PackingSize with the size set to 1 DefineType method, because it
12086         will not allow us to define the interfaces that the struct
12087         implements.
12088
12089         This completes the fixing of bug 27287
12090
12091         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12092         means also structs.  This fixes part of the problem. 
12093         (Expresion.ImplicitReferenceConversionExists): ditto.
12094
12095         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12096         error if there were no errors reported during the type lookup
12097         process, to avoid duplicates or redundant errors.  Without this
12098         you would get an ambiguous errors plus a type not found.  We have
12099         beaten the user enough with the first error.  
12100
12101         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12102         reference. 
12103
12104         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12105         during the resolution process, stop the lookup, this avoids
12106         repeated error reports (same error twice).
12107
12108         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12109
12110         * typemanager.cs (LookupType): Redo the type lookup code to match
12111         the needs of System.Reflection.  
12112
12113         The issue is that System.Reflection requires references to nested
12114         types to begin with a "+" sign instead of a dot.  So toplevel
12115         types look like: "NameSpace.TopLevelClass", and nested ones look
12116         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12117         levels. 
12118
12119 2002-09-19  Martin Baulig  <martin@gnome.org>
12120
12121         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12122         says that a method always returns or always throws an exception,
12123         don't report the CS0161.
12124
12125         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12126         set `Returns = new_returns'.
12127
12128 2002-09-19  Martin Baulig  <martin@gnome.org>
12129
12130         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12131         to an enum constant, check for a CS0176.
12132
12133 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12136         for operators that must be in pairs and report errors.
12137
12138         * ecore.cs (SimpleName.DoResolveType): During the initial type
12139         resolution process, when we define types recursively, we must
12140         check first for types in our current scope before we perform
12141         lookups in the enclosing scopes.
12142
12143         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12144
12145         (Invocation.VerifyArgumentsCompat): Call
12146         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12147         I thought we were supposed to always call this, but there are a
12148         few places in the code where we dont do it.
12149
12150 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * driver.cs: Add support in -linkres and -resource to specify the
12153         name of the identifier.
12154
12155 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * ecore.cs (StandardConversionExists): Sync with the conversion
12158         code: allow anything-* to void* conversions.
12159
12160         (FindMostSpecificSource): Use an Expression argument
12161         instead of a Type, because we might be handed over a Literal which
12162         gets a few more implicit conversions that plain types do not.  So
12163         this information was being lost.
12164
12165         Also, we drop the temporary type-holder expression when not
12166         required.
12167
12168 2002-09-17  Martin Baulig  <martin@gnome.org>
12169
12170         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12171         this is an explicit interface implementation.
12172
12173 2002-09-17  Martin Baulig  <martin@gnome.org>
12174
12175         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12176         different `IndexerName' attributes.
12177
12178         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12179         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12180         virtual CommonResolve().
12181
12182 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12185         and convert that to the UnderlyingType.
12186
12187         * statement.cs (Foreach.Resolve): Indexers are just like variables
12188         or PropertyAccesses.
12189
12190         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12191         inside quoted strings, we were not doing this before.
12192
12193 2002-09-16  Martin Baulig  <martin@gnome.org>
12194
12195         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12196         resolve it.  This is needed for the definite assignment check of the
12197         instance expression, fixes bug #29846.
12198         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12199
12200 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12201
12202         * parameter.cs: Fix compile error.  Cannot reference static member
12203         from an instance object.  Is this an mcs bug?
12204
12205 2002-09-14  Martin Baulig  <martin@gnome.org>
12206
12207         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12208         multiple times.  Fixes bug #30295, added test-166.cs.
12209
12210 2002-09-14  Martin Baulig  <martin@gnome.org>
12211
12212         * statement.cs (Block.Emit): Don't emit unreachable code.
12213         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12214         `break' statements.
12215         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12216
12217 2002-09-14  Martin Baulig  <martin@gnome.org>
12218
12219         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12220         is set.
12221
12222 2002-09-14  Martin Baulig  <martin@gnome.org>
12223
12224         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12225         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12226         be false on the ms runtime.
12227
12228 2002-09-13  Martin Baulig  <martin@gnome.org>
12229
12230         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12231         the CS0038 error message.
12232
12233 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12234
12235         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12236         constant inside, return it.
12237
12238 2002-09-12  Martin Baulig  <martin@gnome.org>
12239
12240         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12241         implicit conversion can be done between enum types.
12242
12243         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12244         check whether an implicit conversion to the current enum's UnderlyingType
12245         exists and report an error if not.
12246
12247         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12248         without debugging support.
12249
12250         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12251         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12252
12253 2002-09-12  Martin Baulig  <martin@gnome.org>
12254
12255         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12256
12257         * ecore.cs (IMemberExpr.DeclaringType): New property.
12258         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12259         nonstatic member of an outer type (CS0038).
12260
12261 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12262
12263         * driver.cs: Activate the using-error detector at warning level
12264         4 (at least for MS-compatible APIs).
12265
12266         * namespace.cs (VerifyUsing): Small buglett fix.
12267
12268         * pending.cs (PendingImplementation): pass the container pointer. 
12269
12270         * interface.cs (GetMethods): Allow for recursive definition.  Long
12271         term, I would like to move every type to support recursive
12272         definitions, not the current ordering mechanism that we have right
12273         now.
12274
12275         The situation is this: Attributes are handled before interfaces,
12276         so we can apply attributes to interfaces.  But some attributes
12277         implement interfaces, we will now handle the simple cases
12278         (recursive definitions will just get an error).  
12279
12280         * parameter.cs: Only invalidate types at the end if we fail to
12281         lookup all types.  
12282
12283 2002-09-09  Martin Baulig  <martin@gnome.org>
12284
12285         * ecore.cs (PropertyExpr.Emit): Also check for
12286         TypeManager.system_int_array_get_length so this'll also work when
12287         compiling corlib.  Fixes #30003.
12288
12289 2002-09-09  Martin Baulig  <martin@gnome.org>
12290
12291         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12292         and throw an exception if we can't get the type's size.  Fixed #30040,
12293         added test-165.cs.
12294
12295 2002-09-09  Martin Baulig  <martin@gnome.org>
12296
12297         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12298
12299         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12300         context.  Fixes bug #30027.
12301
12302         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12303         virtual functions.  Fixes bug #30043, added test-164.cs.
12304
12305 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12306
12307         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12308
12309 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12310
12311         * driver.cs: Use an object to get the windows codepage since it's not a
12312         static property.
12313
12314 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * statement.cs (For.Emit): for infinite loops (test == null)
12317         return whether there is a break inside, not always "true".
12318
12319         * namespace.cs (UsingEntry): New struct to hold the name of the
12320         using definition, the location where it is defined, and whether it
12321         has been used in a successful type lookup.
12322
12323         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12324         strings.
12325
12326         * decl.cs: ditto.
12327
12328 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12329
12330         * attribute.cs : Fix incorrect code which relied on catching
12331         a NullReferenceException to detect a null being passed in
12332         where an object was expected.
12333
12334 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * statement.cs (Try): flag the catch variable as assigned
12337
12338         * expression.cs (Cast): Simplified by using ResolveType instead of
12339         manually resolving.
12340
12341         * statement.cs (Catch): Fix bug by using ResolveType.
12342
12343 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12344
12345         * expression.cs (BetterConversion): Special case for when we have
12346         a NullLiteral as the argument and we have to choose between string
12347         and object types - we choose string the way csc does.
12348
12349         * attribute.cs (Attribute.Resolve): Catch the
12350         NullReferenceException and report error #182 since the Mono
12351         runtime no more has the bug and having this exception raised means
12352         we tried to select a constructor which takes an object and is
12353         passed a null.
12354
12355 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12356
12357         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12358         message (1502, 1503) when we can't locate a method after overload
12359         resolution. This is much more informative and closes the bug
12360         Miguel reported.
12361
12362         * interface.cs (PopulateMethod): Return if there are no argument
12363         types. Fixes a NullReferenceException bug.
12364
12365         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12366         expressions too. Previously we were checking only in one place for
12367         positional arguments leaving out named arguments.
12368
12369         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12370         type to the enum type is not allowed. Remove code corresponding to
12371         that.
12372
12373         (ConvertNumericExplicit): Allow explicit conversions from
12374         the underlying type to enum type. This precisely follows the spec
12375         and closes a bug filed by Gonzalo.
12376
12377 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12378
12379         * compiler.csproj:
12380         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12381
12382 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12383
12384         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12385         it was important that we stored the right value after the
12386         reduction in `converted'.
12387
12388 2002-09-04  Martin Baulig  <martin@gnome.org>
12389
12390         * location.cs (Location.SymbolDocument): Use full pathnames for the
12391         source files.
12392
12393 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12396         of the expression resolve mechanism, because that will catch the
12397         SimpleName error failures.
12398
12399         (Conditional): If we can not resolve the
12400         expression, return, do not crash.
12401
12402 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12403
12404         * cs-tokenizer.cs:
12405         (location): display token name instead of its number.
12406
12407 2002-08-28  Martin Baulig  <martin@gnome.org>
12408
12409         * expression.cs (Binary.ResolveOperator): Don't silently return
12410         but return an error if an operator cannot be applied between two
12411         enum types.
12412
12413 2002-08-28  Martin Baulig  <martin@gnome.org>
12414
12415         * class.cs (Constructor.Define): Set the permission attributes
12416         correctly instead of making all constructors public.
12417
12418 2002-08-28  Martin Baulig  <martin@gnome.org>
12419
12420         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12421         for private members before reporting a CS0103; if we find anything,
12422         it's a CS0122.
12423
12424 2002-08-28  Martin Baulig  <martin@gnome.org>
12425
12426         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12427         to check whether `closure_start_type == closure_invocation_type',
12428         we also need to check whether `m.DeclaringType == closure_invocation_type'
12429         before bypassing the permission checks.  We might be accessing
12430         protected/private members from the base class.
12431         (TypeManager.RealMemberLookup): Only set private_ok if private
12432         members were requested via BindingFlags.NonPublic.
12433
12434         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12435
12436         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12437         MethodGroupExpr.IsExplicitImpl if appropriate.
12438         (Invocation.DoResolve): Don't report the CS0120 for explicit
12439         interface implementations.
12440
12441 2002-08-27  Martin Baulig  <martin@gnome.org>
12442
12443         * expression.cs (Invocation.DoResolve): If this is a static
12444         method and we don't have an InstanceExpression, we must report
12445         a CS0120.
12446
12447 2002-08-25  Martin Baulig  <martin@gnome.org>
12448
12449         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12450         `==' between a valuetype and an object.
12451
12452 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * ecore.cs (TypeExpr): Provide a ToString method.
12455
12456 2002-08-24  Martin Baulig  <martin@gnome.org>
12457
12458         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12459         now called proggie.dbg and it's a binary file.
12460
12461 2002-08-23  Martin Baulig  <martin@gnome.org>
12462
12463         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12464
12465 2002-08-23  Martin Baulig  <martin@gnome.org>
12466
12467         * struct.cs (MyStructInfo.ctor): Make this work with empty
12468         structs; it's not allowed to use foreach() on null.
12469
12470 2002-08-23  Martin Baulig  <martin@gnome.org>
12471
12472         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12473         writer the full pathname of the generated assembly.
12474
12475 2002-08-23  Martin Baulig  <martin@gnome.org>
12476
12477         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12478         A `finally' block never returns or breaks; improved handling of
12479         unreachable code.
12480
12481 2002-08-23  Martin Baulig  <martin@gnome.org>
12482
12483         * statement.cs (Throw.Resolve): Allow `throw null'.
12484
12485 2002-08-23  Martin Baulig  <martin@gnome.org>
12486
12487         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12488         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12489         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12490         MemberLookup would return a wrong event if this is an explicit
12491         interface implementation and the class has an event with the same
12492         name.
12493
12494 2002-08-23  Martin Baulig  <martin@gnome.org>
12495
12496         * statement.cs (Block.AddChildVariableNames): New public method.
12497         (Block.AddChildVariableName): Likewise.
12498         (Block.IsVariableNameUsedInChildBlock): Likewise.
12499         (Block.AddVariable): Check whether a variable name has already
12500         been used in a child block.
12501
12502         * cs-parser.jay (declare_local_variables): Mark all variable names
12503         from the current block as being used in a child block in the
12504         implicit block.
12505
12506 2002-08-23  Martin Baulig  <martin@gnome.org>
12507
12508         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12509         find the symbol writer.
12510
12511         * driver.cs: csc also allows the arguments to /define being
12512         separated by commas, not only by semicolons.
12513
12514 2002-08-23  Martin Baulig  <martin@gnome.org>
12515
12516         * interface.cs (Interface.GetMembers): Added static check for events.
12517
12518 2002-08-15  Martin Baulig  <martin@gnome.org>
12519
12520         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12521         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12522
12523         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12524         why the MethodData.EmitDestructor() change was necessary.
12525
12526 2002-08-20  Martin Baulig  <martin@gnome.org>
12527
12528         * class.cs (TypeContainer.FindMembers): Added static check for events.
12529
12530         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12531
12532         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12533         use Type.GetEvents(), not Type.FindMembers().
12534
12535 2002-08-20  Martin Baulig  <martin@gnome.org>
12536
12537         * decl.cs (MemberCache): Added a special method cache which will
12538         be used for method-only searched.  This ensures that a method
12539         search will return a MethodInfo with the correct ReflectedType for
12540         inherited methods.      
12541
12542 2002-08-20  Martin Baulig  <martin@gnome.org>
12543
12544         * decl.cs (DeclSpace.FindMembers): Made this public.
12545
12546 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12547
12548         * delegate.cs: fixed build on windows.
12549         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12550
12551 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12552
12553         * ecore.cs (StandardConversionExists): Return a false
12554         if we are trying to convert the void type to anything else
12555         since that is not allowed.
12556
12557         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12558         we flag error 70 in the event an event is trying to be accessed
12559         directly from outside the declaring type.
12560
12561 2002-08-20  Martin Baulig  <martin@gnome.org>
12562
12563         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12564         MemberCache from typemanager.cs to decl.cs.
12565
12566 2002-08-19  Martin Baulig  <martin@gnome.org>
12567
12568         * class.cs (TypeContainer): Implement IMemberContainer.
12569         (TypeContainer.DefineMembers): Create the MemberCache.
12570         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12571         return public members if BindingFlags.Public was given, check
12572         whether members are static.
12573
12574 2002-08-16  Martin Baulig  <martin@gnome.org>
12575
12576         * decl.cs (DeclSpace.Define): Splitted this in Define and
12577         DefineMembers.  DefineMembers is called first and initializes the
12578         MemberCache.
12579
12580         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12581         DefineMembers() on all our DeclSpaces.
12582
12583         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12584         but call DefineMembers() on all nested interfaces.  We call their
12585         Define() in our new Define() function.
12586
12587         * interface.cs (Interface): Implement IMemberContainer.
12588         (Interface.Define): Moved all code except the attribute stuf to
12589         DefineMembers().
12590         (Interface.DefineMembers): Initialize the member cache.
12591
12592         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12593         need this anymore since we can use MemberCache.FindMembers directly.
12594
12595 2002-08-19  Martin Baulig  <martin@gnome.org>
12596
12597         * typemanager.cs (MemberCache): When creating the cache for an
12598         interface type, add all inherited members.
12599         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12600         to `out bool used_cache' and documented it.
12601         (TypeManager.MemberLookup): If we already used the cache in the first
12602         iteration, we don't need to do the interfaces check.
12603
12604 2002-08-19  Martin Baulig  <martin@gnome.org>
12605
12606         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12607         here from IMemberFinder and don't implement this interface anymore.
12608         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12609
12610         * typemanager.cs (IMemberFinder): This interface is now only used by
12611         classes which actually support the member cache.
12612         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12613         since we only put DeclSpaces into this Hashtable.
12614         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12615         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12616
12617 2002-08-16  Martin Baulig  <martin@gnome.org>
12618
12619         * typemanager.cs (ICachingMemberFinder): Removed.
12620         (IMemberFinder.MemberCache): New property.
12621         (TypeManager.FindMembers): Merged this with RealFindMembers().
12622         This function will never be called from TypeManager.MemberLookup()
12623         so we can't use the cache here, just the IMemberFinder.
12624         (TypeManager.MemberLookup_FindMembers): Check whether the
12625         IMemberFinder has a MemberCache and call the cache's FindMembers
12626         function.
12627         (MemberCache): Rewrote larger parts of this yet another time and
12628         cleaned it up a bit.
12629
12630 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12631
12632         * driver.cs (LoadArgs): Support quoting.
12633
12634         (Usage): Show the CSC-like command line arguments.
12635
12636         Improved a few error messages.
12637
12638 2002-08-15  Martin Baulig  <martin@gnome.org>
12639
12640         * typemanager.cs (IMemberContainer.Type): New property.
12641         (IMemberContainer.IsInterface): New property.
12642
12643         The following changes are conditional to BROKEN_RUNTIME, which is
12644         defined at the top of the file.
12645
12646         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12647         class'es members, but add all members from TypeHandle.ObjectType
12648         if we're an interface.
12649         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12650         is the current type.
12651         (MemberCache.CacheEntry.Container): Removed this field.
12652         (TypeHandle.GetMembers): Include inherited members.
12653
12654 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12655
12656         * typemanager.cs: fixed compilation and added a comment on a field that
12657         is never used.
12658
12659 2002-08-15  Martin Baulig  <martin@gnome.org>
12660
12661         * class.cs (ConstructorInitializer.Resolve): In the
12662         Expression.MemberLookup call, use the queried_type as
12663         invocation_type.
12664
12665         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12666         declared' attribute, it's always true.
12667         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12668         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12669         temporary wrapper for FindMembers which tells MemberLookup whether
12670         members from the base classes are included in the return value.
12671         This will go away soon.
12672         (TypeManager.MemberLookup): Use this temporary hack here; once the
12673         new MemberCache is completed, we don't need to do the DeclaredOnly
12674         looping here anymore since the MemberCache will take care of this.
12675         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12676         (MemberCache): When creating the MemberCache for a class, get
12677         members from the current class and all its base classes.
12678         (MemberCache.CacheEntry.Container): New field.  This is a
12679         temporary hack until the Mono runtime is fixed to distinguish
12680         between ReflectedType and DeclaringType.  It allows us to use MCS
12681         with both the MS runtime and the unfixed Mono runtime without
12682         problems and without accecting performance.
12683         (MemberCache.SearchMembers): The DeclaredOnly looping from
12684         TypeManager.MemberLookup is now done here.      
12685
12686 2002-08-14  Martin Baulig  <martin@gnome.org>
12687
12688         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12689         Type.GetFields on dynamic types but get the fields from the
12690         corresponding TypeContainer.
12691         (MyStructInfo.GetStructInfo): Added check for enum types.
12692
12693         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12694         (MemberList.SyncRoot): Implemented.
12695         (TypeManager.FilterWithClosure): No need to check permissions if
12696         closure_start_type == closure_invocation_type, don't crash if
12697         closure_invocation_type is null.
12698
12699 2002-08-13  Martin Baulig  <martin@gnome.org>
12700
12701         Rewrote TypeContainer.FindMembers to use a member cache.  This
12702         gives us a speed increase of about 35% for the self-hosting MCS
12703         build and of about 15-20% for the class libs (both on GNU/Linux).
12704
12705         * report.cs (Timer): New class to get enhanced profiling.  This
12706         whole class is "TIMER" conditional since it remarkably slows down
12707         compilation speed.
12708
12709         * class.cs (MemberList): New class.  This is an IList wrapper
12710         which we're now using instead of passing MemberInfo[]'s around to
12711         avoid copying this array unnecessarily.
12712         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12713         (ICachingMemberFinder, IMemberContainer): New interface.
12714         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12715         has already been checked, otherwise use it for the name comparision.
12716         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12717         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12718         if possible.  Returns a MemberList, not a MemberInfo [].
12719         (TypeHandle): New class, implements IMemberContainer.  We create
12720         one instance of this class per type, it contains a MemberCache
12721         which is used to do the member lookups.
12722         (MemberCache): New class.  Each instance of this class contains
12723         all members of a type and a name-based hash table.
12724         (MemberCache.FindMembers): This is our new member lookup
12725         function.  First, it looks up all members of the requested name in
12726         the hash table.  Then, it walks this list and sorts out all
12727         applicable members and returns them.
12728
12729 2002-08-13  Martin Baulig  <martin@gnome.org>
12730
12731         In addition to a nice code cleanup, this gives us a performance
12732         increase of about 1.4% on GNU/Linux - not much, but it's already
12733         half a second for the self-hosting MCS compilation.
12734
12735         * typemanager.cs (IMemberFinder): New interface.  It is used by
12736         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12737         Enum, Delegate or Interface.
12738         (TypeManager.finder_to_member_finder): New PtrHashtable.
12739         (TypeManager.finder_to_container): Removed.
12740         (TypeManager.finder_to_delegate): Removed.
12741         (TypeManager.finder_to_interface): Removed.
12742         (TypeManager.finder_to_enum): Removed.
12743
12744         * interface.cs (Interface): Implement IMemberFinder.
12745
12746         * delegate.cs (Delegate): Implement IMemberFinder.
12747
12748         * enum.cs (Enum): Implement IMemberFinder.
12749
12750         * class.cs (TypeContainer): Implement IMemberFinder.
12751
12752 2002-08-12  Martin Baulig  <martin@gnome.org>
12753
12754         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12755
12756 2002-08-12  Martin Baulig  <martin@gnome.org>
12757
12758         * ecore.cs (ITypeExpression): New interface for expressions which
12759         resolve to a type.
12760         (TypeExpression): Renamed to TypeLookupExpression.
12761         (Expression.DoResolve): If we're doing a types-only lookup, the
12762         expression must implement the ITypeExpression interface and we
12763         call DoResolveType() on it.
12764         (SimpleName): Implement the new ITypeExpression interface.
12765         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12766         hack, the situation that we're only looking up types can't happen
12767         anymore when this method is called.  Moved the type lookup code to
12768         DoResolveType() and call it.
12769         (SimpleName.DoResolveType): This ITypeExpression interface method
12770         is now doing the types-only lookup.
12771         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12772         (ResolveFlags): Added MaskExprClass.
12773
12774         * expression.cs (MemberAccess): Implement the ITypeExpression
12775         interface.
12776         (MemberAccess.DoResolve): Added support for a types-only lookup
12777         when we're called via ITypeExpression.DoResolveType().
12778         (ComposedCast): Implement the ITypeExpression interface.
12779
12780         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12781         Expression.Resolve() with ResolveFlags.Type instead.
12782
12783 2002-08-12  Martin Baulig  <martin@gnome.org>
12784
12785         * interface.cs (Interface.Define): Apply attributes.
12786
12787         * attribute.cs (Attribute.ApplyAttributes): Added support for
12788         interface attributes.
12789
12790 2002-08-11  Martin Baulig  <martin@gnome.org>
12791
12792         * statement.cs (Block.Emit): Only check the "this" variable if we
12793         do not always throw an exception.
12794
12795         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12796         whether the property has a set accessor.
12797
12798 2002-08-11  Martin Baulig  <martin@gnome.org>
12799
12800         Added control flow analysis support for structs.
12801
12802         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12803         with control flow analysis turned off.
12804         (IVariable): New interface.
12805         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12806         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12807         (FieldExpr.DoResolve): Resolve the instance expression with flow
12808         analysis turned off and do the definite assignment check after the
12809         resolving when we know what the expression will resolve to.
12810
12811         * expression.cs (LocalVariableReference, ParameterReference):
12812         Implement the new IVariable interface, only call the flow analysis
12813         code if ec.DoFlowAnalysis is true.
12814         (This): Added constructor which takes a Block argument.  Implement
12815         the new IVariable interface.
12816         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12817         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12818         This does the definite assignment checks for struct members.
12819
12820         * class.cs (Constructor.Emit): If this is a non-static `struct'
12821         constructor which doesn't have any initializer, call
12822         Block.AddThisVariable() to tell the flow analysis code that all
12823         struct elements must be initialized before control returns from
12824         the constructor.
12825
12826         * statement.cs (MyStructInfo): New public class.
12827         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12828         argument to this indexer.  If non-zero, check an individual struct
12829         member, not the whole struct.
12830         (FlowBranching.CheckOutParameters): Check struct members.
12831         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12832         overloaded versions of these methods which take an additional
12833         `int field_idx' argument to check struct members.
12834         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12835         overloaded versions of these methods which take an additional
12836         `string field_name' argument to check struct member.s
12837         (VariableInfo): Implement the IVariable interface.
12838         (VariableInfo.StructInfo): New public property.  Returns the
12839         MyStructInfo instance of the variable if it's a struct or null.
12840         (Block.AddThisVariable): New public method.  This is called from
12841         Constructor.Emit() for non-static `struct' constructor which do
12842         not have any initializer.  It creates a special variable for the
12843         "this" instance variable which will be checked by the flow
12844         analysis code to ensure that all of the struct's fields are
12845         initialized before control returns from the constructor.
12846         (UsageVector): Added support for struct members.  If a
12847         variable/parameter is a struct with N members, we reserve a slot
12848         in the usage vector for each member.  A struct is considered fully
12849         initialized if either the struct itself (slot 0) or all its
12850         members are initialized.
12851
12852 2002-08-08  Martin Baulig  <martin@gnome.org>
12853
12854         * driver.cs (Driver.MainDriver): Only report an error CS5001
12855         if there were no compilation errors.
12856
12857         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12858         `UnsafeContext' property to determine whether the parent is in
12859         unsafe context rather than checking the parent's ModFlags:
12860         classes nested in an unsafe class are unsafe as well.
12861
12862 2002-08-08  Martin Baulig  <martin@gnome.org>
12863
12864         * statement.cs (UsageVector.MergeChildren): Distinguish between
12865         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12866         we return.  Added test17() and test18() to test-154.cs.
12867
12868 2002-08-08  Martin Baulig  <martin@gnome.org>
12869
12870         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12871         Family access, make sure the invoking type isn't a subclass of the
12872         queried type (that'd be a CS1540).
12873
12874         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12875         this method which takes an additional `Type invocation_type'.
12876
12877         * expression.cs (BaseAccess.DoResolve): Use the base type as
12878         invocation and query type.
12879         (MemberAccess.DoResolve): If the lookup failed and we're about to
12880         report a CS0122, try a lookup with the ec.ContainerType - if this
12881         succeeds, we must report a CS1540.
12882
12883 2002-08-08  Martin Baulig  <martin@gnome.org>
12884
12885         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12886         (MethodGroupExpr): Implement the IMemberExpr interface.
12887
12888         * expression (MemberAccess.ResolveMemberAccess): No need to have
12889         any special code for MethodGroupExprs anymore, they're now
12890         IMemberExprs.   
12891
12892 2002-08-08  Martin Baulig  <martin@gnome.org>
12893
12894         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12895         Family, FamANDAssem and FamORAssem permissions.
12896         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12897
12898 2002-08-08  Martin Baulig  <martin@gnome.org>
12899
12900         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12901         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12902         or loop block.
12903
12904 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12905
12906         * driver.cs: implemented /resource option to embed managed resources.
12907
12908 2002-08-07  Martin Baulig  <martin@gnome.org>
12909
12910         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12911         (FieldBase.HasFieldInitializer): New public property.
12912         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12913         returns the field initializer and makes sure it is only resolved once.
12914         (TypeContainer.EmitFieldInitializers): Call
12915         FieldBase.GetInitializerExpression to get the initializer, this ensures
12916         that it isn't resolved multiple times.
12917
12918         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12919         the resolving process (SimpleName/MemberLookup) that we're currently
12920         emitting a field initializer (which must not access any instance members,
12921         this is an error CS0236).
12922
12923         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12924         argument, if the `IsFieldInitializer' flag is set, we must report and
12925         error CS0236 and not an error CS0120.   
12926
12927 2002-08-07  Martin Baulig  <martin@gnome.org>
12928
12929         * ecore.cs (IMemberExpr): New public interface.
12930         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12931         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12932         if the expression is an IMemberExpr.
12933
12934         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12935         to be null, implicitly default to `this' if we're non-static in
12936         this case.  Simplified the code a lot by using the new IMemberExpr
12937         interface.  Also fixed bug #28176 here.
12938
12939 2002-08-06  Martin Baulig  <martin@gnome.org>
12940
12941         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12942         ParameterReferences during semantic analysis so that we can do a
12943         type-only search when resolving Cast, TypeOf and SizeOf.
12944         (block): Pass the `current_local_parameters' to the Block's
12945         constructor.
12946
12947         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12948         argument to the constructor.
12949         (ConstructorInitializer.Resolve): Create a temporary implicit
12950         block with the parameters.
12951
12952         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12953         references here if we aren't doing a type-only search.
12954
12955         * statement.cs (Block): Added constructor which takes a
12956         `Parameters parameters' argument.
12957         (Block.Parameters): New public property.
12958
12959         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12960         to `Parameters' and made it public readonly.
12961
12962 2002-08-06  Martin Baulig  <martin@gnome.org>
12963
12964         * ecore.cs (Expression.Warning): Made this public as well.
12965
12966         * report.cs (Report.Debug): Print the contents of collections.
12967
12968 2002-08-06  Martin Baulig  <martin@gnome.org>
12969
12970         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12971         used to tell Resolve() which kinds of expressions it may return.
12972         (Expression.Resolve): Added overloaded version of this method which
12973         takes a `ResolveFlags flags' argument.  This can be used to tell
12974         Resolve() which kinds of expressions it may return.  Reports a
12975         CS0118 on error.
12976         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12977         ResolveFlags.SimpleName.
12978         (Expression.Error118): Added overloaded version of this method which
12979         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12980         which kinds of expressions are allowed.
12981
12982         * expression.cs (Argument.ResolveMethodGroup): New public method.
12983         Resolves an argument, but allows a MethodGroup to be returned.
12984         This is used when invoking a delegate.
12985
12986         * TODO: Updated a bit.
12987
12988 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12989
12990         Fixed compilation with csc.
12991
12992         * ecore.cs: Expression.Error made public. Is this correct? Should
12993         Warning be made public too?
12994
12995         * expression.cs: use ea.Location instead of ea.loc.
12996         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12997
12998 2002-08-06  Martin Baulig  <martin@gnome.org>
12999
13000         * ecore.cs (Expression.loc): Moved the location here instead of
13001         duplicating it in all derived classes.
13002         (Expression.Location): New public property.
13003         (Expression.Error, Expression.Warning): Made them non-static and
13004         removed the location argument.
13005         (Expression.Warning): Added overloaded version which takes an
13006         `int level' argument.
13007         (Expression.Error118): Make this non-static and removed the
13008         expression and location arguments.
13009         (TypeExpr): Added location argument to the constructor.
13010
13011         * expression.cs (StaticCallExpr): Added location argument to
13012         the constructor.
13013         (Indirection, PointerArithmetic): Likewise.
13014         (CheckedExpr, UnCheckedExpr): Likewise.
13015         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13016         (StringPtr): Likewise.
13017
13018
13019 2002-08-05  Martin Baulig  <martin@gnome.org>
13020
13021         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13022
13023         * assign.cs (Assign.DoResolve): Check whether the source
13024         expression is a value or variable.
13025
13026         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13027         while resolving the corresponding blocks.
13028
13029         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13030         an error, don't silently return null.
13031
13032         * statement.cs (Block.AddVariable): Do the error reporting here
13033         and distinguish between CS0128 and CS0136.
13034         (Block.DoResolve): Report all unused labels (warning CS0164).
13035         (LabeledStatement): Pass the location to the constructor.
13036         (LabeledStatement.HasBeenReferenced): New property.
13037         (LabeledStatement.Resolve): Set it to true here.
13038
13039         * statement.cs (Return.Emit): Return success even after reporting
13040         a type mismatch error (CS0126 or CS0127), this is what csc does and
13041         it avoids confusing the users with any consecutive errors.
13042
13043 2002-08-05  Martin Baulig  <martin@gnome.org>
13044
13045         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13046
13047         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13048
13049         * expression.cs (MemberAccess.DoResolve): Silently return if an
13050         error has already been reported.
13051
13052         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13053         error has already been reported.
13054
13055 2002-08-05  Martin Baulig  <martin@gnome.org>
13056
13057         * statement.cs (UsageVector): Only initialize the `parameters'
13058         vector if we actually have any "out" parameters.
13059
13060 2002-08-05  Martin Baulig  <martin@gnome.org>
13061
13062         * expression.cs (Binary.ResolveOperator): When combining delegates,
13063         they must have the same type.
13064
13065 2002-08-05  Martin Baulig  <martin@gnome.org>
13066
13067         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13068         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13069         work with the ms runtime and we also don't need it: if we're a
13070         PropertyBuilder and not in the `indexer_arguments' hash, then we
13071         are a property and not an indexer.
13072
13073         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13074         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13075         since the latter one doesn't work with the ms runtime.
13076
13077 2002-08-03  Martin Baulig  <martin@gnome.org>
13078
13079         Fixed bugs #27998 and #22735.
13080
13081         * class.cs (Method.IsOperator): New public field.
13082         (Method.CheckBase): Report CS0111 if there's already a method
13083         with the same parameters in the current class.  Report CS0508 when
13084         attempting to change the return type of an inherited method.
13085         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13086         and it's not marked abstract or extern.
13087         (PropertyBase): New abstract base class for Property and Indexer.
13088         (PropertyBase.CheckBase): Moved here from Property and made it work
13089         for indexers.
13090         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13091         the same so we can reuse it there.
13092         (Property, Indexer): Derive from PropertyBase.
13093         (MethodSignature.inheritable_property_signature_filter): New delegate
13094         to find properties and indexers.
13095
13096         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13097         argument and improved error reporting.
13098
13099         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13100         EmptyReadOnlyParameters and made it a property.
13101
13102         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13103         version of this method which takes a `PropertyInfo indexer'.
13104         (TypeManager.RegisterIndexer): New method.
13105
13106         * class.cs: Added myself as author of this file :-)
13107
13108 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13109
13110         * class.cs: fixed compilation on windoze.
13111
13112 2002-08-03  Martin Baulig  <martin@gnome.org>
13113
13114         * interface.cs (Interface.GetInterfaceBases): Check whether all
13115         base interfaces are at least as accessible than the current one.
13116
13117         * class.cs (TypeContainer.GetClassBases): Check whether base types
13118         are at least as accessible than the current type.
13119         (TypeContainer.AsAccessible): Implemented and made non-static.
13120         (MemberBase.CheckParameters): Report errors if the accessibility
13121         checks fail.
13122
13123         * delegate.cs (Delegate.Delegate): The default visibility is
13124         internal for top-level types and private for nested types.
13125         (Delegate.Define): Report errors if the accessibility checks fail.
13126
13127         * enum.cs (Enum.Enum): The default visibility is internal for
13128         top-level types and private for nested types.
13129         (Enum.DefineType): Compute the correct visibility.
13130
13131         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13132         function which takes a `bool is_toplevel' instead of a TypeContainer.
13133
13134         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13135         builtin type.
13136
13137 2002-08-02  Martin Baulig  <martin@gnome.org>
13138
13139         * expression.cs (LocalVariableReferenc): Added constructor which
13140         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13141         (LocalVariableReference.IsReadOnly): New property.
13142         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13143         variable is readonly, use our own readonly flag to do this; you can
13144         use the new constructor to get a writable reference to a read-only
13145         variable.
13146
13147         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13148         reference to the local variable.
13149
13150 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13151
13152         * rootcontext.cs (ResolveCore): Also include System.Exception
13153
13154         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13155         we reach an EmptyStatement.
13156
13157         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13158         is also fine.
13159
13160         * expression.cs (Binary.ResolveOperator): Check error result in
13161         two places.
13162
13163         use brtrue/brfalse directly and avoid compares to null.
13164
13165 2002-08-02  Martin Baulig  <martin@gnome.org>
13166
13167         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13168         Fixes bug #28407, added test-155.cs.
13169
13170 2002-08-01  Martin Baulig  <martin@gnome.org>
13171
13172         * class.cs (Event.EmitDefaultMethod): Make this work with static
13173         events.  Fixes #28311, added verify-3.cs.
13174
13175 2002-08-01  Martin Baulig  <martin@gnome.org>
13176
13177         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13178         `is_disposable' fields.
13179         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13180         `hm.is_disposable' if we're using the collection pattern.
13181         (Foreach.EmitCollectionForeach): Use the correct type for the
13182         enumerator's local variable, only emit the try/finally block if
13183         necessary (fixes #27713).
13184
13185 2002-08-01  Martin Baulig  <martin@gnome.org>
13186
13187         * ecore.cs (Expression.report118): Renamed to Error118 and made
13188         it public static.
13189
13190         * statement.cs (Throw.Resolve): Check whether the expression is of
13191         the correct type (CS0118) and whether the type derives from
13192         System.Exception (CS0155).
13193         (Catch.Resolve): New method.  Do the type lookup here and check
13194         whether it derives from System.Exception (CS0155).
13195         (Catch.CatchType, Catch.IsGeneral): New public properties.
13196
13197         * typemanager.cs (TypeManager.exception_type): Added.
13198
13199 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * driver.cs: Updated About function.
13202
13203 2002-07-31  Martin Baulig  <martin@gnome.org>
13204
13205         Implemented Control Flow Analysis.
13206
13207         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13208         (EmitContext.CurrentBranching): Added.
13209         (EmitContext.StartFlowBranching): Added.
13210         (EmitContext.EndFlowBranching): Added.
13211         (EmitContext.KillFlowBranching): Added.
13212         (EmitContext.IsVariableAssigned): Added.
13213         (EmitContext.SetVariableAssigned): Added.
13214         (EmitContext.IsParameterAssigned): Added.
13215         (EmitContext.SetParameterAssigned): Added.
13216         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13217         Added control flow analysis stuff here.
13218
13219         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13220         resolve the expression as lvalue.
13221         (LocalVariableReference.DoResolve): Check whether the variable has
13222         already been assigned.
13223         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13224         the parameter as assigned here.
13225         (ParameterReference.DoResolve): Check whether the parameter has already
13226         been assigned.
13227         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13228         expression as lvalue.
13229
13230         * statement.cs (FlowBranching): New class for the flow analysis code.
13231         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13232         (LabeledStatement.IsDefined): New public property.
13233         (LabeledStatement.AddUsageVector): New public method to tell flow
13234         analyis that the label may be reached via a forward jump.
13235         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13236         flow analysis.
13237         (VariableInfo.Number): New public field.  This is used by flow analysis
13238         to number all locals of a block.
13239         (Block.CountVariables): New public property.  This is the number of
13240         local variables in this block (including the locals from all parent
13241         blocks).
13242         (Block.EmitMeta): Number all the variables.
13243
13244         * statement.cs: Added flow analysis support to all classes.
13245
13246 2002-07-31  Martin Baulig  <martin@gnome.org>
13247
13248         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13249         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13250         then use this argument.
13251
13252         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13253
13254         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13255         use this to specify /define options.
13256
13257 2002-07-29  Martin Baulig  <martin@gnome.org>
13258
13259         * statement.cs (Fixed): Moved all code that does variable lookups
13260         and resolvings from Emit to Resolve.
13261
13262         * statement.cs (For): Moved all code that does variable lookups
13263         and resolvings from Emit to Resolve.
13264
13265         * statement.cs (Using): Moved all code that does variable lookups
13266         and resolvings from Emit to Resolve.
13267
13268 2002-07-29  Martin Baulig  <martin@gnome.org>
13269
13270         * attribute.cs (Attribute.Resolve): Explicitly catch a
13271         System.NullReferenceException when creating the
13272         CustromAttributeBuilder and report a different warning message.
13273
13274 2002-07-29  Martin Baulig  <martin@gnome.org>
13275
13276         * support.cs (ParameterData.ParameterName): Added method to
13277         get the name of a parameter.
13278
13279         * typemanager.cs (TypeManager.IsValueType): New public method.
13280
13281 2002-07-29  Martin Baulig  <martin@gnome.org>
13282
13283         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13284         is a flag which specifies that it's either ref or out.
13285         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13286         the out parameter to `out Parameter.Modifier mod', also set the
13287         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13288
13289         * support.cs (InternalParameters.ParameterModifier): Distinguish
13290         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13291         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13292
13293         * expression.cs (Argument.GetParameterModifier): Distinguish
13294         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13295         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13296
13297 2002-07-29  Martin Baulig  <martin@gnome.org>
13298
13299         * expression.cs (ParameterReference.ParameterReference): Added
13300         `Location loc' argument to the constructor.
13301
13302         * cs-parser.jay: Pass location to ParameterReference.
13303
13304 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13305
13306         * statement.cs (Try): Initialize the location.
13307
13308         * cs-parser.jay: pass location to Try.
13309
13310         * expression.cs (Unary.Reduce): Change the prototype to return
13311         whether a constant fold could be performed or not.  The result is
13312         returned in an out parameters.  In the case of Indirection and
13313         AddressOf, we want to perform the full tests.
13314
13315 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * statement.cs (Statement.Emit): Flag dead code.
13318
13319 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13320
13321         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13322
13323 2002-07-27  Martin Baulig  <martin@gnome.org>
13324
13325         * class.cs (MethodData.Define): Put back call to
13326         TypeManager.AddMethod(), accidentally commented this out.
13327
13328         * report.cs (Debug): New public method to print debugging information,
13329         this is `[Conditional ("DEBUG")]'.
13330
13331 2002-07-26  Martin Baulig  <martin@gnome.org>
13332
13333         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13334         (switch_statement): Push the current_block to the switch_stack and
13335         pop it again when we're done with the switch.
13336         (switch_section): The new block is a child of the current_block.
13337         Fixes bug #24007, added test-152.cs.
13338
13339 2002-07-27  Martin Baulig  <martin@gnome.org>
13340
13341         * expression.cs (Invocation.EmitArguments): When calling a varargs
13342         function with only its fixed arguments, we need to pass an empty
13343         array.
13344
13345 2002-07-27  Martin Baulig  <martin@gnome.org>
13346
13347         Mono 0.13 has been released.
13348
13349 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13350
13351         * driver.cs: Rename --resource to --linkres, because that is what
13352         we do currently, we dont support --resource yet.
13353
13354         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13355
13356 2002-07-25  Martin Baulig  <martin@gnome.org>
13357
13358         * class.cs (MethodData): New public class.  This is a `method builder'
13359         class for a method or one accessor of a Property/Indexer/Event.
13360         (MethodData.GetMethodFlags): Moved here from MemberBase.
13361         (MethodData.ApplyAttributes): Likewise.
13362         (MethodData.ApplyObsoleteAttribute): Likewise.
13363         (MethodData.ApplyConditionalAttribute): Likewise.
13364         (MethodData.ApplyDllImportAttribute): Likewise.
13365         (MethodData.CheckAbstractAndExternal): Likewise.
13366         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13367         (MethodData.Emit): Formerly known as Method.Emit().
13368         (MemberBase): Moved everything which was specific to a single
13369         accessor/method to MethodData.
13370         (Method): Create a new MethodData and call Define() and Emit() on it.
13371         (Property, Indexer, Event): Create a new MethodData objects for each
13372         accessor and call Define() and Emit() on them.
13373
13374 2002-07-25  Martin Baulig  <martin@gnome.org>
13375
13376         Made MethodCore derive from MemberBase to reuse the code from there.
13377         MemberBase now also checks for attributes.
13378
13379         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13380         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13381         as virtual.
13382         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13383         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13384         (MemberBase.ApplyAttributes): New virtual method; applies the
13385         attributes to a method or accessor.
13386         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13387         (MemberBase.ApplyConditionalAttribute): Likewise.
13388         (MemberBase.ApplyDllImportAttribute): Likewise.
13389         (MemberBase.CheckAbstractAndExternal): Likewise.
13390         (MethodCore.ParameterTypes): This is now a property instead of a
13391         method, it's initialized from DoDefineParameters().
13392         (MethodCore.ParameterInfo): Removed the set accessor.
13393         (MethodCore.DoDefineParameters): New protected virtual method to
13394         initialize ParameterTypes and ParameterInfo.
13395         (Method.GetReturnType): We can now simply return the MemberType.
13396         (Method.GetMethodFlags): Override the MemberBase version and add
13397         the conditional flags.
13398         (Method.CheckBase): Moved some code from Define() here, call
13399         DoDefineParameters() here.
13400         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13401         here to avoid some larger code duplication.
13402         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13403         ensure that abstract and external accessors don't declare a body.
13404
13405         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13406         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13407         lookup in the attribute's parent classes, so we need to abort as soon
13408         as we found the first match.
13409         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13410         the attribute has no arguments.
13411
13412         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13413         of a Method.
13414
13415 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13416
13417         * cs-parser.jay: reverted previous patch.
13418
13419 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13420
13421         * cs-parser.jay: fixed bug #22119.
13422
13423 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13424
13425         * attribute.cs: fixed compilation. The error was:
13426         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13427         be assigned to before control leaves the current method."
13428         [FIXME:  Filed as bug #28186: MCS must report this error.]
13429
13430 2002-07-25  Martin Baulig  <martin@gnome.org>
13431
13432         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13433         method to pull the condition name ouf of a Conditional attribute.
13434         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13435         the obsolete message and error flag out of an Obsolete attribute.
13436
13437         * class.cs (Method.GetMethodFlags): New public method to get the
13438         TypeManager.MethodFlags for this method.
13439         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13440         private methods.
13441         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13442         if we're overriding a virtual function, set the new private variable
13443         `parent_method'; call the new TypeManager.AddMethod().
13444
13445         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13446         the MethodBuilder and the Method in a PtrHashtable.
13447         (TypeManager.builder_to_method): Added for this purpose.
13448         (TypeManager.MethodFlags): Added IsObsoleteError.
13449         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13450         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13451         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13452         the message from the attribute.
13453
13454 2002-07-24  Martin Baulig  <martin@gnome.org>
13455
13456         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13457         preprocessor directives, ensure that the argument to #define/#undef is
13458         exactly one identifier and that it's actually an identifier.
13459
13460         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13461         did not work ....
13462
13463 2002-07-24  Martin Baulig  <martin@gnome.org>
13464
13465         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13466         initialize it to TypeManager.object_type in the constructor.
13467         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13468         of the `hm.get_current' method if we're using the collection pattern.
13469         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13470         for the explicit conversion to make it work when we're using the collection
13471         pattern and the `Current' property has a different return type than `object'.
13472         Fixes #27713.
13473
13474 2002-07-24  Martin Baulig  <martin@gnome.org>
13475
13476         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13477         does not match, but don't report any errors.  This method is called in
13478         order for all methods in a MethodGroupExpr until a matching method is
13479         found, so we don't want to bail out if the first method doesn't match.
13480         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13481         matches, report the 123.  Fixes #28070.
13482
13483 2002-07-24  Martin Baulig  <martin@gnome.org>
13484
13485         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13486         TypeManager.TypeToCoreType() to the top of the method so the
13487         following equality checks will work.  Fixes #28107.
13488
13489 2002-07-24  Martin Baulig  <martin@gnome.org>
13490
13491         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13492         operand is of type uint, and the other operand is of type sbyte,
13493         short or int, the operands are converted to type long." -
13494         Actually do what this comment already told us.  Fixes bug #28106,
13495         added test-150.cs.
13496
13497 2002-07-24  Martin Baulig  <martin@gnome.org>
13498
13499         * class.cs (MethodBase): New abstract class.  This is now a base
13500         class for Property, Indexer and Event to avoid some code duplication
13501         in their Define() and DefineMethods() methods.
13502         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13503         generic methods for Define() and DefineMethods().
13504         (FieldBase): Derive from MemberBase, not MemberCore.
13505         (Property): Derive from MemberBase, not MemberCore.
13506         (Property.DefineMethod): Moved all the code from this method to the
13507         new MethodBase.DefineAccessor(), just call it with appropriate
13508         argumetnts.
13509         (Property.Define): Call the new Property.DoDefine(), this does some
13510         sanity checks and we don't need to duplicate the code everywhere.
13511         (Event): Derive from MemberBase, not MemberCore.
13512         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13513         accessors, this will also make them work with interface events.
13514         (Indexer): Derive from MemberBase, not MemberCore.
13515         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13516         (Indexer.Define): Use the new MethodBase functions.
13517
13518         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13519         argument to the constructor.
13520         (Interface.FindMembers): Added support for interface events.
13521         (Interface.PopluateEvent): Implemented.
13522
13523         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13524
13525 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13526
13527         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13528         but this is required to check for a method name being the same as
13529         the containing class.  
13530
13531         Handle this now.
13532
13533 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13534
13535         * interface.cs: initialize variable.
13536
13537 2002-07-23  Martin Baulig  <martin@gnome.org>
13538
13539         Implemented the IndexerName attribute in interfaces.
13540
13541         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13542         name if this is an explicit interface implementation.
13543         (Indexer.InterfaceIndexerName): New public variable.  If we're
13544         implementing an interface indexer, this is the IndexerName in that
13545         interface.  Otherwise, it's the IndexerName.
13546         (Indexer.DefineMethod): If we're implementing interface indexer,
13547         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13548         and Pending.ImplementIndexer methods.
13549         (Indexer.Define): Also define the PropertyBuilder if we're
13550         implementing an interface indexer and this is neither an explicit
13551         interface implementation nor do the IndexerName match the one in
13552         the interface.
13553
13554         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13555         If a method is defined here, then we always need to create a proxy
13556         for it.  This is used when implementing interface indexers.
13557         (Pending.IsInterfaceIndexer): New public method.
13558         (Pending.ImplementIndexer): New public method.
13559         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13560         This is used when implementing interface indexers to define a proxy
13561         if necessary.
13562         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13563         define a proxy if necessary.
13564
13565         * interface.cs (Interface.IndexerName): New public variable.
13566         (Interface.PopulateIndexer): Set the IndexerName.
13567         (Interface.DefineIndexers): New private method.  Populate all the
13568         indexers and make sure their IndexerNames match.
13569
13570         * typemanager.cs (IndexerPropertyName): Added support for interface
13571         indexers.
13572
13573 2002-07-22  Martin Baulig  <martin@gnome.org>
13574
13575         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13576         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13577         ret if HasReturnLabel.
13578         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13579         variables.
13580
13581         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13582         and set the ec.LoopBeginTryCatchLevel.
13583         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13584         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13585         the current ec.TryCatchLevel, the branch goes out of an exception
13586         block.  In this case, we need to use Leave and not Br.
13587
13588 2002-07-22  Martin Baulig  <martin@gnome.org>
13589
13590         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13591         block unless the block does not always return or it is contained in
13592         another try { ... } catch { ... } block.  Fixes bug #26506.
13593         Added verify-1.cs to the test suite.
13594
13595 2002-07-22  Martin Baulig  <martin@gnome.org>
13596
13597         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13598         then we do not always return.  Fixes bug #24985.
13599
13600 2002-07-22  Martin Baulig  <martin@gnome.org>
13601
13602         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13603         lookup on a per-class level; ie. walk up the class hierarchy until we
13604         found at least one applicable method, then choose the best among them.
13605         Fixes bug #24463 and test-29.cs.
13606
13607 2002-07-22  Martin Baulig  <martin@gnome.org>
13608
13609         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13610         return types of the methods.  The return type is not part of the
13611         signature and we must not check it to make the `new' modifier work.
13612         Fixes bug #27999, also added test-147.cs.
13613         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13614
13615         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13616         on the method's return type.
13617
13618 2002-07-21  Martin Baulig  <martin@gnome.org>
13619
13620         * assign.cs: Make this work if the rightmost source is a constant and
13621         we need to do an implicit type conversion.  Also adding a few more tests
13622         to test-38.cs which should have caught this.
13623
13624         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13625         target in the makefile for this.  The makefile.gnu is primarily intended
13626         for end-users who don't want to debug the compiler.
13627
13628 2002-07-21  Martin Baulig  <martin@gnome.org>
13629
13630         * assign.cs: Improved the Assign class so it can now handle embedded
13631         assignments (X = Y = Z = something).  As a side-effect this'll now also
13632         consume less local variables.  test-38.cs now passes with MCS, added
13633         a few new test cases to that test.
13634
13635 2002-07-20  Martin Baulig  <martin@gnome.org>
13636
13637         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13638         instructions.  Fixes bug #27977, also added test-146.cs.
13639
13640 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13641
13642         * cs-tokenizer.cs: fixed getHex ().
13643
13644 2002-07-19  Martin Baulig  <martin@gnome.org>
13645
13646         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13647         not Type.GetType() to lookup the array type.  This is needed when
13648         we're constructing an array of a user-defined type.
13649         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13650         single-dimensional arrays, but also for single-dimensial arrays of
13651         type decimal.
13652
13653 2002-07-19  Martin Baulig  <martin@gnome.org>
13654
13655         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13656         this function is called, it's not allowed to share LocalBuilders
13657         among ILGenerators.
13658
13659 2002-07-19  Martin Baulig  <martin@gnome.org>
13660
13661         * expression.cs (Argument.Resolve): Report an error 118 when trying
13662         to pass a type as argument.
13663
13664 2002-07-18  Martin Baulig  <martin@gnome.org>
13665
13666         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13667         Conv_R_Un for the signed `long' type.
13668
13669 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13670
13671         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13672         `expr' for the temporary result, as that will fail if we do
13673         multiple resolves on the same expression.
13674
13675 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13678         ec.TypeContainer for looking up aliases. 
13679
13680         * class.cs (TypeContainer): Remove LookupAlias from here.
13681
13682         * decl.cs (DeclSpace); Move here.
13683
13684 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13685
13686         * class.cs (FindMembers): Only call filter if the constructor
13687         bulider is not null.
13688
13689         Also handle delegates in `NestedTypes' now.  Now we will perform
13690         type lookups using the standard resolution process.  This also
13691         fixes a bug.
13692
13693         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13694         This uses Expressions (the limited kind that can be parsed by the
13695         tree) instead of strings.
13696
13697         * expression.cs (ComposedCast.ToString): Implement, used to flag
13698         errors since now we have to render expressions.
13699
13700         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13701         FormArrayType. 
13702
13703         * ecore.cs (SimpleName.ToString): ditto.
13704
13705         * cs-parser.jay: Instead of using strings to assemble types, use
13706         Expressions to assemble the type (using SimpleName, ComposedCast,
13707         MemberAccess).  This should fix the type lookups in declarations,
13708         because we were using a different code path for this.
13709
13710         * statement.cs (Block.Resolve): Continue processing statements
13711         even when there is an error.
13712
13713 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13714
13715         * class.cs (Event.Define): Also remove the `remove' method from
13716         the list of pending items.
13717
13718         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13719         generate more compact code. 
13720
13721 2002-07-17  Martin Baulig  <martin@gnome.org>
13722
13723         * const.cs (Const.LookupConstantValue): Add support for constant
13724         `unchecked' and `checked' expressions.
13725         Also adding test case test-140.cs for this.
13726
13727 2002-07-17  Martin Baulig  <martin@gnome.org>
13728
13729         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13730         check whether mi.ReturnType implements the IEnumerator interface; the
13731         `==' and the IsAssignableFrom() will fail in this situation.
13732
13733 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13734
13735         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13736         here too.
13737
13738 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13739
13740         * expression.cs: fixed bug #27811.
13741
13742 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13743
13744         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13745         Molaro: when we are a ref, the value already contains a pointer
13746         value, do not take the address of it.
13747
13748 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13749         * removed mb-parser.jay and mb-tokenizer.cs
13750
13751 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13752
13753         * expression.cs: check against the building corlib void type.
13754
13755 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13756
13757         * ecore.cs: fix for valuetype static readonly fields: when 
13758         initializing them, we need their address, not the address of a copy.
13759
13760 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13761
13762         * typemanager.cs: register also enum_type in corlib.
13763
13764 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13765
13766         * class.cs: allow calling this (but not base) initializers in structs.
13767
13768 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13769
13770         * ecore.cs: make sure we compare against the building base types
13771         in GetTypeSize ().
13772
13773 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13774
13775         * typemanager.cs: fix TypeToCoreType() to handle void and object
13776         (corlib gets no more typerefs after this change).
13777
13778 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13779
13780         * expression.cs (ArrayCreation.EmitArrayArguments): use
13781         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13782
13783         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13784         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13785         array indexes, the runtime actually forbids them.
13786
13787         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13788         for array arguments here.
13789
13790         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13791         instead of the default for ValueTypes.
13792
13793         (New.DoEmit): Use IsValueType instead of
13794         IsSubclassOf (value_type)
13795         (New.DoResolve): ditto.
13796         (Invocation.EmitCall): ditto.
13797
13798         * assign.cs (Assign): ditto.
13799
13800         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13801         Statements *are* currently doing part of their resolution during
13802         Emit.  
13803
13804         Expressions do always resolve during resolve, but statements are
13805         only required to propagate resolution to their children.
13806
13807 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13808
13809         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13810
13811         (LoadAssembly): Do not add the dll if it is already specified
13812
13813         (MainDriver): Add the System directory to the link path at the end,
13814         after all the other -L arguments. 
13815
13816         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13817         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13818         ldelem.u1) and using the opposite for sbytes.
13819
13820         This fixes Digger, and we can finally run it.
13821
13822         * driver.cs (UnixParseOption): Move the option parsing here.  
13823         (CSCParseOption): Implement CSC-like parsing of options.
13824
13825         We now support both modes of operation, the old Unix way, and the
13826         new CSC-like way.  This should help those who wanted to make cross
13827         platform makefiles.
13828
13829         The only thing broken is that /r:, /reference: and /lib: are not
13830         implemented, because I want to make those have the same semantics
13831         as the CSC compiler has, and kill once and for all the confussion
13832         around this.   Will be doing this tomorrow.
13833
13834         * statement.cs (Unsafe.Resolve): The state is checked during
13835         resolve, not emit, so we have to set the flags for IsUnsfe here.
13836
13837 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13838
13839         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13840         not catch the Error_ObjectRefRequired in SimpleName (as it is
13841         possible to have a class/instance variable name that later gets
13842         deambiguated), we have to check this here.      
13843
13844 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13845
13846         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13847         make static and put into Expression.
13848
13849         (Event.Define): Register the private field of the event with the 
13850         TypeManager so that GetFieldFromEvent can get at it.
13851
13852         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13853         keep track of the private field associated with an event which
13854         has no accessors.
13855
13856         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13857         private field.
13858
13859         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13860
13861 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * expression.cs (Binary.EmitBranchable): this routine emits the
13864         Binary expression in a branchable context.  This basically means:
13865         we need to branch somewhere, not just get the value on the stack.
13866
13867         This works together with Statement.EmitBoolExpression.
13868
13869         * statement.cs (Statement.EmitBoolExpression): Use
13870         EmitBranchable. 
13871
13872 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13873
13874         * statement.cs (For): Reduce the number of jumps in loops.
13875
13876         (For): Implement loop inversion for the For statement.
13877
13878         (Break): We can be breaking out of a Try/Catch controlled section
13879         (foreach might have an implicit try/catch clause), so we need to
13880         use Leave instead of Br.
13881
13882         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13883         now).  If the instace expression supports IMemoryLocation, we use
13884         the AddressOf method from the IMemoryLocation to extract the
13885         address instead of emitting the instance.
13886
13887         This showed up with `This', as we were emitting the instance
13888         always (Emit) instead of the Address of This.  Particularly
13889         interesting when This is a value type, as we dont want the Emit
13890         effect (which was to load the object).
13891
13892 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13893
13894         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13895
13896         * statement.cs (Checked): Set the CheckedState during the resolve
13897         process too, as the ConvCast operations track the checked state on
13898         the resolve process, and not emit.
13899
13900         * cs-parser.jay (namespace_member_declaration): Flag that we have
13901         found a declaration when we do.  This is used to flag error 1529
13902
13903         * driver.cs: Report ok when we display the help only.
13904
13905 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13906
13907         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13908
13909 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * cs-tokenizer.cs (define): We also have to track locally the
13912         defines.  AllDefines is just used for the Conditional Attribute,
13913         but we also need the local defines for the current source code. 
13914
13915 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13916
13917         * statement.cs (While, For, Do): These loops can exit through a
13918         Break statement, use this information to tell whether the
13919         statement is the last piece of code.
13920
13921         (Break): Flag that we break.
13922
13923         * codegen.cs (EmitContexts): New `Breaks' state variable.
13924
13925 2002-07-03  Martin Baulig  <martin@gnome.org>
13926
13927         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13928         modifiers in method declarations in structs.  Otherwise, you won't
13929         be able to override things like Object.Equals().
13930
13931 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13932
13933         * class.cs (Method, Property, Indexer): Do not allow the public
13934         modifier to be used in explicit interface implementations.
13935
13936         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13937         override modifiers in method declarations in structs
13938
13939 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13940
13941         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13942         integer or real overflow, report an error
13943
13944 2002-07-02  Martin Baulig  <martin@gnome.org>
13945
13946         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13947         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13948         to tell the runtime about our newly created System.Object and
13949         System.ValueType types.
13950
13951 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13952
13953         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13954         struct instead of Ldarg/Starg.
13955
13956 2002-07-02  Martin Baulig  <martin@gnome.org>
13957
13958         * expression.cs (Indirection.Indirection): Call
13959         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13960
13961 2002-07-02  Martin Baulig  <martin@gnome.org>
13962
13963         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13964         ValueType, call TypeManager.TypeToCoreType() on it.
13965         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13966         the OpCodes.Newarr argument.
13967
13968 2002-07-02  Martin Baulig  <martin@gnome.org>
13969
13970         * expression.cs (Invocation.EmitCall): When compiling corlib,
13971         replace all calls to the system's System.Array type to calls to
13972         the newly created one.
13973
13974         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13975         System.Array methods.
13976         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13977         from the system's System.Array type which must be replaced.
13978
13979 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13980
13981         * typemanager.cs: load unverifiable_code_ctor so we can build
13982         corlib using the correct type. Avoid using GetTypeCode() with
13983         TypeBuilders.
13984         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13985         TypeManager.object_type to allow building corlib.
13986
13987 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13988
13989         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13990
13991 2002-07-01  Martin Baulig  <martin@gnome.org>
13992
13993         * class.cs: Make the last change actually work, we need to check
13994         whether `ifaces != null' to avoid a crash.
13995
13996 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13997
13998         * class.cs: when we build structs without fields that implement
13999         interfaces, we need to add the interfaces separately, since there is
14000         no API to both set the size and add the interfaces at type creation
14001         time.
14002
14003 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14004
14005         * expression.cs: the dimension arguments to the array constructors
14006         need to be converted if they are a long.
14007
14008 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14009
14010         * class.cs: don't emit ldarg.0 if there is no parent constructor
14011         (fixes showstopper for corlib).
14012
14013 2002-06-29  Martin Baulig  <martin@gnome.org>
14014
14015         MCS now compiles corlib on GNU/Linux :-)
14016
14017         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14018         ie. check for MethodImplOptions.InternalCall.
14019
14020         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14021         and TypeManager.attribute_type are null, so we must explicitly check
14022         whether parent is not null to find out whether it's an attribute type.
14023         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14024         and SetBuilder, not only if the property is neither abstract nor external.
14025         This is necessary to set the MethodImplOptions on the accessor methods.
14026         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14027         SetBuilder, see Property.Emit().
14028
14029         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14030         populate "System.Object", "System.ValueType" and "System.Attribute" since
14031         they've already been populated from BootCorlib_PopulateCoreTypes().
14032
14033 2002-06-29  Martin Baulig  <martin@gnome.org>
14034
14035         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14036         is the NullLiteral, we also need to make sure that target_type is not
14037         an enum type.   
14038
14039 2002-06-29  Martin Baulig  <martin@gnome.org>
14040
14041         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14042         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14043         before calling BootstrapCorlib_ResolveDelegate ().
14044
14045 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14046
14047         * statement.cs: fixed build-breaker. All tests passed ok.
14048
14049 2002-06-27  Martin Baulig  <martin@gnome.org>
14050
14051         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14052         for System.Decimal when compiling corlib.
14053
14054 2002-06-27  Martin Baulig  <martin@gnome.org>
14055
14056         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14057         switch blocks which contain nothing but a default clause.
14058
14059 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14060
14061        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14062
14063 2002-06-27  Martin Baulig  <martin@gnome.org>
14064
14065         * ecore.cs (PropertyExpr.PropertyExpr): Call
14066         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14067
14068         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14069         is already a TypeBuilder.
14070
14071 2002-06-27  Martin Baulig  <martin@gnome.org>
14072
14073         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14074         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14075         the "from an array-type to System.Array" case.  This makes it work
14076         when compiling corlib.
14077
14078 2002-06-27  Martin Baulig  <martin@gnome.org>
14079
14080         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14081         non-static PropertyExpr, set its InstanceExpression.  This makes
14082         the `ICollection.Count' property work in System/Array.cs.
14083
14084 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14085
14086         * driver.cs: Made error handling more consistent.  Errors now
14087         tracked by Report class, so many methods which used to return int
14088         now return void.  Main() now prints success/failure and 
14089         errors/warnings message.
14090
14091         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14092         the magic number return values (123 and 124).  Now, if the
14093         expected error occurs, the compiler exits with success (exit value
14094         0).  If the compilation completes without seeing that particular
14095         error, the compiler exits with failure (exit value 1).  The
14096         makefile in mcs/errors has been changed to handle the new behaviour.
14097
14098         * report.cs: Made 'expected error' number a property and renamed
14099         it from 'Probe' to 'ExpectedError'.
14100
14101         * genericparser.cs: Removed error handling support, since it is
14102         now all done by Report class.
14103
14104         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14105         class, so parse() no longer returns an int.
14106
14107         * namespace.cs: Use Report.Error instead of GenericParser.error
14108
14109 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14112         TypeContainer.AddOperator): At the front of the list put the
14113         explicit implementations, so they get resolved/defined first. 
14114
14115 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14118         interface type is implemented by this TypeContainer.  Used during
14119         explicit interface implementation.
14120
14121         (Property.Define, Indexer.Define, Method.Define): Validate that
14122         the given interface in the explicit implementation is one of the
14123         base classes for the containing type.
14124
14125         Also if we are explicitly implementing an interface, but there is
14126         no match in the pending implementation table, report an error.
14127
14128         (Property.Define): Only define the property if we are
14129         not explicitly implementing a property from an interface.  Use the
14130         correct name also for those properties (the same CSC uses,
14131         although that is really not needed).
14132
14133         (Property.Emit): Do not emit attributes for explicitly implemented
14134         properties, as there is no TypeBuilder.
14135
14136         (Indexer.Emit): ditto.
14137
14138         Hiding then means that we do not really *implement* a pending
14139         implementation, which makes code fail.
14140
14141 2002-06-22  Martin Baulig  <martin@gnome.org>
14142
14143         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14144         the return value of Object.GetType().  [FIXME: we need to do this whenever
14145         we get a type back from the reflection library].
14146
14147 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14148
14149         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14150
14151 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * attribute.cs: Return null if we can not look up the type.
14154
14155         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14156         the interface types found.
14157
14158         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14159         interface types found.
14160
14161         * typemanager.cs (GetInterfaces): Make this routine returns alll
14162         the interfaces and work around the lame differences between
14163         System.Type and System.Reflection.Emit.TypeBuilder in the results
14164         result for GetInterfaces.
14165
14166         (ExpandInterfaces): Given an array of interface types, expand and
14167         eliminate repeated ocurrences of an interface.  This expands in
14168         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14169         be IA, IB, IC.
14170
14171 2002-06-21  Martin Baulig  <martin@gnome.org>
14172
14173         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14174         on System.Enum.
14175
14176 2002-06-21  Martin Baulig  <martin@gnome.org>
14177
14178         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14179         and called with one of the core types, return the corresponding typebuilder for
14180         that type.
14181
14182         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14183         element type.
14184
14185 2002-06-21  Martin Baulig  <martin@gnome.org>
14186
14187         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14188         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14189         (Expression.ConvertReferenceExplicit): Likewise.
14190
14191         * expression.cs (ElementAccess.DoResolve): Likewise.
14192         (ElementAccess.DoResolveLValue): Likewise.
14193
14194 2002-06-10  Martin Baulig  <martin@gnome.org>
14195
14196         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14197         add the "value" parameter to the parameter list.
14198
14199         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14200         to our caller.
14201
14202 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14205         the argument to an int, uint, long or ulong, per the spec.  Also
14206         catch negative constants in array creation.
14207
14208 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14209
14210         * class.cs: do not allow the same interface to appear twice in
14211         the definition list.
14212
14213 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14214
14215         * ecore.cs: don't use ldlen with System.Array.
14216
14217 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14218
14219         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14220
14221 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14222
14223         * modifiers.cs: produce correct field attributes for protected
14224         internal. Easy fix so miguel can work on ther harder stuff:-)
14225
14226 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14227
14228         * pending.cs: New file.  Move the code from class.cs here.
14229         Support clearning the pending flag for all methods (when not doing
14230         explicit interface implementation).
14231
14232 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14233
14234         * rootcontext.cs: added a couple more types needed to bootstrap.
14235
14236 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14237
14238         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14239         constructor in the type, instead of any constructor in the type
14240         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14241         a bug in the Mono runtime when applying the params attribute). 
14242
14243 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14244         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14245
14246 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14247
14248         * expression.cs (Unary.ResolveOperator): Use TypeManager
14249         to resolve the type.
14250
14251 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14252
14253         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14254         attached.
14255
14256         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14257         with each member too.
14258
14259         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14260         field builders too - this takes care of the enum member case.
14261
14262 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14263
14264         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14265         address-of operator on both value types and pointers.
14266
14267 2002-06-10  Martin Baulig  <martin@gnome.org>
14268
14269         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14270         PropertyBuilder to the `property_builders' list.
14271
14272         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14273         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14274         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14275         find any indexers which are inherited from an interface.
14276
14277 2002-06-09  Martin Baulig  <martin@gnome.org>
14278
14279         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14280         the same type as the constant if necessary.  There's also a test-130.cs
14281         for this.
14282
14283         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14284
14285         * typemanager.cs (TypeManager.ChangeType): Previously known as
14286         Enum.ChangeEnumType().
14287
14288 2002-06-09  Martin Baulig  <martin@gnome.org>
14289
14290         * expression.cs (Cast.TryReduce): Added support for consts.
14291
14292 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14293
14294         * class.cs (Accessor): Hold attributes information so we can pass
14295         it along.
14296
14297         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14298         Modify to pass in attributes attached to the methods.
14299
14300         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14301
14302         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14303         to handle the Accessor kind :-)
14304
14305         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14306
14307 2002-06-08  Martin Baulig  <martin@gnome.org>
14308
14309         * expression.cs (Unary.TryReduceNegative): Added support for
14310         ULongConstants.
14311
14312 2002-06-08  Martin Baulig  <martin@gnome.org>
14313
14314         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14315         name can't be found in the `defined_names' - the caller will do a
14316         MemberLookup in this case and thus find methods in System.Enum
14317         such as Enum.IsDefined().
14318
14319 2002-06-08  Martin Baulig  <martin@gnome.org>
14320
14321         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14322         Convert.ChangeType() which works with TypeBuilder created types.
14323         (Enum.LookupEnumValue, Enum.Define): Use it here.
14324
14325         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14326         `TypeBuilder.BaseType != null' check.
14327         (TypeContainer.FindMembers): Only lookup parent members if we
14328         actually have a parent.
14329         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14330         (ConstructorInitializer.Resolve): Likewise.
14331
14332         * interface.cs (Interface.FindMembers): Added
14333         `TypeBuilder.BaseType != null' check.
14334
14335         * rootcontext.cs (RootContext.ResolveCore): Added
14336         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14337         classes_second_stage.
14338
14339         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14340         debug_type and trace_type when compiling with --nostdlib.       
14341
14342 2002-06-07  Martin Baulig  <martin@gnome.org>
14343
14344         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14345         (AddField): Set it to true when adding a non-static field.
14346         (DefineType): Use `have_nonstatic_fields' to find out whether we
14347         have non-static fields, not `Fields != null'.
14348
14349 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14352         dereferencing a null on the static-field code path)
14353
14354 2002-05-30  Martin Baulig  <martin@gnome.org>
14355
14356         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14357         to take command line arguments.  Use reflection to call the new
14358         custom `Initialize' function on the symbol writer and pass it the
14359         command line arguments.
14360
14361         * driver.cs (--debug-args): New command line argument to pass command
14362         line arguments to the symbol writer.
14363
14364 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14367         the target type for indexers and properties.  Thanks to Joe for
14368         catching this.
14369
14370 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * typemanager.cs (MethodFlags): returns the method flags
14373         (Obsolete/ShouldIgnore) that control warning emission and whether
14374         the invocation should be made, or ignored. 
14375
14376         * expression.cs (Invocation.Emit): Remove previous hack, we should
14377         not do this on matching a base type, we should do this based on an attribute
14378
14379         Only emit calls to System.Diagnostics.Debug and
14380         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14381         on the command line.
14382
14383         * rootcontext.cs: Global settings for tracing and debugging.
14384
14385         * cs-tokenizer.cs (define): New utility function to track
14386         defines.   Set the global settings for TRACE and DEBUG if found.
14387
14388 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14389
14390         * interface.cs (Populate*): Pass in the TypeContainer as well as
14391         the DeclSpace as parameters so that we can create EmitContexts and
14392         then use that to apply attributes etc.
14393
14394         (PopulateMethod, PopulateEvent, PopulateProperty)
14395         (PopulateIndexer): Apply attributes everywhere.
14396
14397         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14398         etc.
14399
14400         (ApplyAttributes): Update accordingly.
14401
14402         We now apply interface attributes for all members too.
14403
14404 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14405
14406         * class.cs (Indexer.Define); Correctly check if we are explicit
14407         implementation (instead of checking the Name for a ".", we
14408         directly look up if the InterfaceType was specified).
14409
14410         Delay the creation of the PropertyBuilder.
14411
14412         Only create the PropertyBuilder if we are not an explicit
14413         interface implementation.   This means that explicit interface
14414         implementation members do not participate in regular function
14415         lookups, and hence fixes another major ambiguity problem in
14416         overload resolution (that was the visible effect).
14417
14418         (DefineMethod): Return whether we are doing an interface
14419         implementation. 
14420
14421         * typemanager.cs: Temporary hack until we get attributes in
14422         interfaces (Ravi is working on that) and we get IndexerName
14423         support in interfaces.
14424
14425         * interface.cs: Register the indexers as properties.
14426
14427         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14428         warning, I have verified that this is a bug in the .NET runtime
14429         (JavaScript suffers of the same problem).
14430
14431         * typemanager.cs (MemberLookup): When looking up members for
14432         interfaces, the parent of an interface is the implicit
14433         System.Object (so we succeed in searches of Object methods in an
14434         interface method invocation.  Example:  IEnumerable x;  x.ToString
14435         ()) 
14436
14437 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14438
14439         * class.cs (Event): Events should also register if they do
14440         implement the methods that an interface requires.
14441
14442         * typemanager.cs (MemberLookup); use the new GetInterfaces
14443         method. 
14444
14445         (GetInterfaces): The code used to lookup interfaces for a type is
14446         used in more than one place, factor it here. 
14447
14448         * driver.cs: Track the errors at the bottom of the file, we kept
14449         on going.
14450
14451         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14452         instance if the method we are calling is static!
14453
14454 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14455
14456         * attribute.cs (ApplyAttributes): Make this function filter out
14457         the IndexerName attribute (as that attribute in reality is never
14458         applied) and return the string constant for the IndexerName
14459         attribute. 
14460
14461         * class.cs (TypeContainer.Emit): Validate that all the indexers
14462         have the same IndexerName attribute, and if so, set the
14463         DefaultName attribute on the class. 
14464
14465         * typemanager.cs: The return value might contain other stuff (not
14466         only methods).  For instance, consider a method with an "Item"
14467         property and an Item method.
14468
14469         * class.cs: If there is a problem with the parameter types,
14470         return. 
14471
14472 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14473
14474         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14475         looks at user defined conversion after making a call to 
14476         StandardConversionExists - we need this for overload resolution.
14477
14478         * expression.cs : Update accordingly the various method calls.
14479
14480         This fixes 2 bugs filed against implicit user defined conversions 
14481
14482 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14483
14484         * statement.cs: Track the result of the assignment.
14485
14486 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14487
14488         * expression.cs (MemberAccess): Improved error reporting for
14489         inaccessible members.
14490
14491 2002-05-22  Martin Baulig  <martin@gnome.org>
14492
14493         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14494         itself with debugging support.
14495
14496 2002-05-22  Martin Baulig  <martin@gnome.org>
14497
14498         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14499         Removed, this isn't needed anymore.
14500
14501 2002-05-20  Martin Baulig  <martin@gnome.org>
14502
14503         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14504         be underlying type for an enum.
14505
14506 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14507
14508         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14509         that splits out the loading of just the core types.
14510
14511         * rootcontext.cs (ResolveCore): Split the struct resolution in
14512         two, so we can load the enumeration underlying types before any
14513         enums are used.
14514
14515         * expression.cs (Is): Bandaid until we fix properly Switch (see
14516         bug #24985 for details).
14517
14518         * typemanager.cs (ImplementsInterface): The hashtable will contain
14519         a null if there are no interfaces implemented.
14520
14521 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * cs-parser.jay (indexer_declarator): It is fine to have array
14524         parameters
14525
14526 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * typemanager.cs: (RegisterBuilder): New function used to register
14529         TypeBuilders that implement interfaces.  Since
14530         TypeBuilder.GetInterfaces (as usual) does not work with lame
14531         Reflection.Emit. 
14532         (AddUserType): register interfaces.
14533
14534         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14535         dealing with TypeBuilder.  Also, arrays are showing up as
14536         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14537         methods can not be invoked on them!
14538
14539         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14540         (ImplicitReferenceConversionExists): Split out from
14541         StandardConversionExists. 
14542
14543         * expression.cs (As): We were only implementing one of the three
14544         cases for the as operator.  We now implement them all.
14545         (Is): Implement the various other cases for Is as well.
14546
14547         * typemanager.cs (CACHE): New define used to control if we want or
14548         not the FindMembers cache.  Seems to have a negative impact on
14549         performance currently
14550
14551         (MemberLookup): Nested types have full acess to
14552         enclosing type members
14553
14554         Remove code that coped with instance/static returns for events, we
14555         now catch this in RealFindMembers.
14556
14557         (RealFindMembers): only perform static lookup if the instance
14558         lookup did not return a type or an event.  
14559
14560 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * assign.cs (CompoundAssign): We pass more semantic information
14563         now to Compound Assignments than we did before: now we have all
14564         the information at hand, and now we resolve the target *before* we
14565         do the expression expansion, which allows the "CacheValue" method
14566         to have the effect we intended (before, a [x] += 1 would generate
14567         two differen ArrayAccess expressions from the ElementAccess,
14568         during the resolution process).
14569
14570         (CompoundAssign.DoResolve): Resolve target and original_source here.
14571
14572 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * expression.cs (ArrayAccess): dropped debugging information. 
14575
14576         * typemanager.cs: Small bug fix: I was always returning i_members,
14577         instead of one of i_members or s_members (depending on which had
14578         the content).
14579
14580         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14581         method is invoked before any code generation takes place, and it
14582         is a mechanism to inform that the expression will be invoked more
14583         than once, and that the method should use temporary values to
14584         avoid having side effects
14585
14586         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14587
14588         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14589         implementation.
14590
14591         * expression.cs (Indirection, ArrayAccess): Add support for
14592         CacheTemporaries in these two bad boys. 
14593
14594         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14595         ldobj or ldind_ref.  
14596         (StoreFromPtr): Handle stobj as well.
14597
14598         * expression.cs (UnaryMutator): Share more code.
14599
14600         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14601         down: I was not tracking the Filter function as well, which
14602         was affecting the results of the cache.
14603
14604 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * attribute.cs: Remove the hack to handle the CharSet property on
14607         StructLayouts. 
14608
14609 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * attribute.cs (DoResolve): More uglyness, we now only try to
14612         resolve the attribute partially, to extract the CharSet
14613         information (only if we are a StructLayout attribute).  Otherwise 
14614
14615         (GetExtraTypeInfo): Add some code to conditionally kill in the
14616         future this.   I am more and more convinced that the .NET
14617         framework has special code to handle the attribute setting on
14618         certain elements.
14619
14620         * expression.cs (IsParamsMethodApplicable): Revert my previous
14621         foreach change here, it was wrong.
14622
14623 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14626         (pp_expr): do not abort on unknown input, just return.
14627         (eval): abort if there are pending chars.
14628
14629         * attribute.cs (Attribute.Resolve): Positional parameters are
14630         optional.  Deal with that case.
14631
14632         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14633         the Ansi/Unicode/Auto information for the type.
14634
14635         (TypeContainer.DefineType): instantiate the EmitContext here, as
14636         we will be using it during the type definition (to resolve
14637         attributes) and during the emit phase.
14638
14639         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14640         to pull type information out of the attributes
14641
14642         (Attribute.Resolve): track the constructor builder, and allow for
14643         multiple invocations (structs and classes will use this).
14644
14645         * ecore.cs (MemberLookupFinal): new version with all the
14646         parameters customizable.
14647
14648         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14649         constructors.  Return if the result value is null (as the error
14650         would have been flagged already by MemberLookupFinal)
14651
14652         Do not allow instances of abstract classes or interfaces to be
14653         created.
14654
14655         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14656         We have to compare the assembly property here when dealing with
14657         FamANDAssem and Assembly access modifiers, because we might be
14658         creating an assembly from *modules* (that means that we are not
14659         getting TypeBuilders for types defined in other modules that are
14660         part of this assembly).
14661
14662         (Method.Emit): If the method is marked abstract and has a body,
14663         emit an error. 
14664
14665         (TypeContainer.DefineMembers): If both the defined member and the
14666         parent name match are methods, then do not emit any warnings: let
14667         the Method.Define routine take care of flagging warnings.  But if
14668         there is a mismatch (method overrides something else, or method is
14669         overriwritten by something, then emit warning).
14670
14671         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14672         set to null, this means `do not check for the return type on the
14673         signature'. 
14674
14675         (Method.Define): set the return type for the method signature to
14676         null, so that we get methods with the same name and parameters and
14677         different return types.  This is used to flag warning 114 (you are
14678         hiding a method, and you probably want to use the new/override
14679         keywords instead).
14680
14681         * typemanager.cs (MemberLookup): Implemented proper access
14682         control, closing a long standing set of bug reports.  The problem
14683         was that the Framework only has two bits: Public and NonPublic,
14684         and NonPublic includes private and protected methods, but we need
14685         to enforce the FamANDAssem, FamOrAssem and Family. 
14686
14687 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * statement.cs (GotoCase): Return true: Ammounts to giving up
14690         knowledge on whether we return or not, and letting the other case
14691         be responsible for it.
14692
14693 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14694
14695         * driver.cs: Do not load directories for each file processed, only
14696         do it if there is a pattern.
14697
14698         * ecore.cs: Report readonly assigns here as well, as we might have
14699         been resolved only by MemberAccess.
14700
14701         (SimpleName.SimpleNameResolve): Also be useful for LValue
14702         resolution.   We need this to propagate assign to local readonly variables
14703
14704         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14705         do not want to reuse potential criteria memory.
14706
14707         * class.cs (MyEventBuilder): Set reflected_type;
14708
14709         * ecore.cs (Constantify): Added support for constifying bools.
14710
14711         (RootContext.LookupType): Added a cache for values looked up in
14712         the declaration space.
14713
14714         * typemanager.cs (FindMembers): Now is a front-end to
14715         RealFindMembers, and provides a two-level hashtable-based cache to
14716         the request.  
14717
14718         15% performance improvement: from 22.5 to 19.2 seconds.
14719
14720         * expression.cs (IsParamsMethodApplicable): use foreach.
14721         (Invocation.DoResolve): ditto.
14722         (New.DoResolve): ditto.
14723         (ArrayCreation.DoResolve): ditto.
14724
14725         * ecore.cs (FindMostEncompassingType): use foreach.
14726
14727         * delegate.cs (NewDelegate.DoResolve): Use foreach
14728
14729         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14730         (RemoveMethods): use foreach.
14731
14732         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14733         nested foreach statements instead of for, and also break out of
14734         the inner loop once a match is found.
14735
14736         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14737
14738 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14739
14740         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14741         we actually unwrap the expression to allow for extra information
14742         to be extracted. 
14743
14744         * expression.cs: Use Shr_Un on unsigned operations. 
14745
14746 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14747
14748         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14749         applicable operators was not being considered correctly. This closes
14750         the bug Miguel reported.
14751
14752 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14753
14754         * attribute.cs: check that the type derives from System.Attribute
14755         and report the correct error in that case (moved the duplicate code to
14756         its own method, too).
14757
14758 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14759
14760         * attribute.cs: lookup attribute type name as the spec says: first the
14761         bare attribute name and then name + "Attribute" (nant compiles with
14762         mcs after this fix).
14763
14764 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14765
14766         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14767         Because of the way we parse things, we should try to see if a
14768         UIntConstant can fit in an integer.
14769
14770 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14771
14772         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14773         when we are in an explicit context.
14774
14775         (ConvertReferenceExplicit): When converting from Iface type S to Class
14776         T make sure the rules are implemented as an OR.
14777
14778         * parameter.cs (ParameterType): Make it a property for now although the
14779         purpose really isn't anything immediate.
14780
14781         * expression.cs (Is*Applicable): Do better checking on the parameter type
14782         of a ref/out parameter. The ones from the system assemblies are already 
14783         marked with the correct type so we don't need to do any correction.
14784
14785         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14786         the object type is standard too so include that.
14787
14788 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14789
14790         * ecore.cs (StandardConversionExists): Augment with missing code:
14791         deal with IntConstant, LongConstants and Enumerations.
14792
14793         * assign.cs: Report the error, instead of failing silently
14794
14795         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14796         typecontainer that they are declared, because the
14797         typecontainer/namespace will have the list of using clauses that
14798         need to be applied.
14799
14800         Assembly Attributes were escaping the normal registration
14801         mechanism. 
14802
14803         (EmitCode): Apply attributes within an EmitContext that represents
14804         the container they were declared on.
14805
14806         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14807
14808 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14809
14810         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14811         Revamp completely - make much cleaner as we now operate only
14812         on a set of Types.
14813
14814         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14815         to implement the logic detailed in the spec more correctly.
14816
14817         (UserDefinedConversion): Update accordingly.
14818
14819 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14820
14821         * statement.cs: Return flow analysis information up.
14822
14823         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14824         and the default.
14825
14826         (token): Do not consume an extra character before calling
14827         decimal_digits.
14828
14829 2002-05-06  Piers Haken <piersh@friskit.com>
14830
14831         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14832
14833 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14834
14835         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14836         EmitContext during the instance constructor initializer
14837         resolution, to stop access to instance variables.
14838
14839         This is mandated by the spec, last paragraph of the `constructor
14840         initializers' section. 
14841
14842 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * cs-parser.jay, class.cs (Accessor): new class used to represent
14845         an accessor (get or set).  In the past we used `null' to represent
14846         a missing accessor.  But this is ambiguous because there was no
14847         way to tell in abstract indexers/properties if one of them was
14848         specified.
14849
14850         Now there is a way of addressing that.
14851
14852         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14853         instead of FindMembers.
14854
14855         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14856         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14857
14858         * attribute.cs: Treat indexers and properties as the same in terms
14859         of applying attributes
14860
14861         * ecore.cs (FindMostEncompassedType): Use statically initialized
14862         EmptyExpressions()s like we do elsewhere to avoid creating useless
14863         objects (and we take this out of the tight loop).
14864
14865         (GetConversionOperators): Move the code to extract the actual
14866         operators to a separate routine to clean things up.
14867
14868 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14871         events are always registered FieldBuilders.
14872
14873         * class.cs (FieldBase): New class shared by Fields 
14874
14875         * delegate.cs: If we are a toplevel delegate, use our full name.
14876         If we are a nested delegate, then only use our tail name.
14877
14878 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14879
14880         * expression.cs (IsApplicable): Ensure that we add the "&" to
14881         ref/out types before comparing it with the type of the argument.
14882
14883         (IsParamsMethodApplicable): Ditto.
14884
14885         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14886         silly me ;-)
14887
14888         * delegate.cs : Handle the case when we have more than one applicable
14889         method. Flag an error only when we finish checking all.
14890
14891 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14892
14893         * expression.cs: Add support for boolean static initializers.
14894
14895 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14896
14897         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14898
14899         * parameter.cs (ComputeParameterTypes,
14900         ComputeAndDefineParameterTypes): Better error handling: now we
14901         clear the `types' cache if we fail during any of the type lookups.
14902         We also return the status code correctly to our caller
14903
14904         * delegate.cs: If we fail to define a delegate, abort the extra
14905         steps. 
14906
14907         * expression.cs (Binary.ResolveOperator): for
14908         operator==(object,object) and operator !=(object, object) we also
14909         have to verify that there is an implicit conversion from one to
14910         the other.
14911
14912         (ArrayAccess.DoResolve): Array Access can operate on
14913         non-variables. 
14914
14915 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14916
14917         * assign.cs (CompoundAssign): A new class used as a "flag" that
14918         the assignment actually is happening as part of a compound
14919         assignment operator.
14920
14921         During compound assignment, a few new rules exist to enable things
14922         like:
14923
14924         byte b |= 1 + 2
14925
14926         From the spec:
14927
14928         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14929         to the type of x) if y is implicitly convertible to the type of x,
14930         and the operator is a builtin operator and the return type of the
14931         operator is explicitly convertible to the type of x. 
14932
14933         * rootcontext.cs: Reset warning level to 2.  4 catches various
14934         "interesting" features in mcs, we must clean this up at some
14935         point, but currently am trying to kill other bugs ;-)
14936
14937         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14938         in container classes as well.  
14939
14940         * expression.cs (Binary.ResolveOperator): Handle string case
14941         before anything else (as operator overloading does emit an error
14942         before doing anything else).
14943
14944         This code could go away when we move to a table driven model, but
14945         i could not come up with a good plan last night.
14946
14947 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14948
14949         * typemanager.cs (CSharpName): reimplementation using regex.
14950         * class.cs: added null check for fields in Emit
14951         * rootcontext.cs: set warninglevel to 4
14952
14953 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * typemanager.cs (CSharpName): reimplemented with Lupus
14956         suggestion.
14957
14958 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * statement.cs (If): correclty implement Resolve, because we were
14961         not catching sem errors in there.  The same process is needed
14962         everywhere else. 
14963         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14964
14965
14966         (Statement.Warning_DeadCodeFound): Factorize code.
14967         (While): Report dead code here too.
14968
14969         (Statement): Added Resolve virtual method to allow
14970         for resolution split from the emit code.
14971
14972 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * statement.cs (EmitBoolExpression): No longer try to resolve the
14975         expression here.    
14976         (MakeBoolean): New utility function that resolve, implicitly
14977         converts to boolean and tags the expression. 
14978
14979
14980         (If, Do): Implement dead code elimination.
14981         (While): Implement loop inversion
14982
14983         (Do, While, For, If): Resolve the expression prior to calling our
14984         code generation.
14985
14986 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14987
14988         * class.cs:
14989           - added method Report28 (warning: program has more than one entry point)
14990           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14991           - modified method Method.Define, the part at the end of the method
14992
14993         * rootcontext.cs: added static public Location EntryPointLocation;
14994           
14995         * ../errors/cs0028.cs : Add test case for the above warning.              
14996
14997         * typemanager.cs:
14998           - modified method CSharpName to allow arrays of primitive type to
14999             be printed nicely (e.g. instead of System.Int32[][] it now prints
15000             int[][])
15001           - added method CSharpSignature: returns the signature of a method
15002             in string format to be used in reporting errors, warnings, etc.
15003
15004         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15005         with String.Empty.
15006
15007 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15008
15009         * delegate.cs (Define): Fix extremely silly bug where I was
15010         setting the type of the 'object' parameter of the BeginInvoke
15011         method to System.IAsyncResult instead of System.Object ;-)
15012
15013 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15014
15015         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15016         here. 
15017
15018         (Constructor.Emit): return if we fail to initialize the
15019         constructor.  Another door closed!  
15020
15021         * expression.cs (New.DoResolve): Improve error message (from -6 to
15022         1501).  Use DeclaredOnly lookup to find the exact constructor.
15023
15024         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15025         loop.  This is useful.
15026
15027         * cs-parser.jay: Adjust the default parameters so that destructors
15028         have the proper signature.
15029
15030 2002-04-26  Martin Baulig  <martin@gnome.org>
15031
15032         * driver.cs (LoadAssembly): If `assembly' contains any characters
15033         which are only valid in path names and not in assembly names
15034         (currently slash, backslash and point), use Assembly.LoadFrom ()
15035         instead of Assembly.Load () on the `assembly' (before iteration
15036         over the link_paths).
15037
15038 2002-04-26  Martin Baulig  <martin@gnome.org>
15039
15040         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15041
15042 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * class.cs (Property): use the new typemanager.MemberLookup
15045
15046         (TypeContainer.MemberLookup): Implement using the
15047         TypeManager.MemberLookup now. 
15048
15049         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15050         and return MemberInfos, so that these can be used without an
15051         EmitContext (what we had before).
15052
15053 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * expression.cs: Fix the case where the argument to params if the
15056         type of the params.  I omitted handling this before.   Fixed
15057
15058 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * driver.cs: Call BootCorlib_PopulateCoreType
15061
15062         * class.cs (Property.CheckBase): Check for properties only, not
15063         for all members. 
15064
15065         * interface.cs: Temporary hack: try/catch around the
15066         CustomAttributeBuilder, because I am getting an exception that I
15067         do not understand.
15068
15069         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15070         types whose definitions are required to be there (attributes are
15071         defined before standard types).
15072
15073         Compute definitions as we boot the various types, as they are used
15074         immediately (value_type class will need object_type, but if we do
15075         not initialize object_type, we will pass a null, which will let
15076         the runtime pick the System.Object from the existing corlib, which
15077         is not what we want).
15078
15079 2002-04-22  Patrik Torstensson <totte@labs2.com>
15080
15081         * cs-tokenizer.cs: fixed a number of trim() issues.
15082
15083 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15084
15085         * expression.cs (Argument.Type): Ensure that we return the correct
15086         type when we have out or ref parameters [in which case we 
15087         append a "&"].
15088
15089 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15090
15091         * class.cs (Property, Indexer): Allow extern modifier in there. 
15092
15093         * typemanager.cs (InitBaseTypes): Initializes object_type and
15094         value_type, since those will be used early on during the bootstrap
15095         process to compile corlib.
15096
15097         (InitCoreTypes): Move code from here to InitBaseTypes.
15098
15099 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15100
15101         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15102         single-dimension arrays as using the ldlen opcode.  
15103
15104         Daniel Lewis discovered this optimization.  
15105
15106         * typemanager.cs: Add signature for System.Array::get_Length
15107
15108 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15109
15110         * statement.cs: report the error when the foreach does not apply to an
15111         array nor a collection.
15112
15113 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15114
15115         * expression.cs: Add implicit conversions to the operator ~.
15116
15117         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15118
15119         * typemanager.cs: Locate the decimal constructor.
15120
15121 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15122
15123         * attribute.cs: use the new property of TypeOf.
15124         * expression.cs: added 'get' property around typearg.
15125
15126         These changes fix a build breaker reported by NickD. Is this the
15127         correct way to fix?  If not, please, revert my changes and make it
15128         work :-).
15129
15130 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15131
15132         * attribute.cs: Add support for typeof in attribute invocations.
15133         I am not sure that this is right though.
15134
15135 2002-04-14  Duncan Mak  <duncan@ximian.com>
15136
15137         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15138         Binary.Operator.Division case.
15139
15140 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15141
15142         * class.cs (DefineType): Ensure that we do a proper check on
15143         attribute types and also register it with the TypeManager.
15144
15145         (TypeContainer.Targets): The default for attribute types is
15146         AttributeTargets.All.
15147
15148         * attribute.cs (ApplyAttributes): Registering the attribute type
15149         is done elsewhere, not when we discover we have a Usage attribute.
15150
15151 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15152
15153         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15154         and get rid of is_delegate parameter.
15155
15156         * everywhere : update.
15157
15158 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15159
15160         * cs-parser.jay (compilation_unit): Revamp completely to use
15161         some new ideas that I got from Rhys' grammar to solve the problems
15162         with assembly level attributes.
15163
15164         (outer_declaration): New grammar production.
15165
15166         (attribute_sections): Add.
15167
15168         (opt_attributes): Base on attribute_sections
15169
15170         (namespace_declaration): Allow opt_attributes to tackle the case
15171         when we have assembly level attributes - we are clever in this
15172         regard now ;-)
15173
15174         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15175         attributes in the non-global context.
15176
15177         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15178         instead of SetGlobalAttributes.
15179
15180         * class.cs, rootcontext.cs : Ensure we define and generate 
15181         attribute types before anything else.
15182
15183         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15184         and flag the new error -20 for the case when the attribute type
15185         does not have valid targets specified. csc does not catch this.
15186
15187         * ../errors/errors.txt : update for error # -20
15188
15189 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15190
15191         * support.cs (InternalParameters.ParameterModifier): Do some null
15192         checking and return sane values.
15193
15194         * class.cs (Method.Define): If we are a PInvoke method, ensure
15195         that we are static and extern. Report error # 601
15196
15197         * ../errors/cs0601.cs : Add test case for the above error.
15198
15199 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15200
15201         * rootcontext.cs (attribute_types): We need to keep type of
15202         all attribute types separately and emit code for them first.
15203
15204         (RegisterAttribute) : Implement.
15205
15206         * class.cs (DefineType): Check if the current Type is a custom
15207         attribute type and register it accordingly.
15208
15209         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15210         adding the first attribute twice and rename to
15211
15212         (SetGlobalAttributes): this.
15213
15214         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15215         lookups.
15216
15217         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15218         if we are processing global arguments. Hmm, I am unsure of this.
15219
15220 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15221
15222         * expression.cs: added static array of strings to avoid calling
15223         Enum.ToString () for Operator in Binary. Significant recover of
15224         performance.
15225
15226 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * class.cs (FindMembers): Allow the Builders of the various
15229         members to be null.  If they are skip them.  This only happens
15230         during the PInvoke declaration.
15231
15232 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15233
15234         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15235         failure, so we do not keep going afterwards.
15236
15237         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15238         wanted to pass `false' as the `is_delegate' argument.  If this is
15239         the case, why not use delegate_type == null to mean `is_delegate =
15240         false' and anything else as is_delegate = true.
15241
15242 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15243
15244         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15245         code for the section, not the beginning of the tests.
15246
15247 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15250
15251         * expression.cs (Binary): same.  Warn about errors where we have
15252         Enum/Enum in operator + as well.
15253
15254 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15255
15256         * statement.cs:
15257                 - added support for switch(bool)
15258                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15259                 - add TableSwitchEmit() to handle table-based switch statements
15260
15261 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15262
15263         * expression.cs (Invocation.OverloadResolve): Factor out code which
15264         does parameter compatibility checking with arguments so that we can 
15265         re-use the code even from Delegate.VerifyApplicability
15266
15267         (VerifyArgumentsCompat): Move above code here.
15268
15269         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15270         and instead make a call to the above method.
15271
15272 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15273
15274         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15275         We use it to keep track of classes which are attribute types.
15276
15277 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15278
15279         * delegate.cs (Delegate.Define): Correctly define the types in the
15280         presence of fixed and array parameters.
15281
15282         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15283         doing FindMembers.
15284
15285         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15286         include NonPublic after the first iteration.
15287
15288         * class.cs (Indexer.CheckBase): Only check if both parents are
15289         non-null. 
15290
15291         * cs-parser.jay (accessor_body): If empty, set to null.
15292
15293         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15294         same code path here to resolve constants names that we did have in
15295         MemberAccess.DoResolve.  There is too much code duplicated here.
15296
15297 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15300
15301         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15302         to MakeUnionSet.
15303
15304         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15305         tokens, numbers and strings.
15306
15307         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15308         parenthesis.
15309
15310         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15311         asyncronous parameters and the regular parameters.  
15312
15313         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15314         specify the target directory.
15315
15316         * expression.cs: (This.DoResolve): Simplify
15317         (As.Emit): Optimize, do not generate IsInst if the expression is
15318         always of the given type.
15319
15320         (Is.DoResolve): Bug fix, we were reporting both always/never for
15321         the is expression.
15322
15323         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15324         creating too many unnecessary arrays.
15325
15326 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15327
15328         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15329         fields instead of rolling our own initializer.   Takes care of all
15330         implicit conversions, and drops unnecessary static checks/argument.
15331
15332 2002-03-31  Dick Porter  <dick@ximian.com>
15333
15334         * driver.cs: use the GetDirectories() return values properly, and
15335         use "/" as path separator.
15336
15337 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * expression.cs (Unary): Optimize - - expr into expr.
15340         (Binary): Optimize a + (-b) into a -b.
15341
15342         * codegen.cs (CodeGen): Made all methods static.
15343
15344 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * rootcontext.cs: 
15347
15348         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15349         TypeBuilder property.
15350
15351         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15352         instead. 
15353
15354         * tree.cs: Removed the various RecordXXXX, and replaced with a
15355         single RecordDecl.  Removed all the accessor methods, and just
15356         left a single access point Type 
15357
15358         * enum.cs: Rename DefineEnum to DefineType.
15359
15360         * decl.cs: New abstract method `DefineType' used to unify the
15361         Defines for Enumerations, Interfaces, TypeContainers and
15362         Delegates.
15363
15364         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15365         LookupBaseClasses method that used to live in class.cs and
15366         interface.cs here, and renamed to FindType.
15367
15368         * delegate.cs: Implement DefineType.  Take advantage of the
15369         refactored pattern for locating the parent builder without taking
15370         the parent_builder argument (which we know does not work if we are
15371         nested, and triggering a toplevel definition).
15372
15373 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15374
15375         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15376         accessibility of a member has changed during override and report
15377         an error if so.
15378
15379         * class.cs (Method.Define, Property.Define): Only complain on
15380         overrides if the method is private, any other accessibility is
15381         fine (and since we just checked the permission is the same, we are
15382         good to go).
15383
15384         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15385         and elif are processed always.  The other pre-processing
15386         directives are only processed if we are "taking" the path
15387
15388 2002-03-29  Martin Baulig  <martin@gnome.org>
15389
15390         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15391         current location is not Null.
15392
15393         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15394         a separate method so we can profile it.
15395
15396         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15397         `span.Seconds' are just seconds, but no minutes or hours.
15398         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15399
15400 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15401
15402         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15403         Remove the gratuitous set of Final:
15404
15405                                 // If an interface implementation, then we can set Final.
15406                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15407                                     implementing.DeclaringType.IsInterface)
15408                                         flags |= MethodAttributes.Final;
15409
15410         I do not know what I was smoking when I used that.
15411
15412
15413         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15414         step into fixing the name resolution issues for delegates and
15415         unifying the toplevel name resolution.
15416
15417 2002-03-28  Martin Baulig  <martin@gnome.org>
15418
15419         * class.cs (Method.Emit): If we have a symbol writer, call its
15420         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15421         tell it about the current method.
15422
15423         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15424         writer that we're going to emit the first byte of IL code for a new
15425         statement (a new source line).
15426         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15427         EmitContext.Mark() before emitting any code.
15428
15429         * location.cs (SymbolDocument): Return null when we're Null.
15430
15431         * statement.cs (Statement): Moved the `Location loc' variable here.
15432         (Statement.EmitBoolExpression): If we have a symbol writer, call
15433         ec.Mark() before emitting any code to tell it that we're at the
15434         beginning of a new statement.
15435         (StatementExpression): Added `Location' argument to the constructor.
15436         (Block): Added public readonly variable `StartLocation' and public
15437         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15438         (Block): Added constructor which takes a start and end location.
15439         (Block.SetEndLocation): New method. This sets the end location.
15440         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15441         local variables we create.
15442         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15443         each statement and do also mark the begin and end of the block.
15444
15445         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15446         tell it the current lexer.Location, use Location.Null for the end of the
15447         block.
15448         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15449         current block, set its end location using SetEndLocation().
15450         (statement_expression): StatementExpression constructor now takes the
15451         lexer.Location as additional argument.
15452         (for_statement, declare_local_variables): Likewise.
15453         (declare_local_variables): When creating a new implicit block, use the
15454         new Block constructor and pass it the lexer.Location.
15455
15456 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15457
15458         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15459         members also on the parent interfaces recursively.
15460
15461 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * report.cs: Use new formats, since Gonzalo finished the missing
15464         bits. 
15465
15466         * expression.cs (Binary.ResolveOperator): added missing operator|
15467         operator& and operator^ for bool/bool.
15468
15469         * cs-parser.jay: CheckDef now takes a Location argument that is
15470         used to report errors more precisly (instead of reporting the end
15471         of a definition, we try to track something which is a lot closer
15472         to the source of the problem).
15473
15474         * cs-tokenizer.cs: Track global token use, so we can properly flag
15475         the use of #define/#undef after the first token has been seen.
15476
15477         Also, rename the reportXXXX to Error_DescriptiveName
15478
15479         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15480         TypeContainer, so that Enum and Interface can use this too.
15481
15482         * class.cs (TypeContainer.LookupInterfaceOrClass,
15483         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15484         `builder' argument.  Typically this was used to pass the parent
15485         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15486         the definition).  
15487
15488         The problem is that a nested class could trigger the definition of
15489         a toplevel class, and the builder would be obviously wrong in that
15490         case. 
15491
15492         So we drop this argument, and we compute dynamically the
15493         TypeBuilder/ModuleBuilder (the correct information was available
15494         to us anyways from DeclSpace.Parent)
15495
15496         * interface.cs (Interface.DefineInterface): Drop builder
15497         parameter cleanup like class.cs
15498
15499         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15500         like class.cs
15501
15502         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15503         values. 
15504
15505         (Try.Emit): Propagate the returns value from the statement.
15506
15507         (Return.Emit): Even if we are leavning 
15508
15509         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15510
15511         * modifiers.cs: Fix the computation of MethodAttributes flags.
15512
15513 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15514
15515         * driver.cs: allow compilation of files that start with '/'.
15516         Add a default case when checking the argument of --target.
15517
15518 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * interface.cs: Implement the same search algorithm for types in
15521         the interface code.
15522
15523         * delegate.cs: Do not allow multiple definition.
15524
15525         * Recovered ChangeLog that got accidentally amputated
15526
15527         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15528
15529         * rootcontext.cs: Load manually enum to allow core classes to
15530         contain enumerations.
15531
15532         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15533         Update to new static methods in TypeManager.
15534
15535         * typemanager.cs (GetMethod, GetConstructor): Use our
15536         implementation of FindMembers to find the members, since during
15537         corlib compilation, the types are TypeBuilders and GetMethod and
15538         GetConstructor do not work.
15539
15540         Make all methods in TypeManager static.
15541
15542         (InitCodeHelpers): Split the functionality from
15543         the InitCodeTypes function.
15544
15545         * driver.cs: Call InitCodeHelpers after we have populated the
15546         types. 
15547
15548         * cs-parser.jay (delegate_declaration): we did not used to compute
15549         the delegate name correctly for void delegates.
15550
15551 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * rootcontext.cs (RootContext): Init the interface_resolve_order
15554         and type_container_resolve_order always.
15555
15556         (ResolveCore, BootstrapCorlib_ResolveClass,
15557         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15558         compiler when compiling with --nostdlib
15559
15560         * class.cs (TypeContainer.DefineType): Check that our parent is
15561         not null.  This test is most important when we are bootstraping
15562         the core types.
15563
15564         * codegen.cs: Split out the symbol writing code.
15565
15566 2002-03-25  Martin Baulig  <martin@gnome.org>
15567
15568         * driver.cs (-g): Made -g an alias for --debug.
15569
15570 2002-03-24  Martin Baulig  <martin@gnome.org>
15571
15572         * codegen.cs (SymbolWriter): New public variable. Returns the
15573         current symbol writer.
15574         (CodeGen): Added `bool want_debugging_support' argument to the
15575          constructor. If true, tell the ModuleBuild that we want debugging
15576         support and ask it for the ISymbolWriter.
15577         (Save): If we have a symbol writer, call it's Close() method after
15578         saving the assembly.
15579
15580         * driver.c (--debug): New command line argument to create a
15581         debugger information file.
15582
15583         * location.cs (SymbolDocument): New public property. Returns an
15584         ISymbolDocumentWriter object for the current source file or null
15585         if we don't have a symbol writer.
15586
15587 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * driver.cs (LoadAssembly): Correctly return when all the paths
15590         have been tried and not before.
15591
15592         * statement.cs (Switch.Emit): return the actual coverage for this
15593         statement (returns/not-returns)
15594
15595         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15596         switch of the statement if we are the last switch section.  That
15597         kills two problems: try/catch problems (we used to emit an empty
15598         nop at the end) and switch statements where all branches would
15599         return. 
15600
15601 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * driver.cs: Add default assemblies (the equivalent to the
15604         Microsoft CSC.RSP file)
15605
15606         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15607         also update tokens_seen and set it to false.
15608
15609         * driver.cs: Implement --recurse for Mike.
15610
15611         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15612         correctly splitting out the paths.
15613
15614 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * interface.cs (Interface.PopulateProperty): Instead of using
15617         `parent' as the declaration space for the set parameters, use
15618         `this' 
15619
15620         * support.cs (InternalParameters): InternalParameters constructor
15621         takes a DeclSpace instead of a TypeContainer.
15622
15623         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15624         types are being initialized, load the address of it before calling
15625         the function.  
15626
15627         (New): Provide a mechanism to disable the generation of local
15628         value type temporaries when the caller will be providing us with
15629         an address to store it.
15630
15631         (ArrayCreation.EmitDynamicInitializers): Use it.
15632
15633 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * expression.cs (Invocation.EmitArguments): Only probe for array
15636         property if there is more than one argument.  Sorry about that.
15637
15638         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15639         empty param arrays.
15640
15641         * class.cs (Method.LabelParameters): Fix incorrect code path that
15642         prevented the `ParamArrayAttribute' from being applied to the
15643         params attribute.
15644
15645 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15646
15647         * support.cs (ReflectionParameters): Correctly compute whether the
15648         last argument is a params array.  Fixes the problem with
15649         string.Split ('a')
15650
15651         * typemanager.cs: Make the assemblies array always be non-null
15652         (empty, but non-null)
15653
15654         * tree.cs (RecordDecl): New function that abstracts the recording
15655         of names.  This reports error 101, and provides a pointer to the
15656         previous declaration.  Fixes a crash in the compiler.
15657
15658         * cs-parser.jay (constructor_declaration): Update to new grammar,
15659         and provide a constructor_body that can be empty.
15660
15661 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15662
15663         * driver.cs: Add support for --resources.
15664
15665         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15666         Make all types for the various array helper methods be integer.
15667
15668         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15669         CheckState to ConvCast.
15670
15671         (ConvCast): Now it takes a `checked' state argument, to avoid
15672         depending on the emit context for the conversion, and just using
15673         the resolve time setting.
15674
15675         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15676         instead of Invocation.EmitArguments.  We do not emit the original
15677         arguments, instead we emit those which have been converted to
15678         unsigned int expressions.
15679
15680         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15681
15682         * codegen.cs: ditto.
15683
15684         * expression.cs (LocalVariableReference): Drop the use of the
15685         Store function that depended on the variable index.
15686
15687         * statement.cs (VariableInfo): Drop the `Idx' property from this
15688         class, as this is not taking into account the indexes for
15689         temporaries tat we generate during the execution, getting the
15690         indexes wrong.
15691
15692         * class.cs: First emit class initializers, then call the parent
15693         constructor. 
15694
15695         * expression.cs (Binary): Fix opcode emision.
15696         (UnaryMutator.EmitCode): Support checked code generation
15697
15698         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15699         matches for events for both the Static and Instance scans,
15700         pointing to the same element.   Fix that.
15701
15702 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * rootcontext.cs (ResolveTree): Always set the
15705         interface_resolve_order, because nested interfaces will be calling
15706         into us.
15707
15708         * class.cs (GetInterfaceOrClass): Track the same resolution
15709         process used by TypeManager.LookupType.  This fixes the nested
15710         type lookups in class declarations (separate path from
15711         LookupType). 
15712
15713         (TypeContainer.DefineType): Also define nested interfaces.
15714         (TypeContainer.RegisterOrder): New public function used to
15715         register the order in which child interfaces need to be closed.
15716
15717         Nested interfaces need to be closed after their parents have been
15718         created. 
15719
15720         * interface.cs (InterfaceAttr): Put all the logic for computing
15721         the interface attribute here. 
15722
15723         (DefineInterface): Register our interface order with the
15724         RootContext or with the TypeContainer depending on the case.
15725
15726 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15727
15728         * cs-parser.jay: rework foreach statement to work with the new
15729         changes to the policy on SimpleNames.
15730
15731         * report.cs: support Stacktrace on warnings as well.
15732
15733         * makefile: drop --unsafe and /unsafe from the compile.
15734
15735 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15736
15737         * ecore.cs (StandardConversionExists): Modify to take an Expression
15738         as the first parameter. Ensure we do null -> reference type conversion
15739         checking.
15740
15741         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15742         temporary Expression objects.
15743
15744 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15745
15746         * interface.cs: workaround bug in method overloading resolution
15747         (there is already a bugzilla bug for it).
15748
15749 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15750
15751         We could also solve this problem by having a separate path for
15752         performing type lookups, instead of DoResolve, we could have a
15753         ResolveType entry point, and only participating pieces of the
15754         production (simplename, deref, array) would implement this. 
15755
15756         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15757         signal SimpleName to only resolve type names and not attempt to
15758         resolve anything else.
15759
15760         * expression.cs (Cast): Set the flag.
15761
15762         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15763
15764         * class.cs: Only report 108 if there is no `new' modifier.
15765
15766         * cs-parser.jay: rework foreach statement to work with the new
15767         changes to the policy on SimpleNames.
15768
15769         * report.cs: support Stacktrace on warnings as well.
15770
15771         * makefile: drop --unsafe and /unsafe from the compile.
15772
15773 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15774
15775         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15776         lookups here, instead of doing that at parse time.  This means
15777         that our grammar will not introduce `LocalVariableReferences' as
15778         expressions at this point.  That solves the problem of code like
15779         this:
15780
15781         class X {
15782            static void Main ()
15783            { int X = 1;
15784             { X x = null }}}
15785
15786         This is only half the fix.  The full fix requires parameters to
15787         also be handled in this way.
15788
15789         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15790         makes the use more obvious of the DeclSpace.  The
15791         ec.TypeContainer.TypeBuilder is now only used to pull the
15792         TypeBuilder for it.
15793
15794         My theory is that I can get rid of the TypeBuilder completely from
15795         the EmitContext, and have typecasts where it is used (from
15796         DeclSpace to where it matters).  
15797
15798         The only pending problem is that the code that implements Aliases
15799         is on TypeContainer, and probably should go in DeclSpace.
15800
15801         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15802         lookups here, instead of doing that at parse time.  This means
15803         that our grammar will not introduce `LocalVariableReferences' as
15804         expressions at this point.  That solves the problem of code like
15805         this:
15806
15807         class X {
15808            static void Main ()
15809            { int X = 1;
15810             { X x = null }}}
15811
15812         This is only half the fix.  The full fix requires parameters to
15813         also be handled in this way.
15814
15815         * class.cs (Property.DefineMethod): When implementing an interface
15816         method, set newslot, when implementing an abstract method, do not
15817         set the flag (before we tried never setting it, or always setting
15818         it, which is the difference).
15819         (Indexer.DefineMethod): same.
15820         (Method.DefineMethod): same.
15821
15822         * ecore.cs: Only set the status used flag if we get back a Field.
15823
15824         * attribute.cs: Temporary hack, so Paolo can keep working.
15825
15826 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15827
15828         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15829         the unmanaged type in the case we have a MarshalAs attribute.
15830
15831         (Resolve): Handle the case when we are parsing the special MarshalAs
15832         attribute [we need to store the unmanaged type to use later]
15833
15834         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15835         MarshalAs Attribute.
15836
15837         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15838         on parameters and accordingly set the marshalling info.
15839
15840 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15841
15842         * class.cs: Optimizing slightly by removing redundant code after
15843         we switched to the `NoTypes' return value.
15844         (Property.DefineMethod): use NoTypes here too.
15845
15846         This fixes the bug I introduced in my last batch of changes.
15847
15848 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15849
15850         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15851
15852         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15853         Enums since those are types too. 
15854
15855         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15856
15857         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15858         thanks to a call during the lookup process.
15859
15860 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * statement.cs (Foreach): Lots of work to accomodate a particular
15863         kind of foreach statement that I had not kept in mind.  It is
15864         possible to have foreachs on classes that provide a GetEnumerator
15865         method that return objects that implement the "pattern" for using
15866         a foreach, there is no need to support GetEnumerator
15867         specifically. 
15868
15869         This is needed to compile nant.
15870
15871         * decl.cs: Only report 114 if the member is not `Finalize' and if
15872         the warning level is at least 2.
15873
15874         * class.cs: Moved the compare function from Method to
15875         MethodSignature. 
15876
15877         (MethodSignature.InheritableMemberSignatureCompare): Add new
15878         filter function that is used to extract inheritable methods from a
15879         class. 
15880
15881         (Method.Define): Use the new `inheritable_method_signature_filter'
15882         delegate
15883
15884         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15885         command. 
15886
15887 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15890
15891         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15892
15893         * expression.cs: Pass location information to
15894         ConvertImplicitStandard. 
15895
15896         * class.cs: Added debugging code to track return values from
15897         interfaces. 
15898
15899 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15900
15901         * expression.cs (Is.DoResolve): If either side of the `is' is an
15902         interface, do not flag the warning.
15903
15904         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15905         for interfaces
15906
15907         * report.cs: Allow for --fatal to be used with --probe.
15908
15909         * typemanager.cs (NoTypes): Move the definition for the empty Type
15910         array here. 
15911
15912         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15913         properties. 
15914         (TypeContainer.DefineProxy): New function used to proxy to parent
15915         implementations when implementing interfaces.
15916         (TypeContainer.ParentImplements): used to lookup if our parent
15917         implements a public function that is required by an interface.
15918         (TypeContainer.VerifyPendingMethods): Hook this up.
15919
15920         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15921         `modules' and `assemblies' arraylists into arrays.  We only grow
15922         these are the very early start up of the program, so this improves
15923         the speedof LookupType (nicely measured).
15924
15925         * expression.cs (MakeByteBlob): Replaced unsafe code with
15926         BitConverter, as suggested by Paolo.
15927
15928         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15929         folding of string concatenation, but if either side is a string,
15930         and the other is not, then return null, and let the runtime use
15931         the concatenation on the string plus the object (using
15932         `Object.ToString'). 
15933
15934 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15935
15936         Constant Folding has been implemented now.
15937
15938         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15939         the error instead on types that are not supported in one's
15940         complement. 
15941
15942         * constant.cs (Constant and all children): New set of functions to
15943         perform implict and explicit conversions.
15944
15945         * ecore.cs (EnumConstant): Implement the new functions to perform
15946         conversion by proxying to the child expression.
15947
15948         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15949         own separate setting that can not be turned off from the command
15950         line using --unchecked or --checked and is only controlled using
15951         the checked/unchecked statements and expressions.  This setting is
15952         used by the constant folder to flag errors.
15953
15954         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15955         ConstantCheckState as well.   
15956
15957         During Resolve, they also have to flag the state, because the
15958         constant folder runs completely in the Resolve phase.
15959
15960         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15961         well.
15962
15963 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * cfold.cs: New file, this file contains the constant folder.
15966
15967         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15968         argument to track whether we are using the resulting address to
15969         load or store a value and provide better error messages. 
15970
15971         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15972         new AddressOf arguments.
15973
15974         * statement.cs (Foreach.EmitCollectionForeach): Update
15975
15976         * expression.cs (Argument.Emit): Call AddressOf with proper
15977         arguments to track usage.
15978
15979         (New.DoEmit): Call AddressOf with new arguments.
15980
15981         (Unary.Emit): Adjust AddressOf call.
15982
15983 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15984
15985         * cs-parser.jay (member_access): Change the case for pre-defined types
15986         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15987         this suggestion.
15988
15989         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15990         a method body.
15991
15992         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15993         essentially like methods and apply attributes like MethodImplOptions to them too.
15994
15995         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15996         not being null.
15997
15998         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15999         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16000         is the DeclSpace.
16001
16002         * Update code everywhere accordingly.
16003
16004         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16005
16006         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16007
16008 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16009
16010         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16011         try performing lookups against those instead of jumping straight into using
16012         the 'using' clauses.
16013
16014         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16015
16016         (LookupType): Perform lookups in implicit parents too.
16017
16018         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16019         sequence as RootContext.LookupType. 
16020
16021         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16022         the various cases of namespace lookups into this method.
16023
16024 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16025
16026         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16027         in positional arguments)
16028
16029         * class.cs (Operator): Update the AllowedModifiers to contain
16030         extern. 
16031
16032         * cs-parser.jay: Update operator declaration to allow for the
16033         operator body to be empty.
16034
16035         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16036         values. 
16037
16038 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16039
16040         * class.cs (Method.Emit): Label parameters.
16041
16042         * driver.cs: Return 1 or 0 as the program exit code.
16043
16044 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * expression.cs: Special case the `null' object when trying to
16047         auto-compute the type, as anything can be explicitly converted to
16048         that. 
16049
16050         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16051         spotting this Paolo.
16052
16053         (Expression.ImplicitNumericConversion): Perform comparissions of
16054         the type using the underlying type in the case of an enumeration
16055         rather than using the enumeration type for the compare.
16056
16057         Cope with the underlying == type case, which is not possible to
16058         catch before. 
16059
16060         (Expression.ConvertNumericExplicit): Perform comparissions of
16061         the type using the underlying type in the case of an enumeration
16062         rather than using the enumeration type for the compare.
16063
16064         * driver.cs: If the user does not supply an extension, assume .exe
16065
16066         * cs-parser.jay (if_statement): Rewrote so that we can track the
16067         location for the if statement.
16068
16069         * expression.cs (Binary.ConstantFold): Only concat strings when
16070         the operation is "+", not everything ;-)
16071
16072         * statement.cs (Statement.EmitBoolExpression): Take a location
16073         argument. 
16074         (If, While, Do): Track location.
16075
16076         * expression.cs (Binary.ResolveOperator): In the object + string
16077         case, I was missing a call to ConvertImplicit
16078
16079 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16080
16081         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16082         Location arguments. Ensure we use RootContext.LookupType to do our work
16083         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16084
16085         * interface.cs (PopulateMethod): Handle the type of the parameter being
16086         null gracefully.
16087
16088         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16089         have a params method with no fixed arguments and a call is made with no
16090         arguments.
16091
16092 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16093
16094         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16095         the verbatim-string-literal
16096
16097         * support.cs (InternalParameters.ParameterModifier): handle null
16098         fixed parameters.
16099         (InternalParameters.ParameterType): ditto.
16100
16101         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16102         duplicating the name of the variable parameter.
16103         (GetParameterByName): Fix bug where we were not looking up array
16104         paramters if they were the only present (thanks Paolo!).
16105         (GetParameterInfo): We only have an empty set of types if both
16106         fixed and array are set to null.
16107         (GetParameterInfo-idx): Handle FixedParameter == null
16108
16109         * cs-parser.jay: Handle the case where there is no catch
16110         statements (missing null test).
16111
16112 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16113
16114         * driver.cs (MainDriver): Be conservative on our command line
16115         handling.
16116
16117         Catch DirectoryNotFoundException when calling GetFiles.
16118
16119         (SplitPathAndPattern): Used to split the input specification into
16120         a path and a pattern that we can feed to Directory.GetFiles.
16121
16122 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16123
16124         * statement.cs (Fixed): Implement the last case of the Fixed
16125         statement (string handling).
16126
16127         * expression.cs (StringPtr): New class used to return a char * to
16128         a string;  Used by the Fixed statement.
16129
16130         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16131
16132         * expression.cs (Binary.ResolveOperator): Remove redundant
16133         MemberLookup pn parent type.
16134         Optimize union call, we do not need a union if the types are the same.
16135         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16136         type.
16137
16138         Specialize the use of MemberLookup everywhere, instead of using
16139         the default settings. 
16140
16141         (StackAlloc): Implement stackalloc keyword.
16142
16143         * cs-parser.jay: Add rule to parse stackalloc.
16144
16145         * driver.cs: Handle /h, /help, /?
16146
16147         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16148         before we supported unsafe code.
16149
16150         * makefile: add --unsafe to the self compilation of mcs.
16151
16152 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * expression.cs (PointerArithmetic): New class that is used to
16155         perform pointer arithmetic.
16156         (Binary.Resolve): Handle pointer arithmetic
16157         Handle pointer comparission.
16158         (ArrayPtr): Utility expression class that is used to take the
16159         address of an array.
16160
16161         (ElementAccess): Implement array access for pointers
16162
16163         * statement.cs (Fixed): Implement fixed statement for arrays, we
16164         are missing one more case before we are done.
16165
16166         * expression.cs (Indirection): Implement EmitAssign and set the
16167         ExprClass to Variable.  This allows pointer dereferences to be
16168         treated as variables, and to have values assigned to them.
16169
16170         * ecore.cs (Expression.StoreFromPtr): New utility function to
16171         store values dereferencing.
16172
16173 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16174
16175         * expression.cs (Binary.ResolveOperator): Ensure that we are
16176         not trying to operate on a void type - this fixes the reported
16177         bug.
16178
16179         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16180         the parent implementation is sealed.
16181
16182         * ../errors/cs0239.cs : Add.
16183
16184         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16185
16186         * typemanager.cs (unverifiable_code_type): Corresponds to 
16187         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16188         which have unsafe code in them.
16189
16190         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16191         unsafe context.
16192
16193 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * cs-tokenizer.cs: Add support for @"litreal strings"
16196
16197         Make tokenizer accept pre-processor directives
16198         on any column (remove the old C-like limitation). 
16199
16200         * rootcontext.cs (EmitCode): Emit any global attributes.
16201         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16202
16203         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16204
16205         * cs-parser.jay: Add support for global attributes.  
16206
16207 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * expression.cs (Indirection): New helper class.  Unary will
16210         create Indirection classes to be able to implement the
16211         IMemoryLocation interface on it.
16212
16213 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * cs-parser.jay (fixed_statement): reference the right statement.
16216
16217         * statement.cs (Fixed.Emit): Finish implementing the fixed
16218         statement for the &x case.
16219
16220 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16221
16222         * class.cs (Property.Define, Method.Define): Remove newslot when
16223         `implementing'.  
16224
16225         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16226         wrong.  NewSlot should only be used if the `new' keyword is present.
16227
16228         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16229         locating our system dir.  Sorry about this.
16230
16231 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16232
16233         * driver.cs (GetSystemDir): Compute correctly the location of our
16234         system assemblies.  I was using the compiler directory instead of
16235         the library directory.
16236
16237 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16238
16239         * expression.cs (BetterFunction): Put back in what Miguel commented out
16240         since it is the correct fix. The problem is elsewhere ;-)
16241
16242         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16243         parameters of the parms method are themselves compatible or not !
16244
16245         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16246         to check that a class implements an interface before saying that an implicit
16247         conversion was allowed. Use ImplementsInterface to do the checking.
16248
16249 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * class.cs (Method.Define): Track whether we are an explicit
16252         implementation or not.  And only call DefineMethodOverride if we
16253         are an explicit implementation.
16254
16255         (Property.DefineMethod): Ditto.
16256
16257 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16258
16259         * expression.cs (BetterFunction): Catch hideous bug which was
16260          preventing us from detecting ambiguous calls due to implicit casts i.e
16261         cs0121.
16262
16263 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * support.cs (Pair): Remove un-needed method.  I figured why I was
16266         getting the error in cs-parser.jay, the variable in a foreach loop
16267         is readonly, and the compiler does not really treat this as a variable.
16268
16269         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16270         instead of EQUALS in grammar.  
16271
16272         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16273
16274         * expression.cs (Unary.DoResolve): Check whether the argument is
16275         managed or not.
16276
16277 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16278
16279         * support.cs: Api for Pair to set a value.  Despite the fact that
16280         the variables are public the MS C# compiler refuses to compile
16281         code that accesses the field if the variable is part of a foreach
16282         statement. 
16283
16284         * statement.cs (Fixed): Begin implementation of the fixed
16285         statement.
16286
16287         (Block.AddVariable): Return the VariableInfo on success and null
16288         on failure instead of true/false. 
16289
16290         * cs-parser.jay (foreach): Catch errors on variables already
16291         defined (we were ignoring this value before) and properly unwind
16292         the block hierarchy
16293
16294         (fixed_statement): grammar for the fixed statement.
16295
16296 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16299         pointer types to be incretemented.
16300
16301         (SizeOf): Implement.
16302
16303         * cs-parser.jay (pointer_member_access): Implement
16304         expr->IDENTIFIER production.
16305
16306         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16307         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16308         on safe contexts.
16309
16310         (Unary): Implement indirection.
16311
16312         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16313         use in non-unsafe context).
16314
16315         (SimpleName.DoResolve): Check for pointers in field access on safe
16316         contexts. 
16317
16318         (Expression.LoadFromPtr): Factor the load-indirect code in this
16319         function.  This was duplicated in UnboxCast and ParameterReference
16320
16321 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * expression.cs (ComposedCast): report an error if a pointer cast
16324         is used in a safe region.
16325
16326         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16327         pointer type casts in unsafe context.
16328
16329         * codegen.cs (EmitContext): Set up IsUnsafe.
16330
16331         * cs-parser.jay (non_expression_type): Add productions for pointer
16332         casts. 
16333
16334         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16335         code.  We should not use force into static mode if the method is
16336         not virtual.  Fixes bug in MIS
16337
16338         * statement.cs (Do.Emit, While.Emit, For.Emit,
16339         Statement.EmitBoolExpression): Add support to Do and While to
16340         propagate infinite loop as `I do return' semantics.
16341
16342         Improve the For case to also test for boolean constants.
16343
16344         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16345         to the list of attributes we can add.
16346
16347         Remove `EmitContext' argument.
16348
16349         * class.cs (Method.Define): Apply parameter attributes.
16350         (Constructor.Define): Apply parameter attributes.
16351         (MethodCore.LabelParameters): Move here the core of labeling
16352         parameters. 
16353
16354         * support.cs (ReflectionParameters.ParameterModifier,
16355         InternalParameters.ParameterModifier): Use IsByRef on the type and
16356         only return the OUT bit for these parameters instead of in/out/ref
16357         flags.
16358
16359         This is because I miss-understood things.  The ParameterInfo.IsIn
16360         and IsOut represent whether the parameter has the [In] and [Out]
16361         attributes set.  
16362
16363 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * ecore.cs (FieldExpr.Emit): Release temporaries.
16366
16367         * assign.cs (LocalTemporary.Release): new function.
16368
16369         * codegen.cs (EmitContext.GetTemporaryStorage,
16370         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16371         temporary storage.  Now we can "put back" localbuilders when we
16372         are done with them
16373
16374 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16375
16376         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16377         need to make a copy of the variable to generate verifiable code.
16378
16379 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16380
16381         * driver.cs: Compute dynamically the system directory.
16382
16383         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16384         Slower, but more generally useful.  Used by the abstract
16385         registering implementation. 
16386
16387         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16388         the rules for the special rule on Type/instances.  First check if
16389         we have the same name, and if so, try that special static path
16390         rather than the instance path.
16391
16392 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16395         for, while and if.
16396
16397         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16398         Enum, ValueType, Delegate or Array for non-corlib compiles.
16399
16400         * cs-tokenizer.cs: Catch long identifiers (645)
16401
16402         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16403         piece of code.
16404
16405         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16406         fix, we were returning too early, so we were not registering
16407         pending methods from abstract classes.
16408
16409         Do not register pending methods if the class is abstract.
16410
16411         * expression.cs (Conditional.DoResolve): Report circular implicit
16412         conversions when we neecd to compute it for conditional
16413         expressions. 
16414
16415         (Is.DoResolve): If the expression is always of the provided type,
16416         flag warning 183.  If the expression can not ever be of the
16417         provided type flag warning 184.
16418
16419         * class.cs: Catch 169 as well.
16420
16421         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16422         read. 
16423
16424 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16425
16426         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16427
16428 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * interface.cs: (PopulateMethod): Check for pointers being defined
16431         only if the unsafe context is active.
16432         (PopulateProperty): ditto.
16433         (PopulateIndexer): ditto.
16434
16435         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16436         specified.  If pointers are present, make sure that they are
16437         present in an unsafe context.
16438         (Constructor, Constructor.Define): ditto.
16439         (Field, Field.Define): ditto.
16440         (Property, Property.Define): ditto.
16441         (Event, Event.Define): ditto.
16442
16443         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16444         hashtable if there are classes or structs defined.
16445
16446         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16447         code, as the constant resolution moved.
16448
16449         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16450         the metadata, so we can flag error 133. 
16451
16452         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16453         pointer is being declared in an unsafe context.
16454
16455 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16456
16457         * modifiers.cs (Modifiers.Check): Require a Location argument.
16458         Report error 227 for Unsafe use.
16459
16460         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16461
16462         * statement.cs (For.Emit): If the test is null, then report that
16463         we do `return', as we wont reach anything afterwards.
16464
16465         (Switch.SwitchGoverningType): Track the expression that matched
16466         the conversion.
16467
16468         * driver.cs: Allow negative numbers as an error code to flag.
16469
16470         * cs-parser.jay: Handle 1551.
16471
16472         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16473
16474 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * cs-parser.jay: Report 1518 (type declaration can only contain
16477         class, struct, interface, enum or delegate)
16478
16479         (switch_label): Report 1523 (keywords `case' or `default' must
16480         preced code)
16481
16482         (opt_switch_sections): Report 1522 (empty switch)
16483
16484         * driver.cs: Report 1515 (response file specified multiple times)
16485         Report 1516 (Source file specified multiple times).
16486
16487         * expression.cs (Argument.Resolve): Signal 1510
16488
16489         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16490         access not allowed in static code)
16491
16492 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16493
16494         * typemanager.cs (IsPointerType): Utility method which we are going
16495         to need a lot.
16496
16497         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16498         the object type, so we take care of that.
16499
16500         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16501
16502         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16503         added to non-params parameters :-)
16504
16505         * typemanager.cs (CSharpName): Include 'void' type too. 
16506
16507         (void_ptr_type): Include in the set of core types.
16508
16509         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16510         duplicating code.
16511
16512         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16513         an unsafe context.
16514
16515         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16516         completely forgotten about it.
16517
16518 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16519
16520         * cs-parser.jay (pointer_type): Add. This begins our implementation
16521         of parsing rules for unsafe code.
16522
16523         (unsafe_statement): Implement.
16524
16525         (embedded_statement): Modify to include the above.
16526
16527         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16528
16529         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16530         if the current context is an unsafe one.
16531
16532         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16533         are handled differently, we need separate rules for them.
16534
16535         (local_variable_declaration): Update to use local_variable_pointer_type
16536         to allow variable declarations of unmanaged pointer types.
16537
16538         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16539         in unsafe contexts.
16540
16541         * ../errors/cs0214.cs : Add.
16542
16543 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16544
16545         * makefile: remove 'response' file when cleaning.
16546
16547 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * cs-parser.jay: Report 1524.
16550
16551 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * typemanager.cs (RegisterMethod): drop checking if we have
16554         registered this from here
16555
16556 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16557
16558         * class.cs (Method.EmitDestructor): Implement calling our base
16559         destructor. 
16560
16561         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16562         value of InFinally.
16563
16564         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16565         this routine and will wrap the call in a try/catch block.  Deal
16566         with the case.
16567
16568 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * ecore.cs (Expression.MemberLookup): instead of taking a
16571         parameter `same_type' that was used to tell whether we could
16572         access private members we compute our containing type from the
16573         EmitContext.
16574
16575         (FieldExpr): Added partial support for volatile fields.  This does
16576         not work for volatile fields exposed from assemblies, as I can not
16577         figure out how to extract the modreq from it.
16578
16579         Updated all the source files to use this.
16580
16581         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16582         because it is referenced by MemberLookup very often. 
16583
16584 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16585
16586         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16587         TypeBuilder.GetCustomAttributes to retrieve what we need.
16588
16589         Get rid of redundant default_member_attr_type as this is the same as
16590         default_member_type which already exists.
16591
16592         * interface.cs, attribute.cs : Update accordingly.
16593
16594 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16597         work for TYpeBuilders though.  Ravi, can you please fix this?
16598
16599         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16600
16601         * expression.cs (Argument.Emit): Handle the case of ref objects
16602         being passed to ref functions;  
16603
16604         (ParameterReference.EmitLoad): Loads the content of the pointer
16605         without dereferencing.
16606
16607 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16608
16609         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16610
16611 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16612
16613         * class.cs (Indexer.DefineMethod): Incorporate the interface
16614         type in the name of the method if we are doing explicit interface
16615         implementation.
16616
16617         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16618
16619         (BetterConversion): Fix extremely trivial bug where we were referring to
16620         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16621         again !
16622
16623         * ../errors/bug16.cs : Add although we have fixed it.
16624
16625 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * expression.cs (BaseIndexer): Begin implementation.
16628
16629         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16630
16631         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16632         production directly to remove a shift/reduce, and implement
16633         explicit interface implementation.
16634
16635         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16636         after a floating point suffix.
16637
16638         * expression.cs (DoNumericPromotions): Improved the conversion for
16639         uint/uint.  If we have a constant, we avoid doing a typecast to a
16640         larger type.
16641
16642         * class.cs (Indexer): Implement explicit interface implementation
16643         for indexers.
16644
16645 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16646
16647         * class.cs: make the default instance constructor public and hidebysig.
16648
16649 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16650
16651         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16652         so we can call it from elsewhere.
16653
16654         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16655         we emit it internally if the class has a defined indexer; otherwise the user
16656         emits it by decorating the class definition with the DefaultMemberAttribute.
16657
16658         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16659         attribute is not used on a type which defines an indexer.
16660
16661         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16662         character when we skip whitespace.
16663
16664         * ../errors/cs0646.cs : Add.
16665
16666 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16667
16668         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16669         again. 
16670
16671         * makefile: Add practical target `mcs3.exe' which builds the third
16672         generation compiler. 
16673
16674         * expression.cs (New): Fix structures constructor calling.
16675
16676         * class.cs (Property, Method, Indexer): Emit Final flag on the
16677         method if we are an interface implementation and we are not
16678         abstract. 
16679
16680         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16681         whether this property is referencing a `base' method.
16682
16683         * expression.cs (Invocation.EmitCall): take an extra argument:
16684         is_base, this is used to determine whether the `call' or
16685         `callvirt' opcode should be used.
16686
16687
16688         * delegate.cs: update EmitCall.
16689
16690         * class.cs (Method.Define): Set NewSlot for the cases where we are
16691         not implementing an interface method.
16692
16693         (Property.Define): ditto.
16694
16695 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16698         'r'.  Allows mcs to parse itself fully.
16699
16700 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16701
16702         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16703         of the number of initializers that require the InitializeArray method.
16704
16705         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16706         update the above field where necessary.
16707
16708         (MakeByteBlob): Update accordingly.
16709
16710         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16711         greater than 2.
16712
16713         (EmitDynamicInitializers): Update in accordance with the new optimization.
16714
16715         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16716         same OpCode applies.
16717
16718         * cs-parser.jay : Fix some glaring errors I introduced.
16719
16720 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16721
16722         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16723         so that we can check for name clashes there too.
16724
16725         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16726         for interface indexers.
16727
16728         * interfaces.cs (Define): Emit the default member attribute.
16729
16730         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16731         variable was being referred to while setting the value ;-)
16732
16733 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16734
16735         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16736         byte-by-byte information when we know the data is zero.
16737
16738         Make the block always a multiple of 4, because
16739         DefineInitializedData has a bug.
16740
16741         * assign.cs: Fix, we should assign from the temporary, not from
16742         the source. 
16743
16744         * expression.cs (MakeByteBlob): Fix my incorrect code.
16745
16746 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * typemanager.cs (EnumToUnderlying): This function is used to get
16749         the underlying type from an enumeration, because it does not
16750         always work. 
16751
16752         * constant.cs: Use the I4_S form for values between -128 and 127.
16753
16754         * statement.cs (Block.LookupLabel): Looks up a label.
16755         (Block): Drop support for labeled blocks.
16756
16757         (LabeledStatement): New kind of statement that represents a label
16758         only.
16759
16760         (Goto): Finally implement this bad boy.
16761
16762         * cs-parser.jay: Update to reflect new mechanism to implement
16763         labels.
16764
16765 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16766
16767         * codegen.cs (EmitContext.This): a codegen property that keeps the
16768         a single instance of this instead of creating many different this
16769         instances. 
16770
16771         * delegate.cs (Delegate.DoResolve): Update to use the property;
16772
16773         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16774
16775         * expression.cs (BaseAccess.DoResolve): Ditto.
16776
16777 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16778
16779         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16780         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16781
16782         (InitCoreTypes): Update accordingly.
16783
16784         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16785         so we can quickly store the state.
16786
16787         (ApplyAttributes): Set the correct implementation flags
16788         for InternalCall methods.
16789
16790 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16791
16792         * expression.cs (EmitCall): if a method is not virtual, then do
16793         not use callvirt on it.
16794
16795         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16796         user defined stuff) requires the use of stobj, which takes an
16797         address on the stack instead of an array and an index.  So emit
16798         the Ldelema operation for it.
16799
16800         (EmitStoreOpcode): Use stobj for valuetypes.
16801
16802         (UnaryMutator.EmitCode): Use the right 1 value depending on
16803         whether we are dealing with int64/uint64, float or doubles.
16804
16805         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16806         constructors that I implemented last night.
16807
16808         (Constructor.IsDefault): Fix to work properly for static
16809         constructors.
16810
16811         * cs-parser.jay (CheckDef): report method signature errors.
16812         Update error number 103 to be 132.
16813
16814         * decl.cs: New AdditionResult enumeration value: MethodExists.
16815         Although we do this check for methods later on in the semantic
16816         analysis, catching repeated default constructors is so easy that
16817         we catch these here. 
16818
16819         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16820         promotions code.
16821
16822         (ParameterReference.EmitAssign, Emit): handle
16823         bools as bytes.
16824
16825         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16826         (ArrayAccess.EmitStoreOpcode): ditto.
16827
16828         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16829
16830         * expression.cs (MakeByteBlob): Complete all the missing types
16831         (uint, short, ushort, byte, sbyte)
16832
16833         * class.cs: Only init instance field initializers on instance
16834         constructors. 
16835
16836         Rename `constructors' to instance_constructors. 
16837
16838         (TypeContainer.AddConstructor): Only add constructors to the list
16839         if it is not static.
16840
16841         Make sure that we handle default_static_constructor independently
16842         everywhere where we handle instance_constructors
16843
16844 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * class.cs: Do not lookup or create a base initializer for a
16847         static constructor.
16848
16849         (ConstructorInitializer.Resolve): use the proper type to lookup
16850         for constructors.
16851
16852         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16853
16854         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16855         in DeclSpace. 
16856
16857         * decl.cs: CloseType is now an virtual method, the default
16858         implementation just closes this type.
16859
16860 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16861
16862         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16863         to PreserveSig by default. Also emit HideBySig on such methods.
16864
16865         Basically, set the defaults to standard values.
16866
16867         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16868         argument, if candidate is better, it can't be worse than the best !
16869
16870         (Invocation): Re-write bits to differentiate between methods being
16871         applicable in their expanded form and their normal form - for params
16872         methods of course.
16873
16874         Get rid of use_standard everywhere as only standard conversions are allowed
16875         in overload resolution. 
16876
16877         More spec conformance.
16878
16879 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16880
16881         * driver.cs: Add --timestamp, to see where the compiler spends
16882         most of its time.
16883
16884         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16885         `this' in static code.
16886
16887         (SimpleName.DoResolve): Implement in terms of a helper function
16888         that allows static-references to be passed upstream to
16889         MemberAccess.
16890
16891         (Expression.ResolveWithSimpleName): Resolve specially simple
16892         names when called by MemberAccess to implement the special
16893         semantics. 
16894
16895         (Expression.ImplicitReferenceConversion): Handle conversions from
16896         Null to reference types before others, as Null's type is
16897         System.Object. 
16898
16899         * expression.cs (Invocation.EmitCall): Handle the special case of
16900         calling methods declared on a reference type from a ValueType
16901         (Base classes System.Object and System.Enum)
16902
16903         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16904         the left hand side is a TypeExpr, not on every enumeration. 
16905
16906         (Binary.Resolve): If types are reference types, then do a cast to
16907         object on operators != and == of both arguments.
16908
16909         * typemanager.cs (FindMembers): Extract instance and static
16910         members if requested.
16911
16912         * interface.cs (PopulateProperty): Use void_type instead of null
16913         as the return type for the setter method.
16914
16915         (PopulateIndexer): ditto.
16916
16917 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16918
16919         * support.cs (ReflectionParameters): Fix minor bug where we
16920         were examining the wrong parameter for the ParamArray attribute.
16921
16922         Cope with requests for the type of the parameter at position
16923         greater than the params parameter's. We now return the element
16924         type of the params array as that makes more sense.
16925
16926         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16927         accordingly as we no longer have to extract the element type
16928         ourselves.
16929
16930         (Invocation.OverloadResolve): Update.
16931
16932 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16933
16934         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16935         against IEnumerator, test whether the return value is a descendant
16936         of the IEnumerator interface.
16937
16938         * class.cs (Indexer.Define): Use an auxiliary method to implement
16939         the other bits of the method definition.  Begin support for
16940         explicit interface implementation.
16941
16942         (Property.DefineMethod): Use TypeManager.void_type instead of null
16943         for an empty return value.
16944
16945 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16948         dealing with a FieldExpr which is composed of a FieldBuilder, in
16949         the code path we did extract the constant, but we should have
16950         obtained the underlying value to be able to cast it (otherwise we
16951         end up in an infinite loop, this is what Ravi was running into).
16952
16953         (ArrayCreation.UpdateIndices): Arrays might be empty.
16954
16955         (MemberAccess.ResolveMemberAccess): Add support for section
16956         14.5.4.1 that deals with the special case of E.I when E is a type
16957         and something else, that I can be a reference to a static member.
16958
16959         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16960         handle a particular array type to create byte blobs, it is just
16961         something we dont generate byteblobs for.
16962
16963         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16964         arguments. 
16965
16966         * location.cs (Push): remove the key from the hashtable that we
16967         are about to add.   This happens for empty files.
16968
16969         * driver.cs: Dispose files after we have parsed them.
16970
16971         (tokenize): new function that only runs the tokenizer on its
16972         input, for speed testing.
16973
16974 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16975
16976         * class.cs (Event.Define): Define the private field only if there
16977         are no accessors defined.
16978
16979         * expression.cs (ResolveMemberAccess): If there is no associated
16980         field with the event, that means we have an event defined with its
16981         own accessors and we should flag error cs0070 since transforming
16982         ourselves into a field is not valid in that case.
16983
16984         * ecore.cs (SimpleName.DoResolve): Same as above.
16985
16986         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16987         and charset to sane values.
16988
16989 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16990
16991         * assign.cs (DoResolve): Perform check on events only if they 
16992         are being accessed outside the declaring type.
16993
16994         * cs-parser.jay (event_declarations): Update rules to correctly
16995         set the type of the implicit parameter etc.
16996
16997         (add_accessor, remove_accessor): Set current local parameters.
16998
16999         * expression.cs (Binary): For delegate addition and subtraction,
17000         cast the return value from the method into the appropriate delegate
17001         type.
17002
17003 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17004
17005         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17006         of these as the workaround is unnecessary.
17007
17008         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17009         delegate data - none of that is needed at all.
17010
17011         Re-write bits to extract the instance expression and the delegate method
17012         correctly.
17013
17014         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17015         on delegates too.
17016
17017         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17018         of attaching attributes instead of duplicating code everywhere.
17019
17020         * everywhere : Update code to do attribute emission using the above method.
17021
17022 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17023
17024         * expression.cs (IsParamsMethodApplicable): if there are not
17025         parameters, return immediately.
17026
17027         * ecore.cs: The 0 literal can be implicity converted to an enum
17028         type. 
17029
17030         (SimpleName.DoResolve): First lookup the type, then lookup the
17031         members. 
17032
17033         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17034         want to get its address.  If the InstanceExpression is not
17035         addressable, store the result in a temporary variable, then get
17036         the address of it.
17037
17038         * codegen.cs: Only display 219 errors on warning level or above. 
17039
17040         * expression.cs (ArrayAccess): Make it implement the
17041         IMemoryLocation interface.
17042
17043         (Binary.DoResolve): handle the operator == (object a, object b)
17044         and operator != (object a, object b) without incurring into a
17045         BoxedCast (because 5 != o should never be performed).
17046
17047         Handle binary enumerator operators.
17048
17049         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17050         value type, otherwise use Ldelem_ref.
17051
17052         Use precomputed names;
17053
17054         (AddressOf): Implement address of
17055
17056         * cs-parser.jay (labeled_statement): Fix recursive block
17057         addition by reworking the production.
17058
17059         * expression.cs (New.DoEmit): New has a special case:
17060                 
17061                  If we are dealing with a ValueType, we have a few
17062                  situations to deal with:
17063                 
17064                     * The target of New is a ValueType variable, that is
17065                       easy, we just pass this as the variable reference
17066                 
17067                     * The target of New is being passed as an argument,
17068                       to a boxing operation or a function that takes a
17069                       ValueType.
17070                 
17071                       In this case, we need to create a temporary variable
17072                       that is the argument of New.
17073
17074
17075 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17076
17077         * rootcontext.cs (LookupType): Check that current_type is not null before
17078         going about looking at nested types.
17079
17080         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17081         not implement the IAssignMethod interface any more.
17082
17083         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17084         where we tranform them into FieldExprs if they are being resolved from within
17085         the declaring type.
17086
17087         * ecore.cs (SimpleName.DoResolve): Do the same here.
17088
17089         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17090
17091         * ../errors/bug10.cs : Add.
17092
17093         * ../errors/cs0070.cs : Add.
17094
17095         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17096
17097         * assign.cs : Get rid of EventIsLocal everywhere.
17098
17099 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * ecore.cs (ConvertIntLiteral): finished the implementation.
17102
17103         * statement.cs (SwitchLabel): Convert the value we are using as a
17104         key before looking up the table.
17105
17106 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17107
17108         * codegen.cs (EmitTopBlock): Require a Location argument now.
17109
17110         * cs-parser.jay (constructor_declarator): We need to setup
17111         current_local_parameters before we parse the
17112         opt_constructor_initializer, to allow the variables to be bound
17113         to the constructor arguments.
17114
17115         * rootcontext.cs (LookupType): First lookup nested classes in our
17116         class and our parents before we go looking outside our class.
17117
17118         * expression.cs (ConstantFold): Extract/debox the values at the
17119         beginnning. 
17120
17121         * rootcontext.cs (EmitCode): Resolve the constants first before we
17122         resolve the types.  This is not really needed, but it helps debugging.
17123
17124         * statement.cs: report location.
17125
17126         * cs-parser.jay: pass location to throw statement.
17127
17128         * driver.cs: Small bug fix.
17129
17130         * report.cs: Updated format to be 4-zero filled digits.
17131
17132 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17133
17134         * expression.cs (CheckIndices): Fix minor bug where the wrong
17135         variable was being referred to ;-)
17136
17137         (DoEmit): Do not call EmitStaticInitializers when the 
17138         underlying type is System.Object.
17139
17140 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17141
17142         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17143         and do the usual workaround for SRE.
17144
17145         * class.cs (MyEventBuilder.EventType): New member to get at the type
17146         of the event, quickly.
17147
17148         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17149
17150         * assign.cs (Assign.DoResolve): Handle the case when the target
17151         is an EventExpr and perform the necessary checks.
17152
17153         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17154         interface.
17155
17156         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17157
17158         (EventExpr): Set the type in the constructor itself since we 
17159         are meant to be born fully resolved.
17160
17161         (EventExpr.Define): Revert code I wrote earlier.
17162                 
17163         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17164         instance expression is null. The instance expression is a This in that case
17165         or a null, depending on whether it is a static method or not.
17166
17167         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17168         refers to more than one method.
17169
17170         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17171         and accordingly flag errors.
17172
17173 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17174
17175         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17176
17177 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17178
17179         * location.cs (ToString): Provide useful rutine.
17180
17181 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17184         objects, return the actual integral boxed.
17185
17186         * statement.cs (SwitchLabel): define an ILLabel for each
17187         SwitchLabel. 
17188
17189         (Switch.CheckSwitch): If the value is a Literal, extract
17190         the underlying literal.
17191
17192         Also in the unused hashtable we had, add the SwitchLabel so we can
17193         quickly look this value up.
17194
17195         * constant.cs: Implement a bunch of new constants.  Rewrite
17196         Literal based on this.  Made changes everywhere to adapt to this.
17197
17198         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17199         dereferencing array only once, and also copes with enumrations.
17200
17201         bytes are two bytes wide, not one.
17202
17203         (Cast): Perform constant conversions.
17204
17205         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17206         wrappers to the literals here.
17207
17208         * expression.cs (DoNumericPromotions): long literals can converted
17209         to ulong implicity (this is taken care of elsewhere, but I was
17210         missing this spot).
17211
17212         * ecore.cs (Expression.Literalize): Make the return type Literal,
17213         to improve type checking.
17214
17215         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17216
17217 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17218
17219         * literal.cs: Revert code from ravi that checked the bounds.  The
17220         bounds are sane by the definition of the type itself. 
17221
17222         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17223         need to actually look up in our parent hierarchy for interfaces
17224         implemented. 
17225
17226         * const.cs: Use the underlying type for enumerations
17227
17228         * delegate.cs: Compute the basename for the delegate creation,
17229         that should fix the delegate test case, and restore the correct
17230         Type Lookup semantics in rootcontext
17231
17232         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17233         referencing a nested type with the Reflection API is using the "+"
17234         sign. 
17235
17236         * cs-parser.jay: Do not require EOF token at the end.
17237
17238 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17239
17240         * rootcontext.cs (LookupType): Concatenate type names with
17241         a '.' instead of a '+' The test suite passes again.
17242
17243         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17244         field of the enumeration.
17245
17246         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17247         the case when the member is an EventExpr.
17248
17249         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17250         static has an associated instance expression.
17251
17252         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17253
17254         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17255
17256         * class.cs (Event.Define): Register event and perform appropriate checks
17257         for error #111.
17258
17259         We define the Add and Remove methods even if the use provides none because
17260         in that case, we provide default implementations ourselves.
17261
17262         Define a private field of the type of the event. This is done by the CSC compiler
17263         and we should be doing it too ;-)
17264
17265         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17266         More methods we use in code we generate.
17267
17268         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17269         is important.
17270
17271         (InitCoreTypes): Update accordingly for the above.
17272
17273         * class.cs (Event.Emit): Generate code for default accessors that we provide
17274
17275         (EmitDefaultMethod): Do the job in the above.
17276
17277         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17278         appropriate place.
17279
17280 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17283         builders even if we were missing one.
17284
17285         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17286         pass the Basename as our class name instead of the Name.  The
17287         basename will be correctly composed for us.
17288
17289         * parameter.cs (Paramters): Now takes a Location argument.
17290
17291         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17292         make all the code call directly LookupType in RootContext and take
17293         this chance to pass the Location information everywhere.
17294
17295         * Everywhere: pass Location information.
17296
17297 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * class.cs (Constructor.Define): Updated way of detecting the
17300         length of the parameters.
17301
17302         (TypeContainer.DefineType): Use basename as the type name for
17303         nested types.
17304
17305         (TypeContainer.Define): Do not recursively define types here, as
17306         definition is taken care in order by the RootContext.
17307
17308         * tree.cs: Keep track of namespaces in a per-file basis.
17309
17310         * parameter.cs (Parameter.ComputeSignature): Update to use
17311         DeclSpace. 
17312
17313         (Parameters.GetSignature): ditto.
17314
17315         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17316         instead of a TypeContainer.
17317
17318         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17319         resolve names.  Because we need to be resolve in our context, not
17320         our parents.
17321
17322         * driver.cs: Implement response files.
17323
17324         * class.cs (TypeContainer.DefineType): If we are defined, do not
17325         redefine ourselves.
17326
17327         (Event.Emit): Emit the code for add/remove handlers.
17328         (Event.Define): Save the MethodBuilders for add/remove.
17329
17330         * typemanager.cs: Use pair here too.
17331
17332         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17333         DictionaryEntry requires the first argument to be non-null.  
17334
17335         (enum_declaration): Compute full name for registering the
17336         enumeration.
17337
17338         (delegate_declaration): Instead of using
17339         formal_parameter_list, use opt_formal_parameter_list as the list
17340         can be empty.
17341
17342         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17343         (EventParsing): New property that controls whether `add' and
17344         `remove' are returned as tokens or identifiers (for events);
17345
17346 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17347
17348         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17349         use MyEventBuilder only and let it wrap the real builder for us.
17350
17351         (MyEventBuilder): Revamp constructor etc.
17352
17353         Implement all operations that we perform on EventBuilder in precisely the same
17354         way here too.
17355
17356         (FindMembers): Update to use the EventBuilder member.
17357
17358         (Event.Emit): Update accordingly.
17359
17360 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17361
17362         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17363         by calling the appropriate methods.
17364
17365         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17366         useful.
17367
17368         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17369
17370 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17371
17372         * delegate.cs (Delegate.Populate): Check that the return type
17373         and various parameters types are indeed accessible.
17374
17375         * class.cs (Constructor.Define): Same here.
17376
17377         (Field.Define): Ditto.
17378
17379         (Event.Define): Ditto.
17380
17381         (Operator.Define): Check that the underlying Method defined itself
17382         correctly - so it's MethodBuilder should not be null.
17383
17384         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17385         expression happens to be null.
17386
17387         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17388         members but as of now we don't seem to be able to do anything really useful with it.
17389
17390         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17391         not the EventBuilder.
17392
17393 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * cs-tokenizer.cs: Add support for defines.
17396         Add support for #if, #elif, #else, #endif
17397
17398         (eval_var): evaluates a variable.
17399         (eval): stubbed for evaluating functions.
17400
17401         * cs-parser.jay: Pass the defines information
17402
17403         * driver.cs: Add --define command line option.
17404
17405         * decl.cs: Move MemberCore here.
17406
17407         Make it the base class for DeclSpace.  This allows us to catch and
17408         report 108 and 109 for everything now.
17409
17410         * class.cs (TypeContainer.Define): Extract all the members
17411         before populating and emit the warning 108 (new keyword required
17412         to override) instead of having each member implement this.
17413
17414         (MemberCore.Define): New abstract method, we will be using this in
17415         the warning reporting engine in Populate.
17416
17417         (Operator.Define): Adjust to new MemberCore protocol. 
17418
17419         * const.cs (Const): This does not derive from Expression, it is a
17420         temporary object we use to create fields, it is a MemberCore. 
17421
17422         * class.cs (Method.Define): Allow the entry point to be in a
17423         specific class.
17424
17425         * driver.cs: Rewrite the argument handler to clean it up a bit.
17426
17427         * rootcontext.cs: Made it just an auxiliary namespace feature by
17428         making everything static.
17429
17430         * driver.cs: Adapt code to use RootContext type name instead of
17431         instance variable.
17432
17433         * delegate.cs: Remove RootContext argument.
17434
17435         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17436         argument. 
17437
17438         * class.cs (Event.Define): The lookup can fail.
17439
17440         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17441
17442         * expression.cs: Resolve the this instance before invoking the code.
17443
17444 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * cs-parser.jay: Add a production in element_access that allows
17447         the thing to become a "type" reference.  This way we can parse
17448         things like "(string [])" as a type.
17449
17450         Note that this still does not handle the more complex rules of
17451         casts. 
17452
17453
17454         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17455
17456         * ecore.cs: (CopyNewMethods): new utility function used to
17457         assemble the list of methods from running FindMembers.
17458
17459         (MemberLookup): Rework FindMembers so that 
17460
17461 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17462
17463         * class.cs (TypeContainer): Remove Delegates who fail to be
17464         defined.
17465
17466         * delegate.cs (Populate): Verify that we dont get null return
17467         values.   TODO: Check for AsAccessible.
17468
17469         * cs-parser.jay: Use basename to emit error 574 (destructor should
17470         have the same name as container class), not the full name.
17471
17472         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17473         possible representation.  
17474
17475         Also implements integer type suffixes U and L.
17476
17477 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17478
17479         * expression.cs (ArrayCreation.DoResolve): We need to do the
17480         argument resolution *always*.
17481
17482         * decl.cs: Make this hold the namespace.  Hold the root context as
17483         well.
17484         (LookupType): Move here.
17485
17486         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17487
17488         * location.cs (Row, Name): Fixed the code, it was always returning
17489         references to the first file.
17490
17491         * interface.cs: Register properties defined through interfaces.
17492
17493         * driver.cs: Add support for globbing on the command line
17494
17495         * class.cs (Field): Make it derive from MemberCore as well.
17496         (Event): ditto.
17497
17498 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17499
17500         * class.cs (Event::Define): Check that the type of the event is a delegate
17501         type else flag error #66.
17502
17503         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17504         same.
17505
17506         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17507         values of EntryPoint, CharSet etc etc.
17508
17509         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17510
17511         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17512         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17513         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17514         which needs this to do its work.
17515
17516         * ../errors/cs0066.cs : Add.
17517
17518 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17521         helper functions.
17522
17523         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17524         clears out the parameters field.
17525         (MemberSignatureCompare): Cleanup
17526
17527         (MemberCore): New base class used to share code between MethodCore
17528         and Property.
17529
17530         (RegisterRequiredImplementations) BindingFlags.Public requires
17531         either BindingFlags.Instace or Static.  Use instance here.
17532
17533         (Property): Refactored code to cope better with the full spec.
17534
17535         * parameter.cs (GetParameterInfo): Return an empty array instead
17536         of null on error.
17537
17538         * class.cs (Property): Abstract or extern properties have no bodies.
17539
17540         * parameter.cs (GetParameterInfo): return a zero-sized array.
17541
17542         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17543         method modifier validation to the typecontainer so we can reuse
17544         this on properties.
17545
17546         (MethodCore.ParameterTypes): return an empty sized array of types.
17547
17548         (Property.Define): Test property modifier validity.
17549
17550         Add tests for sealed/override too.
17551
17552         (Method.Emit): abstract or extern methods have no bodies.
17553
17554 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17555
17556         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17557         thing.
17558
17559         (Method::Define, ::Emit): Modify accordingly.
17560
17561         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17562
17563         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17564
17565         * makefile: Pass in /unsafe.
17566
17567 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17568
17569         * class.cs (MakeKey): Kill routine.
17570
17571         * class.cs (TypeContainer.Define): Correctly define explicit
17572         method implementations (they require the full interface name plus
17573         the method name).
17574
17575         * typemanager.cs: Deply the PtrHashtable here and stop using the
17576         lame keys.  Things work so much better.
17577
17578         This of course broke everyone who depended on `RegisterMethod' to
17579         do the `test for existance' test.  This has to be done elsewhere.
17580
17581         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17582         the object stupid Equals method (because, that like fails all over
17583         the place).  We still do not use it.
17584
17585         * class.cs (TypeContainer.SetRequiredInterface,
17586         TypeContainer.RequireMethods): Killed these two routines and moved
17587         all the functionality to RegisterRequiredImplementations.
17588
17589         (TypeContainer.RegisterRequiredImplementations): This routine now
17590         registers all the implementations required in an array for the
17591         interfaces and abstract methods.  We use an array of structures
17592         which can be computed ahead of time to reduce memory usage and we
17593         also assume that lookups are cheap as most classes will not
17594         implement too many interfaces.
17595
17596         We also avoid creating too many MethodSignatures.
17597
17598         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17599         clear the "pending" bit if we find that there are problems with
17600         the declaration.
17601
17602         (TypeContainer.VerifyPendingMethods): Update to report errors of
17603         methods that look like implementations but are not.
17604
17605         (TypeContainer.Define): Add support for explicit interface method
17606         implementation. 
17607
17608 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17609
17610         * typemanager.cs: Keep track of the parameters here instead of
17611         being a feature of the TypeContainer.
17612
17613         * class.cs: Drop the registration of parameters here, as
17614         InterfaceMethods are also interface declarations.
17615
17616         * delegate.cs: Register methods with the TypeManager not only with
17617         the TypeContainer.  This code was buggy.
17618
17619         * interface.cs: Full registation here.
17620
17621 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17622
17623         * expression.cs: Remove reducer for binary expressions, it can not
17624         be done this way.
17625
17626         * const.cs: Put here the code that used to go into constant.cs
17627
17628         * constant.cs: Put here the code for constants, this is a new base
17629         class for Literals.
17630
17631         * literal.cs: Make Literal derive from Constant.
17632
17633 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17634
17635         * statement.cs (Return.Emit): Report error 157 if the user
17636         attempts to return from a finally block.
17637
17638         (Return.Emit): Instead of emitting a return, jump to the end of
17639         the function.
17640
17641         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17642         LocalBuilder to store the result of the function.  ReturnLabel is
17643         the target where we jump.
17644
17645
17646 2001-12-09  Radek Doulik  <rodo@ximian.com>
17647
17648         * cs-parser.jay: remember alias in current namespace
17649
17650         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17651         namespaces
17652
17653         * class.cs (LookupAlias): lookup alias in my_namespace
17654
17655         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17656         aliases hashtable
17657         (LookupAlias): lookup alias in this and if needed in parent
17658         namespaces
17659
17660 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17661
17662         * support.cs: 
17663
17664         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17665         making things static.  I need this to avoid passing the
17666         TypeContainer when calling ParameterType.
17667
17668         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17669         that did string manipulation to compute the type and then call
17670         GetType.  Use Parameter.ParameterType instead.
17671
17672         * cs-tokenizer.cs: Consume the suffix for floating values.
17673
17674         * expression.cs (ParameterReference): figure out whether this is a
17675         reference parameter or not.  Kill an extra variable by computing
17676         the arg_idx during emission.
17677
17678         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17679         function that returns whether a parameter is an out/ref value or not.
17680
17681         (Parameter.ParameterType): The type of the parameter (base,
17682         without ref/out applied).
17683
17684         (Parameter.Resolve): Perform resolution here.
17685         (Parameter.ExternalType): The full type (with ref/out applied).
17686
17687         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17688         support for expressions on the using statement.
17689
17690 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17691
17692         * statement.cs (Using.EmitLocalVariableDecls): Split the
17693         localvariable handling of the using statement.
17694
17695         (Block.EmitMeta): Keep track of variable count across blocks.  We
17696         were reusing slots on separate branches of blocks.
17697
17698         (Try.Emit): Emit the general code block, we were not emitting it. 
17699
17700         Check the type of the declaration to be an IDisposable or
17701         something that can be implicity converted to it. 
17702
17703         Emit conversions if required.
17704
17705         * ecore.cs (EmptyExpression): New utility class.
17706         (Expression.ImplicitConversionExists): New utility function.
17707
17708 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * statement.cs (Using): Implement.
17711
17712         * expression.cs (LocalVariableReference): Support read only variables.
17713
17714         * statement.cs: Remove the explicit emit for the Leave opcode.
17715         (VariableInfo): Add a readonly field.
17716
17717 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17718
17719         * ecore.cs (ConvCast): new class used to encapsulate the various
17720         explicit integer conversions that works in both checked and
17721         unchecked contexts.
17722
17723         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17724         properly generate the overflow opcodes.
17725
17726 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * statement.cs: The correct type for the EmptyExpression is the
17729         element_type, not the variable type.  Ravi pointed this out.
17730
17731 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17732
17733         * class.cs (Method::Define): Handle PInvoke methods specially
17734         by using DefinePInvokeMethod instead of the usual one.
17735
17736         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17737         above to do the task of extracting information and defining the method.
17738
17739 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17740
17741         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17742         of the condition for string type.
17743
17744         (Emit): Move that here. 
17745
17746         (ArrayCreation::CheckIndices): Keep string literals in their expression
17747         form.
17748
17749         (EmitDynamicInitializers): Handle strings appropriately.
17750
17751 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17752
17753         * codegen.cs (EmitContext): Replace multiple variables with a
17754         single pointer to the current Switch statement.
17755
17756         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17757         EmitContext.
17758
17759 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17760
17761         * statement.cs 
17762
17763         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17764         default'.
17765
17766         (Foreach.Emit): Foreach on arrays was not setting
17767         up the loop variables (for break/continue).
17768
17769         (GotoCase): Semi-implented.
17770
17771 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17772
17773         * attribute.cs (CheckAttribute): Handle system attributes by using
17774         Attribute.GetAttributes to examine information we need.
17775
17776         (GetValidPlaces): Same here.
17777
17778         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17779
17780         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17781
17782         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17783
17784         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17785
17786         (Method::Emit): Handle the case when we are a PInvoke method.
17787
17788 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * expression.cs: Use ResolveWithSimpleName on compound names.
17791
17792 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17793
17794         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17795         before trying to reduce it.
17796
17797         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17798
17799         * constant.cs (LookupConstantValue): Implement.
17800
17801         (EmitConstant): Use the above in emitting the constant.
17802
17803         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17804         that are user-defined by doing a LookupConstantValue on them.
17805
17806         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17807         too, like above.
17808
17809 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17812
17813         (BaseAccess.DoResolve): Implement.
17814
17815         (MemberAccess.DoResolve): Split this routine into a
17816         ResolveMemberAccess routine that can be used independently
17817
17818 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17819
17820         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17821         As that share bits of the implementation.  Is returns a boolean,
17822         while As returns the Type that is being probed.
17823
17824 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17825
17826         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17827         instead of a Literal - much easier.
17828
17829         (EnumInTransit): Remove - utterly useless :-)
17830
17831         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17832
17833         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17834
17835         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17836         chain when we have no associated expression.
17837
17838 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17839
17840         * constant.cs (Define): Use Location while reporting the errror.
17841
17842         Also emit a warning when 'new' is used and there is no inherited
17843         member to hide.
17844
17845         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17846         populated.
17847
17848         (LookupEnumValue): Implement to lookup an enum member's value and define it
17849         if necessary.
17850
17851         (Populate): Re-write accordingly to use the above routine.
17852
17853 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17854
17855         * expression.cs (This): Fix prototype for DoResolveLValue to
17856         override the base class DoResolveLValue.
17857
17858         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17859         declarations) 
17860
17861         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17862         (we need to load the address of the field here).  This fixes
17863         test-22. 
17864
17865         (FieldExpr.DoResolveLValue): Call the DoResolve
17866         function to initialize the Instance expression.
17867
17868         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17869         correctly the GetEnumerator operation on a value type.
17870
17871         * cs-parser.jay: Add more simple parsing error catches.
17872
17873         * statement.cs (Switch): Add support for string switches.
17874         Handle null specially.
17875
17876         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17877
17878 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17879
17880         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17881
17882         (declare_local_constant): New helper function.
17883
17884         * statement.cs (AddConstant): Keep a separate record of constants
17885
17886         (IsConstant): Implement to determine if a variable is a constant.
17887
17888         (GetConstantExpression): Implement.
17889
17890         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17891
17892         * statement.cs (IsVariableDefined): Re-write.
17893
17894 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17895
17896         * class.cs (TypeContainer::FindMembers): Look for constants
17897         in the case when we are looking for MemberTypes.Field
17898
17899         * expression.cs (MemberAccess::DoResolve): Check that in the
17900         case we are a FieldExpr and a Literal, we are not being accessed
17901         by an instance reference.
17902
17903         * cs-parser.jay (local_constant_declaration): Implement.
17904
17905         (declaration_statement): Implement for constant declarations.
17906
17907 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * statement.cs (Switch): Catch double defaults.
17910
17911         (Switch): More work on the switch() statement
17912         implementation.  It works for integral values now, need to finish
17913         string support.
17914
17915
17916 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17917
17918         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17919         integer literals into other integer literals.  To be used by
17920         switch. 
17921
17922 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17923
17924         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17925         some memory.
17926
17927         (EmitDynamicInitializers): Cope with the above since we extract data
17928         directly from ArrayData now.
17929
17930         (ExpectInitializers): Keep track of whether initializers are mandatory
17931         or not.
17932
17933         (Bounds): Make it a hashtable to prevent the same dimension being 
17934         recorded for every element in that dimension.
17935
17936         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17937         from being found.
17938
17939         Also fix bug which was causing the indices to be emitted in the reverse
17940         order.
17941
17942 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17943
17944         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17945         unfinished.  They do not work, because the underlying code is
17946         sloppy.
17947
17948 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17949
17950         * cs-parser.jay: Remove bogus fixme.
17951
17952         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17953         on Switch statement.
17954
17955 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17956
17957         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17958         the same. 
17959
17960         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17961         parameter. Apparently, any expression is allowed. 
17962
17963         (ValidateInitializers): Update accordingly.
17964
17965         (CheckIndices): Fix some tricky bugs thanks to recursion.
17966
17967         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17968         I was being completely brain-dead.
17969
17970         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17971         and re-write acordingly.
17972
17973         (DelegateInvocation): Re-write accordingly.
17974
17975         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17976
17977         (MakeByteBlob): Handle types more correctly.
17978
17979         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17980         initialization from expressions but it is incomplete because I am a complete
17981         Dodo :-|
17982
17983 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17984
17985         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17986         on If.  Basically, we have to return `true' (ie, we do return to
17987         our caller) only if both branches of the if return.
17988
17989         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17990         short-circuit operators, handle them as short circuit operators. 
17991
17992         (Cast.DoResolve): Resolve type.
17993         (Cast.Cast): Take an expression as the target type.
17994
17995         * cs-parser.jay (cast_expression): Remove old hack that only
17996         allowed a limited set of types to be handled.  Now we take a
17997         unary_expression and we resolve to a type during semantic
17998         analysis.
17999
18000         Use the grammar productions from Rhys to handle casts (this is
18001         not complete like Rhys syntax yet, we fail to handle that corner
18002         case that C# has regarding (-x), but we will get there.
18003
18004 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18005
18006         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18007         field which is an array type.
18008
18009         * cs-parser.jay (declare_local_variables): Support array initialization too.
18010
18011         * typemanager.cs (MakeKey): Implement.
18012
18013         (everywhere): Use the above appropriately.
18014
18015         * cs-parser.jay (for_statement): Update for array initialization while
18016         declaring variables.
18017
18018         * ecore.cs : The error message was correct, it's the variable's names that
18019         were misleading ;-) Make the code more readable.
18020
18021         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18022         the correct type etc.
18023
18024         (ConvertExplicit): Handle Enum types by examining the underlying type.
18025
18026 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18027
18028         * parameter.cs (GetCallingConvention): Always return
18029         CallingConventions.Standard for now.
18030
18031 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18034         and `r' after calling DoNumericPromotions.
18035
18036         * ecore.cs: Fix error message (the types were in the wrong order).
18037
18038         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18039         BindingFlags.Instance as well 
18040
18041         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18042         implicit int literal conversion in an empty cast so that we
18043         propagate the right type upstream.
18044
18045         (UnboxCast): new class used to unbox value types.
18046         (Expression.ConvertExplicit): Add explicit type conversions done
18047         by unboxing.
18048
18049         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18050         the target type before applying the implicit LongLiterals to ULong
18051         literal cast.
18052
18053 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18054
18055         * cs-parser.jay (for_statement): Reworked the way For works: now
18056         we declare manually any variables that are introduced in
18057         for_initializer to solve the problem of having out-of-band code
18058         emition (that is what got for broken).
18059
18060         (declaration_statement): Perform the actual variable declaration
18061         that used to be done in local_variable_declaration here.
18062
18063         (local_variable_declaration): Do not declare anything, just pass
18064         the information on a DictionaryEntry
18065
18066 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18067
18068         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18069         re-write of the logic to now make it recursive.
18070
18071         (UpdateIndices): Re-write accordingly.
18072
18073         Store element data in a separate ArrayData list in the above methods.
18074
18075         (MakeByteBlob): Implement to dump the array data into a byte array.
18076
18077 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18078
18079         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18080         into CheckIndices.
18081
18082         * constant.cs (Define): Implement.
18083
18084         (EmitConstant): Re-write fully.
18085
18086         Pass in location info.
18087
18088         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18089         respectively.
18090
18091         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18092         DictionaryEntry since we need location info too.
18093
18094         (constant_declaration): Update accordingly.
18095
18096         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18097         code into another method : UpdateIndices.
18098
18099 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18100
18101         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18102         some type checking etc.
18103
18104 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18105
18106         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18107         bits to provide dimension info if the user skips doing that.
18108
18109         Update second constructor to store the rank correctly.
18110
18111 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18112
18113         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18114         and try to implement.
18115
18116         * ../errors/cs0150.cs : Add.
18117
18118         * ../errors/cs0178.cs : Add.
18119
18120 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18121
18122         * statement.cs: Implement foreach on multi-dimensional arrays. 
18123
18124         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18125         name of the params argument.
18126
18127         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18128         initializing the array.
18129
18130         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18131         we can use this elsewhere.
18132
18133         * statement.cs: Finish implementation of foreach for single
18134         dimension arrays.
18135
18136         * cs-parser.jay: Use an out-of-band stack to pass information
18137         around, I wonder why I need this.
18138
18139         foreach_block: Make the new foreach_block the current_block.
18140
18141         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18142         function used to return a static Parameters structure.  Used for
18143         empty parameters, as those are created very frequently.
18144
18145         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18146
18147 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18148
18149         * interface.cs : Default modifier is private, not public. The
18150         make verify test passes again.
18151
18152 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18153
18154         * support.cs (ReflectionParameters): Fix logic to determine
18155         whether the last parameter is a params one. Test 9 passes again.
18156
18157         * delegate.cs (Populate): Register the builders we define with
18158         RegisterParameterForBuilder. Test 19 passes again.
18159
18160         * cs-parser.jay (property_declaration): Reference $6 instead
18161         of $$ to get at the location.
18162
18163         (indexer_declaration): Similar stuff.
18164
18165         (attribute): Ditto.
18166
18167         * class.cs (Property): Register parameters for the Get and Set methods
18168         if they exist. Test 23 passes again.
18169
18170         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18171         call to EmitArguments as we are sure there aren't any params arguments. 
18172         Test 32 passes again.
18173
18174         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18175         IndexOutOfRangeException. 
18176
18177         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18178         Test 33 now passes again.
18179
18180 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18181
18182         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18183         broke a bunch of things.  Will have to come up with a better way
18184         of tracking locations.
18185
18186         * statement.cs: Implemented foreach for single dimension arrays.
18187
18188 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18191         an error.  This removes the lookup from the critical path.
18192
18193         * cs-parser.jay: Removed use of temporary_loc, which is completely
18194         broken. 
18195
18196 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18197
18198         * support.cs (ReflectionParameters.ParameterModifier): Report
18199         whether the argument is a PARAMS argument or not.
18200
18201         * class.cs: Set the attribute `ParamArrayAttribute' on the
18202         parameter argument.
18203
18204         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18205         and cons_param_array_attribute (ConstructorInfo for
18206         ParamArrayAttribute)., 
18207
18208         * codegen.cs: Emit the return using the `Return' statement, that
18209         way we can report the error correctly for missing return values. 
18210
18211         * class.cs (Method.Emit): Clean up.
18212
18213         * expression.cs (Argument.Resolve): Take another argument: the
18214         location where this argument is used.  Notice that this is not
18215         part of the "Argument" class as to reduce the size of the
18216         structure (we know the approximate location anyways).
18217
18218         Test if the argument is a variable-reference, if not, then
18219         complain with a 206.
18220
18221         (Argument.Emit): Emit addresses of variables.
18222
18223         (Argument.FullDesc): Simplify.
18224
18225         (Invocation.DoResolve): Update for Argument.Resolve.
18226
18227         (ElementAccess.DoResolve): ditto.
18228
18229         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18230         method should be virtual, as this method is always virtual.
18231
18232         (NewDelegate.DoResolve): Update for Argument.Resolve.
18233
18234         * class.cs (ConstructorInitializer.DoResolve): ditto.
18235
18236         * attribute.cs (Attribute.Resolve): ditto.
18237
18238 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18239
18240         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18241
18242         * expression.cs (ParameterReference): Drop IStackStorage and implement
18243         IAssignMethod instead. 
18244
18245         (LocalVariableReference): ditto.
18246
18247         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18248         IAssignMethod instead. 
18249
18250 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18251
18252         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18253         enumerations that are used in heavily used structures derive from
18254         byte in a laughable and pathetic attempt to reduce memory usage.
18255         This is the kind of pre-optimzations that you should not do at
18256         home without adult supervision.
18257
18258         * expression.cs (UnaryMutator): New class, used to handle ++ and
18259         -- separatedly from the other unary operators.  Cleans up the
18260         code, and kills the ExpressionStatement dependency in Unary.
18261
18262         (Unary): Removed `method' and `Arguments' from this class, making
18263         it smaller, and moving it all to SimpleCall, so I can reuse this
18264         code in other locations and avoid creating a lot of transient data
18265         strucutres when not required.
18266
18267         * cs-parser.jay: Adjust for new changes.
18268
18269 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * enum.cs (Enum.Populate): If there is a failure during
18272         definition, return
18273
18274         * cs-parser.jay (opt_enum_base): we used to catch type errors
18275         here, but this is really incorrect.  The type error should be
18276         catched during semantic analysis.
18277
18278 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18279
18280         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18281         current_local_parameters as expected since I, in my stupidity, had forgotten
18282         to do this :-)
18283
18284         * attribute.cs (GetValidPlaces): Fix stupid bug.
18285
18286         * class.cs (Method::Emit): Perform check on applicability of attributes.
18287
18288         (Constructor::Emit): Ditto.
18289
18290         (Field::Emit): Ditto.
18291
18292         (Field.Location): Store location information.
18293
18294         (Property, Event, Indexer, Operator): Ditto.
18295
18296         * cs-parser.jay (field_declaration): Pass in location for each field.
18297
18298         * ../errors/cs0592.cs : Add.
18299
18300 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18301
18302         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18303
18304         (InitCoreTypes): Update accordingly.
18305
18306         (RegisterAttrType, LookupAttr): Implement.
18307
18308         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18309         info about the same.
18310
18311         (Resolve): Update to populate the above as necessary.
18312
18313         (Error592): Helper.
18314
18315         (GetValidPlaces): Helper to the above.
18316
18317         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18318
18319         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18320
18321 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18322
18323         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18324
18325         * ../errors/cs0617.cs : Add.
18326
18327 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18328
18329         * enum.cs (Emit): Rename to Populate to be more consistent with what
18330         we expect it to do and when exactly it is called.
18331
18332         * class.cs, rootcontext.cs : Update accordingly.
18333
18334         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18335         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18336
18337         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18338
18339         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18340         of a fieldinfo using the above, when dealing with a FieldBuilder.
18341
18342 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18343
18344         * ../errors/cs0031.cs : Add.
18345
18346         * ../errors/cs1008.cs : Add.
18347
18348         * ../errrors/cs0543.cs : Add.
18349
18350         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18351         enum type.
18352
18353         (FindMembers): Implement.
18354
18355         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18356         enums and delegates too.
18357
18358         (enum_types): Rename to builder_to_enum.
18359
18360         (delegate_types): Rename to builder_to_delegate.
18361
18362         * delegate.cs (FindMembers): Implement.
18363
18364 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18365
18366         * typemanager.cs (IsEnumType): Implement.
18367
18368         * enum.cs (Emit): Re-write parts to account for the underlying type
18369         better and perform checking etc.
18370
18371         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18372         of the underlying type.
18373
18374         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18375         value
18376
18377         * enum.cs (error31): Helper to report error #31.
18378
18379         * cs-parser.jay (enum_declaration): Store location of each member too.
18380
18381         * enum.cs (member_to_location): New hashtable. 
18382
18383         (AddEnumMember): Update location hashtable.
18384
18385         (Emit): Use the location of each member while reporting errors.
18386
18387 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18388
18389         * cs-parser.jay: A for_initializer if is a
18390         local_variable_declaration really ammount to have an implicit
18391         block with the variable declaration and no initializer for for.
18392
18393         * statement.cs (For.Emit): Cope with null initializers.
18394
18395         This fixes the infinite loop on for initializers.
18396
18397 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18398
18399         * enum.cs: More cleanup.
18400
18401         * ecore.cs: Remove dead code.
18402
18403         * class.cs (Property.Emit): More simplification.
18404         (Event.Emit): ditto.
18405
18406         Reworked to have less levels of indentation.
18407
18408 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18409
18410         * class.cs (Property): Emit attributes.
18411
18412         (Field): Ditto.
18413
18414         (Event): Ditto.
18415
18416         (Indexer): Ditto.
18417
18418         (Operator): Ditto.
18419
18420         * enum.cs (Emit): Ditto.
18421
18422         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18423         Enums too.
18424
18425         * class.cs (Field, Event, etc.): Move attribute generation into the
18426         Emit method everywhere.
18427
18428         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18429         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18430         as we had no way of defining nested enums !
18431
18432         * rootcontext.cs : Adjust code accordingly.
18433
18434         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18435
18436 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18437
18438         * expression.cs (EvalConstantExpression): Move into ecore.cs
18439
18440         * enum.cs (Enum): Rename some members and make them public and readonly
18441         according to our convention.
18442
18443         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18444         nothing else.
18445
18446         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18447
18448         (Enum::Emit): Write a simple version for now which doesn't try to compute
18449         expressions. I shall modify this to be more robust in just a while.
18450
18451         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18452
18453         (TypeContainer::CloseType): Create the Enum types too.
18454
18455         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18456
18457         * expression.cs (EvalConstantExpression): Get rid of completely.
18458
18459         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18460         user-defined values and other cases.
18461
18462         (IsValidEnumLiteral): Helper function.
18463
18464         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18465         out there in the case we had a literal FieldExpr.
18466
18467         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18468
18469         (Literalize): Revamp a bit to take two arguments.
18470
18471         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18472
18473 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18474
18475         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18476
18477         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18478
18479         (Resolve): Use the above to ensure we have proper initializers.
18480
18481 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18482
18483         * expression.cs (Expression::EvalConstantExpression): New method to 
18484         evaluate constant expressions.
18485
18486         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18487
18488 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18489
18490         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18491         in an array.
18492
18493         (Binary.ResolveOperator): Handle operator != (object a, object b)
18494         and operator == (object a, object b);
18495
18496         (Binary.DoNumericPromotions): Indicate whether the numeric
18497         promotion was possible.
18498
18499         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18500         Implement.  
18501
18502         Made the ArrayAccess implement interface IAssignMethod instead of
18503         IStackStore as the order in which arguments are passed reflects
18504         this.
18505
18506         * assign.cs: Instead of using expr.ExprClass to select the way of
18507         assinging, probe for the IStackStore/IAssignMethod interfaces.
18508
18509         * typemanager.cs: Load InitializeArray definition.
18510
18511         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18512         static data that can be used to initialize arrays. 
18513
18514 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18515
18516         * expression.cs: Handle operator== and operator!= for booleans.
18517
18518         (Conditioal.Reduce): Implement reducer for the ?: operator.
18519
18520         (Conditional.Resolve): Implement dead code elimination.
18521
18522         (Binary.Resolve): Catch string literals and return a new
18523         concatenated string.
18524
18525         (Unary.Reduce): Implement reduction of unary expressions.
18526
18527         * ecore.cs: Split out the expression core handling here.
18528
18529         (Expression.Reduce): New method used to perform constant folding
18530         and CSE.  This is needed to support constant-expressions. 
18531
18532         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18533         targets, and optimize for !x.
18534
18535 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18536
18537         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18538         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18539         set custom atttributes.
18540
18541         * literal.cs (Literal::GetValue): New abstract method to return the actual
18542         value of the literal, cast as an object.
18543
18544         (*Literal): Implement GetValue method.
18545
18546         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18547         expressions to the arraylist but objects of type Argument.
18548
18549         * class.cs (TypeContainer::Emit): Emit our attributes too.
18550
18551         (Method::Emit, Constructor::Emit): Ditto.
18552
18553         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18554         to be ignoring earlier.
18555
18556 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18557
18558         * attribute.cs (AttributeSection::Define): Implement to do the business
18559         of constructing a CustomAttributeBuilder.
18560
18561         (Attribute): New trivial class. Increases readability of code.  
18562
18563         * cs-parser.jay : Update accordingly.
18564
18565         (positional_argument_list, named_argument_list, named_argument): New rules
18566
18567         (attribute_arguments): Use the above so that we are more correct.
18568
18569 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18570
18571         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18572         to perform all checks for a method with a params parameter.
18573
18574         (Invocation::OverloadResolve): Update to use the above method and therefore
18575         cope correctly with params method invocations.
18576
18577         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18578         params too.
18579
18580         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18581         constructors in our parent too because we can't afford to miss out on 
18582         protected ones ;-)
18583
18584         * attribute.cs (AttributeSection): New name for the class Attribute
18585
18586         Other trivial changes to improve readability.
18587
18588         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18589         use the new class names.
18590
18591 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18592
18593         * class.cs (Method::Define): Complete definition for params types too
18594
18595         (Indexer::Define): Ditto.
18596
18597         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18598         Cope everywhere with a request for info about the array parameter.
18599
18600 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18601
18602         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18603
18604         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18605         local_variable_type to extract the string corresponding to the type.
18606
18607         (local_variable_type): Fixup the action to use the new helper method.
18608
18609         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18610         go.
18611
18612         * expression.cs : Clean out code which uses the above.
18613
18614 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18615
18616         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18617         and bale out if necessary by returning a false.
18618
18619         (RegisterProperty): Ditto.
18620
18621         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18622         and print out appropriate error messages.
18623
18624         * interface.cs (everywhere): Ditto.
18625
18626         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18627         location to constructor.
18628
18629         * class.cs (Property, Event, Indexer): Update accordingly.
18630
18631         * ../errors/cs111.cs : Added.
18632
18633         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18634         of a method, as laid down by the spec.
18635
18636         (Invocation::OverloadResolve): Use the above method.
18637
18638 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18639
18640         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18641         now take a TypeContainer and a Parameters object.
18642
18643         (ParameterData): Modify return type of ParameterModifier method to be 
18644         Parameter.Modifier and not a string.
18645
18646         (ReflectionParameters, InternalParameters): Update accordingly.
18647
18648         * expression.cs (Argument::GetParameterModifier): Same here.
18649
18650         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18651         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18652         symbol in it at all so maybe this is only for now.
18653
18654 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18655
18656         * support.cs (InternalParameters): Constructor now takes an extra argument 
18657         which is the actual Parameters class.
18658
18659         (ParameterDesc): Update to provide info on ref/out modifiers.
18660
18661         * class.cs (everywhere): Update call to InternalParameters to pass in
18662         the second argument too.
18663
18664         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18665         to return the modifier info [ref/out etc]
18666
18667         (InternalParameters, ReflectionParameters): Implement the above.
18668
18669         * expression.cs (Argument::ParameterModifier): Similar function to return
18670         info about the argument's modifiers.
18671
18672         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18673         too.
18674
18675         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18676         a new SetFormalParameters object which we pass to InternalParameters.
18677
18678 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18679
18680         * expression.cs (NewArray): Merge into the ArrayCreation class.
18681
18682 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18683
18684         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18685         NewUserdefinedArray into one as there wasn't much of a use in having
18686         two separate ones.
18687
18688         * expression.cs (Argument): Change field's name to ArgType from Type.
18689
18690         (Type): New readonly property which returns the proper type, taking into 
18691         account ref/out modifiers.
18692
18693         (everywhere): Adjust code accordingly for the above.
18694
18695         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18696         whether we are emitting for a ref or out parameter.
18697
18698         * expression.cs (Argument::Emit): Use the above field to set the state.
18699
18700         (LocalVariableReference::Emit): Update to honour the flag and emit the
18701         right stuff.
18702
18703         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18704
18705         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18706
18707         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18708
18709         (ReflectionParameters, InternalParameters): Implement the above method.
18710
18711         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18712         reporting errors.
18713
18714         (Invocation::FullMethodDesc): Ditto. 
18715
18716 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18717
18718         * cs-parser.jay: Add extra production for the second form of array
18719         creation. 
18720
18721         * expression.cs (ArrayCreation): Update to reflect the above
18722         change. 
18723
18724         * Small changes to prepare for Array initialization.
18725
18726 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18727
18728         * typemanager.cs (ImplementsInterface): interface might be null;
18729         Deal with this problem;
18730
18731         Also, we do store negative hits on the cache (null values), so use
18732         this instead of calling t.GetInterfaces on the type everytime.
18733
18734 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18735
18736         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18737
18738         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18739         split functionality out into different classes.
18740
18741         (New::FormArrayType): Move into NewBuiltinArray.
18742
18743         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18744         quite useless.
18745
18746         (NewBuiltinArray): New class to handle creation of built-in arrays.
18747
18748         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18749         account creation of one-dimensional arrays.
18750
18751         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18752
18753         (NewUserdefinedArray::DoResolve): Implement.
18754
18755         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18756
18757         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18758         we maintain inside the TypeManager. This is necessary to perform lookups on the
18759         module builder.
18760
18761         (LookupType): Update to perform GetType on the module builders too.     
18762
18763         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18764
18765         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18766
18767 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18768
18769         * expression.cs (New::DoResolve): Implement guts of array creation.
18770
18771         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18772
18773 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * expression.cs: Fix bug I introduced lsat night that broke
18776         Delegates. 
18777
18778         (Expression.Resolve): Report a 246 error (can not resolve name)
18779         if we find a SimpleName in the stream.
18780
18781         (Expression.ResolveLValue): Ditto.
18782
18783         (Expression.ResolveWithSimpleName): This function is a variant of
18784         ResolveName, this one allows SimpleNames to be returned without a
18785         warning.  The only consumer of SimpleNames is MemberAccess
18786
18787 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18790         might arrive here.  I have my doubts that this is correct.
18791
18792         * statement.cs (Lock): Implement lock statement.
18793
18794         * cs-parser.jay: Small fixes to support `lock' and `using'
18795
18796         * cs-tokenizer.cs: Remove extra space
18797
18798         * driver.cs: New flag --checked, allows to turn on integer math
18799         checking. 
18800
18801         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18802         Threading.Monitor.Exit 
18803
18804 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18807         Expression Class to be IndexerAccess.
18808
18809         Notice that Indexer::DoResolve sets the eclass to Value.
18810
18811 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18812
18813         * class.cs (TypeContainer::Emit): Emit code for indexers.
18814
18815         * assign.cs (IAssignMethod): New interface implemented by Indexers
18816         and Properties for handling assignment.
18817
18818         (Assign::Emit): Simplify and reuse code. 
18819
18820         * expression.cs (IndexerAccess, PropertyExpr): Implement
18821         IAssignMethod, clean up old code. 
18822
18823 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18824
18825         * typemanager.cs (ImplementsInterface): New method to determine if a type
18826         implements a given interface. Provides a nice cache too.
18827
18828         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18829         method.
18830
18831         (ConvertReferenceExplicit): Ditto.
18832
18833         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18834         various methods, with correct names etc.
18835
18836         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18837         Operator.UnaryNegation.
18838
18839         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18840         we have a unary plus or minus operator.
18841
18842         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18843         UnaryMinus.
18844
18845         * everywhere : update accordingly.
18846
18847         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18848         respectively.
18849
18850         * class.cs (Method::Define): For the case where we are implementing a method
18851         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18852         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18853
18854 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18855
18856         * interface.cs (FindMembers): Implement to work around S.R.E
18857         lameness.
18858
18859         * typemanager.cs (IsInterfaceType): Implement.
18860
18861         (FindMembers): Update to handle interface types too.
18862
18863         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18864         use IsAssignableFrom as that is not correct - it doesn't work.
18865
18866         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18867         and accordingly override EmitStatement.
18868
18869         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18870         using the correct logic :-)
18871
18872 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18873
18874         * ../errors/cs-11.cs : Add to demonstrate error -11 
18875
18876 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18877
18878         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18879         then pass this as a hint to ResolveLValue.
18880
18881         * expression.cs (FieldExpr): Add Location information
18882
18883         (FieldExpr::LValueResolve): Report assignment to readonly
18884         variable. 
18885
18886         (Expression::ExprClassFromMemberInfo): Pass location information.
18887
18888         (Expression::ResolveLValue): Add new method that resolves an
18889         LValue. 
18890
18891         (Expression::DoResolveLValue): Default invocation calls
18892         DoResolve. 
18893
18894         (Indexers): New class used to keep track of indexers in a given
18895         Type. 
18896
18897         (IStackStore): Renamed from LValue, as it did not really describe
18898         what this did.  Also ResolveLValue is gone from this interface and
18899         now is part of Expression.
18900
18901         (ElementAccess): Depending on the element access type
18902
18903         * typemanager.cs: Add `indexer_name_type' as a Core type
18904         (System.Runtime.CompilerServices.IndexerNameAttribute)
18905
18906         * statement.cs (Goto): Take a location.
18907
18908 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18909
18910         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18911         if two delegates are compatible.
18912
18913         (NewDelegate::DoResolve): Update to take care of the case when
18914         we instantiate a delegate from another delegate.
18915
18916         * typemanager.cs (FindMembers): Don't even try to look up members
18917         of Delegate types for now.
18918
18919 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18920
18921         * delegate.cs (NewDelegate): New class to take care of delegate
18922         instantiation.
18923
18924         * expression.cs (New): Split the delegate related code out into 
18925         the NewDelegate class.
18926
18927         * delegate.cs (DelegateInvocation): New class to handle delegate 
18928         invocation.
18929
18930         * expression.cs (Invocation): Split out delegate related code into
18931         the DelegateInvocation class.
18932
18933 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18934
18935         * expression.cs (New::DoResolve): Implement delegate creation fully
18936         and according to the spec.
18937
18938         (New::DoEmit): Update to handle delegates differently.
18939
18940         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18941         because of which we were printing out arguments in reverse order !
18942
18943         * delegate.cs (VerifyMethod): Implement to check if the given method
18944         matches the delegate.
18945
18946         (FullDelegateDesc): Implement.
18947
18948         (VerifyApplicability): Implement.
18949
18950         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18951         delegate invocations too.
18952
18953         (Invocation::Emit): Ditto.
18954
18955         * ../errors/cs1593.cs : Added.
18956
18957         * ../errors/cs1594.cs : Added.
18958
18959         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18960
18961 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18962
18963         * typemanager.cs (intptr_type): Core type for System.IntPtr
18964
18965         (InitCoreTypes): Update for the same.
18966
18967         (iasyncresult_type, asynccallback_type): Ditto.
18968
18969         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18970         correct.
18971
18972         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18973         too.
18974
18975         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18976         the builders for the 4 members of a delegate type :-)
18977
18978         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18979         type.
18980
18981         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18982
18983         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18984
18985 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * statement.cs (Break::Emit): Implement.   
18988         (Continue::Emit): Implement.
18989
18990         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18991         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18992         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18993         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18994         end loop
18995
18996         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18997         properties that track the label for the current loop (begin of the
18998         loop and end of the loop).
18999
19000 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19001
19002         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19003         use of emitting anything at all.
19004
19005         * class.cs, rootcontext.cs : Get rid of calls to the same.
19006
19007         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19008
19009         (Populate): Define the constructor correctly and set the implementation
19010         attributes.
19011
19012         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19013         have been defined.
19014
19015         (AddDelegateType): Implement.
19016
19017         (IsDelegateType): Implement helper method.
19018
19019         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19020
19021         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19022         and accordingly handle it.
19023
19024         * delegate.cs (Populate): Take TypeContainer argument.
19025         Implement bits to define the Invoke method. However, I still haven't figured out
19026         how to take care of the native int bit :-(
19027
19028         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19029         Qualify the name of the delegate, not its return type !
19030
19031         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19032         conversion.
19033
19034         (StandardConversionExists): Checking for array types turns out to be recursive.
19035
19036         (ConvertReferenceExplicit): Implement array conversion.
19037
19038         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19039
19040 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19041
19042         * cs-parser.jay (delegate_declaration): Store the fully qualified
19043         name as it is a type declaration.
19044
19045         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19046         readonly.
19047
19048         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19049         as TypeContainer::DefineType.
19050
19051         (Populate): Method in which all the definition of the various methods (Invoke)
19052         etc is done.
19053
19054         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19055         see.
19056
19057         (CloseDelegate): Finally creates the delegate.
19058
19059         * class.cs (TypeContainer::DefineType): Update to define delegates.
19060         (Populate, Emit and CloseType): Do the same thing here too.
19061
19062         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19063         delegates in all these operations.
19064
19065 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * expression.cs: LocalTemporary: a new expression used to
19068         reference a temporary that has been created.
19069
19070         * assign.cs: Handle PropertyAccess back here, so that we can
19071         provide the proper semantic access to properties.
19072
19073         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19074         a few more explicit conversions. 
19075
19076         * modifiers.cs: `NEW' modifier maps to HideBySig.
19077
19078         * expression.cs (PropertyExpr): Make this into an
19079         ExpressionStatement, and support the EmitStatement code path. 
19080
19081         Perform get/set error checking, clean up the interface.
19082
19083         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19084         them into toplevel access objects.
19085
19086 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19089         SRE.
19090
19091         * typemanager.cs: Keep track here of our PropertyBuilders again to
19092         work around lameness in SRE.
19093
19094 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19095
19096         * expression.cs (LValue::LValueResolve): New method in the
19097         interface, used to perform a second resolution pass for LValues. 
19098
19099         (This::DoResolve): Catch the use of this in static methods.
19100
19101         (This::LValueResolve): Implement.
19102
19103         (This::Store): Remove warning, assigning to `this' in structures
19104         is 
19105
19106         (Invocation::Emit): Deal with invocation of
19107         methods on value types.  We need to pass the address to structure
19108         methods rather than the object itself.  (The equivalent code to
19109         emit "this" for structures leaves the entire structure on the
19110         stack instead of a pointer to it). 
19111
19112         (ParameterReference::DoResolve): Compute the real index for the
19113         argument based on whether the method takes or not a `this' pointer
19114         (ie, the method is static).
19115
19116         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19117         value types returned from functions when we need to invoke a
19118         method on the sturcture.
19119
19120
19121 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19122
19123         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19124         defining the type in the Modulebuilder or Typebuilder. This is to take
19125         care of nested types which need to be defined on the TypeBuilder using
19126         DefineNestedMethod.
19127
19128         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19129         methods in RootContext, only ported to be part of TypeContainer.
19130
19131         (TypeContainer::GetInterfaceOrClass): Ditto.
19132
19133         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19134
19135         * interface.cs (Interface::DefineInterface): New method. Does exactly
19136         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19137         too.
19138
19139         (Interface::GetInterfaces): Move from RootContext here and port.
19140
19141         (Interface::GetInterfaceByName): Same here.
19142
19143         * rootcontext.cs (ResolveTree): Re-write.
19144
19145         (PopulateTypes): Re-write.
19146
19147         * class.cs (TypeContainer::Populate): Populate nested types too.
19148         (TypeContainer::Emit): Emit nested members too.
19149
19150         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19151         instead just use the name argument passed in as it is already fully
19152         qualified.
19153
19154         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19155         to TypeContainer mapping to see if a type is user-defined.
19156
19157         * class.cs (TypeContainer::CloseType): Implement. 
19158
19159         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19160         the default constructor.
19161
19162         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19163         twice.
19164
19165         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19166
19167         * interface.cs (CloseType): Create the type here.
19168
19169         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19170         the hierarchy.
19171
19172         Remove all the methods which are now in TypeContainer.
19173
19174 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19175
19176         * delegate.cs (Define): Re-write bits to define the delegate
19177         correctly.
19178
19179 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19180
19181         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19182
19183         * expression.cs (ImplicitReferenceConversion): handle null as well
19184         as a source to convert to any reference type.
19185
19186         * statement.cs (Return): Perform any implicit conversions to
19187         expected return type.  
19188
19189         Validate use of return statement.  
19190
19191         * codegen.cs (EmitContext): Pass the expected return type here.
19192
19193         * class.cs (Method, Constructor, Property): Pass expected return
19194         type to EmitContext.
19195
19196 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19197
19198         * expression.cs: Make DoResolve take an EmitContext instead of a
19199         TypeContainer.
19200
19201         Replaced `l' and `location' for `loc', for consistency.
19202
19203         (Error, Warning): Remove unneeded Tc argument.
19204
19205         * assign.cs, literal.cs, constant.cs: Update to new calling
19206         convention. 
19207
19208         * codegen.cs: EmitContext now contains a flag indicating whether
19209         code is being generated in a static method or not.
19210
19211         * cs-parser.jay: DecomposeQI, new function that replaces the old
19212         QualifiedIdentifier.  Now we always decompose the assembled
19213         strings from qualified_identifier productions into a group of
19214         memberaccesses.
19215
19216 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19217
19218         * rootcontext.cs: Deal with field-less struct types correctly now
19219         by passing the size option to Define Type.
19220
19221         * class.cs: Removed hack that created one static field. 
19222
19223 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * statement.cs: Moved most of the code generation here. 
19226
19227 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19228
19229         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19230         seem very right.
19231
19232         (ElementAccess): Remove useless bits for now - keep checks as the spec
19233         says.
19234
19235 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19236
19237         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19238         and start performing checks according to the spec.
19239
19240 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19241
19242         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19243         rank_specifiers instead.
19244
19245         (rank_specifiers): Change the order in which the rank specifiers are stored
19246
19247         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19248
19249         * expression.cs (ElementAccess): Implement the LValue interface too.
19250
19251 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19252
19253         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19254         except that user defined conversions are not included.
19255
19256         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19257         perform the conversion of the return type, if necessary.
19258
19259         (New::DoResolve): Check whether we are creating an array or an object
19260         and accordingly do the needful.
19261
19262         (New::Emit): Same here.
19263
19264         (New::DoResolve): Implement guts of array creation.
19265
19266         (New::FormLookupType): Helper function.
19267
19268 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * codegen.cs: Removed most of the code generation here, and move the
19271         corresponding code generation bits to the statement classes. 
19272
19273         Added support for try/catch/finalize and throw.
19274
19275         * cs-parser.jay: Added support for try/catch/finalize.
19276
19277         * class.cs: Catch static methods having the flags override,
19278         virtual or abstract.
19279
19280         * expression.cs (UserCast): This user cast was not really doing
19281         what it was supposed to do.  Which is to be born in fully resolved
19282         state.  Parts of the resolution were being performed at Emit time! 
19283
19284         Fixed this code.
19285
19286 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * expression.cs: Implicity convert the result from UserCast.
19289
19290 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19291
19292         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19293         prevented it from working correctly. 
19294
19295         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19296         merely ConvertImplicit.
19297
19298 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19299
19300         * typemanager.cs: Make the LookupTypeContainer function static,
19301         and not per-instance.  
19302
19303         * class.cs: Make static FindMembers (the one that takes a Type
19304         argument). 
19305
19306         * codegen.cs: Add EmitForeach here.
19307
19308         * cs-parser.jay: Make foreach a toplevel object instead of the
19309         inline expansion, as we need to perform semantic analysis on it. 
19310
19311 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19312
19313         * expression.cs (Expression::ImplicitUserConversion): Rename to
19314         UserDefinedConversion.
19315
19316         (Expression::UserDefinedConversion): Take an extra argument specifying 
19317         whether we look for explicit user conversions too.
19318
19319         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19320
19321         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19322
19323         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19324         with the appropriate arguments.
19325
19326         * cs-parser.jay (cast_expression): Record location too.
19327
19328         * expression.cs (Cast): Record location info.
19329
19330         (Expression::ConvertExplicit): Take location argument.
19331
19332         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19333         to determine if we are doing explicit conversions.
19334
19335         (UserCast::Emit): Update accordingly.
19336
19337         (Expression::ConvertExplicit): Report an error if everything fails.
19338
19339         * ../errors/cs0030.cs : Add.
19340
19341 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19344         virtual and newslot bits. 
19345
19346         * class.cs (TypeContainer::RegisterRequiredImplementations):
19347         Record methods we need.
19348
19349         (TypeContainer::MakeKey): Helper function to make keys for
19350         MethodBases, since the Methodbase key is useless.
19351
19352         (TypeContainer::Populate): Call RegisterRequiredImplementations
19353         before defining the methods.   
19354
19355         Create a mapping for method_builders_to_methods ahead of time
19356         instead of inside a tight loop.
19357
19358         (::RequireMethods):  Accept an object as the data to set into the
19359         hashtable so we can report interface vs abstract method mismatch.
19360
19361 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19362
19363         * report.cs: Make all of it static.
19364
19365         * rootcontext.cs: Drop object_type and value_type computations, as
19366         we have those in the TypeManager anyways.
19367
19368         Drop report instance variable too, now it is a global.
19369
19370         * driver.cs: Use try/catch on command line handling.
19371
19372         Add --probe option to debug the error reporting system with a test
19373         suite. 
19374
19375         * report.cs: Add support for exiting program when a probe
19376         condition is reached.
19377
19378 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19379
19380         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19381         we do a forcible conversion regardless of type, to check if 
19382         ForceConversion returns a null.
19383
19384         (Binary::error19): Use location to report error.
19385
19386         (Unary::error23): Use location here too.
19387
19388         * ../errors/cs0019.cs : Check in.
19389
19390         * ../errors/cs0023.cs : Check in.
19391
19392         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19393         case of a non-null MethodInfo object with a length of 0 !
19394
19395         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19396         an applicable member - according to the spec :-)
19397         Also fix logic to find members in base types.
19398
19399         (Unary::ResolveOperator): Same here.
19400
19401         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19402         as I was getting thoroughly confused between this and error19 :-)
19403
19404         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19405         (::FindMostEncompassedType): Implement.
19406         (::FindMostEncompassingType): Implement.
19407         (::StandardConversionExists): Implement.
19408
19409         (UserImplicitCast): Re-vamp. We now need info about most specific
19410         source and target types so that we can do the necessary conversions.
19411
19412         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19413         mathematical union with no duplicates.
19414
19415 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19418         in order from base classes to child classes, so that we can in
19419         child classes look up in our parent for method names and
19420         attributes (required for handling abstract, virtual, new, override
19421         constructs: we need to instrospect our base class, and if we dont
19422         populate the classes in order, the introspection might be
19423         incorrect.  For example, a method could query its parent before
19424         the parent has any methods and would determine that the parent has
19425         no abstract methods (while it could have had them)).
19426
19427         (RootContext::CreateType): Record the order in which we define the
19428         classes.
19429
19430 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * class.cs (TypeContainer::Populate): Also method definitions can
19433         fail now, keep track of this.
19434
19435         (TypeContainer::FindMembers): Implement support for
19436         DeclaredOnly/noDeclaredOnly flag.
19437
19438         (Constructor::Emit) Return the ConstructorBuilder.
19439
19440         (Method::Emit) Return the MethodBuilder. 
19441         Check for abstract or virtual methods to be public.
19442
19443         * rootcontext.cs (RootContext::CreateType): Register all the
19444         abstract methods required for the class to be complete and the
19445         interface methods that must be implemented. 
19446
19447         * cs-parser.jay: Report error 501 (method requires body if it is
19448         not marked abstract or extern).
19449
19450         * expression.cs (TypeOf::Emit): Implement.
19451
19452         * typemanager.cs: runtime_handle_type, new global type.
19453
19454         * class.cs (Property::Emit): Generate code for properties.
19455
19456 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19457
19458         * expression.cs (Unary::ResolveOperator): Find operators on base type
19459         too - we now conform exactly to the spec.
19460
19461         (Binary::ResolveOperator): Same here.
19462
19463         * class.cs (Operator::Define): Fix minor quirk in the tests.
19464
19465         * ../errors/cs0215.cs : Added.
19466
19467         * ../errors/cs0556.cs : Added.
19468
19469         * ../errors/cs0555.cs : Added.
19470
19471 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19472
19473         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19474         single integer which is really efficient
19475
19476 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19477
19478         *  expression.cs (Expression::ImplicitUserConversion): Use location
19479         even in the case when we are examining True operators.
19480  
19481         * class.cs (Operator::Define): Perform extensive checks to conform
19482         with the rules for operator overloading in the spec.
19483
19484         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19485         some of the other conversions mentioned in the spec.
19486
19487         * typemanager.cs (array_type): New static member for the System.Array built-in
19488         type.
19489
19490         (cloneable_interface): For System.ICloneable interface.
19491
19492         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19493         we start resolving the tree and populating types.
19494
19495         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19496  
19497 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19498
19499         * expression.cs (Expression::ExprClassFromMemberInfo,
19500         Expression::Literalize): Create literal expressions from
19501         FieldInfos which are literals.
19502
19503         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19504         type casts, because they were wrong.  The test suite in tests
19505         caught these ones.
19506
19507         (ImplicitNumericConversion): ushort to ulong requires a widening
19508         cast. 
19509
19510         Int32 constant to long requires widening cast as well.
19511
19512         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19513         for integers because the type on the stack is not i4.
19514
19515 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * expression.cs (report118): require location argument. 
19518
19519         * parameter.cs: Do not dereference potential null value.
19520
19521         * class.cs: Catch methods that lack the `new' keyword when
19522         overriding a name.  Report warnings when `new' is used without
19523         anything being there to override.
19524
19525         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19526
19527         * class.cs: Only add constructor to hashtable if it is non-null
19528         (as now constructors can fail on define).
19529
19530         (TypeManager, Class, Struct): Take location arguments.
19531
19532         Catch field instance initialization in structs as errors.
19533
19534         accepting_filter: a new filter for FindMembers that is static so
19535         that we dont create an instance per invocation.
19536
19537         (Constructor::Define): Catch errors where a struct constructor is
19538         parameterless 
19539
19540         * cs-parser.jay: Pass location information for various new
19541         constructs. 
19542
19543         * delegate.cs (Delegate): take a location argument.
19544
19545         * driver.cs: Do not call EmitCode if there were problesm in the
19546         Definition of the types, as many Builders wont be there. 
19547
19548         * decl.cs (Decl::Decl): Require a location argument.
19549
19550         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19551         into integers, and find the most appropiate integer for it.
19552
19553         * literal.cs: Implement ULongLiteral.
19554
19555         * rootcontext.cs: Provide better information about the location of
19556         failure when CreateType fails.
19557
19558 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19561         as well.
19562
19563         * expression.cs (Binary::CheckShiftArguments): Add missing type
19564         computation.
19565         (Binary::ResolveOperator): Add type to the logical and and logical
19566         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19567         before.
19568
19569         (Binary::DoNumericPromotions): In the case where either argument
19570         is ulong (and most signed types combined with ulong cause an
19571         error) perform implicit integer constant conversions as well.
19572
19573 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19574
19575         * expression.cs (UserImplicitCast): Method should always be
19576         non-null. 
19577         (Invocation::BetterConversion): Simplified test for IntLiteral.
19578
19579         (Expression::ImplicitNumericConversion): Split this routine out.
19580         Put the code that performs implicit constant integer conversions
19581         here. 
19582
19583         (Expression::Resolve): Become a wrapper around DoResolve so we can
19584         check eclass and type being set after resolve.
19585
19586         (Invocation::Badness): Remove this dead function
19587
19588         (Binary::ResolveOperator): Do not compute the expensive argumnets
19589         unless we have a union for it.
19590
19591         (Probe::Emit): Is needs to do an isinst and then
19592         compare against null.
19593
19594         (::CanConvert): Added Location argument.  If the Location argument
19595         is null (Location.Null), then we do not report errors.  This is
19596         used by the `probe' mechanism of the Explicit conversion.  We do
19597         not want to generate an error for something that the user
19598         explicitly requested to be casted.  But the pipeline for an
19599         explicit cast first tests for potential implicit casts.
19600
19601         So for now, if the Location is null, it means `Probe only' to
19602         avoid adding another argument.   Might have to revise this
19603         strategy later.
19604
19605         (ClassCast): New class used to type cast objects into arbitrary
19606         classes (used in Explicit Reference Conversions).
19607
19608         Implement `as' as well.
19609
19610         Reverted all the patches from Ravi below: they were broken:
19611
19612                 * The use of `level' as a mechanism to stop recursive
19613                   invocations is wrong.  That was there just to catch the
19614                   bug with a strack trace but not as a way of addressing
19615                   the problem.
19616
19617                   To fix the problem we have to *understand* what is going
19618                   on and the interactions and come up with a plan, not
19619                   just get things going.
19620
19621                 * The use of the type conversion cache that I proposed
19622                   last night had an open topic: How does this work across
19623                   protection domains.  A user defined conversion might not
19624                   be public in the location where we are applying the
19625                   conversion, a different conversion might be selected
19626                   (ie, private A->B (better) but public B->A (worse),
19627                   inside A, A->B applies, but outside it, B->A will
19628                   apply).
19629
19630                 * On top of that (ie, even if the above is solved),
19631                   conversions in a cache need to be abstract.  Ie, `To
19632                   convert from an Int to a Short use an OpcodeCast', not
19633                   `To convert from an Int to a Short use the OpcodeCast on
19634                   the variable 5' (which is what this patch was doing).
19635
19636 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19637
19638         * expression.cs (Invocation::ConversionExists): Re-write to use
19639         the conversion cache
19640
19641         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19642         cache all conversions done, not just user-defined ones.
19643
19644         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19645         to determine if a conversion exists instead of acutually trying to 
19646         perform the conversion. It's faster too.
19647
19648         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19649         and only then attempt the implicit conversion.
19650
19651 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19652
19653         * expression.cs (ConvertImplicit): Use a cache for conversions
19654         already found. Check level of recursion and bail out if necessary.
19655
19656 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19659         Export standard methods that we expect for string operations.
19660
19661         * statement.cs (Block::UsageWarning): Track usage of variables and
19662         report the errors for not used variables.
19663
19664         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19665         operator. 
19666
19667 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19668
19669         * codegen.cs: remove unnneded code 
19670
19671         * expression.cs: Removed BuiltinTypeAccess class
19672
19673         Fix the order in which implicit conversions are
19674         done.  
19675
19676         The previous fixed dropped support for boxed conversions (adding a
19677         test to the test suite now)
19678
19679         (UserImplicitCast::CanConvert): Remove test for source being null,
19680         that code is broken.  We should not feed a null to begin with, if
19681         we do, then we should track the bug where the problem originates
19682         and not try to cover it up here.
19683
19684         Return a resolved expression of type UserImplicitCast on success
19685         rather than true/false.  Ravi: this is what I was talking about,
19686         the pattern is to use a static method as a "constructor" for
19687         objects. 
19688
19689         Also, do not create arguments until the very last minute,
19690         otherwise we always create the arguments even for lookups that
19691         will never be performed. 
19692
19693         (UserImplicitCast::Resolve): Eliminate, objects of type
19694         UserImplicitCast are born in a fully resolved state. 
19695
19696         * typemanager.cs (InitCoreTypes): Init also value_type
19697         (System.ValueType). 
19698
19699         * expression.cs (Cast::Resolve): First resolve the child expression.
19700
19701         (LValue): Add new method AddressOf to be used by
19702         the `&' operator.  
19703
19704         Change the argument of Store to take an EmitContext instead of an
19705         ILGenerator, because things like FieldExpr need to be able to call
19706         their children expression to generate the instance code. 
19707
19708         (Expression::Error, Expression::Warning): Sugar functions for
19709         reporting errors.
19710
19711         (Expression::MemberLookup): Accept a TypeContainer instead of a
19712         Report as the first argument.
19713
19714         (Expression::ResolvePrimary): Killed.  I still want to improve
19715         this as currently the code is just not right.
19716
19717         (Expression::ResolveMemberAccess): Simplify, but it is still
19718         wrong. 
19719
19720         (Unary::Resolve): Catch errors in AddressOf operators.
19721
19722         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19723         index to a byte for the short-version, or the compiler will choose
19724         the wrong Emit call, which generates the wrong data.
19725
19726         (ParameterReference::Emit, ::Store): same.
19727
19728         (FieldExpr::AddressOf): Implement.
19729
19730         * typemanager.cs: TypeManager: made public variable instead of
19731         property.
19732
19733         * driver.cs: document --fatal.
19734
19735         * report.cs (ErrorMessage, WarningMessage): new names for the old
19736         Error and Warning classes.
19737
19738         * cs-parser.jay (member_access): Turn built-in access to types
19739         into a normal simplename
19740
19741 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19742
19743         * expression.cs (Invocation::BetterConversion): Fix to cope
19744         with q being null, since this was introducing a bug.
19745
19746         * expression.cs (ConvertImplicit): Do built-in conversions first.
19747
19748 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19749
19750         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19751
19752 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19753
19754         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19755         I had introduced long ago (what's new ?).
19756
19757         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19758         the work of all the checking. 
19759         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19760         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19761
19762         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19763         that is the right way. 
19764
19765         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19766         overloading resolution. Use everywhere instead of cutting and pasting code.
19767
19768         (Binary::ResolveOperator): Use MakeUnionSet.
19769
19770         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19771         we have to convert to bool types. Not complete yet.
19772
19773 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19774
19775         * typemanager.cs (TypeManager::CSharpName): support ushort.
19776
19777         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19778         to provide an expression that performsn an implicit constant int
19779         conversion (section 6.1.6).
19780         (Expression::ConvertImplicitRequired): Reworked to include
19781         implicit constant expression conversions.
19782
19783         (Expression::ConvertNumericExplicit): Finished.
19784
19785         (Invocation::Emit): If InstanceExpression is null, then it means
19786         that we perform a call on this.
19787
19788 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * expression.cs (Unary::Emit): Remove some dead code.
19791         (Probe): Implement Resolve and Emit for `is'.
19792         (Expression::ConvertImplicitRequired): Attempt to do constant
19793         expression conversions here.  Maybe should be moved to
19794         ConvertImplicit, but I am not sure.
19795         (Expression::ImplicitLongConstantConversionPossible,
19796         Expression::ImplicitIntConstantConversionPossible): New functions
19797         that tell whether is it possible to apply an implicit constant
19798         expression conversion.
19799
19800         (ConvertNumericExplicit): Started work on explicit numeric
19801         conversions.
19802
19803         * cs-parser.jay: Update operator constants.
19804
19805         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19806         (Parameters::GetSignature): Hook up VerifyArgs here.
19807         (Parameters::VerifyArgs): Verifies that no two arguments have the
19808         same name. 
19809
19810         * class.cs (Operator): Update the operator names to reflect the
19811         ones that the spec expects (as we are just stringizing the
19812         operator names).
19813
19814         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19815         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19816         previous usage did only work for our methods.
19817         (Expression::ConvertImplicit): Handle decimal implicit numeric
19818         conversions as well.
19819         (Expression::InternalTypeConstructor): Used to invoke constructors
19820         on internal types for default promotions.
19821
19822         (Unary::Emit): Implement special handling for the pre/post
19823         increment/decrement for overloaded operators, as they need to have
19824         the same semantics as the other operators.
19825
19826         (Binary::ResolveOperator): ditto.
19827         (Invocation::ConversionExists): ditto.
19828         (UserImplicitCast::Resolve): ditto.
19829
19830 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19831
19832         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19833         operator, return after emitting body. Regression tests pass again !
19834
19835         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19836         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19837         (Invocation::OverloadResolve): Ditto.
19838         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19839
19840         * everywhere : update calls to the above methods accordingly.
19841
19842 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19845
19846         * expression.cs (ExpressionStatement): New base class used for
19847         expressions that can appear in statements, so that we can provide
19848         an alternate path to generate expression that do not leave a value
19849         on the stack.
19850
19851         (Expression::Emit, and all the derivatives): We no longer return
19852         whether a value is left on the stack or not.  Every expression
19853         after being emitted leaves a single value on the stack.
19854
19855         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19856         facilties of ExpressionStatement if possible.
19857
19858         * cs-parser.jay: Update statement_expression.
19859
19860 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19861
19862         * driver.cs: Change the wording of message
19863
19864 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19865
19866         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19867         the type of the expression to the return type of the method if
19868         we have an overloaded operator match ! The regression tests pass again !
19869         (Unary::ResolveOperator): Ditto.
19870
19871         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19872         to find "op_Implicit", not "implicit" ;-)
19873         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19874         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19875
19876         * everywhere : Correct calls to the above accordingly.
19877
19878         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19879         (ConvertImplicit): Do user-defined conversion if it exists.
19880
19881 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * assign.cs: track location.
19884         (Resolve): Use implicit conversions on assignment.
19885
19886         * literal.cs: Oops.  Not good, Emit of short access values should
19887         pass (Bytes) or the wrong argument will be selected.
19888
19889         * expression.cs (Unary::Emit): Emit code for -expr.
19890
19891         (Unary::ResolveOperator): Handle `Substract' for non-constants
19892         (substract from zero from the non-constants).
19893         Deal with Doubles as well. 
19894
19895         (Expression::ConvertImplicitRequired): New routine that reports an
19896         error if no implicit conversion exists. 
19897
19898         (Invocation::OverloadResolve): Store the converted implicit
19899         expressions if we make them
19900
19901 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19902
19903         * class.cs (ConstructorInitializer): Take a Location argument.
19904         (ConstructorBaseInitializer): Same here.
19905         (ConstructorThisInitializer): Same here.
19906
19907         * cs-parser.jay : Update all calls accordingly.
19908
19909         * expression.cs (Unary, Binary, New): Take location argument.
19910         Update accordingly everywhere.
19911
19912         * cs-parser.jay : Update all calls to the above to take a location
19913         argument.
19914
19915         * class.cs : Ditto.
19916
19917 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19918
19919         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19920         (Invocation::BetterConversion): Same here
19921         (Invocation::ConversionExists): Ditto.
19922
19923         (Invocation::ConversionExists): Implement.
19924
19925 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19926
19927         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19928         Also take an additional TypeContainer argument.
19929
19930         * All over : Pass in TypeContainer as argument to OverloadResolve.
19931
19932         * typemanager.cs (CSharpName): Update to check for the string type and return
19933         that too.
19934
19935         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19936         a given method.
19937
19938 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19939
19940         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19941         (Invocation::BetterFunction): Implement.
19942         (Invocation::BetterConversion): Implement.
19943         (Invocation::ConversionExists): Skeleton, no implementation yet.
19944
19945         Okay, things work fine !
19946
19947 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19948
19949         * typemanager.cs: declare and load enum_type, delegate_type and
19950         void_type. 
19951
19952         * expression.cs (Expression::Emit): Now emit returns a value that
19953         tells whether a value is left on the stack or not.  This strategy
19954         might be reveted tomorrow with a mechanism that would address
19955         multiple assignments.
19956         (Expression::report118): Utility routine to report mismatches on
19957         the ExprClass.
19958
19959         (Unary::Report23): Report impossible type/operator combination
19960         utility function.
19961
19962         (Unary::IsIncrementableNumber): Whether the type can be
19963         incremented or decremented with add.
19964         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19965         complemented. 
19966         (Unary::ResolveOperator): Implement ++, !, ~,
19967
19968         (Invocation::Emit): Deal with new Emit convetion.
19969
19970         * All Expression derivatives: Updated their Emit method to return
19971         whether they leave values on the stack or not.
19972
19973         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19974         stack for expressions that are statements. 
19975
19976 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19977
19978         * expression.cs (LValue): New interface.  Must be implemented by
19979         LValue objects.
19980         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19981         LValue interface.
19982
19983         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19984         interface for generating code, simplifies the code.
19985
19986 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19987
19988         * expression.cs (everywhere): Comment out return statements in ::Resolve
19989         methods to avoid the warnings.
19990
19991 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19992
19993         * driver.cs (parse): Report error 2001 if we can not open the
19994         source file.
19995
19996         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19997         not resolve it.
19998
19999         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20000         object. 
20001
20002         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20003         otherwise nested blocks end up with the same index.
20004
20005         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20006
20007         * expression.cs:  Instead of having FIXMEs in the Resolve
20008         functions, throw exceptions so it is obvious that we are facing a
20009         bug. 
20010
20011         * cs-parser.jay (invocation_expression): Pass Location information.
20012
20013         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20014         Use a basename for those routines because .NET does not like paths
20015         on them. 
20016
20017         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20018         already defined.
20019
20020 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20021
20022         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20023         are loading the correct data types (throws an exception if not).
20024         (TypeManager::InitCoreTypes): Use CoreLookupType
20025
20026         * expression.cs (Unary::ResolveOperator): return the child
20027         expression for expressions which are just +expr.
20028         (Unary::ResolveOperator): Return negative literals for -LITERAL
20029         expressions (otherwise they are Unary {Literal}).
20030         (Invocation::Badness): Take into account `Implicit constant
20031         expression conversions'.
20032
20033         * literal.cs (LongLiteral): Implement long literal class.
20034         (IntLiteral): export the `Value' of the intliteral. 
20035
20036 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20037
20038         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20039
20040         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20041         instead of 'Operator'
20042
20043         * expression.cs (Binary::ResolveOperator): Update accordingly.
20044         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20045         and 'Minus'
20046
20047         * cs-parser.jay (unary_expression): Update to use the new names.
20048
20049         * gen-treedump.cs (GetUnary): Same here.
20050
20051         * expression.cs (Unary::Resolve): Implement.
20052         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20053         operators are found instead of making noise ;-)
20054         (Unary::ResolveOperator): New method to do precisely the same thing which
20055         Binary::ResolveOperator does for Binary expressions.
20056         (Unary.method, .Arguments): Add.
20057         (Unary::OperName): Implement.   
20058         (Unary::ForceConversion): Copy and Paste !
20059
20060         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20061         a unary operator.
20062
20063         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20064         for the inbuilt operators. Only overloading works for now ;-)
20065
20066 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20067
20068         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20069         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20070
20071         * expression.cs (This::Emit): Implement. 
20072         (This::Resolve): Implement.
20073         (TypeOf:Resolve): Implement.
20074         (Expression::ResolveSimpleName): Add an implicit this to instance
20075         field references. 
20076         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20077         Bind instance variable to Field expressions.
20078         (FieldExpr::Instance): New field used to track the expression that
20079         represents the object instance.
20080         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20081         binding 
20082         (FieldExpr::Emit): Implement.
20083
20084         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20085         the last instruction contains a return opcode to avoid generating
20086         the last `ret' instruction (this generates correct code, and it is
20087         nice to pass the peverify output).
20088
20089         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20090         initializer for static and instance variables.
20091         (Constructor::Emit): Allow initializer to be null in the case of
20092         static constructors.  Only emit initializer for instance
20093         constructors. 
20094
20095         (TypeContainer::FindMembers): Return a null array if there are no
20096         matches.
20097
20098         Also fix the code for the MemberTypes.Method branch, as it was not
20099         scanning that for operators (or tried to access null variables before).
20100
20101         * assign.cs (Assign::Emit): Handle instance and static fields. 
20102
20103         * TODO: Updated.
20104
20105         * driver.cs: Stop compilation if there are parse errors.
20106
20107         * cs-parser.jay (constructor_declaration): Provide default base
20108         initializer for non-static constructors.
20109         (constructor_declarator): Do not provide a default base
20110         initializers if none was specified.
20111         Catch the fact that constructors should not have parameters.
20112
20113         * class.cs: Do not emit parent class initializers for static
20114         constructors, that should be flagged as an error.
20115
20116 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20117
20118         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20119         Move back code into TypeContainer::Populate.
20120
20121 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20122
20123         * class.cs (TypeContainer::AddConstructor): Fix the check to
20124         compare against Name, not Basename. 
20125         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20126
20127         * cs-parser.jay : Update accordingly.
20128
20129         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20130         for methods, don't forget to look into the operators too.
20131         (RegisterMethodBuilder): Helper method to take care of this for
20132         methods, constructors and operators.
20133         (Operator::Define): Completely revamp.
20134         (Operator.OperatorMethod, MethodName): New fields.
20135         (TypeContainer::Populate): Move the registering of builders into
20136         RegisterMethodBuilder.
20137         (Operator::Emit): Re-write.
20138
20139         * expression.cs (Binary::Emit): Comment out code path to emit method
20140         invocation stuff for the case when we have a user defined operator. I am
20141         just not able to get it right !
20142
20143 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20144
20145         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20146         argument. 
20147
20148         (Expression::MemberLookup): Provide a version that allows to
20149         specify the MemberTypes and BindingFlags. 
20150
20151         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20152         so it was not fetching variable information from outer blocks.
20153
20154         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20155         Beforefieldinit as it was buggy.
20156
20157         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20158         that Ravi put here.  
20159
20160         * class.cs (Constructor::Emit): Only emit if block is not null.
20161         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20162         deal with this by semantically definining it as if the user had
20163         done it.
20164
20165         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20166         constructors as we now "emit" them at a higher level.
20167
20168         (TypeContainer::DefineDefaultConstructor): Used to define the
20169         default constructors if none was provided.
20170
20171         (ConstructorInitializer): Add methods Resolve and Emit. 
20172
20173         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20174
20175 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20176
20177         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20178         the default constructor builder with our hashtable for methodbuilders
20179         to methodcores.
20180
20181         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20182         and argument_count is 0 in which case we have a match.
20183         (Binary::ResolveOperator): More null checking and miscellaneous coding
20184         style cleanup.
20185
20186 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20187
20188         * rootcontext.cs (IsNameSpace): Compare against null.
20189
20190         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20191
20192         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20193         and Unary::Operator.
20194
20195         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20196         accordingly.
20197
20198         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20199         we have overloaded operators.
20200         (Binary::ResolveOperator): Implement the part which does the operator overload
20201         resolution.
20202
20203         * class.cs (Operator::Emit): Implement.
20204         (TypeContainer::Emit): Emit the operators we have too.
20205
20206         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20207         the case when we have a user-defined operator.
20208
20209 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20212
20213 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20214
20215         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20216         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20217         (Constructor::Emit): Implement.
20218         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20219         if we have no work to do. 
20220         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20221         Emit method.
20222
20223         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20224         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20225
20226         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20227         of parent.parent.
20228
20229 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20230
20231         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20232         in the source.
20233         (Tree::RecordNamespace): Method to do what the name says ;-)
20234         (Tree::Namespaces): Property to get at the namespaces hashtable.
20235
20236         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20237         keep track.
20238
20239         * rootcontext.cs (IsNamespace): Fixed it :-)
20240
20241 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20242
20243         * class.cs (TypeContainer::FindMembers): Add support for
20244         constructors. 
20245         (MethodCore): New class that encapsulates both the shared aspects
20246         of a Constructor and a Method.  
20247         (Method, Constructor): Factored pieces into MethodCore.
20248
20249         * driver.cs: Added --fatal which makes errors throw exceptions.
20250         Load System assembly as well as part of the standard library.
20251
20252         * report.cs: Allow throwing exceptions on errors for debugging.
20253
20254         * modifiers.cs: Do not use `parent', instead use the real type
20255         container to evaluate permission settings.
20256
20257         * class.cs: Put Ravi's patch back in.  He is right, and we will
20258         have to cope with the
20259
20260 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20261
20262         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20263         FamORAssem, not FamANDAssem.
20264
20265 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20266
20267         * driver.cs: Added --parse option that only parses its input files
20268         and terminates.
20269
20270         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20271         incorrect.  IsTopLevel is not used to tell whether an object is
20272         root_types or not (that can be achieved by testing this ==
20273         root_types).  But to see if this is a top-level *class* (not
20274         necessarly our "toplevel" container). 
20275
20276 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20277
20278         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20279         parent instead of a direct call to GetType.
20280
20281 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20282
20283         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20284         Modifiers.TypeAttr. This should just be a call to that method.
20285
20286         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20287         object so that we can determine if we are top-level or not.
20288
20289         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20290         TypeContainer too.
20291
20292         * enum.cs (Enum::Define): Ditto.
20293
20294         * modifiers.cs (FieldAttr): Re-write.
20295
20296         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20297         (TypeContainer::HaveStaticConstructor): New property to provide access
20298         to precisely that info.
20299
20300         * modifiers.cs (MethodAttr): Re-write.
20301         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20302
20303         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20304         of top-level types as claimed.
20305
20306 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * expression.cs (MemberLookup): Fruitless attempt to lookup
20309         constructors.  Maybe I need to emit default constructors?  That
20310         might be it (currently .NET emits this for me automatically).
20311         (Invocation::OverloadResolve): Cope with Arguments == null.
20312         (Invocation::EmitArguments): new function, shared by the new
20313         constructor and us.
20314         (Invocation::Emit): Handle static and instance methods.  Emit
20315         proper call instruction for virtual or non-virtual invocations.
20316         (New::Emit): Implement.
20317         (New::Resolve): Implement.
20318         (MemberAccess:Resolve): Implement.
20319         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20320         to track instances.
20321         (FieldExpr::Resolve): Set type.
20322
20323         * support.cs: Handle empty arguments.
20324                 
20325         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20326         SimpleLookup): Auxiliary routines to help parse a qualifier
20327         identifier.  
20328
20329         Update qualifier_identifier rule.
20330
20331         * codegen.cs: Removed debugging messages.
20332
20333         * class.cs: Make this a global thing, this acts just as a "key" to
20334         objects that we might have around.
20335
20336         (Populate): Only initialize method_builders_to_methods once.
20337
20338         * expression.cs (PropertyExpr): Initialize type from the
20339         PropertyType. 
20340
20341         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20342         Resolve pattern.  Attempt to implicitly convert value to boolean.
20343         Emit code.
20344
20345         * expression.cs: Set the type for the int32/int32 argument case.
20346         (Binary::ResolveOperator): Set the return type to boolean for
20347         comparission operators
20348
20349         * typemanager.cs: Remove debugging print code.
20350
20351         (Invocation::Resolve): resolve type.
20352
20353         * class.cs: Allocate a MemberInfo of the correct size, as the code
20354         elsewhere depends on the test to reflect the correct contents.
20355
20356         (Method::) Keep track of parameters, due to System.Reflection holes
20357
20358         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20359         mapping here.
20360
20361         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20362         of the exact size and return that.
20363
20364         (Class::LookupMethodByBuilder): New function that maps
20365         MethodBuilders to its methods.  Required to locate the information
20366         on methods because System.Reflection bit us again.
20367
20368         * support.cs: New file, contains an interface ParameterData and
20369         two implementations: ReflectionParameters and InternalParameters
20370         used to access Parameter information.  We will need to grow this
20371         as required.
20372
20373         * expression.cs (Invocation::GetParameterData): implement a cache
20374         and a wrapper around the ParameterData creation for methods. 
20375         (Invocation::OverloadResolve): Use new code.
20376
20377 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20378
20379         * class.cs (TypeContainer::EmitField): Remove and move into 
20380         (Field::Define): here and modify accordingly.
20381         (Field.FieldBuilder): New member.
20382         (TypeContainer::Populate): Update accordingly.
20383         (TypeContainer::FindMembers): Implement.
20384
20385 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20386
20387         * statement.cs: (VariableInfo::VariableType): New field to be
20388         initialized with the full type once it is resolved. 
20389
20390 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * parameter.cs (GetParameterInfo): Use a type cache to compute
20393         things only once, and to reuse this information
20394
20395         * expression.cs (LocalVariableReference::Emit): Implement.
20396         (OpcodeCast::Emit): fix.
20397
20398         (ParameterReference::Resolve): Implement.
20399         (ParameterReference::Emit): Implement.
20400
20401         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20402         that are expressions need to stay as Expressions.
20403
20404         * typemanager.cs (CSharpName): Returns the C# name of a type if
20405         possible. 
20406
20407         * expression.cs (Expression::ConvertImplicit): New function that
20408         implements implicit type conversions.
20409
20410         (Expression::ImplicitReferenceConversion): Implements implicit
20411         reference conversions.
20412
20413         (EmptyCast): New type for transparent casts.
20414
20415         (OpcodeCast): New type for casts of types that are performed with
20416         a sequence of bytecodes.
20417
20418         (BoxedCast): New type used for casting value types into reference
20419         types.  Emits a box opcode.
20420
20421         (Binary::DoNumericPromotions): Implements numeric promotions of
20422         and computation of the Binary::Type.
20423
20424         (Binary::EmitBranchable): Optimization.
20425
20426         (Binary::Emit): Implement code emission for expressions.
20427
20428         * typemanager.cs (TypeManager): Added two new core types: sbyte
20429         and byte.
20430
20431 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20432
20433         * class.cs (TypeContainer::FindMembers): Method which does exactly
20434         what Type.FindMembers does, only we don't have to use reflection. No
20435         implementation yet.
20436
20437         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20438         typecontainer objects as we need to get at them.
20439         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20440
20441         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20442         typecontainer object.
20443
20444         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20445         of just a Report object.
20446
20447 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20448
20449         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20450         "remove_"
20451         (TypeContainer::Populate): Now define the delegates of the type too.
20452         (TypeContainer.Delegates): Property to access the list of delegates defined
20453         in the type.
20454
20455         * delegates.cs (Delegate::Define): Implement partially.
20456
20457         * modifiers.cs (TypeAttr): Handle more flags.
20458
20459 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20460
20461         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20462         and not <=
20463         (Operator::Define): Re-write logic to get types by using the LookupType method
20464         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20465         (Indexer::Define): Ditto.
20466         (Event::Define): Ditto.
20467         (Property::Define): Ditto.
20468
20469 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20470
20471         * class.cs (TypeContainer::Populate): Now define operators too. 
20472         (TypeContainer.Operators): New property to access the list of operators
20473         in a type.
20474         (Operator.OperatorMethodBuilder): New member to hold the method builder
20475         for the operator we are defining.
20476         (Operator::Define): Implement.
20477
20478 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20479
20480         * class.cs (Event::Define): Make the prefixes of the accessor methods
20481         addOn_ and removeOn_ 
20482
20483         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20484         of the location being passed in too. Ideally, this should go later since all
20485         error reporting should be done through the Report object.
20486
20487         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20488         (Populate): Iterate thru the indexers we have and define them too.
20489         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20490         for the get and set accessors.
20491         (Indexer::Define): Implement.
20492
20493 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20494
20495         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20496         my previous implementation, did not work.
20497
20498         * typemanager.cs: Add a couple of missing types (the longs).
20499
20500         * literal.cs: Use TypeManager.bool_type instead of getting it.
20501
20502         * expression.cs (EventExpr): New kind of expressions.
20503         (Expressio::ExprClassFromMemberInfo): finish
20504
20505 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * assign.cs: Emit stores to static fields differently.
20508
20509 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20510
20511         * Merge in changes and adjust code to tackle conflicts. Backed out my
20512         code in Assign::Resolve ;-) 
20513
20514 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20515
20516         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20517         instead Report.Error and also pass in the location.
20518         (CSharpParser::Lexer): New readonly property to return the reference
20519         to the Tokenizer object.
20520         (declare_local_variables): Use Report.Error with location instead of plain 
20521         old error.
20522         (CheckDef): Ditto.
20523
20524         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20525         (Operator.CheckBinaryOperator): Ditto.
20526
20527         * cs-parser.jay (operator_declarator): Update accordingly.
20528
20529         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20530         (CheckBinaryOperator): Same here.
20531
20532         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20533         on the name without any prefixes of namespace names etc. This is because we
20534         already might have something already fully qualified like 
20535         'System.Console.WriteLine'
20536
20537         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20538
20539 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20540
20541         * cs-tokenizer.cs (location): Return a string which also contains
20542         the file name.
20543
20544         * expression.cs (ElementAccess): New class for expressions of the
20545         type 'element access.'
20546         (BaseAccess): New class for expressions of the type 'base access.'
20547         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20548         respectively.
20549
20550         * cs-parser.jay (element_access): Implement action.
20551         (base_access): Implement actions.
20552         (checked_expression, unchecked_expression): Implement.
20553
20554         * cs-parser.jay (local_variable_type): Correct and implement.
20555         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20556
20557         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20558
20559         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20560         name and the specifiers.
20561
20562         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20563
20564         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20565         making them all public ;-)
20566
20567         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20568         class anyways.
20569
20570 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20573         PropertyExprs.
20574         (FieldExpr, PropertyExprs): New resolved expressions.
20575         (SimpleName::MemberStaticCheck): Perform static checks for access
20576         to non-static fields on static methods. Maybe this should be
20577         generalized for MemberAccesses. 
20578         (SimpleName::ResolveSimpleName): More work on simple name
20579         resolution. 
20580
20581         * cs-parser.jay (primary_expression/qualified_identifier): track
20582         the parameter index.
20583
20584         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20585         (EmitContext::EmitBoolExpression): Chain to expression generation
20586         instead of temporary hack.
20587         (::EmitStatementExpression): Put generic expression code generation.
20588
20589         * assign.cs (Assign::Emit): Implement variable assignments to
20590         local variables, parameters and fields.
20591
20592 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * statement.cs (Block::GetVariableInfo): New method, returns the
20595         VariableInfo for a variable name in a block.
20596         (Block::GetVariableType): Implement in terms of GetVariableInfo
20597
20598         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20599         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20600
20601 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20602
20603         * cs-parser.jay (operator_declaration): Continue on my quest : update
20604         to take attributes argument.
20605         (event_declaration): Ditto.
20606         (enum_declaration): Ditto.
20607         (indexer_declaration): Ditto.
20608
20609         * class.cs (Operator::Operator): Update constructor accordingly.
20610         (Event::Event): Ditto.
20611
20612         * delegate.cs (Delegate::Delegate): Same here.
20613
20614         * enum.cs (Enum::Enum): Same here.
20615
20616 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20617
20618         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20619
20620         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20621
20622         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20623         being passed around as an arraylist.
20624         (Attributes::AddAttribute): Method to add attribute sections.
20625
20626         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20627         (struct_declaration): Update accordingly.
20628         (constant_declaration): Update.
20629         (field_declaration): Update.
20630         (method_header): Update.
20631         (fixed_parameter): Update.
20632         (parameter_array): Ditto.
20633         (property_declaration): Ditto.
20634         (destructor_declaration): Ditto.
20635
20636         * class.cs (Struct::Struct): Update constructors accordingly.
20637         (Class::Class): Ditto.
20638         (Field::Field): Ditto.
20639         (Method::Method): Ditto.
20640         (Property::Property): Ditto.
20641         (TypeContainer::OptAttribute): update property's return type.
20642
20643         * interface.cs (Interface.opt_attributes): New member.
20644         (Interface::Interface): Update to take the extra Attributes argument.
20645
20646         * parameter.cs (Parameter::Parameter): Ditto.
20647
20648         * constant.cs (Constant::Constant): Ditto.
20649
20650         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20651         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20652         the attributes as a parameter.
20653         (InterfaceProperty): Update constructor call.
20654         (InterfaceEvent): Ditto.
20655         (InterfaceMethod): Ditto.
20656         (InterfaceIndexer): Ditto.
20657
20658         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20659         pass the attributes too.
20660         (interface_event_declaration): Ditto.
20661         (interface_property_declaration): Ditto.
20662         (interface_method_declaration): Ditto.
20663         (interface_declaration): Ditto.
20664
20665 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20666
20667         * class.cs (Method::Define): Track the "static Main" definition to
20668         create an entry point. 
20669
20670         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20671         EntryPoint if we find it. 
20672
20673         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20674         (EmitContext::ig): Make this variable public.
20675
20676         * driver.cs: Make the default output file be the first file name
20677         with the .exe extension.  
20678
20679         Detect empty compilations
20680
20681         Handle various kinds of output targets.  Handle --target and
20682         rename -t to --dumper.
20683
20684         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20685         methods inherited from Expression return now an Expression.  This
20686         will is used during the tree rewriting as we resolve them during
20687         semantic analysis.
20688
20689         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20690         the spec.  Missing entirely is the information about
20691         accessability of elements of it.
20692
20693         (Expression::ExprClassFromMemberInfo): New constructor for
20694         Expressions that creates a fully initialized Expression based on
20695         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20696         a Type.
20697
20698         (Invocation::Resolve): Begin implementing resolution of invocations.
20699
20700         * literal.cs (StringLiteral):  Implement Emit.
20701
20702 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20703
20704         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20705         member.
20706
20707 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20708
20709         * cs-parser.jay (attribute_arguments): Implement actions.
20710         (attribute): Fix bug in production. Implement action.
20711         (attribute_list): Implement.
20712         (attribute_target): Implement.
20713         (attribute_target_specifier, opt_target_specifier): Implement
20714         (CheckAttributeTarget): New method to check if the attribute target
20715         is valid.
20716         (attribute_section): Implement.
20717         (opt_attributes): Implement.
20718
20719         * attribute.cs : New file to handle attributes.
20720         (Attribute): Class to hold attribute info.
20721
20722         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20723         (attribute_section): Modify production to use 2 different rules to 
20724         achieve the same thing. 1 s/r conflict down !
20725         Clean out commented, useless, non-reducing dimension_separator rules.
20726
20727         * class.cs (TypeContainer.attributes): New member to hold list
20728         of attributes for a type.
20729         (Struct::Struct): Modify to take one more argument, the attribute list.
20730         (Class::Class): Ditto.
20731         (Field::Field): Ditto.
20732         (Method::Method): Ditto.
20733         (Property::Property): Ditto.
20734
20735         * cs-parser.jay (struct_declaration): Update constructor call to
20736         pass in the attributes too.
20737         (class_declaration): Ditto.
20738         (constant_declaration): Ditto.
20739         (field_declaration): Ditto.
20740         (method_header): Ditto.
20741         (fixed_parameter): Ditto.
20742         (parameter_array): Ditto.
20743         (property_declaration): Ditto.
20744
20745         * constant.cs (Constant::Constant): Update constructor similarly.
20746         Use System.Collections.
20747
20748         * parameter.cs (Parameter::Parameter): Update as above.
20749
20750 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20751
20752         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20753         (TypeContainer.delegates): New member to hold list of delegates.
20754
20755         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20756         this time as I seem to be on crack ;-)
20757
20758 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20759
20760         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20761         tell whether an identifier represents a namespace.
20762
20763         * expression.cs (NamespaceExpr): A namespace expression, used only
20764         temporarly during expression resolution.
20765         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20766         utility functions to resolve names on expressions.
20767
20768 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * codegen.cs: Add hook for StatementExpressions. 
20771
20772         * class.cs: Fix inverted test for static flag in methods.
20773
20774 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20775
20776         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20777         to make it coincide with MS' number.
20778         (Operator::CheckBinaryOperator): Ditto.
20779
20780         * ../errors/errors.txt : Remove error numbers added earlier.
20781
20782         * ../errors/cs1019.cs : Test case for error # 1019
20783
20784         * ../errros/cs1020.cs : Test case for error # 1020
20785
20786         * cs-parser.jay : Clean out commented cruft.
20787         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20788         used anywhere - non-reducing rule.
20789         (namespace_declarations): Non-reducing rule - comment out.
20790
20791         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20792         with TypeContainer::AddEnum.
20793
20794         * delegate.cs : New file for delegate handling classes.
20795         (Delegate): Class for declaring delegates.
20796
20797         * makefile : Update.
20798
20799         * cs-parser.jay (delegate_declaration): Implement.
20800
20801 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20802
20803         * class.cs (Event::Define): Implement.
20804         (Event.EventBuilder): New member.
20805
20806         * class.cs (TypeContainer::Populate): Update to define all enums and events
20807         we have.
20808         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20809         readonly fields for all these cases ?
20810
20811 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20812
20813         * class.cs (Property): Revamp to use the convention of making fields readonly.
20814         Accordingly modify code elsewhere.
20815
20816         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20817         the Define method of the Property class.
20818
20819         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20820         trivial bug.
20821         (TypeContainer::Populate): Update to define all the properties we have. Also
20822         define all enumerations.
20823
20824         * enum.cs (Define): Implement.
20825
20826 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20827
20828         * cs-parser.jay (overloadable_operator): The semantic value is an
20829         enum of the Operator class.
20830         (operator_declarator): Implement actions.
20831         (operator_declaration): Implement.
20832
20833         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20834         validity of definitions.
20835         (Operator::CheckBinaryOperator): Static method to check for binary operators
20836         (TypeContainer::AddOperator): New method to add an operator to a type.
20837
20838         * cs-parser.jay (indexer_declaration): Added line to actually call the
20839         AddIndexer method so it gets added ;-)
20840
20841         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20842         already taken care of by the MS compiler ?  
20843
20844 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20845
20846         * class.cs (Operator): New class for operator declarations.
20847         (Operator::OpType): Enum for the various operators.
20848
20849 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20850
20851         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20852         ostensibly handle this in semantic analysis.
20853
20854         * cs-parser.jay (general_catch_clause): Comment out
20855         (specific_catch_clauses, specific_catch_clause): Ditto.
20856         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20857         (catch_args, opt_catch_args): New productions.
20858         (catch_clause): Rewrite to use the new productions above
20859         (catch_clauses): Modify accordingly.
20860         (opt_catch_clauses): New production to use in try_statement
20861         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20862         and re-write the code in the actions to extract the specific and
20863         general catch clauses by being a little smart ;-)
20864
20865         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20866         Hooray, try and catch statements parse fine !
20867
20868 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20869
20870         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20871         string from the hashtable of variables.
20872
20873         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20874         I end up making that mistake ;-)
20875         (catch_clauses): Fixed gross error which made Key and Value of the 
20876         DictionaryEntry the same : $1 !!
20877
20878 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20879
20880         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20881
20882         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20883         when the add and remove accessors are specified. 
20884
20885 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20886
20887         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20888         information about indexer_declarator.
20889         (indexer_declarator): Implement actions.
20890         (parsing_indexer): New local boolean used to keep track of whether
20891         we are parsing indexers or properties. This is necessary because 
20892         implicit_parameters come into picture even for the get accessor in the 
20893         case of an indexer.
20894         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20895
20896         * class.cs (Indexer): New class for indexer declarations.
20897         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20898         (TypeContainer::indexers): New member to hold list of indexers for the
20899         type.
20900
20901 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20902
20903         * cs-parser.jay (add_accessor_declaration): Implement action.
20904         (remove_accessor_declaration): Implement action.
20905         (event_accessors_declaration): Implement
20906         (variable_declarators): swap statements for first rule - trivial.
20907
20908         * class.cs (Event): New class to hold information about event
20909         declarations.
20910         (TypeContainer::AddEvent): New method to add an event to a type
20911         (TypeContainer::events): New member to hold list of events.
20912
20913         * cs-parser.jay (event_declaration): Implement actions.
20914
20915 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20916
20917         * cs-parser.jay (dim_separators): Implement. Make it a string
20918         concatenating all the commas together, just as they appear.
20919         (opt_dim_separators): Modify accordingly
20920         (rank_specifiers): Update accordingly. Basically do the same
20921         thing - instead, collect the brackets here.
20922         (opt_rank_sepcifiers): Modify accordingly.
20923         (array_type): Modify to actually return the complete type string
20924         instead of ignoring the rank_specifiers.
20925         (expression_list): Implement to collect the expressions
20926         (variable_initializer): Implement. We make it a list of expressions
20927         essentially so that we can handle the array_initializer case neatly too.
20928         (variable_initializer_list): Implement.
20929         (array_initializer): Make it a list of variable_initializers
20930         (opt_array_initializer): Modify accordingly.
20931
20932         * expression.cs (New::NType): Add enumeration to help us
20933         keep track of whether we have an object/delegate creation
20934         or an array creation.
20935         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20936         members to hold data about array creation.
20937         (New:New): Modify to update NewType
20938         (New:New): New Overloaded contructor for the array creation
20939         case.
20940
20941         * cs-parser.jay (array_creation_expression): Implement to call
20942         the overloaded New constructor.
20943
20944 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20945
20946         * class.cs (TypeContainer::Constructors): Return member
20947         constructors instead of returning null.
20948
20949 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20950
20951         * typemanager.cs (InitCoreTypes): Initialize the various core
20952         types after we have populated the type manager with the user
20953         defined types (this distinction will be important later while
20954         compiling corlib.dll)
20955
20956         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20957         on Expression Classification.  Now all expressions have a method
20958         `Resolve' and a method `Emit'.
20959
20960         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20961         generation from working.     Also add some temporary debugging
20962         code. 
20963
20964 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20965
20966         * codegen.cs: Lots of code generation pieces.  This is only the
20967         beginning, will continue tomorrow with more touches of polish.  We
20968         handle the fundamentals of if, while, do, for, return.  Others are
20969         trickier and I need to start working on invocations soon.
20970
20971         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20972         s.InitStatement. 
20973
20974         * codegen.cs (EmitContext): New struct, used during code
20975         emission to keep a context.   Most of the code generation will be
20976         here. 
20977
20978         * cs-parser.jay: Add embedded blocks to the list of statements of
20979         this block.  So code generation proceeds in a top down fashion.
20980
20981 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * statement.cs: Add support for multiple child blocks.
20984
20985 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * codegen.cs (EmitCode): New function, will emit the code for a
20988         Block of code given a TypeContainer and its ILGenerator. 
20989
20990         * statement.cs (Block): Standard public readonly optimization.
20991         (Block::Block constructors): Link children. 
20992         (Block::Child): Child Linker.
20993         (Block::EmitVariables): Emits IL variable declarations.
20994
20995         * class.cs: Drop support for MethodGroups here, delay until
20996         Semantic Analysis.
20997         (Method::): Applied the same simplification that I did before, and
20998         move from Properties to public readonly fields.
20999         (Method::ParameterTypes): Returns the parameter types for the
21000         function, and implements a cache that will be useful later when I
21001         do error checking and the semantic analysis on the methods is
21002         performed.
21003         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21004         and made a method, optional argument tells whether this is a class
21005         or a structure to apply the `has-this' bit.
21006         (Method::GetCallingConvention): Implement, returns the calling
21007         convention. 
21008         (Method::Define): Defines the type, a second pass is performed
21009         later to populate the methods.
21010
21011         (Constructor::ParameterTypes): implement a cache similar to the
21012         one on Method::ParameterTypes, useful later when we do semantic
21013         analysis. 
21014
21015         (TypeContainer::EmitMethod):  New method.  Emits methods.
21016
21017         * expression.cs: Removed MethodGroup class from here.
21018
21019         * parameter.cs (Parameters::GetCallingConvention): new method.
21020
21021 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21022
21023         * class.cs (TypeContainer::Populate): Drop RootContext from the
21024         argument. 
21025
21026         (Constructor::CallingConvention): Returns the calling convention.
21027         (Constructor::ParameterTypes): Returns the constructor parameter
21028         types. 
21029
21030         (TypeContainer::AddConstructor): Keep track of default constructor
21031         and the default static constructor.
21032
21033         (Constructor::) Another class that starts using `public readonly'
21034         instead of properties. 
21035
21036         (Constructor::IsDefault): Whether this is a default constructor. 
21037
21038         (Field::) use readonly public fields instead of properties also.
21039
21040         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21041         track of static constructors;  If none is used, turn on
21042         BeforeFieldInit in the TypeAttributes. 
21043
21044         * cs-parser.jay (opt_argument_list): now the return can be null
21045         for the cases where there are no arguments. 
21046
21047         (constructor_declarator): If there is no implicit `base' or
21048         `this', then invoke the default parent constructor. 
21049
21050         * modifiers.cs (MethodAttr): New static function maps a set of
21051         modifiers flags into a MethodAttributes enum
21052         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21053         MethodAttr, TypeAttr to represent the various mappings where the
21054         modifiers are used.
21055         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21056
21057 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21060         method arguments.
21061
21062         * interface.cs (PopulateIndexer): Implemented the code generator
21063         for interface indexers.
21064
21065 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21066
21067         * interface.cs (InterfaceMemberBase): Now we track the new status
21068         here.  
21069
21070         (PopulateProperty): Implement property population.  Woohoo!  Got
21071         Methods and Properties going today. 
21072
21073         Removed all the properties for interfaces, and replaced them with
21074         `public readonly' fields. 
21075
21076 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21077
21078         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21079         initialize their hashtables/arraylists only when they are needed
21080         instead of doing this always.
21081
21082         * parameter.cs: Handle refs and out parameters.
21083
21084         * cs-parser.jay: Use an ArrayList to construct the arguments
21085         instead of the ParameterCollection, and then cast that to a
21086         Parameter[] array.
21087
21088         * parameter.cs: Drop the use of ParameterCollection and use
21089         instead arrays of Parameters.
21090
21091         (GetParameterInfo): Use the Type, not the Name when resolving
21092         types. 
21093
21094 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21095
21096         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21097         and instead use public readonly fields.
21098
21099         * class.cs: Put back walking code for type containers.
21100
21101 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21102
21103         * class.cs (MakeConstant): Code to define constants.
21104
21105         * rootcontext.cs (LookupType): New function.  Used to locate types 
21106
21107
21108 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21109
21110         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21111         this System.Reflection code is.  Kudos to Microsoft
21112
21113         * typemanager.cs: Implement a type cache and avoid loading all
21114         types at boot time.  Wrap in LookupType the internals.  This made
21115         the compiler so much faster.  Wow.  I rule!
21116
21117         * driver.cs: Make sure we always load mscorlib first (for
21118         debugging purposes, nothing really important).
21119
21120         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21121         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21122
21123         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21124         on namespaces that have been imported using the `using' keyword.
21125
21126         * class.cs (TypeContainer::TypeAttr): Virtualize.
21127         (Class::TypeAttr): Return attributes suitable for this bad boy.
21128         (Struct::TypeAttr): ditto.
21129         Handle nested classes.
21130         (TypeContainer::) Remove all the type visiting code, it is now
21131         replaced with the rootcontext.cs code
21132
21133         * rootcontext.cs (GetClassBases): Added support for structs. 
21134
21135 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21136
21137         * interface.cs, statement.cs, class.cs, parameter.cs,
21138         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21139         Drop use of TypeRefs, and use strings instead.
21140
21141 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * rootcontext.cs: 
21144
21145         * class.cs (Struct::Struct): set the SEALED flags after
21146         checking the modifiers.
21147         (TypeContainer::TypeAttr): new property, returns the
21148         TypeAttributes for a class.  
21149
21150         * cs-parser.jay (type_list): Oops, list production was creating a
21151         new list of base types.
21152
21153         * rootcontext.cs (StdLib): New property.
21154         (GetInterfaceTypeByName): returns an interface by type name, and
21155         encapsulates error handling here.
21156         (GetInterfaces): simplified.
21157         (ResolveTree): Encapsulated all the tree resolution here.
21158         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21159         types. 
21160
21161         * driver.cs: Add support for --nostdlib, to avoid loading the
21162         default assemblies.
21163         (Main): Do not put tree resolution here. 
21164
21165         * rootcontext.cs: Beginning of the class resolution.
21166
21167 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * rootcontext.cs: Provide better error reporting. 
21170
21171         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21172
21173         * rootcontext.cs (CreateInterface): Handle the case where there
21174         are no parent interfaces.
21175
21176         (CloseTypes): Routine to flush types at the end.
21177         (CreateInterface): Track types.
21178         (GetInterfaces): Returns an array of Types from the list of
21179         defined interfaces.
21180
21181         * typemanager.c (AddUserType): Mechanism to track user types (puts
21182         the type on the global type hash, and allows us to close it at the
21183         end). 
21184
21185 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21186
21187         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21188         RecordInterface instead.
21189
21190         * cs-parser.jay: Updated to reflect changes above.
21191
21192         * decl.cs (Definition): Keep track of the TypeBuilder type that
21193         represents this type here.  Not sure we will use it in the long
21194         run, but wont hurt for now.
21195
21196         * driver.cs: Smaller changes to accomodate the new code.
21197
21198         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21199         when done. 
21200
21201         * rootcontext.cs (CreateInterface):  New method, used to create
21202         the System.TypeBuilder type for interfaces.
21203         (ResolveInterfaces): new entry point to resolve the interface
21204         hierarchy. 
21205         (CodeGen): Property, used to keep track of the code generator.
21206
21207 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21208
21209         * cs-parser.jay: Add a second production for delegate_declaration
21210         with `VOID'.
21211
21212         (enum_body): Put an opt_comma here instead of putting it on
21213         enum_body or enum_member_declarations so we can handle trailing
21214         commas on enumeration members.  Gets rid of a shift/reduce.
21215
21216         (type_list): Need a COMMA in the middle.
21217
21218         (indexer_declaration): Tell tokenizer to recognize get/set
21219
21220         * Remove old targets.
21221
21222         * Re-add the parser target.
21223
21224 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21225
21226         * cs-parser.jay: Add precendence rules for a number of operators
21227         ot reduce the number of shift/reduce conflicts in the grammar.
21228
21229 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21232         and put it here.
21233
21234         Get rid of old crufty code.
21235
21236         * rootcontext.cs: Use this to keep track of the parsed
21237         representation and the defined types available to the program. 
21238
21239         * gen-treedump.cs: adjust for new convention.
21240
21241         * type.cs: Split out the type manager, and the assembly builder
21242         from here. 
21243
21244         * typemanager.cs: the type manager will live here now.
21245
21246         * cil-codegen.cs: And the code generator here. 
21247
21248 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21249
21250         * makefile: Fixed up for easy making.
21251
21252 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21253
21254         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21255         the 
21256
21257         (unary_expression): Expand pre_increment_expression and
21258         post_decrement_expression to reduce a shift/reduce.
21259
21260 2001-07-11  Simon Cozens
21261
21262         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21263
21264         Improve allow_keyword_as_indent name.
21265
21266 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * Adjustments for Beta2. 
21269
21270 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21271
21272         * decl.cs: Added `Define' abstract method.
21273         (InTransit): new property, used to catch recursive definitions. 
21274
21275         * interface.cs: Implement `Define'. 
21276
21277         * modifiers.cs: Map Modifiers.constants to
21278         System.Reflection.TypeAttribute flags.
21279
21280         * class.cs: Keep track of types and user-defined types.
21281         (BuilderInit): New method for creating an assembly
21282         (ResolveType): New function to launch the resolution process, only
21283         used by interfaces for now.
21284
21285         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21286         that are inserted into the name space. 
21287
21288 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * ARGH.  I have screwed up my tree so many times due to the use of
21291         rsync rather than using CVS.  Going to fix this at once. 
21292
21293         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21294         load types.
21295
21296 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21297
21298         * Experiment successful: Use System.Type rather that our own
21299         version of Type.  
21300
21301 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21302
21303         * cs-parser.jay: Removed nsAliases from here.
21304
21305         Use new namespaces, handle `using XXX;' 
21306
21307         * namespace.cs: Reimplemented namespace handling, use a recursive
21308         definition of the class.  Now we can keep track of using clauses
21309         and catch invalid using clauses.
21310
21311 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * gen-treedump.cs: Adapted for all the renaming.
21314
21315         * expression.cs (Expression): this class now has a Type property
21316         which returns an expression Type.
21317
21318         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21319         `Type', as this has a different meaning now in the base
21320
21321 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21322
21323         * interface.cs, class.cs: Removed from all the sources the
21324         references to signature computation, as we can not do method
21325         signature computation during the parsing time, as we are not
21326         trying to solve at that point distinguishing:
21327
21328         class X {
21329                 void a (Blah x) {}
21330                 void a (NS.Blah x) {}
21331         }
21332
21333         Which depending on the context might be valid or not, as we do not
21334         know if Blah is the same thing as NS.Blah at that point.
21335
21336         * Redid everything so the code uses TypeRefs now instead of
21337         Types.  TypeRefs are just temporary type placeholders, that need
21338         to be resolved.  They initially have a pointer to a string and the
21339         current scope in which they are used.  This is used later by the
21340         compiler to resolve the reference to an actual Type. 
21341
21342         * DeclSpace is no longer a CIR.Type, and neither are
21343         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21344         are all DeclSpaces, but no Types. 
21345
21346         * type.cs (TypeRefManager): This implements the TypeRef manager,
21347         which keeps track of all the types that need to be resolved after
21348         the parsing has finished. 
21349
21350 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21351
21352         * ARGH.  We are going to have to store `foreach' as a class rather
21353         than resolving it, as we need to verify error 1579 after name
21354         resolution.   *OR* we could keep a flag that says `This request to
21355         IEnumerator comes from a foreach statement' which we can then use
21356         to generate the error.
21357
21358 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * class.cs (TypeContainer.AddMethod): we now add methods to the
21361         MethodGroup instead of the method hashtable.  
21362
21363         * expression.cs: Add MethodGroup abstraction, which gets us one
21364         step closer to the specification in the way we handle method
21365         declarations.  
21366
21367         * cs-parser.jay (primary_expression): qualified_identifier now
21368         tried to match up an identifier to a local variable reference or
21369         to a parameter reference.
21370
21371         current_local_parameters is now a parser global variable that
21372         points to the current parameters for the block, used during name
21373         lookup.
21374
21375         (property_declaration): Now creates an implicit `value' argument to
21376         the set accessor.
21377
21378 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21379
21380         * parameter.cs: Do not use `param' arguments as part of the
21381         signature, per the spec.
21382
21383 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21384
21385         * decl.cs: Base class for classes, structs and interfaces.  This
21386         is the "Declaration Space" 
21387
21388         * cs-parser.jay: Use CheckDef for checking declaration errors
21389         instead of having one on each function.
21390
21391         * class.cs: Factor out some code for handling error handling in
21392         accordance to the "Declarations" section in the "Basic Concepts"
21393         chapter in the ECMA C# spec.
21394
21395         * interface.cs: Make all interface member classes derive from
21396         InterfaceMemberBase.
21397
21398 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * Many things: all interfaces are parsed and generated in
21401         gen-treedump.  Support for member variables, constructors,
21402         destructors, properties, constants is there.
21403
21404         Beginning of the IL backend, but very little done, just there for
21405         testing purposes. 
21406
21407 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21408
21409         * cs-parser.jay: Fix labeled statement.
21410
21411         * cs-tokenizer.cs (escape): Escape " and ' always.
21412         ref_line, ref_name: keep track of the line/filename as instructed
21413         by #line by the compiler.
21414         Parse #line.
21415
21416 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21417
21418         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21419         to match the values in System.CodeDOM.
21420
21421         Divid renamed to Divide.
21422
21423         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21424         statements. 
21425         (Statements.set): remove.
21426
21427         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21428         statements. 
21429
21430         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21431         falseStatements always have valid values. 
21432
21433         * cs-parser.jay: Use System.CodeDOM now.
21434