2005-10-23 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2
3         * anonymous.cs (AnonymousContainer): Don't crash when container
4         doesn't exist.
5
6 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7
8         * expression.cs (Binary.DoResolve): Warn when comparing same
9         values.
10
11 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
12
13         Fix #76486.
14         * expression.cs (Binary.DoResolve): It looks like there are no
15         convetsion rules in enum context.
16
17 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18
19         Add support for extern alias qualifiers.
20         * typemanager.cs: Move some LookupTypeReflection code
21         to namespace.cs, to have cleaner code. Added some methods
22         to help us keep track of the extern aliased references.
23         * driver.cs: Add suport for extern alias assemblies on command
24         line and check for their warnings/errors. Also keep track of the
25         extern aliased assemblies.
26         * namespace.cs: Move the global functionality of Namespace
27         to GlobalRootNamespace/RootNamespace. Now the global namespace
28         is GlobalRootNamespace.Globa. Also the code moved from 
29         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
30         Finally added LocalAliasEntry (AliasEntry before) and
31         ExternAliasEntry, to handle alias statements.
32         * cs-parser.jay: Add support in the grammar for extern alias
33         statement.
34         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
35         Update callings to Namespace (now in GlobalRootNamespace).
36
37 2005-10-18  Raja R Harinath  <rharinath@novell.com>
38
39         Fix #76371.
40         * class.cs (TypeContainer.DefineType): Move updating of
41         topological sort earlier in the code.
42         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
43
44 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
45
46         Fix #76273.
47         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
48         
49         * constant.cs (Constant.TryReduce): Moved from Cast class.
50         (Reduce): Made little bit more OO and fixed missing conversions.
51         
52         * ecore.cs (Reduce): Implemented.
53         (Binary.EnumLiftUp): New method to upgrade values to enum values.
54         
55         * literal.cs (Reduce): Implemented.
56         
57         * class.cs: Reverted Miguel's wrong commit.
58
59 2005-10-14  Miguel de Icaza  <miguel@novell.com>
60
61         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
62
63 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
64
65         * cs-parser.jay, expression.cs : CS0214 was missing error location
66           for constants. Fixed bug #76404.
67
68 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
69
70         Fix #76370.
71         * convert.cs (ExplicitConversionCore): Fixed object->enum
72         conversion.
73
74 2005-10-10  Raja R Harinath  <rharinath@novell.com>
75
76         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
77         InstanceExpression.
78         (PropertyExpr.EmitCall): Likewise.
79         * expression.cs (Invocation.EmitArguments): Handle case where
80         arguments == null.
81         (Invocation.EmitCall): Avoid allocating temporary variable if
82         there are no arguments.
83
84 2005-10-07  Raja R Harinath  <rharinath@novell.com>
85
86         Fix #76323.
87         * convert.cs (ImplicitConversionStandard): Move conversion of
88         void* to arbitrary pointer types ...
89         (ExplicitConversionStandard): .. here.
90         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
91         error to always print typenames.
92
93 2005-10-07  Raja R Harinath  <rharinath@novell.com>
94
95         * convert.cs (GetConversionOperator): Rename from
96         GetConversionOperators.  Move operator selection code from ...
97         (UserDefinedConversion): ... here.
98
99 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
100
101         * convert.cs (ExplicitConversionCore): Removed duplicate enum
102         conversion.
103
104 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
105
106         * assign.cs (Assign.DoResolve): Error method changed.
107
108         * cfold.cs (DoConstantNumericPromotions): Error method changed.
109         
110         * const.cs (ResolveValue): Reset in_transit immediately.
111         
112         * constant.cs: Error method changed.
113         
114         * convert.cs: Removed useless location parameter.
115         (ExplicitNumericConversion): Don't do double enum check.
116         (ExplicitConversionCore): Renamed from ExplicitConversion.
117         (ExplicitUnsafe): Extracted from ExplicitConversion.
118         (ExplicitConversion): Uses for error reporting.
119         
120         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
121         error messages.
122         (ResolveBoolean): Uses common error method.
123         (CastToDecimal): Get rid of ec.
124         (CastFromDecimal): Optimized.
125         (ConvCast): Get rid of ec.
126         
127         * enum.cs (ResolveValue): Reset in_transit immediately.
128         (Emit): Return after first error.
129         
130         * expression.cs: Convert changes.
131         
132         * literal.cs: Error method changed.
133         
134         * statement.cs: Error method changed.
135
136 2005-10-03  Raja R Harinath  <rharinath@novell.com>
137
138         * support.cs (SeekableStreamReader.Position): Don't error out when
139         the requested position is just beyond the end of the current
140         buffered data.
141
142 2005-09-28  Raja R Harinath  <rharinath@novell.com>
143
144         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
145         try to keep in sync with the byte count of the underlying Stream.
146         However, this limits us to a window size of 2048 characters: i.e.,
147         the maximum lookahead of our lexer/parser can be 2048 characters.
148
149 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
150
151         Fix #76255.
152         * driver.cs: Fix compilation files with full root path.
153
154 2005-09-25  Miguel de Icaza  <miguel@novell.com>
155
156         * report.cs (SymbolRelatedToPreviousError): Format the output so
157         it does not use an open parenthesis that is never closed. 
158
159         * driver.cs: Follow coding guidelines
160
161 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
162
163         Fix #72930.
164         * const.cs (Const.ResolveValue): Check for assigning non-null
165         value to reference type.
166
167 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
168
169         * anonymous.cs: Implemented ExprClassName.
170         
171         * assign.cs (Assign.DoResolve): Don't chrash when type is not
172         delegate.
173         
174         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
175         check.
176         
177         * class.cs (StaticClass.DefineContainerMembers): Report protected
178         members as error.
179         
180         * codegen.cs: if(ed) PRODUCTION.
181         
182         * convert.cs (Error_CannotImplicitConversion): Better error
183         distinction.
184         
185         * cs-parser.jay: More error checks.
186         
187         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
188         
189         * driver.cs (CSCParseOption): Enabled wrong option check.
190         
191         * ecore.cs (Expression.ExprClassName): Turned to property.
192         (MemberExpr.CheckIntermediateModification): For checking boxed
193         value types     modification.
194         
195         * statement.cs (Fixed.Resolve): Expression type must be
196         convertible to fixed type.
197         (CollectionForeach.GetEnumeratorFilter,TryType):
198         Small refactoring for easier error checking.
199
200 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
201
202         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
203         attributes.
204         
205         * class.cs (GeneratedBaseInitializer): New class for customization
206         compiler generated initializers.
207         (MemberBase.DoDefine): Check Obsolete attribute here.
208         (FieldMember.DoDefine): Ditto.
209         
210         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
211         constants.
212         
213         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
214         (MemberCore.GetObsoleteAttribute): Removed argument.
215         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
216         (MemberCore.CheckObsoleteType): New helper.
217         
218         * delegate.cs,
219         * enum.cs,
220         * statement.cs: Updates after MemberCore changes.
221         
222         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
223         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
224         
225         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
226         obsolete attribute for compiler construct.
227         (As.DoResolve): Cache result.
228         
229         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
230
231 2005-09-26  Raja R Harinath  <rharinath@novell.com>
232
233         Fix #76133.
234         * expression.cs (This.VerifyFixed): In a value type T, the type of
235         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
236         value type R, 'this' is treated as a value parameter.
237
238 2005-09-22  Miguel de Icaza  <miguel@novell.com>
239
240         * statement.cs (Lock): Use the TemporaryVariable class instead of
241         manually using local variables as those do not work when variables
242         are captured.
243
244         * ecore.cs: Moved the TemporaryVariable class from being a nested
245         class inside Foreach to be a public class that can be employed in
246         other places. 
247
248 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
249
250         * cs-parser.jay: interface_accessors replaced by
251         accessor_declarations.
252
253         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
254         location.
255         
256         * statement.cs (GotoCase.Resolve): Convert null constant to
257         null case.
258         (SwitchLabel.ResolveAndReduce): Ditto.
259         (SwitchLabel.NullStringCase): Custom null stamp.
260         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
261         
262         typemanager.cs (CSharpSignature): Don't skip first argument
263         for full names.
264
265 2005-09-18  Miguel de Icaza  <miguel@novell.com>
266
267         * driver.cs: Set InEmacs based on the environment variable EMACS. 
268
269         * location.cs (InEmacs): in this mode, do not report column
270         location as it confuses Emacs.
271
272 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
273
274         * cfold.cs, constant.cs, convert.cs, ecore.cs,
275         expression.cs, iterators.cs, literal.cs: Store constants and
276         literals location.
277         
278         * class.cs (MemberBase.ShortName): Pass location.
279         
280         * cs-parser.jay: Some location fixes.
281         
282         * ecore.cs (Expression.Location): Made virtual.
283
284 2005-09-05  Miguel de Icaza  <miguel@novell.com>
285
286         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
287         if the underlying types are the same, otherwise we need to produce
288         code that will do the proper cast.
289
290         This was exposed by Marek's constant rewrite which produced
291         invalid code for the call site:
292
293         enum X : long { a }
294         void Method (X v) {}
295
296         Method ((X) 5)
297
298         This fixes test-49.cs
299
300 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
301
302         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
303           Type/Object should be allowed as well. Fixed bug #75968.
304
305 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
306
307         * expression.cs : (Binary.DoResolve): when one is enum constant and
308           another is constant 0, then return enum one *as enum type*.
309           Fixed bug 74846.
310
311 2005-09-02  Raja R Harinath  <rharinath@novell.com>
312
313         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
314         internal.
315
316         Fix #75941.
317         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
318         flow-branching for LocalVariableReferences in case we were invoked
319         from a MemberAccess.
320         * expression.cs (LocalVariableReference.VerifyAssigned): New.
321         Carved out of ...
322         (LocalVariableReference.DoResolveBase): ... this.
323         (MemberAccess.Resolve): Do the check that was disabled during
324         SimpleNameResolve.
325
326 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
327
328         * class.cs :
329           (PartialContainer.Create): check abstract/sealed/static strictly
330           but abstract/sealed can exist only at one side. Fixed bug #75883.
331
332 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
333
334         Fix #75945.
335         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
336         specified, don't default to UnmanagedType.I4.
337
338 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
339
340         * expression.cs : conditional operator should check possibly
341           incorrect assign expression. Fixed bug #75946.
342
343 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
344
345         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
346           Reverting the change. gmcs is much complex than mcs on this matter.
347
348 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
349
350         * cs-tokenizer.cs : To read another token ahead of the actual 
351           consumption, use new SavedToken and cache token instead of moving
352           back the stream with SeekableStreamReader (it seemed problematic).
353         * cs-parser.jay,
354           driver.cs : Thus use StreamReader directly.
355         * support.cs : Thus removed SeekableStreamReader.
356
357 2005-08-30  Raja R Harinath  <rharinath@novell.com>
358
359         Fix #75934.
360         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
361         (ScopeInfo.EmitScopeType): Use it to construct field names from
362         names of captured locals.
363
364         Fix #75929.
365         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
366         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
367         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
368         (ExplicitConversion): Remove enum cases already handled by
369         implicit conversion.  Move implicit conversion check to the beginning.
370         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
371         * expression.cs (ArrayCreation.EmitDynamicInitializers):
372         Don't treat System.Enum as a struct.
373
374 2005-08-30  Jb Evain  <jbevain@gmail.com>
375
376         * attribute.cs: handles as expression in parameters.
377
378 2005-08-30  Raja R Harinath  <rharinath@novell.com>
379
380         Fix #75802.
381         * class.cs (TypeContainer.VerifyClsName): Don't use a
382         PartialContainer when verifying CLS compliance.
383         (AbstractPropertyEventMethod): Set Parent here, ...
384         (PropertyMethod): ... not here.
385
386 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
387
388         * attribute.cs : escaped attribute name should not be allowed to be
389           resolved (e.g. @class as classAttribute). Fixed bug #75930.
390
391 2005-08-29  Raja R Harinath  <rharinath@novell.com>
392
393         Fix #75927.
394         * convert.cs (ImplicitStandardConversionExists): Allow zero also
395         when converting a long constant to unsigned long.
396         * expression.cs (Invocation.OverloadResolve): Add sanity check to
397         detect where IsApplicable and VerifyArgumentsCompat disagree.
398
399 2005-08-29  Raja R Harinath  <rharinath@novell.com>
400         and Carlos Alberto Cortez  <carlos@unixmexico.org>
401
402         Fix #75848.
403         * class.cs (TypeContainer.CanElideInitializer): New helper.
404         (TypeContainer.EmitFieldInitializers): Use it to determine if we
405         can safely emitting the initializer of a field.
406
407 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
408
409         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
410           allowed inside a switch (without loop). Fixed bug #75433.
411
412 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
413
414         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
415         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
416
417 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
418
419         * driver.cs : kinda reverting the default encoding changes (not exact 
420           revert since I noticed that "codepage:reset" might not work fine).
421
422 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
423
424         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
425           Location. Now getter and setter store location correctly.
426           (errors/cs0111-12.cs now reports the expected location.)
427
428 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
429
430         * driver.cs : Use default encoding on the environment.
431           Removed (now that) extra parameter for SeekableStreamReader.
432         * support.cs : (SeekableStreamReader) third .ctor() argument for
433           StreamReader is not required (always true). preamble size could
434           be acquired in simpler and safe way.
435
436 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
437
438         * cs-parser.jay: report CS0642 at warning level 3
439           and report CS0642 for an if else statement also
440           fixes bug #74745. Patch by John Luke (and a bit
441           modified by me).
442           Removed extra CS0642 warning check for "while",
443           "for" and "fixed".
444         * statement.cs: In Block.Resolve(), CS0642 check
445           is reimplemented to check a sequence of an empty
446           statement and a block.
447
448           Both fix bug #66777.
449
450 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
451
452         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
453         detection until I fix it.
454         
455         * cs-tokenizer.cs: Changed error message.
456         
457         * cs-parser.jay: Fixed 2 error locations.
458         
459         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
460         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
461         properties.
462         
463         * enum.cs (GetSignatureForError): Fixed.
464         
465         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
466         method detection.
467         
468         * class.cs,
469         * typemanager.cs (RegisterProperty): Removed.
470         
471         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
472
473 2005-08-24  Raja R Harinath  <rharinath@novell.com>
474
475         Fix #75874.
476         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
477         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
478
479 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
480
481         * expression.cs : tiny fix is required for not warning positive ulong.
482           See test-441.cs.
483
484 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
485
486         * expression.cs : add CS0652 check for constant and integral
487           expression. Fixed bug #53974.
488
489 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
490
491         * expression.cs : in DoNumericPromotions(), check if there is implicit
492           conversion overload for string (to check CS0034). Fixed bug #52492.
493
494 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
495
496         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
497
498 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
499
500         * ecore.cs : report location when it is *not* Null.
501
502 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
503
504         * codegen.cs,
505           ecore.cs,
506           flowanalysis.cs,
507           expression.cs:
508           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
509           correctly. Fixed bug #75721.
510
511 2005-08-23  Raja R Harinath  <rharinath@novell.com>
512
513         * support.cs (SeekableStreamReader.Position): Avoid an expensive
514         loop that performs 'min (pos, char_count)'.
515
516         Fix #75862.
517         * expression.cs (Unary.ResolveOperator): Don't discard implicit
518         converted value in Operator.OnesComplement.
519
520 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
521
522         * anonymous.cs: If the anon method is pulled into a helper class,
523         it needs to be `internal' not `private'. Fixes runtime behavior on
524         msft. bug #75704
525
526 2005-08-20  Martin Baulig  <martin@ximian.com>
527
528         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
529         scope if we don't already have it.
530
531         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
532         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
533         fixes #75867.
534
535 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
536
537         Fix #75803
538         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
539         is a partial class.
540
541 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
542
543         The big constants rewrite
544         Fix #75746, #75685 and more
545         As a side effect saved 1MB for MWF ;-)
546         
547         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
548         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
549         enum based for corlib compilation.
550         
551         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
552         subtractions.
553         
554         * class.cs (FixedField.Define): Use ResolveAsConstant.
555         
556         * const.cs (IConstant): Interface constants and enums.
557         (Const.ResolveValue): New method for constant resolvning.
558         (ExternalConstant): Constants from imported assemblies.
559         
560         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
561         conversion; like enums.
562         (Constant.ToType): Converts this constant to different type.
563         (Constant.Increment): Adds 1.
564         
565         * convert.cs (ImplicitConversionRequired): Simplified.
566         
567         * cs-parser.jay: Create EnumMember directly.
568         
569         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
570         
571         * doc.cs (GenerateEnumDocComment): Removed.
572         
573         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
574         (ConvertIntLiteral): Removed.
575         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
576         
577         * enum.cs (EnumMember): Implement IConstant.
578         (Enum.IsValidEnumConstant): Removed.
579         (Enum.GetNextDefaultValue): Removed.
580         (Enum.FindMembers): Updated.
581         (Enum.GenerateDocComment): Iterate enum members.
582         
583         * expression.cs (Cast.TryReduce): Handle enums correctly.
584         (New.Constantify): Made public.
585         (MemberAccess.DoResolve): Removed contant specific if(s).
586         
587         * literal.cs (NullLiteral): Implement new abstract methods.
588         
589         * statement.cs (GotoCase.Resolve): Use new constant methods.
590         (SwitchLabel.ResolveAndReduce): Use new constant methods.
591         
592         * typemanager.cs (LookupEnum): Removed.
593         (IsEnumType): Fixed to work with corlib.
594         (RegisterConstant): Removed.
595         (LookupConstant): Removed.
596         (GetConstant): Changed to work with IConstant.
597
598 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
599
600         * location.cs : Fixed overflown (>255) column number.
601
602 2005-08-03  Raja R Harinath  <rharinath@novell.com>
603
604         First cut of the qualified-alias-member feature.
605         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
606         token.
607         * cs-parser.jay (DOUBLE_COLON): New token.
608         (namespace_or_type_name): Add rule for recognizing
609         qualified-alias-members.
610         (primary_expression): Likewise.
611         (element_access): Allow QualifiedAliasMember as a possible
612         type-bearing expression.
613         (local_variable_type, local_variable_pointer_type): Likewise.
614         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
615         aliases in the current and enclosing namespace declarations.
616         (NamespaceEntry.UsingAlias): Add CS0440 warning.
617         * decl.cs (MemberName.is_double_colon): New.
618         (MemberName.MemberName): Add new constructor for alias-member.
619         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
620         * expression.cs (QualifiedAliasMember): New expression type.
621
622 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
623
624         * location.cs : it borked when no argument was specified.
625
626 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
627
628         * location.cs : tiny ToString() format fix.
629
630 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
631
632         * statement.cs : oops, it was missing.
633
634 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
635
636         A set of fixes for precise line/column location.
637
638         * location.cs :
639           "token" field now holds a file/line "delta", a line number offset 
640           from the segment, and a column number. See also:
641           http://lists.ximian.com/pipermail/mono-devel-list/2004-
642           December/009508.html
643           Removed static IsNull. Use instance IsNull property instead.
644         * cs-tokenizer.cs :
645           For some tokens it stores Location. For Identifier it stores
646           LocatedToken which is a pair of string name and location.
647           Column numbers are adjusted only at getChar().
648         * report.cs :
649           Use Location.ToString() for reporting (it now contains column).
650         * cs-parser.jay :
651           Largely modified to use LocatedToken instead of
652           string (IDENTIFIER), and to acquire Location from some tokens.
653         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
654           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
655           codegen.cs :
656           Now MemberName holds Location. DeclSpace.ctor() receives Location
657           as a parameter. Removed extra parameters to all derived classes.
658           Replaced Location.IsNull() with instance property.
659         * assign.cs, expression.cs :
660           Added .ctor() overload that omits Location.
661         * attribute.cs :
662           Added "nameEscaped" flag that indicates the identifier was escaped
663           in the source file. This fixes bug #57047.
664
665 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
666
667         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
668         New method, looking for lo-case imported cls type.
669
670         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
671         here.
672
673         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
674
675         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
676
677         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
678         all_imported_types.
679         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
680
681         Optimized to save 3.5 MB for SWF compilation.
682
683 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
684
685         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
686         (PartialContainer.Create): Moved logic AddToContainer.
687         (PartialContainer.MarkForDuplicationCheck): Shares name.
688         
689         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
690         place.
691         
692         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
693         initialization.
694         (Namespace.GetSignatureForError): New method.
695         
696         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
697         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
698
699 2005-08-01  Raja R Harinath  <rharinath@novell.com>
700
701         Fix #75669.
702         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
703         member lookup rather than qualifier_type, since qualifier_type can
704         be null.
705
706 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
707
708         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
709         enum member.
710
711 2005-07-31  Miguel de Icaza  <miguel@novell.com>
712
713         * statement.cs: Copy the local exception into the exception
714         captured local.  Fixes 75674
715
716 2005-07-31  Raja R Harinath  <harinath@gmail.com>
717
718         Fix #75658.
719         * expression.cs (Invocation.OverloadResolve): Don't report error
720         CS1501 if error CS1502 has been reported.
721         (New.DoResolve): Delegate CS1501 reporting to
722         Invocation.OverloadResolve.
723
724         Fix #75656.
725         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
726         invariant-meaning-in-block property in an enclosing block if
727         necessary.
728
729 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
730
731         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
732         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
733         (Switch.CheckSwitch): Just save 50kb for SWF.
734
735 2005-07-27  Martin Baulig  <martin@ximian.com>
736
737         * anonymous.cs (CaptureContext.AddField): Added
738         `AnonymousContainer am' argument; compute its toplevel scope if
739         it's not already computed.  Fixes #75649.
740
741 2005-07-26  Raja R Harinath  <rharinath@novell.com>
742
743         Fix #75628.
744         * class.cs (Constructor.Emit): Reset block to null if the block
745         resolve fails.
746
747 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
748
749         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
750
751 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
752
753         * class.cs (MethodData.Define): Check whether accessor implementing
754         interface is public.
755
756         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
757
758 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
759
760         Fix #57245
761         * namespace.cs (LookupType): Moved same type check to...
762         
763         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
764         with the same name.
765
766 2005-07-21  Raja R Harinath  <rharinath@novell.com>
767
768         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
769         already found a typebuilder.
770         * class.cs (MethodCore.IsDuplicateImplementation): Compare
771         MemberNames, not strings.
772
773         * const.cs (Error_ExpressionMustBeConst): 
774         Rename from Error_EpressionMustBeConst.
775         * const.cs, class.cs, statement.cd: Update.
776
777 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
778
779         Fix #65573
780
781         * const.cs (Const.LookupConstantValue): Report missing contant expression
782         everytime.
783         (Error_EpressionMustBeConstant): Only one error method.
784
785         * class.cs, statement.c: Updated.
786
787 2005-07-20  Raja R Harinath  <rharinath@novell.com>
788
789         * statement.cs (Block.Flags): Add back HasVarargs.
790         (Block.flags): Make protected.
791         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
792
793         * typemanager.cs (types, typecontainers, user_types): Remove.
794         (UserTypes, TypeContainers): Likewise.
795         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
796         (CleanUp, Reset): Update.
797         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
798         (GetNestedType): Use Type.GetNestedType.
799         (CoreLookupType): Take two arguments, the namespace and the
800         basename of the type.  Update to use the Namespace.Lookup
801         mechanism.
802         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
803         (RealMemberLookup): Use IsNestedChildOf instead of playing with
804         string concatenation and substring matches.
805         * class.cs, enum.cs, delegate.cs: Update to changes.
806
807 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
808
809         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
810         Expression and made virtual.
811
812         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
813         (ImplicitStandardConversionExists): Fixed `byte' typo ?
814
815         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
816
817         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
818         error message.
819
820         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
821         change.
822
823 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
824
825         Fix #57707
826         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
827         AssemblyCultureAttribute is not used on executable.
828
829         * rootcontext.cs,
830         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
831
832 2005-07-16  Raja R Harinath  <rharinath@novell.com>
833
834         Fix #60638.
835         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
836         New.  Reports CS0252/CS0253.
837         Mostly taken from preliminary patch by Duncak Mak.
838         (Binary.DoResolveOperator): Store results of operator lookup.
839         Use them to detect if we need to warn about unintended reference
840         comparisons.
841
842 2005-07-15  Raja R Harinath  <rharinath@novell.com>
843
844         Fix #72969.
845         * namespace.cs (Namespace.Lookup): Add back location parameter.
846         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
847         * delegate.cs, ecore.cs, expression.cs: Update to changes.
848
849         * codegen.cs (EmitContext.DeclSpace): Make readonly.
850         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
851         (Namespace.LookupType): ... this.
852         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
853         of namespaces.
854         * typemanager.cs (LookupTypeReflection): Remove buggy code that
855         purported to handle pointers.
856         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
857         CoreLookupType.
858
859 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
860
861         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
862         type as namespace.
863
864 2005-07-15  Raja R Harinath  <rharinath@novell.com>
865
866         * namespace.cs (Namespace.Lookup): Drop location parameter.
867         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
868         (NamespaceEntry.Lookup): ... this.
869         (NamespaceEntry.Error_AmbiguousTypeReference):
870         Move here from DeclSpace.
871         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
872         names ...
873         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
874         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
875         Move to NamespaceEntry.
876         * delegate.cs, expression.cs: Update to changes.
877
878 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
879
880         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
881         CheckAttributeType and refactored.
882         (Attribute.ResolvePossibleAttributeType): Changed to reuse
883         ResolveAsTypeTerminal error handling.
884         (ResolveAsTypeTerminal): Introduced because of global attributes extra
885         handling.
886         (GetSignatureForError): Print errors in same way.
887
888         * class.cs,
889         * codegen.cs: Reflect attribute GetSignatureForError change.
890
891         * ecore.cs,
892         * expression.cs: Add silent parameter to ResolveAsTypeStep.
893
894         * namespace.cs (UsingEntry): Refactored to make fields private.
895
896         * assign.cs,
897         statement.cs: Error_UnexpectedKind has extra parameter.
898
899 2005-07-14  Raja R Harinath  <rharinath@novell.com>
900
901         * ecore.cs (IAlias): Remove.
902         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
903         that implement the interface.
904         * namespace.cs (Namespace): Likewise.
905         (Namespace.declspaces): Renamed from 'defined_names'.
906         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
907         DeclSpace instead of an IAlias.
908         * tree.cs (Tree.AddDecl): Update.
909
910 2005-07-12  Raja R Harinath  <rharinath@novell.com>
911
912         * statement.cs (Block.Flags); Remove HasVarargs.
913         (Block.HasVarargs): Move to ToplevelBlock.
914         (Block.ThisVariable, Block.AddThisVariable): Likewise.
915         (Block.Variables): Make protected.  Initialize variable hashtable
916         if necessary.
917         (Block.AddVariable): Update.
918         (Block.Resolve): Update to changes.
919         (ToplevelBlock.HasVarargs): New boolean.
920         (ToplevelBlock.ThisVariable): Move here from Block.
921         (ToplevelBlock.AddThisVariable): Likewise.
922         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
923         * expression.cs (This.ResolveBase): Update to changes.
924         (ArglistAccess.DoResolve): Likewise.
925
926 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
927
928         Fix #75321
929         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
930
931         * class.cs (TypeContainer.VerifyMembers): Distinguish between
932         not used and not used & assigned.
933         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
934
935 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
936
937         Fix #75053
938         * expression.cs (Is.DoResolve): null is never provided type.
939
940 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
941
942         Fix #52496
943         * cs-parser.jay: Less strict event error rule to catch more errors.
944
945 2005-07-08  Martin Baulig  <martin@ximian.com>
946
947         Fix test-iter-10.cs - distinguish whether we `yield' in a property
948         gettter (allowed) or setter (not allowed).
949
950         * class.cs (Accessor): Implement IIteratorContainer.
951         (Accessor.Yields): New public field.
952         (PropertyBase.PropertyMethod.Define): Handle iterators on a
953         per-accessor basis.
954
955         * cs-parser.jay
956         (get_accessor_declaration, set_accessor_declaration): Set the
957         `yields' flag on the accessor, not the property.
958         (property_declaration): Do the iterators check on a per-accessor
959         basis and not for the whole property.
960
961 2005-07-08  Martin Baulig  <martin@ximian.com>
962
963         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
964         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
965
966 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
967
968         Fix #74975
969         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
970         (ExtractSecurityPermissionSet): Cope with self referencing security
971         attributes properly.
972
973         * driver.cs (SetOutputFile): Made public property OutputFile.
974
975 2005-07-07  Raja R Harinath  <rharinath@novell.com>
976
977         Fix #75486.
978         * class.cs (TypeContainer.first_nonstatic_field): Rename from
979         has_nonstatic_fields.  Make into a FieldBase pointer.
980         (TypeContainer.AddField): Add CS0282 check.
981         (TypeContainer.EmitType): Update.
982
983 2005-07-06  Miguel de Icaza  <miguel@novell.com>
984
985         * cs-tokenizer.cs (consume_identifier): Do not create strings to
986         compare if they start with __.
987
988 2005-07-06  Raja R Harinath  <rharinath@novell.com>
989
990         * statement.cs (Switch.SwitchGoverningType): Only look at
991         UserCasts that don't need implicit standard conversions to one of
992         the allowed switch types (Fixes test-322.cs).
993         (LocalInfo.Resolve): Re-enable sanity-test.
994
995 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
996
997         * cs-tokenizer.cs (consume_identifier): Detect double undescores
998         
999         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1000         
1001         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1002
1003 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1004
1005         Fix #75472.
1006         * ecore.cs (SimpleName.GetSignatureForError): Add.
1007         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1008         (MemberAccess.GetSignatureForError): Add.
1009
1010 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1011  
1012         The big error and warning messages review.
1013         
1014         * anonymous.cs,
1015         * assign.cs,
1016         * attribute.cs,
1017         * class.cs,
1018         * codegen.cs,
1019         * convert.cs,
1020         * cs-parser.jay,
1021         * cs-tokenizer.cs,
1022         * decl.cs,
1023         * delegate.cs,
1024         * doc.cs,
1025         * driver.cs,
1026         * ecore.cs,
1027         * enum.cs,
1028         * expression.cs,
1029         * flowanalysis.cs,
1030         * iterators.cs,
1031         * literal.cs,
1032         * location.cs,
1033         * modifiers.cs,
1034         * namespace.cs,
1035         * parameter.cs,
1036         * pending.cs,
1037         * report.cs,
1038         * rootcontext.cs,
1039         * statement.cs,
1040         * support.cs,
1041         * tree.cs,
1042         * typemanager.cs: Updated.
1043         
1044         * class.cs: (MethodCore.SetYields): Moved here to share.
1045         (PropertyMethod.Define): Moved iterator setup here.
1046         
1047         * iterators.cs: Add orig_method to have full access to parent
1048         container.
1049
1050 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1051
1052         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1053         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1054         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1055         variable of struct type.
1056         * expression.cs (Unary.ResolveOperator): Update to change.
1057         (Indirection.VerifyFixed): Likewise.
1058         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1059         (ParameterReference.VerifyFixed): Value parameters are fixed.
1060         (This.VerifyFixed): Treat 'this' as a value parameter.
1061         * statement.cs (LocalInfo.IsFixed): Remove.
1062
1063 2005-07-01  Martin Baulig  <martin@ximian.com>
1064
1065         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1066         `ec.EmitThis ()' to get the correct scope.
1067
1068 2005-07-01  Martin Baulig  <martin@ximian.com>
1069
1070         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1071         instance is a ParameterReference; fixes #75299.
1072
1073 2005-07-01  Martin Baulig  <martin@ximian.com>
1074
1075         Reverted Marek's latest patch (r46725):
1076         - it contains structural changes which are neither mentioned in
1077           the ChangeLog nor explained anywhere; for example the additional
1078           argument of EmitContext's and Iterator's .ctor's and the
1079           TypeContainer.DefineMembers() change.
1080         - structural changes like this should go in in seperate patches
1081           and not be hidden in a huge patch which just seems to affect
1082           warnings and errors.
1083           a big and hard to understand patch.
1084         - it breaks iterators and causes regressions, for instance in
1085           test-iter-03.cs.      
1086
1087 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1088
1089         Fix #75412.
1090         * expression.cs (Indexers.map): Remove.
1091         (Indexers.Append): Filter out inaccessible setters and getters.
1092         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1093
1094         Fix #75283.
1095         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1096         Refactored from ...
1097         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1098         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1099         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1100         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1101
1102 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1103
1104         Fix #75322
1105         * class.cs (FieldBase.GetInitializerExpression): One more field
1106         for backup.
1107
1108 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1109
1110         * pending.cs: Do not define a proxy if the base method is virtual,
1111         it will be picked up by the runtime (bug 75270).
1112
1113 2005-06-08  Martin Baulig  <martin@ximian.com>
1114
1115         The big Iterators rewrite :-)
1116
1117         * iterators.cs: Rewrite this to use the anonymous methods framework.
1118
1119         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1120         before the TypeContainers; see 2test-21.cs.
1121
1122         * class.cs
1123         (TypeContainer.DefineType): Don't create a new EmitContext if we
1124         already have one (this only happens if we're an Iterator).
1125         (TypeContainer.Define): Also call Define() on all our iterators.
1126         (Method.CreateEmitContext): Added support for iterators.
1127
1128         * anonymous.cs
1129         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1130         (AnonymousContainer.CreateMethodHost): Moved here from
1131         AnonymousMethod and made abstract.
1132         (AnonymousContainer.CreateScopeType): New abstract method.
1133         (AnonymousContainer.IsIterator): New public property.
1134         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1135         get the ScopeTypeBuilder rather than manually defining it here. 
1136         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1137         iterators here.
1138
1139         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1140         before RootContext.DefineTypes().
1141
1142         * codegen.cs (EmitContext.RemapToProxy): Removed.
1143         (EmitContext.CurrentAnonymousMethod): Changed type from
1144         AnonymousMethod -> AnonymousContainer.
1145         (EmitContext.ResolveTopBlock): Protect from being called twice.
1146         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1147         (EmitContext.EmitThis): Removed the iterators hacks; use the
1148         anonymous methods framework for that.
1149
1150         * statement.cs
1151         (ToplevelBlock.Container): Make this a property, not a field.
1152         (ToplevelBlock.ReParent): New public method; move the
1153         ToplevelBlock into a new container.
1154         (Foreach.TemporaryVariable): Simplify.
1155
1156 2005-06-05  Martin Baulig  <martin@ximian.com>
1157
1158         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1159         (Block.AddTemporaryVariable): New public method; creates a new
1160         `LocalInfo' for a temporary variable.
1161         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1162         variables here.
1163         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1164         non-iterator variables.
1165
1166 2005-06-05  Martin Baulig  <martin@ximian.com>
1167
1168         * statement.cs (Foreach.TemporaryVariable): Create the
1169         LocalBuilder in the Emit phase and not in Resolve since in some
1170         situations, we don't have an ILGenerator during Resolve; see
1171         2test-19.cs for an example.
1172
1173 2005-06-04  Martin Baulig  <martin@ximian.com>
1174
1175         **** Merged r45395 from GCS ****
1176
1177         The big Foreach rewrite - Part II.
1178
1179         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1180         with `PropertyInfo ienumerator_getcurrent'.
1181
1182         * codegen.cs (VariableStorage): Removed.
1183
1184         * statement.cs
1185         (Foreach): Derive from Statement, not ExceptionStatement.
1186         (Foreach.CollectionForeach): New nested class.  Moved all the code
1187         dealing with collection foreach here.
1188         (Foreach.ForeachHelperMethods): Removed.
1189         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1190
1191 2005-05-23  Martin Baulig  <martin@ximian.com>
1192
1193         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1194         don't need to.  Fix #75014.
1195
1196 2005-05-20  Martin Baulig  <martin@ximian.com>
1197
1198         Merged r44808 from GMCS.
1199
1200         * class.cs (TypeContainer.CircularDepException): Removed.
1201         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1202         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1203         (CS0146) and interface (CS0529) dependencies here.
1204
1205 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1206
1207         * expression.cs (Invocation.EmitCall): Fix initialization
1208         'this_call' to reflect current behaviour.  Fix indentation.
1209
1210         * convert.cs (FindMostEncompassedType): Add two trivial special
1211         cases (number_of_types == 0 || number_of_types == 1).
1212         (FindMostEncompasingType): Likewise.
1213
1214 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1215
1216         Some cleanups preparing for the fix of #75283.
1217         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1218         error testing.
1219         (EventExpr.InstanceResolve): Likewise.
1220         (EventExpr.DoResolve): Remove redundant checks.
1221
1222 2005-06-10  Duncan Mak  <duncan@novell.com>
1223
1224         * cs-tokenizer.cs (process_directives): New flag for controlling
1225         the processing of preprocessor directives.
1226         (x_token): After seeing a '#', return Token.NONE instead of going
1227         to handle_preprocessing_directive() when not processing
1228         directives. This avoids unnecessary processing during the token peek in
1229         is_punct().
1230
1231         This fixes #74939.
1232
1233         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1234         the existing error reporting methods instead of Report.Error.
1235
1236         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1237         after Raja's rewrite.
1238
1239 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1240
1241         * class.cs: Small fix.
1242
1243 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1244
1245         Fix #75160.
1246         * class.cs (GetPartialBases): Fix return value check of
1247         part.GetClassBases.
1248
1249 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1250
1251         Ensure that partial classes are registered in their enclosing
1252         namespace.  Initial part of fix of #75160.
1253         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1254         Register declspace with namespace here, not in
1255         DeclSpace.RecordDecl.
1256         * cs-parser.jay: Pass namespace to RecordDecl.
1257         * class.cs (PartialContainer.Create): Likewise.
1258         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1259         called.
1260         * decl.cs (Declspace.RecordDecl): Remove.
1261         * namespace.cs (NamespaceEntry.DefineName): Remove.
1262
1263 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1264
1265         * rootcontext.cs: Reset TargetExt as well.
1266
1267 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1268
1269         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1270         -langversion:ISO-1.
1271
1272 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1273
1274         Fix #75080, cs0119.cs.
1275         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1276         of ...
1277         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1278         allowing ExprClass.Type and ExprClass.Namespace for
1279         ResolveFlags.VariableOrValue.
1280         (Expression.Resolve) [1-argument variant]: Change default resolve
1281         flags based on language version.
1282         (Expression.Error_UnexpectedKind): Use a simple string array
1283         rather than an ArrayList.
1284         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1285         not ExprClass.Type.
1286         (TypeOfVoid.DoResolve): Likewise.
1287         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1288         flags argument -- it always has the same value.
1289
1290 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1291
1292         Fix #75081.
1293         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1294         Use it in the error message.
1295         * assign.cs, expression.cs, statement.cs: Update.
1296
1297 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1298
1299         Fix #75088.
1300         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1301         the "almostMatchedMember" case too.
1302         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1303         that failed the accessibility checks to 'almost_match'.
1304
1305 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1306
1307         * attribute.cs: Use internal MethodBuilder methods to set
1308         ExactSpelling and SetLastError on PInvoke methods, instead
1309         of passing them via charset.  Fixes #75060.
1310
1311 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1312
1313         * parameter.cs (Parameter): Remove TODO comment.
1314         (Parameter.DefineParameter): Remove Location parameter.
1315         (Parameters.LabelParameters): Likewise.
1316         * class.cs (Constructor.Emit): Update to change.
1317         (MethodData.Emit): Likewise.
1318         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1319         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1320
1321 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1322
1323         * parameter.cs,
1324           Removed Parameters.Location and added Parameter.Location instead.
1325           Removed Location parameter from Emit() and GetSignature().
1326         * anonymous.cs,
1327           class.cs,
1328           cs-parser.jay,
1329           delegate.cs,
1330           iterators.cs,
1331           statement.cs :
1332           Modified all related calls.
1333
1334 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1335
1336         Improve user-defined conversion handling.
1337         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1338         applicable operators.
1339         (AddConversionOperators): New.  Helper for GetConversionOperators.
1340         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1341         there is only one most encompassed/encompassing type.
1342         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1343         "applicable operator" handling.
1344         (UserConversion): Move cache here from GetConversionOperators.
1345         Directly cache the chosen operator, rather than the whole
1346         MethodGroup.
1347         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1348         case.  Allow conversion of decimal to sbyte and byte too.
1349         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1350         New static methods.  Used to avoid allocating EmptyExpressions in
1351         convert.cs.
1352
1353 2005-05-24  Duncan Mak  <duncan@novell.com>
1354
1355         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1356         another class, used in Convert.ExplicitNumericConversion.
1357         (CastToDecimal): New class, similar to above, but casts to
1358         System.Decimal, used in Convert.ImplicitNumericConversion and also
1359         in explicit convesion from double/float to decimal.
1360
1361         * convert.cs (ImplicitNumericConversion): Handle implicit
1362         conversions to System.Decimal.
1363         (ExplicitNumericConversion): handle explicit conversions to
1364         System.Decimal.
1365
1366         This fixes #68711.
1367         
1368 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1369
1370         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1371         know the type at this stage, just break through.   Fixes #75008 
1372
1373 2005-05-19  Martin Baulig  <martin@ximian.com>
1374
1375         * delegate.cs
1376         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1377         to disable error reporting.
1378
1379         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1380         here since we don't want to report an error; see the new test-336.cs.
1381
1382 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1383
1384         * statement.cs (ToplevelBlock.GetParameterReference)
1385         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1386         Move here from class Block.
1387         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1388         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1389
1390 2005-05-18  Martin Baulig  <martin@ximian.com>
1391
1392         Fix #74978.
1393
1394         * flowanalysis.cs
1395         (FlowBranching.Reachability): Add non-static public And() and Or()
1396         methods.
1397         (FlowBranchingSwitch): New class; do the `break_origins' thing
1398         like in FlowBranchingLoop.
1399         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1400         reachability, not just locals and parameters.
1401         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1402         switch; MergeBreakOrigins() now takes care of that.
1403
1404 2005-05-18  Martin Baulig  <martin@ximian.com>
1405
1406         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1407         a loop and may leave it, reset the barrier; fixes #74974.
1408
1409 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1410         
1411         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1412         is back.
1413         
1414         * cs-parser.jay: Catch more lexical errors.
1415         
1416         * report.cs: Add one more Error method.
1417         
1418         * rootcontext.cs,
1419         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1420
1421 2005-05-17  Martin Baulig  <martin@ximian.com>
1422
1423         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1424         #70970. 
1425
1426 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1427
1428         Fix test-382.cs.  Emit values of decimal constants.
1429         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1430         Carved out of ...
1431         (TypeContainer.AddField): ... this.
1432         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1433         with initializers to include 'Const's.
1434         (ClassPart.RegisterFieldForInitialization): Forward to
1435         PartialContainer.
1436         * const.cs (Const.Const): Pass initializer to base class.
1437         (Const.Define): In case of decimal constants, register them for
1438         initialization in a static constructor.
1439
1440 2005-05-14  Martin Baulig  <martin@ximian.com>
1441
1442         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1443         do not call ResolveUnreachable() on unreachable statements in
1444         here, see the comment in the source code.
1445
1446 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1447
1448         Fix #74934.
1449         * expression.cs (BinaryResolveOperator): If one of the operands of
1450         an equality comparison is 'null' and the other is a pointer type,
1451         convert the null to a NullPointer.
1452         * convert.cs (ImplicitReferenceConversion): If the expression is a
1453         NullLiteral and the target type is a pointer type, return a
1454         NullPointer instead.
1455         (ImplicitConversionStandard): Likewise.
1456
1457 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1458         
1459         * cs-parser.jay: Set readonly context based on special constructs.
1460         
1461         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1462         readonly variable error handling.
1463         
1464         * rootcontext.cs (EmitCode): Don't verify members when error
1465         occurred.
1466         
1467         * statement.cs (LocalInfo): Add reaodnly context information.
1468         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1469
1470 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1471
1472         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1473         for #74041 to initialize 'resolved' to false only for explicit
1474         blocks.  Fixes #74873.
1475
1476 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1477
1478         Fix #74920.
1479         * typemanager.cs (unmanaged_enclosing_types): New.
1480         (IsUnmanagedType): Avoid infloops by using
1481         'unmanaged_enclosing_types' to talk with recursive invocations.
1482
1483 2005-05-13  Martin Baulig  <martin@ximian.com>
1484
1485         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1486         instance variable, not a local.  Fix #74873.
1487         (Block.ResolveUnreachable): Set it to true here.
1488
1489 2005-05-11  Duncan Mak  <duncan@novell.com>
1490
1491         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1492         continuing to process for 'arg'.
1493         (handle_preprocessing_directive): Check the argument of the #endif
1494         directive and report error CS1025 if there are any trailing
1495         characters.
1496
1497         According to the C# spec, having even whitespace after the #endif
1498         directive is illegal; however, because we call arg.TrimEnd ()
1499         beforehand, we have the same behavior as csc, allowing whitespace
1500         after the directive.
1501
1502         Fixes #74892.
1503
1504 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1505
1506         Fix #74863.
1507         
1508         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1509         (Constructor.GetObsoleteAttribute): Implemented correctly.
1510
1511 2005-05-10  Martin Baulig  <martin@ximian.com>
1512
1513         * support.cs (ReflectionParameters.ParameterModifier): Use
1514         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1515         and `ParameterAttributes.In'.  Fixes #74884.
1516
1517 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1518
1519         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1520         
1521         * expression.cs (Argument.GetParameterModifier): Turned to property.
1522         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1523         
1524         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1525         its C# equivalent.
1526         
1527 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1528
1529         Fix #74852.
1530         * decl.cs (MemberCache.AddMethods): Register override methods,
1531         rather than non-override methods.
1532         * typemanager.cs (RegisterOverride): New.
1533         (IsOverride): Update.
1534
1535 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1536
1537         Fix #73105.
1538         
1539         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1540         recursive declaration.
1541         
1542         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1543         
1544 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1545
1546         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1547         
1548         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1549
1550 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1551
1552         Fix #74797.
1553         * decl.cs (DeclSpace.FamilyAccessible): 
1554         Use TypeManager.IsNestedFamilyAccessible.
1555
1556         Fix reopened #64812.
1557         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1558         internal'.
1559
1560 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1561             Abin Thomas  <projectmonokochi@rediffmail.com>
1562             Anoob V E  <projectmonokochi@rediffmail.com>
1563             Harilal P R  <projectmonokochi@rediffmail.com>
1564
1565         Fix #64812.
1566         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1567         allow access to all static members.
1568
1569 2005-05-04  Martin Baulig  <martin@ximian.com>
1570
1571         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1572
1573 2005-05-04  Martin Baulig  <martin@ximian.com>
1574
1575         Fix #74655.
1576
1577         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1578         section at the end; make things work if `default' is not the last
1579         section.        
1580
1581 2005-05-04  Martin Baulig  <martin@ximian.com>
1582
1583         Fix #70400.
1584
1585         * statement.cs (Switch): Replaced the `got_default' field with a
1586         `default_section' one.
1587         (Switch.CheckSwitch): Set `default_section' here.
1588         (Switch.Resolve): If we're a constant switch and the constant is
1589         not found, use the default section.
1590
1591 2005-05-03  Martin Baulig  <martin@ximian.com>
1592
1593         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1594
1595         * statement.cs (Foreach.ArrayForeach): New nested class.
1596         (Foreach.TemporaryVariable): New nested class.
1597         (Foreach.EmitArrayForeach): Removed; this is now in the new
1598         ArrayForeach class.
1599
1600 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1601
1602         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1603         more conservative.
1604         (VerifyPendingMethods): Revert change below.
1605
1606         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1607         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1608         that used to trigger warning -28.  Remove warning -28.
1609         * expression.cs (Invocation.OverloadResolve): Use
1610         TypeManager.IsOverride to distinguish override methods.
1611
1612         Fix #74773.
1613         * pending.cs (VerifyPendingMethods): If a base type implements the
1614         requested interface, don't bother checking individual methods of
1615         the base type.  As a side-effect, this prevents the creation of
1616         unnecessary proxies.
1617
1618 2005-05-02  Martin Baulig  <martin@ximian.com>
1619
1620         Fix #70182.
1621
1622         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1623         Also `And' the locals if the old vector is null.
1624         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1625         null; in this case we basically reset all the variables.        
1626
1627 2005-05-02  Martin Baulig  <martin@ximian.com>
1628
1629         Fix #74529.
1630
1631         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1632         Added `FlowBranching branching' argument; always `and' the
1633         variables instead of `or'ing them unless we're an infinite loop.
1634
1635         * statement.cs (While.Resolve): Create a new sibling unless we're
1636         infinite.       
1637
1638 2005-05-02  Martin Baulig  <martin@ximian.com>
1639
1640         Fix #70140.
1641
1642         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1643         arguments; use it instead of creating a new TopLevelBlock.
1644         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1645         our ConstructorInitializer.
1646
1647         * statement.cs
1648         (TopLevelBlock.TopLevelBranching): New public property.
1649         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1650         and create our `TopLevelBranching'.
1651
1652         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1653         anonymous method host, use `block.TopLevelBranching' rather than
1654         creating a new branching.
1655
1656 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1657
1658         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1659         a ScopeInfo, if any of the current children is a child of the new
1660         entry, move those children there.
1661
1662 2005-04-30  Martin Baulig  <martin@ximian.com>
1663
1664         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1665         at the beginning of a SwitchSection.  Fix #73335.
1666
1667 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1668
1669         Fix #74378
1670         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1671         
1672         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1673         (FieldExpr.DoResolve): Obsolete members are ignored for field
1674         initializers.
1675         
1676 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1677
1678         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1679         of arrays detection.
1680
1681         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1682         verification.
1683         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1684
1685         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1686         arrays report.
1687
1688 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1689
1690         * cs-parser.jay: Use the prefered version of -unsafe in error
1691         message.
1692
1693 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1694
1695         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1696         circumstances.
1697
1698 2005-04-20  John Luke  <john.luke@gmail.com>
1699
1700         * driver.cs: fix typo in error message, --outout to --output
1701
1702 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1703
1704         * codegen.cs (InRefOutArgumentResolving): New field.
1705         
1706         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1707         fields outside contructor.
1708         
1709         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1710         
1711 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1712
1713         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1714         parameter code was not completed ever, so it was not as up-to-date
1715         as local variables.  Must finish it.
1716
1717         The bug fix was to compare the Toplevel of the block, not the
1718         current block.  Thanks for Ben for pointing this out. 
1719
1720 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1721
1722         * decl.cs (AddMethods): Use the declaring type of the problem
1723         method to determine if we want to squash a warning.
1724
1725 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1726
1727         * attribute.cs: Removed debug output.
1728
1729         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1730         
1731         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1732         Report.Stderr.
1733         
1734 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1735
1736         Fix #74481.
1737         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1738         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1739         all null comparisons against reference types.
1740
1741 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1742
1743         Fix# 74565
1744         * class.cs (TypeContainer.CircularDepException) New nested
1745         exception class.
1746         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1747         (TypeContainer.DefineType): Removed error, reset InTransit before
1748         exit.
1749         (Class.DefineType): Throw exception when is in Transit.
1750         Catch exception and report error.
1751         (Struct.DefineType): Throw exception when is in Transit.
1752         Catch exception and report error.
1753         (Interface.DefineType): Throw exception when is in Transit.
1754         Catch exception and report error.
1755
1756         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1757         handle nested exception handlers.
1758
1759         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1760         a catch.
1761
1762         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1763         InFinally and InCatch storage.
1764
1765         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1766         (Catch.Resolve): Set and Restore ec.InCatch.
1767         (Try.Resolve): Set and Restore ec.InFinally.
1768         (Try.HasCatch): True when try has catch.
1769
1770 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1771
1772         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1773           for the same event member, so exclude such cases from warning 419.
1774           Fixed bug #74633.
1775
1776 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1777
1778         * expression.cs (Binary.ResolveOperator): Apply patch from John
1779         Luke to fix bug 59864: operators &, | and ^ on enumerations
1780         require that the same enum type on both sides.
1781
1782         * driver.cs: Add warnings to old flag usage, this is to assist
1783         people who produce Makefiles and hope that the Makefiles will be
1784         used on Windows.
1785
1786         * class.cs (TypeContainer.EmitType): Moved the definition of the
1787         special $PRIVATE$ field from the resolve phase to the Emit phase.
1788         During resolve we do not know if we are a struct with
1789         HasExplicitLayout, we know this only after the attributes for the
1790         type are emitted.
1791
1792         Set the FieldOffset to zero on the dummy field that we create for
1793         the class.   Fixes 74590.
1794
1795 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1796
1797         Fix #73834.
1798         * ecore.cs (PropertyExpr.resolved): New.
1799         (DoResolve): Use it to handle a case of double resolution here.
1800         Handle a case of identical-name-and-type-name.
1801         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1802         resolution by storing the results of expression resolution back
1803         into the "probes" array.
1804
1805 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1806
1807         Fix cs0208-7.cs and cs0208-8.cs.
1808         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1809         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1810         error reporting to point out the reason a struct is not unmanaged.
1811
1812 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1813
1814         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1815           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1816
1817 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1818
1819         Fix #74528.
1820         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1821         IdenticalNameAndTypeName here.
1822         (EventExpr.InstanceResolve): Likewise.
1823
1824 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1825
1826         C# 2.0 DefaultCharSetAttribute implementation
1827         
1828         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1829         which allows us to set GlobalNamespace for every resolve.
1830         (Attribute.ResolveArguments): Cut from Resolve.
1831         (Attribute.GetCharSetValue): Returns CharSet named argument.
1832         (Attribute.DefinePInvokeMethod): Gets default charset from
1833         module settings.
1834         (GlobalAttribute.ResolveAsTypeStep): Override.
1835         (GlobalAttribute.ResolveArguments): Override.
1836         
1837         * class.cs (TypeAttr): Is protected.
1838         
1839         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1840         (ModuleClass.DefaultCharSetType): New memeber.
1841         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1842         
1843         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1844         charset from module.
1845         
1846         * delegate.cs (TypeAttr): Override.
1847         (Delegate.DefineType): Use this TypeAttr.
1848         
1849         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1850         at very early stage (before types are defined) to resolve model
1851         module attributes. It will probably not work with corlib but it
1852         should be ok.
1853         
1854         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1855         charset from module.
1856         
1857         * typemanager.cs (default_charset_type): New type.
1858
1859 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1860
1861         * decl.cs (MemberCache.AddMethods): Don't warn if
1862         System.Object.Finalize has buggy MethodAttributes.
1863
1864         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1865         removed below.
1866
1867 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1868
1869         * doc.cs : detect ambiguous reference to overloaded members.
1870           Fixed bug #71603. MS 1.1 csc does not detect it.
1871
1872 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1873
1874         * doc.cs : delegates must not be referenced with parameters.
1875           Fixed bug #71605.
1876
1877 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1878
1879         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1880
1881 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1882
1883         * driver.cs (MainDriver): Stop processing if the CLS stage found
1884         errors. 
1885
1886         (CompilerCallableEntryPoint.InvokeCompiler): Always
1887         reset after execution;   Take a TextWriter argument for the
1888         output.
1889
1890         * report.cs: Use the error stream instead of hardcoding stderr. 
1891
1892 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1893
1894         * class.cs: Reduce code paths to test, too small of an
1895         optimization to make it worth the extra testing.  Always perform
1896         it. 
1897
1898 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1899
1900         Fix #74510.
1901         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1902         operators that had errors reported on them.
1903
1904 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1905
1906         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1907         argument types.
1908         (Attribute.Resolve): Add named argument type checking.
1909         
1910         * class.cs (FixedField.Define): Use IsPrimitiveType
1911         
1912         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1913         
1914         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1915         unsafe parameter types.
1916         
1917         * statement.cs (Using.ResolveExpression): Add better error description.
1918         
1919         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1920         
1921 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1922
1923         Fix #74484.
1924         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1925         AttributeUsageAttribute in the emitcontext of the attribute class,
1926         not in the emitcontext of the attributable entity it was attached to.
1927         * cs-parser.jay: Use 'current_class', not 'current_container',
1928         when creating a GlobalAttribute.
1929
1930 2005-04-08  Alp Toker  <alp@atoker.com>
1931
1932         * pending.cs: The fix to #58413 failed to compile methods implementing
1933         interfaces with/without params modifiers and vice versa, even though
1934         params modifiers aren't part of the signature. Make the modifier check
1935         less strict as in csc.
1936
1937 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1938             Anoob V E  <projectmonokochi@rediffmail.com>
1939             Harilal P R  <projectmonokochi@rediffmail.com>
1940
1941         Fix #58413.
1942         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1943         modifiers of pending methods.
1944         (PendingImplementation.PendingImplementation): Initialize it.
1945         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1946         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1947         with ParameterData.  Add check for modifiers.
1948         * class.cs (MethodData.Define): Update to changes.
1949
1950 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1951
1952         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1953
1954 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1955
1956         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1957         property.
1958         
1959         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1960         
1961         * rootcontext.cs,
1962         * typemanager.cs: Registered RequiredAttributeAttribute.
1963         
1964 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1965
1966         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1967         Warning CS0169 is back at level 3.
1968         (IMethodData.SetMemberIsUsed): New method.
1969         
1970         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1971         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1972         
1973         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1974
1975         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1976         contants.
1977         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1978         is used.
1979         
1980         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1981         is used.
1982         
1983         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1984         to avoid the problems with nested types.
1985
1986 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1987             Anoob V.E  <projectmonokochi@rediffmail.com>
1988             Harilal P.R  <projectmonokochi@rediffmail.com>
1989             Raja R Harinath  <rharinath@novell.com>
1990
1991         Fix #73820.
1992         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1993         attribute.
1994         * typemanager (GetConstructor): Make public.
1995
1996 2005-04-05  John Luke  <john.luke@gmail.com>
1997             Raja R Harinath  <rharinath@novell.com>
1998
1999         Fix #62232.
2000         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2001         struct too.  Return false quicker in a few cases.
2002         (VerifyUnManaged): Use it.
2003
2004 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2005
2006         Fix #74041.
2007         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2008         not 'unreachable_seen'.
2009
2010 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2011
2012         * attribute.cs (Attribute.GetValue): Removed unused.
2013         
2014         * codegen.cs (CodeGen.TrimExt): Removed unused.
2015         
2016         * cs-parser.jay (output): Removed unused.
2017         
2018         * cs-tokenizer.cs (hex_digits): Removed unused.
2019         
2020         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2021         
2022         * expression.cs (Indirection.LoadExprValue): Removed unused.
2023         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2024         
2025         * iterators.cs (Iterator.param_types): Removed unused.
2026         
2027         * statement.cs (Goto.block): Removed unused.
2028         (ToplevelBlock.did): Removed unused.
2029         (Switch.ResolveConstantSwitch): Removed unused.
2030
2031 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2032
2033         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2034         resetting thingy.
2035
2036 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2037
2038         Fix #74232 and cs0208-3.cs.
2039         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2040         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2041         unmanaged type.  Don't use FieldBuilders when 't' is a
2042         TypeBuilder.  Use ModFlags and MemberType fields.
2043         * class.cs (MemberBase.member_type): Rename from MemberType.
2044         (MemberBase.MemberType): New property.  Determines member_type on
2045         demand.
2046         (MemberBase.DoDefine): Don't initialize MemberType here.
2047         (FieldMember.Define): Likewise.
2048
2049 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2050
2051         Fix #74241
2052         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2053         Attributes are emitted there.
2054         
2055 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2056
2057         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2058         keyword in 'partial enum' too.
2059         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2060         is not allowed).
2061         Report from Kamil Skalski <nazgul@omega.pl>.
2062
2063         Fix #74309.
2064         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2065         have partial containers too.
2066
2067         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2068         in block' checks to Block.CheckInvariantMeaningInBlock.
2069         * statement.cs (Block.GetKnownVariableInfo): Make private.
2070         (Block.IsVariableUsedInChildBlock): Remove.
2071         (Block.IsVariableUsedInBlock): Likewise.
2072         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2073         conflicting declaration.
2074         (Block.AddVariable): Make error messages less long-winded and more
2075         specific.  Show location of conflicting declaration.
2076         * parameter.cs (Parameters.Location): New readonly property.
2077
2078 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2079
2080         Clean up semantics of invoking ResolveMemberAccess.
2081         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2082         can have an instance, ensure that we pass in a non-TypeExpression
2083         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2084         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2085         argument.  Update to changes and simplify.
2086         (FieldExpr.Emitinstance): Remove CS0120 check.
2087         (PropertyExpr.EmitInstance): Likewise.
2088         * expression.cs (Argument.Resolve): Likewise.
2089         (Invocation.DoResolve): Update to changes in semantics of
2090         InstanceExpression.
2091
2092 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2093
2094         Fix #74241
2095         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2096         customization.
2097         
2098         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2099
2100 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2101
2102         Fix difference in behaviour with commandline invocation.
2103         * driver.cs (Driver.Reset): New.
2104         (CompilerCallableEntryPoint): Call it.
2105
2106         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2107         variable" warnings if the boolean expression failed to resolve.
2108
2109 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2110
2111         * attribute.cs: Fix the union of several permissions when some of them
2112         are unrestricted (so the result isn't an unrestricted permission set).
2113         Fix #74036.
2114
2115 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2116
2117         * ecore.cs (MemberExpr): New class.  Convert from interface
2118         IMemberExpr.
2119         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2120         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2121         error checks.
2122         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2123         (MethodGroupExpr.IsExplicitImpl): Remove.
2124         (Expression.GetFieldFromEvent): Remove.
2125         (SimpleName.MemberStaticCheck): Remove.
2126         (SimpleName.DoSimpleNameResolve): Update to changes.
2127         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2128         (MemberAccess.IdenticalNameAndTypeName): Remove.
2129         (MemberAccess.error176): Move to MemberExpr.
2130         (MemberAccess.DoResolve): Update to changes.
2131         (BaseAccess.DoResolve): Likewise.
2132
2133 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2134
2135         C# 2.0 Conditional attribute class implementation
2136         
2137         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2138         Analyzes class whether it has attribute which has ConditionalAttribute
2139         and its condition is not defined.
2140         
2141         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2142         (Class.IsExcluded): New method. Search for at least one defined
2143         condition in ConditionalAttribute of attribute class.
2144
2145 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2146
2147         * ecore.cs (PropertyExpr): Derive from Expression, not
2148         ExpressionStatement.
2149         (PropertyExpr.EmitStatement): Remove.
2150
2151 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2152
2153         Fix #74060.
2154         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2155         internal field "value__" of an enum be private.  The examples for
2156         "value__" that I found on MSDN all used FieldAttributes.Private.
2157
2158         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2159         Don't mention IL method attribute names.
2160
2161         Fix #47991.  Remove a TODO.
2162         * statement.cs (Block.Toplevel): Make into a field.
2163         (Block.Parameters): Move into ToplevelBlock.
2164         (Block.known_variables): Rename from child_variable_names.
2165         (Block.Block): Remove variants that take Parameters.  Initialize
2166         'Toplevel' with the immediately surrounding toplevel block.
2167         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2168         LocalInfo parameter.
2169         (Block.GetKnownVariableInfo): New.
2170         (Block.IsVariableNameUsedInChildBlock): Update.
2171         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2172         the block, even though it may not be in scope.
2173         (Block.AddVariable): Remove Parameters parameter.  Use
2174         Toplevel.Parameters instead.
2175         (Block.AddConstant): Remove Parameters parameter.
2176         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2177         (Block.IsParamaterReference): Likewise.
2178         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2179         (ToplevelBlock.Parameters): New.  Moved from Block.
2180         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2181         initialize Parameters to a non-null value.
2182         * cs-parser.jay: Update to changes.
2183         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2184         simple names that mean different things in the same block.  Use
2185         Block.IsVariableNameUsedInBlock.
2186
2187 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2188
2189         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2190         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2191         GetTypeHandle.  It is possible for a reflected type to derive from
2192         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2193         System.Array during mscorlib compilation).
2194         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2195         contain a method_hash, don't create one either.  Don't create a
2196         deep copy of the base cache's method_hash.
2197         (MemberCache.SetupCache): Rename back from DeepCopy.
2198         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2199         already initialized.  If we see an override function, add its
2200         underlying base virtual function to the member_hash too.
2201
2202         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2203
2204 2005-03-26  Raja R Harinath  <harinath@acm.org>
2205
2206         Fix #73038.
2207         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2208         fails to resolve, ensure that the LHS is still resolved as an
2209         lvalue.
2210
2211 2005-03-25  Raja R Harinath  <harinath@acm.org>
2212
2213         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2214         ec.ContainerType.
2215         (Enum.current_ec): Remove.
2216         (Enum.LookupEnumValue): Remove EmitContext argument.
2217         Just uses the one created during DefineType.
2218         (Enum.FindMembers): Update.
2219         * expression.cs (MemberAccess.DoResolve): Update.
2220
2221 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2222
2223         * assign.cs (Assign.DoResolve): Check for CS1717 when
2224         source and target are same (uses Equals).
2225
2226         * expression.cs (LocalVariableReference, ParameterReference,
2227         This): Implemented Equals, GetHashCode.
2228
2229         * statement.cs (Block.GetParameterReference): Removed useless
2230         local variable.
2231
2232 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2233
2234         Fix cs0128.cs
2235         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2236         blocks before deciding whether the error is cs0136 or cs0128.
2237
2238         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2239         (using_alias_directive, using_namespace_directive): Pass
2240         MemberName, not an expression to Namespace.UsingAlias and
2241         Namespace.Using.
2242         (MakeName): Use the MemberName of the namespace.
2243         * namespace.cs (Namespace.MemberName): New.
2244         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2245         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2246         Likewise.
2247         * decl.cs (MemberName.Name): Make readonly.
2248         (MemberName.FromDotted): New "constructor".
2249         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2250         (MemberCore.Name): Compute from MemberName on demand.
2251         (MemberCore.SetMemberName): Provide a way to change the
2252         MemberName.
2253         (MemberCore.AddToContainer): Don't take a fullname parameter.
2254         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2255         fully qualified name of the container to the member name.
2256         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2257         only if the type is a member of the root container.
2258         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2259         MemberName.Left rather than searching for an embedded ".".
2260         (PartialContainer.CreatePart): Update to changes in RootContext.
2261         (MemberBase.ShortName): Turn into a property.  Use
2262         MemberCore.SetMemberName.
2263         (MemberBase.ExplicitInterfaceName): Remove.
2264         (MemberBase.UpdateMemberName): Remove.
2265         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2266         (PropertyBase.SetMemberName): New override.
2267         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2268         (Tree.GetDecl): New.
2269         (Tree.AllDecls): Rename from Decls.
2270         * attribute.cs, enum.cs, report.cs: Update to changes.
2271         * driver.cs (MainDriver): Use MemberName.FromDotted on
2272         RootContext.MainClass.
2273
2274 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2275
2276         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2277         checks.
2278
2279         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2280
2281 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2282
2283         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2284         property accessor modifiers.
2285
2286         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2287         fixed buffer attribute (CS1716).
2288         (PropertyMethod.HasCustomAccessModifier): When property accessor
2289         has custom modifier.
2290
2291         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2292         modifiers.
2293         (PropertyExpr.DoResolveLValue): Add CS0272.
2294
2295 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2296
2297         * convert.cs: When converting to a pointer, use the proper Conv.U
2298         or Conv.I depending on the source data type.
2299
2300         * cs-tokenizer.cs: Make the size for large decimal constants,
2301         fixes #72957.
2302
2303 2005-03-17  Martin Baulig  <martin@ximian.com>
2304
2305         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2306         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2307
2308 2005-03-17  Martin Baulig  <martin@ximian.com>
2309
2310         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2311         to bool so we can return an error condition.
2312         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2313         returned an error.
2314
2315 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2316
2317         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2318         attributes.
2319
2320 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2321
2322         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2323         Refactor to avoid traversing the list of assemblies, and to avoid
2324         string concatenation.
2325         * typemanager.cs (guid_attr_type): Remove.
2326         (negative_hits, pointers, references): Remove hashes.
2327         (type_hash): New.
2328         (GetConstructedType): New.  Uses type_hash to handle constructed
2329         types (arrays, references, pointers).
2330         (GetReferenceType, GetPointerType): Use it.
2331         (GetNestedType): New.  Uses type_hash to handle nested types of
2332         reflected types.
2333         (LookupType, LookupTypeDirect): Remove.
2334         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2335         'types' hash and LookupTypeReflection directly.
2336         (params_string, params_object): Use GetConstructedType.
2337         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2338         top-level types.
2339         (Namespace.Lookup): Use cached_types.
2340         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2341         provided by old TypeManager.LookupType.
2342         * rootcontext.cs (MakeFQN): Remove.
2343         * decl.cs (DeclSpace.MakeFQN): Likewise.
2344         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2345         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2346         TypeManager.GetConstructedType.
2347         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2348
2349 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2350
2351         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2352         indexers.
2353
2354         * cs-parser.jay: Reports CS1527 for any namespace element.
2355
2356         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2357         Added CS0407.
2358
2359         * expression.cs (ParameterReference.IsAssigned): Changed error to
2360         CS0269.
2361         (Error_WrongNumArguments): Moved CS0245 detection here.
2362
2363         * statement.cs (Return.Resolve): Add CS1622 report.
2364
2365 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2366
2367         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2368
2369 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2370
2371         * attribute.cs expression.cs: Get rid of some allocations.
2372
2373 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2374
2375         * doc.cs : just eliminate the latest change.
2376
2377 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2378
2379         * doc.cs : commented out the latest change. It breaks xml-030.cs
2380
2381 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2382
2383         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2384           fail. So invoke CreateType() in FindDocumentedType().
2385
2386 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2387
2388         * cs-tokenizer.cs : added IsKeyword().
2389         * doc.cs : Detect keyword incorrectly used as identifier.
2390           Allow identifiers prefixed by @.
2391
2392 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2393
2394         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2395         It caused exception in namespace resolving (again!).
2396         
2397         * class.cs (Class.ctor): Removed exit.
2398         (PropertyMethod.ctor): ditto.
2399         
2400         * codegen.cs (Codegen.Reset): Reset static data.
2401         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2402         
2403         * cs-tokenizer.cs (Cleanup): Removed.
2404         
2405         * driver.cs (GetSystemDir): Rewrote to one line command.
2406         It caused problem with unloaded dynamic modules.
2407         (UnixParseOption): Removed Exit.
2408         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2409         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2410         Now can be mcs used as library.
2411         
2412         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2413         empty location.
2414         
2415         * location.cs (Reset): Reset static data.
2416         
2417         * namespace.cs (Reset): Reset static data.
2418         
2419         * report.cs (Report.Reset): Reset static data.
2420         
2421         * rootcontext.cs (RootContext.Reset): Reset static data.
2422         
2423         * tree.cs (RootTypes.ctor): Use Location.Null
2424         
2425         * typemanager.cs (TypeManager.Reset): Reset static data.
2426         (CoreLookupType): Removed Exit.
2427         (TypeHandle.Reset): Reset static data.
2428         
2429 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2430
2431         Fix #73516.
2432         * typemanager.cs (ComputeNamespaces): Import namespaces from
2433         referenced modules too.
2434
2435 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2436
2437         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2438         than '.'.
2439
2440 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2441
2442         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2443         enclosing DeclSpace.  This ensures that a name-lookup populates
2444         more caches and there are fewer 'TypeExpression's.  Carve out
2445         nested type lookup into ...
2446         (LookupNestedTypeInHierarchy): ... this.
2447
2448 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2449
2450         Clean up a few partial-class semantics.  
2451         Fixes test-357.cs and cs1618-2.cs.
2452         * cs-parser.jay (struct_declaration): Use 'current_class' as
2453         parent of newly-created struct.  Remove call to Register ().
2454         Use 'pop_current_class' to complete handing the current struct.
2455         (interface_declaration): Likewise.
2456         (class_declaration): Likewise.
2457         (enum_declaration): Use 'current_class' as parent of newly created
2458         enum.
2459         (delegate_declaration): Likewise.
2460         (pop_current_class): New function.  This is used to handle closing
2461         up the 'current_class' and 'current_container', and pointing them
2462         to the enclosing class/container.
2463         (CSharpParser): Initialize 'current_class' too.
2464         * decl.cs (MemberCore): Add check for invariant: a partial
2465         container is not a parsed entity, and thus does not enclose any
2466         parsed members.
2467         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2468         (DeclSpace.BaseTypeExpr): Use it.
2469         (DeclSpace.LookupType): Add check for invariant.
2470         * class.cs (TypeContainer): Add check for invariant: a nested
2471         class should have the same NamespaceEntry as its enclosing class.
2472         (TypeContainer.EmitFieldInitializers): Make virtual.
2473         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2474         MemberCore.
2475         (TypeContainer.Register): Remove.
2476         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2477         null.  Use TypeResolveEmitContext for resolving base types and
2478         interfaces.  Move initialization of Parts.TypeBuilder here from
2479         ...
2480         (TypeContainer.DefineNestedTypes): ... here.
2481         (PartialContainer): Take a Namespace not a NamespaceEntry.
2482         (PartialContainer.Create): Don't use Register.  Call the
2483         appropriate Add... function directly.
2484         (ClassPart): Take both the PartialContainer and the enclosing
2485         class as constructor arguments.
2486         (ClassPart.EmitFieldInitializers): Override.
2487         (ClassPart.PartFindNestedTypes): Remove.
2488         (FieldBase.GetInitializerExpression): Resolve the initializer
2489         expression in the emit context of the enclosing class.
2490         * tree.cs (RootTypes): Remove Register ().
2491         
2492 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2493
2494         * cs-parser.jay: Removed CS0134.
2495         
2496         * driver.cs: Removed CS1901.
2497         
2498         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2499         for predefined types.
2500
2501 2005-03-07  Duncan Mak  <duncan@novell.com>
2502
2503         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2504         well. Fixes bug #73454.
2505
2506 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2507
2508         * cs-tokenizer.cs (xtoken): Add CS1035.
2509         
2510         * class.cs (MethodData.Define): Add CS0683.
2511         (FieldMember.ctor): Add CS0681.
2512
2513 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2514
2515         * ecore.cs (SimpleName.DoResolve): Rename from
2516         SimpleName.DoResolveAllowStatic.
2517         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2518         Pass 'intermediate' flag to MemberStaticCheck.
2519         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2520         of "intermediate" lookups via MemberAccess.
2521         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2522         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2523
2524 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2525
2526         Fix #73394.
2527         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2528         slipped in because of variable names that are identical to a
2529         builtin type's BCL equivalent ('string String;', 'int Int32;').
2530         (PropertyExpr.EmitInstance): Likewise.
2531
2532 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2533
2534         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2535         
2536         * report.cs (warning_ignore_table): Made public.
2537
2538 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2539
2540         Fix #73282.
2541         * class.cs (MethodData.Emit): Pass 'container' to
2542         container.GetObsoleteAttribute instead of 'container.Parent'.
2543
2544 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2545
2546         * cs-parser.jay: Add 1534 error test.
2547
2548         * iterators.cs (Yield.CheckContext): Add error 1629.
2549         (Iterator.ctor): Save unsafe modifier.
2550         (MoveNextMethod.DoEmit): Restore unsafe context.
2551
2552         * namespace.cs (UsingAlias): Better error message.
2553
2554 2005-03-03  Dan Winship  <danw@novell.com>
2555
2556         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2557         the warning message [#73219]
2558
2559 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2560
2561         Fix compile with MCS 1.0.0.0.
2562         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2563         w_restore to not depend on string constant folding.
2564
2565 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2566
2567         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2568         CS0246 check to users who passed 'silent = false'.
2569         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2570         check.
2571         (SimpleName.SimpleNameResolve): Update.
2572         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2573         (MemberAccess.IdenticalNameAndTypeName): Update.
2574         * doc.cs (FindDocumentedTypeNonArray): Update.
2575
2576 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2577
2578         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2579         * parameters.cs (ComputeAndDefineParameters): Remove.
2580         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2581         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2582         Use GetParameterInfo.
2583
2584 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2587
2588 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2589
2590         Unify DeclSpace.LookupType and DeclSpace.FindType.
2591         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2592         is in charge of defining nested types on demand.
2593         (DeclSpace.LookupType): Use it when the current_type is a
2594         TypeBuilder.  Use LookupTypeDirect for reflected types.
2595         (DeclSpace.FindType): Remove.
2596         (DeclSpace.LookupInterfaceOrClass): Likewise.
2597         (DeclSpace.DefineTypeAndParents): Likewise.
2598         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2599         DeclSpace.LookupType.
2600         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2601         * typemanager.cs (LookupType): Simplify.
2602         (AddUserType): Remove type from negative_hits.
2603         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2604         * class.cs (TypeContainer.FindMembers): Move handling of nested
2605         types ...
2606         (TypeContainer.FindMembers_NestedTypes): ... here.
2607         (TypeContainer.FindNestedType): Implement override.
2608         (ClassPart.FindNestedType): Delegate to PartialContainer.
2609         (ClassPart.PartFindNestedType): Looks up the nested types of the
2610         part alone.
2611
2612 2005-03-02  Martin Baulig  <martin@ximian.com>
2613
2614         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2615         static constructor in static classes.
2616
2617 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2618
2619         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2620         sizeParamIndex is not specified.
2621
2622 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2623
2624         Fix #73117
2625         * report.cs (WarningMessage.IsEnabled): Missing null check.
2626
2627 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2628
2629         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2630         in the fields and not in the properties.
2631
2632 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2633
2634         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2635         fields as well.
2636
2637 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2638
2639         * attribute.cs: Small refactoring (improved robustness).
2640         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2641         (ValidateGuid): Removed.
2642         (Resolve): Removed referenced to above mentioned.
2643         (GetAttributeUsage): Made private and changed to work without
2644         class assistance.
2645         (GetIndexerAttributeValue): Don't crash.
2646         (GetConditionalAttributeValue): Ditto.
2647         (GetClsCompliantAttributeValue): Ditto.
2648         (ExtractSecurityPermissionSet): All attributes exceptions are
2649         error 648.
2650         (GetPropertyValue): New helper.
2651         (GetMethodImplOptions): New method.
2652         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2653         some missing properties.
2654         
2655         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2656         (Method.ApplyAttributeBuilder): Updated.
2657         
2658         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2659         exception.
2660
2661 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2662
2663         Fix #73052.
2664         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2665         non-simple types (array, pointer, reference).
2666
2667 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2668
2669         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2670
2671         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2672         for operators.
2673         (Method.CheckBase): Catch wrong destructor here.
2674         (MethodData.Define): Add errors 550, 668.
2675
2676         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2677
2678         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2679
2680         * pending.cs (VerifyPendingMethods): Add error 551.
2681
2682         * typemanager.cs (CSharpName): Next error report helper.
2683
2684 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2685
2686         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2687         attributes. Removed useless attribute double check.
2688         It saves almost 2MBs for corlib.
2689
2690 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2691
2692         Fix #72924.
2693         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2694         called twice in case of error.
2695
2696 2005-02-23  Chris Toshok  <toshok@ximian.com>
2697
2698         Fix compiler portions of #72827.
2699         * statement.cs (Block.Emit): call Begin/EndScope on the
2700         EmitContext instead of the ILGenerator.
2701
2702         * codegen.cs (EmitContext.BeginScope): new method, call
2703         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2704         we have one.)
2705         (EmitContext.BeginScope): same, but EndScope and CloseScope
2706
2707         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2708         offset and call the superclass's OpenScope(int) with it.
2709         (SymbolWriter.CloseScope): get the current il
2710         offset and call superclass's CloseScope(int) with it.
2711
2712 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2713
2714         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2715         CS1677 for out and ref as well.
2716
2717         * class.cs (Method.Define): Add error CS1599 detection.
2718         
2719         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2720         
2721         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2722         
2723         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2724         
2725         * support.cs.cs (ModifierDesc): New helper method.
2726
2727 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2728             Abin Thomas  <projectmonokochi@rediffmail.com>
2729             Anoob V E  <projectmonokochi@rediffmail.com>
2730             Harilal P R  <projectmonokochi@rediffmail.com>
2731
2732         Fix #57851, #72718.
2733         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2734         MemberLookup (used for error reporting) actually returns a result.
2735         Fix error report number (122, not 112).
2736
2737 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2738             Anoob V E  <projectmonokochi@rediffmail.com>
2739             Harilal P R  <projectmonokochi@rediffmail.com>
2740
2741         Fix #71134.
2742         * pending.cs (PendingImplementation.GetAbstractMethods):
2743         Find NonPublic members too.
2744
2745 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2746
2747         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2748         Fixed error 217.
2749         
2750         * class.cs (MethodCore.CheckMethodAgainstBase):
2751         Add error 239 report.
2752
2753 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2754
2755         Fix #68955.
2756         * expression.cs (Invocation.IsApplicable): Make public.
2757         (Invocation.IsParamsMethodApplicable): Likewise.
2758         * delegate.cs (Delegate.VerifyApplicability): Don't use
2759         Invocation.VerifyArgumentCompat for parameter applicability
2760         testing.  Use Invocation.IsApplicable and
2761         Invocation.IsParamsMethodApplicable.
2762
2763 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2766         
2767         * class.cs (Operator.Define): Add error 217 report.
2768         
2769 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2770
2771         * namespace.cs (UsingEntry.Resolve): Undo change below.
2772
2773 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2774
2775         Fix #72756.
2776         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2777         disable the error message when the extended MemberLookup also
2778         fails.
2779         (Expression.MemberLookupFinal): Update.
2780         (SimpleName.DoSimpleNameResolve): Update.
2781         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2782         Don't use MemberLookupFinal.
2783         (New.DoResolve): Update.
2784         (BaseAccess.CommonResolve): Update.
2785
2786 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2787
2788         Fix #72732.
2789         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2790         occured previously, don't resolve again.
2791
2792 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2793
2794         Fix #69949
2795         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2796         argument. Call ResolveAttributeUsage for unresolved.
2797         when types doesn't match ctor arguments.
2798         
2799         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2800         for nested attribute classes.
2801         (Class.attribute_usage): Removed.
2802         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2803         for attribute class.
2804         
2805         * ecore.cs (IsAttribute): Removed.
2806         
2807         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2808         
2809         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2810         now normal types.
2811         (attribute_types): Removed.
2812         (EmitCode): Global attributes are emited as the latest.
2813
2814 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2815
2816         * class.cs (EmitFieldInitializers): Don't emit field initializer
2817         for default values when optimilization is on.
2818         
2819         * constant.cs (Constant.IsDefaultValue): New property.
2820         
2821         * driver.cs: Add /optimize handling.
2822         
2823         * constant.cs,
2824         * ecore.cs,
2825         * literal.cs: Implement new IsDefaultValue property.
2826         
2827         * rootcontext.cs (Optimize): New field, holds /optimize option.
2828
2829 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2830
2831         Fix crasher in re-opened #72347.
2832         * namespace.cs (Namespace.Lookup): Return null if
2833         DeclSpace.DefineType returns null.
2834
2835         Fix #72678.
2836         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2837
2838 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2839
2840         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2841         now returns null if it cannot resolve to an lvalue.
2842         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2843         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2844         returned null.  Remove check for SimpleName.
2845         (EventExpr.DoResolveLValue): New.
2846         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2847         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2848         error from ...
2849         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2850         avoid CS0131 error.
2851         (Unary.ResolveOperator): Move CS0211 check ...
2852         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2853         CS0131 error.
2854         (Unary.DoResolveLValue): Simplify.
2855         (AddressOf.DoResolveLValue): New.
2856         (ArrayAccess.DoResolveLValue): New.
2857
2858 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2859
2860         * attribute.cs (Attribute.Resolve): Add arguments casting for
2861         when types doesn't match ctor arguments.
2862
2863 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2864
2865         Fix parts of #63202.
2866         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2867         lookup of operator in base type.  Ensure that all checks happen
2868         when the operator resolves to an "op_..." method.
2869
2870 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #71992.
2873         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2874         'ignore_cs0104' parameter.  Pass it to ...
2875         (NamespaceEntry.Lookup): ... this.
2876         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2877         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2878         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2879         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2880         Update.  Request that cs0104 errors be ignored.
2881         (ComposedCast.ResolveAsTypeStep): Update.
2882
2883 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2884
2885         Fix #59209.
2886         * expression.cs (Invocation.BetterFunction): Remove support for
2887         comparing virtual functions and their overrides.
2888         (Invocation.IsOverride): New.
2889         (Invocation.OverloadResolve): Don't consider 'override' functions
2890         during candidate selection.  Store them in a lookaside list.
2891         If the selected method is a 'virtual' function, use the list to
2892         find any overrides that are closer to the LHS type.
2893
2894 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2895
2896         * expression.cs (New.DoResolve): Add complex core type reduction.
2897         (New.Constantify): Converts complex core type syntax like 'new int ()'
2898         to simple constant.
2899         
2900 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2901
2902         * decl.cs (EntryType.EntryType): New constructor to create an
2903         updated copy of a cache entry.
2904         (MemberCache.AddMethods): Use it.
2905         (MemberCache.ClearDeclaredOnly): Remove.
2906         (MemberCache.MemberCache): Update.
2907
2908 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2909
2910         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2911         variable.  This one is represents the actual low-level declaration
2912         of the method, as opposed to the semantic level `IsStatic'.   
2913
2914         An anonymous method which is hosted into a static method might be
2915         actually an instance method.  IsStatic would reflect the
2916         container, while MethodIsStatic represents the actual code
2917         generated.
2918
2919         * expression.cs (ParameterReference): Use the new MethodIsStatic
2920         instead of IsStatic.
2921
2922         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2923         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2924         set on the current EmitContext. 
2925
2926         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2927         resolve our casted expression as an LValue.  This triggers the
2928         proper LValue processing that is later required by Assign.
2929
2930         This fixes 72347.
2931
2932         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2933
2934 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2935
2936         C# 2.0 Fixed buffer implementation
2937
2938         * anonymous.cs: Update after RegisterHelperClass renaming.
2939
2940         * attribute.cs (AttributeTester.fixed_buffer_cache):
2941         Cache of external fixed buffers.
2942         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2943         implementation if field is fixed buffer else null.
2944
2945         * class.cs
2946         (TypeContainer.AddField): Accept FieldMember instead of Field.
2947         (FieldBase.IsFieldClsCompliant): Extracted code from
2948         VerifyClsCompliance descendant customization.
2949         (FixedField): New class handles fixed buffer fields.
2950         (FixedFieldExternal): Keeps information about imported fixed
2951         buffer.
2952         (IFixedField): Make access to internal or external fixed buffer
2953         same.
2954
2955         * cs-parser.jay: Add fixed buffer parsing.
2956
2957         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2958         buffer.
2959
2960         * expression.cs (Indirection): Extended implementation to accept
2961         fixed buffer field.
2962         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2963         (ElementAccess.MakePointerAccess): Get type as parameter.
2964         (DoResolve): Add fixed buffer field expression conversion.
2965         (DoResolveLValue): Ditto.
2966         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2967         (ArrayPtr): Derives from FixedBufferPtr.
2968         (ArrayPtr.Emit): Add extra emit for array elements.
2969
2970         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2971
2972         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2973         for compiler generated types.
2974         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2975
2976         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2977         and consume less memory.
2978         (Fixed.Resolve): Add fixed buffer case.
2979
2980         * typemanager.cs (compiler_generated_attr_ctor,
2981         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2982         (HasElementType): Add our own implementation to work on every
2983         runtime.
2984
2985 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2986
2987         * anonymous.cs (CaptureContext): Track whether `this' has been
2988         referenced.   
2989
2990         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2991         only captured `this' if it was implicitly done (instance
2992         methods/variables were used). 
2993
2994         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2995         `this' must be captured.
2996
2997 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2998  
2999         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3000         is null it means that there has been no need to capture anything,
3001         so we just create a sibling.
3002
3003         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3004
3005         Just a partial fix.  The other half is fairly elusive.
3006         
3007 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3008
3009         Fix #52586, cs0121-4.cs.
3010         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3011         and return a hashtable.
3012         (MemberCache.ClearDeclaredOnly): New.
3013         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3014         the method_hash of a base type too.
3015         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3016         type methods.  Overwrite entries with the same MethodHandle so
3017         that the ReflectedType is correct.  The process leaves in base
3018         virtual functions and their overrides as distinct entries.
3019         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3020         matters since it was boxed in a ArrayList before.
3021         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3022         modifier.
3023         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3024         case of a virtual function and its override (choose the overload
3025         as better).
3026         (Invocation.OverloadResolve): Avoid 'override' members during
3027         'applicable_type' calculation.
3028
3029 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3030
3031         Combine two near-redundant caches.
3032         * typemanager.cs (method_params): Rename from method_internal_params.
3033         (TypeManager.GetParameterData): New.  Replace
3034         Invocation.GetParameterData.
3035         (TypeManager.LookupParametersByBuilder): Remove.
3036         * expression.cs (Invocation.method_parameter_cache): Remove.
3037         (Invocation.GetParameterData): Remove.
3038         Update to changes.
3039         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3040         Update to changes.
3041
3042 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3043
3044         Fix #72015.
3045         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3046         TypeManager.multicast_delegate_type is null, resolve it by looking
3047         up "System.MulticastDelegate".
3048         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3049
3050 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3051             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3052             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3053
3054         Fix cs0164.cs.
3055         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3056         (LabeledStatement.AddReference): New.  Set 'referenced'.
3057         (Goto.Resolve): Use it.
3058
3059 2005-02-05  John Luke  <john.luke@gmail.com>
3060
3061         * driver.cs: remove duplicate -doc line in Usage ()
3062
3063 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3064
3065         * location.cs (Location.AddFile): Fix CS2002 error report.
3066
3067 2005-02-02  Martin Baulig  <martin@ximian.com>
3068
3069         * delegate.cs (Delegate.DefineType): Report an internal error if
3070         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3071         details.        
3072
3073 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3074
3075         Fix a crasher in a variant of #31984.
3076         * const.cs (Constant.CheckBase): New override that defers the
3077         new-or-override check in case the base type hasn't been populated
3078         yet.
3079         (Constant.Define): Ensure the new-or-override check is performed.
3080
3081 2005-02-01  Duncan Mak  <duncan@ximian.com>
3082
3083         * const.cs (LookupConstantValue): Check that `ce' is not null
3084         before calling GetValue ().
3085
3086 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3087
3088         Fix test-334.cs (#69519).
3089         * cs-parser.jay (using_alias_directive): Pass in an expression to
3090         NamespaceEntry.UsingAlias.
3091         (using_namespace_directive): Pass in an expression to
3092         NamespaceEntry.Using.
3093         (namespace_name): Don't flatten to a string.
3094         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3095         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3096         ResolveAsTypeStep.
3097         (NamespaceEntry.UsingEntry): Likewise.
3098         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3099         changes.
3100         (NamespaceEntry.LookupForUsing): Remove.
3101         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3102         names.
3103         (NamespaceEntry.Lookup): Remove support for dotted names.
3104
3105 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3106
3107         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3108         split into two.
3109         (NamespaceEntry.ImplicitParent): Compute on demand.
3110         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3111         parallels the current.
3112         (NamespaceEntry.LookupForUsing): Use it.
3113         (NamespaceEntry.Lookup): If the current namespace-entry is
3114         implicit, don't search aliases and using tables.
3115
3116 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3117
3118         Fix #31984.
3119         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3120         BaseCache here.
3121         (TypeContainer.BaseCache): Compute on demand.
3122         (TypeContainer.FindMembers): Define constants and types if they're
3123         not already created.
3124         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3125         check.
3126         * const.cs (Constant.Define): Make idempotent.
3127
3128 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3129
3130         * pending.cs: Produce better code (no nops produced by using Ldarg
3131         + value).
3132         
3133         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3134         i - 1' it should be arg + 1.
3135
3136         Fixes bug #71819.
3137
3138 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3139
3140         * attribute.cs (Attribute.CheckAttributeType): Make private
3141         non-virtual.
3142         (Attribute.ResolveType): Make virtual.
3143         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3144         handling of RootContext.Tree.Types.
3145
3146 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3147
3148         Update attribute-handling to use the SimpleName/MemberAccess
3149         mechanisms.
3150         * cs-parser.jay (attribute): Pass in an expression to the
3151         constructors of Attribute and GlobalAttribute.
3152         * attribute.cs (Attribute): Take an expression for the name.
3153         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3154         passed in attribute name expression.
3155         (Attribute.CheckAttributeType): Use it.
3156         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3157         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3158         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3159         argument to prevent error messages if the lookup fails.
3160
3161 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3162
3163         * expression.cs (Indirection): Implemented IVariable interface
3164         to support indirection in AddressOf operator.
3165         (PointerArithmetic.Emit): Add optimalization for case where
3166         result can be precomputed.
3167
3168 2005-01-26  Martin Baulig  <martin@ximian.com>
3169
3170         * class.cs (TypeContainer.AttributeTargets): Return the correct
3171         AttributeTargets depending on our `Kind' instead of throwing an
3172         exception; fixes #71632.
3173
3174 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3175
3176         Fix #71257
3177         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3178         constant members.
3179
3180 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3181
3182         Fix #71602.
3183         * expression.cs (MemberAccess.DoResolve): Don't complain with
3184         cs0572 when the LHS of a member access has identical name and type
3185         name.
3186
3187 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3188
3189         Fix #71651, #71675
3190         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3191         CreatePermission.
3192         Create custom PermissionSet only for PermissionSetAttribute.
3193
3194 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3195
3196         Fix #71649
3197         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3198         delegates in static class.
3199
3200 2005-01-24  Martin Baulig  <martin@ximian.com>
3201
3202         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3203         merging an implicit block, just use its reachability.
3204
3205         * statement.cs (Block.Resolve): Make the unreachable code check
3206         work wrt. implicit blocks; see test-337 from #63842.
3207
3208 2005-01-21  Alp Toker  <alp@atoker.com>
3209  
3210         * cs-parser.jay: destructor_declaration's container is PartialContainer
3211         not Class when partial types are used, so use Kind prop instead of
3212         'is'.
3213         
3214 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3215
3216         * cs-parser.jay: Improve error reporting when an interface
3217         declares new types.
3218
3219 2005-01-20  Dick Porter  <dick@ximian.com>
3220
3221         * support.cs: SeekableStreamReader fix from Sandor Dobos
3222         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3223         chars are read.  Fixes bug 70369.
3224
3225 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3226
3227         * cs-parser.jay (catch_clause): Simplify current_block handling
3228         somewhat.
3229
3230 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3231
3232         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3233         code with ImplicitStandardConversion to handle the implicit
3234         conversion of method groups into valid delegate invocations. 
3235
3236         The problem is that in parameter handling we were using this code
3237         path.  Fixes bug #64698
3238
3239 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3240
3241         * cs-parser.jay: Fix several infelicities.
3242         - Avoid assigning to the parser value stack.  Code like 
3243           '$3 = null' is unclean.  Synthesize a value for the code block
3244           instead. 
3245         - Avoid using oob_stack for storing location information.  Use ...
3246         (_mark_): ... this.  New (empty) rule.  Saves the current location
3247         in $$.
3248         (foreach_statement): Avoid using oob_stack for current_block
3249         handling.  Use technique used in for_statement and
3250         using_statement.  Synthesize a value for the code block to store
3251         additional intermediate information.
3252
3253 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3254
3255         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3256         of a different type is only allowed to private fields of a
3257         containing type, not on fields of a base class.
3258
3259         See test-174.cs and error cs0122-9.cs
3260
3261 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3262
3263         Fix test-335.cs (bug #58126).
3264         * cs-parser.jay (argument): Split out non-expression parts of the
3265         rule into 'non_simple_argument'.
3266         (invocation_expression): Support parenthesized invocations with
3267         multiple arguments, and with single non-simple arguments.
3268
3269 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3270
3271         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3272         places.
3273
3274 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3275
3276         Fix cs0038-1.cs, cs1640-6.cs.
3277         * ecore.cs (Expression.Resolve): Remove special-case for
3278         SimpleName in error-handling.
3279         (Expression.almostMatchedMembers): Relax access permission to
3280         protected.
3281         (Expression.MemberLookupFailed): Handle duplicates in
3282         almostMatchedMembers list.
3283         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3284         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3285         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3286         overload if the passed in MemberInfo is a MethodBase.
3287
3288 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3289
3290         Fix #70749
3291         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3292         for non-CAS & merge permission sets properly.
3293
3294 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3295
3296         Improve standard-compliance of simple name and member access 
3297         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3298         * ecore.cs (FullNamedExpression): New abstract base class 
3299         for Namespaces and TypeExpressions.
3300         (ResolveFlags.SimpleName): Remove.
3301         (SimpleName): Remove support for dotted names.
3302         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3303         DeclSpace.FindType and DeclSpace.LookupType.
3304         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3305         (Expression.ExprClassName): Make member function.
3306         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3307         a namespace.  Remove creation of dotted "SimpleName"s.
3308         (MemberAccess.DoResolve): Likewise.
3309         * decl.cs (DeclSpace.Cache): Make private.
3310         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3311         (DeclSpace.FindType): Update.
3312         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3313         FullNamedExpression.
3314         * namespace.cs (Namespace): Derive from FullNamedExpression
3315         so that it can be part of expression resolution.
3316         (Namespace.Lookup): Return an FullNamedExpression.
3317         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3318         namespace.
3319         * rootcontext.cs (NamespaceLookup): Remove.
3320         (LookupType): Move to DeclSpace.
3321         * attribute.cs (CheckAttributeType): Update.
3322         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3323         (FindDocumentedTypeNonArray): Likewise.
3324
3325 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3326
3327         Fix cs0509.cs, cs1632.cs.
3328         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3329         is the same as IsInterface.
3330         (TypeContainer.GetClassBases): Likewise.
3331         * statement.cs (LabeledStatement.ig): New field.
3332         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3333         label.
3334         (LabeledStatement.DoEmit): Check that the label was created with
3335         the same ILGenerator.
3336
3337 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3338
3339         Fix #71058
3340         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3341         accessors to its properties.
3342
3343         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3344         from accessors to property.
3345         
3346 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3347
3348         Fix #70722
3349         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3350         only for overrides.
3351         
3352 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3353
3354         * attribute.cs: Check for null and empty strings.  
3355
3356         I have lost another battle to Paolo.
3357
3358 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3359
3360         Fix #70942
3361         * class.cs (PropertyMethod): Set Parent field in ctors.
3362         (SetMethod.InternalParameters): Add unsafe switch hack.
3363         Override MarkForDuplicationCheck where it is appropriate.
3364
3365         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3366         It says whether container allows members with the same name.
3367         Base default is no.
3368         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3369         Removed is_method parameter.
3370
3371 2005-01-06  Duncan Mak  <duncan@ximian.com>
3372
3373         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3374         because the previous change led to incorrect reporting of CS1032
3375         ("Cannot define/undefine preprocessor symbols after first token in
3376         file"). Instead of using `tokens_seen' as the only flag that
3377         triggers CS1040, introduce `comments_seen'. This new flag is used
3378         to signify having seen comments on the current line, so it is
3379         unset after a newline.
3380
3381 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3382
3383         * doc.cs : When searching for a type, find nested type too.
3384           This fixes bug #71040.
3385
3386 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3387
3388         * doc.cs :
3389           - Warn missing member comment on those classes which also does not
3390             have doc comments. Fixed bug #71041.
3391           - Don't warn missing doc comment on default constructor.
3392             Fixed bug #71042.
3393
3394 2005-01-06  Duncan Mak  <duncan@ximian.com>
3395
3396         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3397         comments, set `tokens_seen' to true. This allows us to detect
3398         misplaced preprocessor directives (i.e. not at the beginning of
3399         the a line, nor after whitespaces). In that case, report error
3400         CS1040. This fixes bug #56460.
3401
3402         * cs-parser.jay (interface_member_declaration): Add checks for
3403         IsExplicitImpl, and report CS0541 error if an interface member is
3404         defined as an explicit interface declaration.
3405
3406 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3407
3408         Fix #70817
3409         * class.cs (PropertyMethod): Set Parent field in ctors.
3410         (SetMethod.InternalParameters): Add unsafe switch hack.
3411         
3412         * decl.cs (MemberCore.Parent): Cannot be readonly.
3413
3414 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3415
3416         * decl.cs (DeclSpace.ResolveType): Remove.
3417         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3418         Merge in code from ...
3419         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3420         * class.cs, enum.cs: Update to changes.
3421
3422 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3423
3424         * anonymous.cs: Ensure that we init the scope of our parent if it
3425         has not been initialized yet.
3426
3427 2004-12-30  Duncan Mak  <duncan@ximian.com>
3428
3429         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3430         if field.FieldBuilder is null. Fixes #70758.
3431
3432         * convert.cs: Fixed some typos and updated some of the comments.
3433         (ImplicitStandardConversionExists):
3434         (TryImplicitIntConversion): If `target_type' is an interface and
3435         the type of `ic' implements this interface, return true or a new
3436         BoxedCast instead of null. This fixes #70468.
3437
3438 2004-12-29  Duncan Mak  <duncan@ximian.com>
3439
3440         * expression.cs (Argument.Emit): Check that Expr is
3441         IMemoryLocation before casting to it, and report CS1510 otherwise.
3442
3443         This fixes #70402.
3444
3445 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3446
3447         * statement.cs (Block.ThisVariable): remove the recursion here, to
3448         make the --profile more sane.
3449
3450 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3451
3452         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3453         assembly, by JB Evain.
3454
3455 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3456
3457         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3458           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3459         "parent" refers to enclosing type/class.  "base" refers to superclass.
3460
3461 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3462
3463         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3464         Ensure that we only have GlobalAttributes.
3465         * attribute.cs (Attribute.Emit): Make non-virtual.
3466         (GlobalAttribute.Emit): Remove.
3467         (Attribute.Resolve): Make virtual.
3468         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3469         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3470         the argument. Don't create one.
3471         (Attribute.GetObsoleteAttribute): Likewise.
3472         (Attribute.GetClsCompliantAttributeValue): Likewise.
3473         * class.cs, decl.cs: Update to changes.
3474
3475 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3476
3477         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3478         
3479         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3480         
3481         * statement.cs (Foreach.Resolve): Add error 186 report.
3482
3483 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3484
3485         * expression.cs (Conditional.DoResolve): Add warning 429.
3486         
3487         * statement.cs (If.Resolve): Add warning 665.
3488
3489 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3490
3491         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3492         except when in the parser, and in GlobalAttribute.
3493         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3494         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3495         RootContext.Tree.Types.NamespaceEntry once work is done.
3496         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3497         and resets RootContext.Tree.Types.NamespaceEntry.
3498
3499 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3500
3501         * cs-parser.jay: Don't create a block for every variable.
3502
3503 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3504
3505         * location.cs: Provide extra information.
3506
3507         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3508         variables from the captured environment, it is the ldarg_0.
3509
3510 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3511
3512         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3513         find a conclusion.
3514         
3515         * class.cs: Changed warning level for 169 to avoid developer
3516         displeasure from warning flooding. It will be changed back when they
3517         fix most of current BCL warnings.
3518         
3519         * RootContext.cs: Pushed default WarningLevel to 3.
3520         
3521         * statement.cs: Removed unused variable.
3522
3523 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3524
3525         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3526         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3527         Add error 502 report.
3528         (StaticClass.DefineType): Add error 441 report.
3529         (Class.AllowedModifiersProp): New virtual property as temporary
3530         extension to AllowedModifiers.
3531         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3532         to share implementation with StaticClass and don't call virtual
3533         methods from ctor.
3534         
3535         * driver.cs (MainDriver): Add error 1558 test.
3536
3537         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3538         report. Moved error 36 test here.
3539
3540         * statement.cs (Throw.Resolve): Add error 724 report.
3541
3542         * typemanager.cs: Add out_attribute_type core type.
3543         
3544 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3545
3546         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3547         3018 report.
3548         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3549
3550         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3551         3017 report.
3552         
3553         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3554
3555         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3556         Add error 3023 report.
3557         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3558
3559         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3560         implementation.
3561
3562 2004-12-12  John Luke  <john.luke@gmail.com>
3563
3564         * driver.cs (AddArgs): take -- into account when
3565         adding arguments, fixes bug 65710 
3566
3567 2004-12-12  Martin Baulig  <martin@ximian.com>
3568
3569         * expression.cs (Unary.TryReduceNegative): Added support for
3570         SByteConstant and ByteConstant.
3571         (Unary.Reduce): Check error values from TryReduceNegative().
3572
3573 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3574
3575         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3576         and report exception as error 182.
3577
3578 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3579
3580         * driver.cs (Main): Fix message when there are warnings.
3581
3582 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3583
3584         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3585
3586 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3587
3588         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3589         Reduced number of warnings.
3590         
3591         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3592
3593 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3594
3595         * driver.cs: Removed message.
3596
3597         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3598
3599 2004-12-08    <vargaz@freemail.hu>
3600
3601         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3602
3603 2004-12-08  Martin Baulig  <martin@ximian.com>
3604
3605         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3606         instead of a CS3002 for properties and indexer.
3607
3608 2004-12-08  Martin Baulig  <martin@ximian.com>
3609
3610         * decl.cs (MemberName.ToString): Make this work again.
3611
3612 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3613
3614         * attribute.cs (Resolve): Add error 591 detection.
3615
3616         * class.cs (FieldMember.Define): Add error 1547 detection.
3617         (Indexer.Define): Add error 620 detection.
3618         (Operator.Define): Add error 590 detection.
3619
3620         * ecore.cs: Missing argument for error 79.
3621
3622         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3623         detection.
3624
3625 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3626
3627         Fix #70106
3628         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3629         only.
3630
3631 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3632
3633         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3634           Some operator comments were suppressed.
3635         * doc.cs : Implicit/explicit operator name in doc comments are like
3636           "op_Explicit(type)~returnType", so added suffix handling.
3637
3638 2004-12-07  Martin Baulig  <martin@ximian.com>
3639
3640         * decl.cs
3641         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3642         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3643         (DeclSpace.ec): New protected field; store the EmitContext here.
3644         (DeclSpace.EmitContext): New public property; moved here from
3645         `TypeContainer'.
3646         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3647         EmitContext.
3648
3649         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3650         (Enum.Emit): Don't create a new EmitContext.
3651
3652         * delegate.cs (Delegate.DefineType): Always create the
3653         EmitContext.
3654
3655         * iterators.cs (Iterators.DefineIterator): Create a new
3656         EmitContext and store it in `ec'.
3657
3658 2004-08-24  Martin Baulig  <martin@ximian.com>
3659
3660         * typemanager.cs
3661         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3662         this for accessibility checks.
3663         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3664         IsNestedFamilyAccessible.
3665         (TypeManager.IsSubclassOf): New method, do what the name actually
3666         says.   
3667
3668 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3669
3670         Fix crash on cs0657-17.cs.
3671         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3672         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3673         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3674         the case where the NamespaceEntry gets overwritten.
3675
3676 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3677
3678         Fixed #69195, #56821
3679         * ecore.cs (ResolveBoolean): Tiny refactoring.
3680
3681         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3682         of right expression resolving when left is false constant and
3683         operator is LogicalAnd OR true constant and operator is LogicalOr.
3684
3685         * statement.cs (ResolveUnreachable): Always reports warning.
3686
3687 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3688
3689         * class.cs: Distinguish between 1721 and 1722 (just a little help
3690         for the programmer).
3691
3692 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3693
3694         * delegate.cs: Only allow this on new versions of the language. 
3695
3696 2004-12-02  Duncan Mak  <duncan@ximian.com>
3697
3698         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3699         Expression class.
3700         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3701         here as a static method. Take an additional bool out parameter
3702         `must_do_cs1540_check' for signaling to InstanceResolve.
3703         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3704         member field from PropertyExpr class and made it an argument of
3705         the method instead.
3706         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3707         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3708         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3709         and `remove_accessor' as well as InstanceResolve: report CS0122
3710         where applicable.
3711
3712         Fixes #70129.
3713
3714 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3715
3716         Fix test-327.cs, test-328.cs, and put in early infrastructure
3717         for eventually fixing #52697.
3718         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3719         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3720         from other methods.
3721         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3722         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3723         (VerifyUsing, error246): Update.
3724         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3725         'NamespaceEntry.LookupNamespaceOrType'.
3726
3727 2004-12-03  Martin Baulig  <martin@ximian.com>
3728
3729         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3730         method as our child, call AnonymousMethod.Compatible() on it.
3731
3732 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3733
3734         Disable XML documentation support in 'basic' profile.
3735         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3736         Redirect XmlElement to System.Object.
3737         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3738         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3739         * mcs.exe.sources: Add doc-bootstrap.cs.
3740         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3741         of doc.cs.
3742
3743 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3744
3745         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3746           comments are allowed.
3747
3748 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3749
3750         * delegate.cs: Add checks for subtypes in paramaters and return values
3751         in VerifyMethod () to add support for Covariance/Contravariance
3752         in delegates.
3753         
3754 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3755
3756         * report.cs: Remove extra closing parenthesis.
3757
3758         * convert.cs (Error_CannotImplicitConversion): If the name of the
3759         types are the same, provide some extra information.
3760
3761         * class.cs (FieldBase): Use an unused bit field from the field to
3762         encode the `has_offset' property from the FieldMember.  This saves
3763         a couple of Ks on bootstrap compilation.
3764
3765         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3766         method as our child, return the AnonymousMethod resolved
3767         expression.
3768
3769         * expression.cs (New.DoResolve): Allow return values from
3770         NewDelegate to also include AnonymousMethods.
3771
3772         Fixes #70150.
3773
3774 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3775
3776         Fix bug #70102
3777         * attribute.cs (Resolve): Improved implementation of params
3778         attribute arguments.
3779
3780         * support.cs (ParameterData): Add HasParams to be faster.
3781
3782 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3783
3784         all things are for /doc support:
3785
3786         * doc.cs: new file that supports XML documentation generation.
3787         * mcs.exe.sources: added doc.cs.
3788         * driver.cs:
3789           Handle /doc command line option.
3790           Report error 2006 instead of 5 for missing file name for /doc.
3791           Generate XML documentation when required, after type resolution.
3792         * cs-tokenizer.cs:
3793           Added support for picking up documentation (/// and /** ... */),
3794           including a new XmlCommentState enumeration.
3795         * cs-parser.jay:
3796           Added lines to fill Documentation element for field, constant,
3797           property, indexer, method, constructor, destructor, operator, event
3798           and class, struct, interface, delegate, enum.
3799           Added lines to warn incorrect comment.
3800         * rootcontext.cs :
3801           Added Documentation field (passed only when /doc was specified).
3802         * decl.cs:
3803           Added DocComment, DocCommentHeader, GenerateDocComment() and
3804           OnGenerateDocComment() and some supporting private members for
3805           /doc feature to MemberCore.
3806         * class.cs:
3807           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3808         * delegate.cs:
3809           Added overriden DocCommentHeader.
3810         * enum.cs:
3811           Added overriden DocCommentHeader and GenerateDocComment().
3812
3813 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3814
3815         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3816         unwrapping the enumeration values, chain to
3817         DoConstantNumericPromotions again, so we can promote things to the
3818         fundamental types (takes care of enums that are bytes, sbytes).
3819
3820         Fixes bug #62054.
3821
3822 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3823
3824         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3825         Fix long-standing bug in type-lookup.  Use FindType instead of
3826         LookupType when ec.ResolvingTypeTree.
3827         (Attribute.ResolveType, Attribute.Resolve)
3828         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3829         Update to changes.
3830         (Attributes.Search): Remove internal version.  Update.
3831         (Attributes.SearchMulti): Update.
3832         (Attributes.GetClsCompliantAttribute): Remove.
3833         (Attributes.GetIndexerNameAttribute): Remove.
3834         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3835         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3836         * class.cs (Indexer.Define): Likewise.
3837
3838 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3839
3840         Fix bug #68790
3841         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3842         MarshallByReference members access.
3843
3844         * expression.cs: Use CheckMarshallByRefAccess;
3845         Better error CS0197 message.
3846
3847         * report.cs: Print whole related error message.
3848
3849 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3850
3851         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3852         the current directory to help debugging.
3853
3854 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3855
3856         * class (GetClassBases): Better error 60 report.
3857         (EventProperty): Disabled warning 67 detection.
3858
3859 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3860
3861         Fix bug #60324
3862         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3863
3864         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3865         precise values.
3866
3867 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3868
3869         Fix bug #49488
3870         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3871
3872         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3873
3874 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3875
3876         * attribute.cs (Attribute.Resolve): Refine error reporting and
3877         report a cs0117 if the identifier does not exist, to distinguish
3878         from 0617 which is a miss-use of the actual identifier.
3879
3880         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3881         between cs0070 and cs0079.
3882
3883         * class.cs (MemberBase.DoDefine): When reporting a wrong
3884         accessibility level, we use MethodCore to compare instead of
3885         Method (this was a regression in some refactoring effort).
3886
3887         So now we correctly report cs0056 again.
3888
3889         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3890         testing the target_type (which was known to be object_type) and
3891         not the source type (which is anonymous_method).
3892
3893         Fixed reporting of error cs1660.
3894
3895         * expression.cs (UserCast.Source): Expose the underlying cast.
3896
3897         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3898         allowed types to find a match to int32 first (most common).
3899
3900         In addition, it ignores any ImplicitUserConversions that did an
3901         internal implicit conversion (as the switch statement allows only
3902         one integral conversion to exist).
3903
3904         * class.cs (PartialContainer.Create): rename `name' to
3905         `member_name' for clarity.  Then replace the string calls with a
3906         call to MemberName.GetPartialName, as now using
3907         MemberName.ToString is an error (this is due to the side effects
3908         it had, that were fixed in the past).
3909
3910         This will restore the error reporting on a number of partial class
3911         errors that were missusing this (and getting an exception as a
3912         results, which is now just a plain textual warning, because
3913         yyparse debug output would crash otherwise).
3914
3915 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3916
3917         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3918
3919 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3920
3921         * rootcontext.cs (LookupType): Make sure to cache lookups that
3922         don't give us a negative result. This saves about 5% of corlib
3923         compilation time.
3924
3925 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3926
3927         * report.cs (AbstractMessage.Print): messages are sent to stderr
3928
3929         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3930         non-interface in the list of interfaces (at this point, either
3931         parent was properly set, or a base class is being listed in the
3932         interfaces section).
3933
3934         This flags error 1722, and resolves the crash from bug 69259.
3935
3936 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3937
3938         * statement.cs (Using.EmitExpressionFinally): make this work right
3939         for valuetypes. Fixes 69926.
3940
3941 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3942
3943         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3944         converted to an enum" here, before we try to change the underlying
3945         type.  This code exists, but it is a different code path than the
3946         one used while encoding constants.
3947
3948         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3949         old bug: when converting from the null literal to a pointer,
3950         return an EmptyCast, not the NullLiteral.
3951
3952         This fixes #69921, the recent null_type changes probably made this
3953         bug more prominent.
3954
3955         (ImplicitReferenceConversionExists): In addition, resynchronized
3956         the code here, so it matches the same code in
3957         ImplicitReferenceConversionExists for the `from any class-type S
3958         to any interface-type T'.
3959         
3960
3961 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3962
3963         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3964
3965 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3966
3967         * cs-parser.jay: Use verbosity accordingly. 
3968
3969 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3970
3971         * expression.cs (Unary.ResolveOperator): Do not report warning;
3972         AddressOf reads from variable.
3973         
3974         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3975
3976 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3977
3978         Fix bug #69462
3979
3980         * attribute.cs (Attributable): Removed CheckTargets.
3981         (Attributes.Emit): Explicit attribute targets are tested here.
3982
3983         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3984         not enabled for interfaces.
3985
3986         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3987         (GetAssemblyName): Ouch next bug there.
3988
3989 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3990
3991         * expression.cs: Error 275 added.
3992         
3993 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3994
3995         Fix bug #69177 (Implemented decimal constant support)
3996
3997         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3998         (BinaryFold): Add DecimalConstant.
3999
4000         * const.cs (Define): Decimal constant 
4001         (is not constant.
4002         (ChangeType): Add decimal type handling.
4003         (LookupConstantValue): Don't set value for decimal type but
4004         emit DecimalConstantAttribute. Needed for constant optimization.
4005
4006         * constant.cs (ToDecimal): New method.
4007         (ConvertToDecimal): New method.
4008         (IntConstant): Implemented ConvertToDecimal.
4009         (DecimalConstant.Emit): Emit optimized version for decimals in
4010         int range.
4011
4012         * expression.cs (ResolveOperator): Changed order of constant
4013         reduction to work correctly with native types which have
4014         overloaded operators.
4015         (ResolveMemberAccess): Extract constant value from attribute
4016         for decimal type.
4017
4018         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4019
4020         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4021         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4022         (ChangeType): Decimal is special.
4023         (TypeToCoreType): Add decimal type.
4024
4025 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4026
4027         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4028         decimal types.
4029
4030 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4031
4032         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4033         test cs1667-5.cs.
4034
4035 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4038
4039         * pending.cs (PendingImplementation): Grab only interfaces.
4040
4041 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4042
4043         * statement.cs (ForeachHelperMethods): Add location member and
4044         error 202 detection.
4045
4046 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4047
4048         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4049         automatically handled by executable.make.
4050         (PROGRAM): Make profile-specific.
4051
4052 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4053
4054         * expression.cs (DoResolveBase): Fixed wrong warning for out
4055         variables.
4056
4057 2004-11-18  Martin Baulig  <martin@ximian.com>
4058
4059         Merged latest changes into gmcs.  Please keep this comment in
4060         here, it makes it easier for me to see what changed in MCS since
4061         the last time I merged.
4062
4063 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4064
4065         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4066         (TypeHandle.GetMemberCache): New.
4067         (TypeHandle.TypeHandle): Update.
4068         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4069         (TypeManager.LookupParentInterfacesCache):
4070         Rename from LookupInterfaceCache.  Optimize slightly.
4071         (TypeManager.MemberLookup_FindMembers): Update.
4072         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4073         multi-type variant.
4074         (AddCacheContents): Rename from AddHashtable.
4075         * class.cs (TypeContainer.parent_container): Remove.
4076         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4077         (TypeContainer.DoDefineMembers): Don't initialize it.
4078         Update to name changes.
4079         
4080 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4081
4082         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4083         that factors the code to check access modifiers on override.  
4084
4085         (PropertyBase): Use the code here.
4086
4087         Patch from Lluis S'anchez, fixes bug #69361.
4088
4089 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4090
4091         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4092         routine that is used to report the use of a captured variable
4093         whose address has been taken.
4094
4095         There are two checks: one when variables are being captured and
4096         the other check is when the address of a variable is taken. 
4097         
4098         (because an anonymous methods might be resolved before *or* after
4099         the address has been taken) and 
4100
4101         * expression.cs (Conditional.DoResolve): Remove the special
4102         casing that Martin added to trueExpr and falseExpr being both
4103         NullLiteral.  We get the right behavior now just by introducing
4104         the null_type into the compiler. 
4105
4106         * convert.cs (ExplicitConversion): Change the code to use
4107         null_type instead of testing `expr is NullLiteral'.
4108         (ImplicitConversionStandard): use null_type too.
4109         (ImplicitReferenceConversionExists): use null_type too.
4110         (ImplicitReferenceConversion): use null_type too.
4111
4112         * literal.cs: The type of `NullLiteral' is now null_type instead
4113         of object_type. 
4114         (Resolve): Set the type here.
4115
4116         * typemanager.cs: Introduce null_type.
4117
4118 2004-11-17  Martin Baulig  <martin@ximian.com>
4119
4120         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4121         direction, like FindMembers() does.  Fixes #69546, testcase is in
4122         test-315.cs.    
4123
4124 2004-11-16  Martin Baulig  <martin@ximian.com>
4125
4126         This is based on a patch from Marek Safar, see bug #69082.
4127         Fixes bugs #63705 and #67130.
4128
4129         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4130         method; create a MemberCache for an interface type and cache the
4131         result.
4132
4133         * decl.cs (IMemberContainer.ParentContainer): Removed.
4134         (IMemberContainer.ParentCache): New property.
4135         (MemberCache.SetupCacheForInterface): Removed.
4136         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4137         to create a cache for an interface's "parent".
4138
4139         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4140         interfaces too.
4141
4142 2004-11-16  Martin Baulig  <martin@ximian.com>
4143
4144         Merged back from gmcs; these changes already went into gmcs a
4145         couple of weeks ago.
4146
4147         * typemanager.cs
4148         (TypeManager.AddUserType): Removed the `ifaces' argument.
4149         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4150         `TypeExpr []'.
4151         (TypeManager.AddUserInterface): Removed.
4152         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4153         `TypeExpr []'.
4154         (TypeManager.GetInterfaces): Likewise.
4155         (TypeManager.GetExplicitInterfaces): Likewise.
4156
4157         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4158
4159         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4160         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4161
4162 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4163
4164         * statement.cs: Avoid adding bools to a hashtable.
4165
4166 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4167
4168         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4169         calling an unsafe method from a safe location.
4170
4171 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4172
4173         Fix #69167
4174         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4175
4176 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4177
4178         * namespace.cs (VerifyUsing): use GetPartialName instead of
4179         ToString. 
4180
4181 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4182
4183         * statement.cs (Return.Resolve): Fix regression in typo: if
4184         `in_exc', we have to request a NeedReturnLabel, this was a typo
4185         introduced in the anonymous method check-in.  Fixes #69131.
4186
4187         * Indexers were using the ShortName when defining themselves,
4188         causing a regression in the compiler bootstrap when applying the
4189         patch from 2004-11-02 (first part), now they use their full name
4190         and the bug is gone.
4191
4192 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4193
4194         * driver.cs: Strip the path from the names of embedded resources. Fixes
4195         #68519.
4196
4197 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4198
4199         Fix error message regression: cs0104-2.cs.
4200         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4201         (AliasEntry.Resolve): Update.
4202         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4203         'silent' flag.
4204         (RootContext.LookupType): Update.
4205
4206 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4207
4208         * cs-parser.jay: Add support for handling accessor modifiers
4209         * class: Add support port accessor modifiers and error checking,
4210         define PropertyMethod.Define as virtual (not abstract anymore)
4211         * ecore.cs: Add checking for proeprties access with access modifiers
4212         * iterators.cs: Modify Accessor constructor call based in the modified
4213         constructor
4214 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4215
4216         * expression.cs (StringConcat): Handle being called twice,
4217         as when we have a concat in a field init with more than two
4218         ctors in the class
4219
4220 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4221
4222         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4223         special case explicit implementations, we should always produce
4224         the .property or .event declaration.
4225         
4226         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4227         since it will not return correct data if people use this
4228         unresolved in the presence of using statements (see test-313).
4229
4230         * class.cs (MethodData.Define): If we are an explicit interface
4231         implementation, set the method name to the full name of the
4232         interface plus the name of the method.  
4233
4234         Notice that using the method.MethodName.GetFullName() does not
4235         work, as it will only contain the name as declared on the source
4236         file (it can be a shorthand in the presence of using statements)
4237         and not the fully qualifed type name, for example:
4238
4239         using System;
4240
4241         class D : ICloneable {
4242                 object ICloneable.Clone ()  {
4243                 }
4244         }
4245
4246         Would produce a method called `ICloneable.Clone' instead of
4247         `System.ICloneable.Clone'.
4248
4249         * namespace.cs (Alias.Resolve): Use GetPartialName.
4250         
4251 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * cs-parser.jay: Add error 1055 report.
4254
4255 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4256
4257         * assign.cs (Assign.DoResolve): Only do the transform of
4258         assignment into a New if the types are compatible, if not, fall
4259         through and let the implicit code deal with the errors and with
4260         the necessary conversions. 
4261
4262 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4263
4264         * cs-parser.jay: Add error 1031 report.
4265
4266         * cs-tokenizer.cs: Add location for error 1038.
4267
4268 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4269
4270         * cs-parser.jay: Add error 1016 report.
4271
4272 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4273
4274         * cs-parser.jay: Add errors 1575,1611 report.
4275
4276 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * cs-parser.jay: Add error 1001 report.
4279
4280 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4281
4282         Fix #68850
4283         * attribute.cs (GetMarshal): Add method argument for
4284         caller identification.
4285
4286         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4287         agument for GetMarshal and RuntimeMissingSupport.
4288
4289 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4290
4291         * attribute.cs (ExtractSecurityPermissionSet): Removed
4292         TypeManager.code_access_permission_type.
4293
4294         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4295
4296 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4297
4298         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4299         for obsolete use of a variable here.   Fixes regression on errors
4300         cs0619-25 and cs0619-26.
4301
4302 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4303
4304         Fix #62358, implemented security attribute encoding.
4305
4306         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4307         Tests permitted SecurityAction for assembly or other types.
4308         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4309         data from SecurityPermissionAttribute to PermisionSet class.
4310
4311         * class.cs (ApplyAttributeBuilder): Added special handling
4312         for System.Security.Permissions.SecurityAttribute based types.
4313
4314         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4315         special handling for System.Security.Permissions.SecurityAttribute
4316         based types.
4317
4318         * enum.cs (ApplyAttributeBuilder): Added special handling
4319         for System.Security.Permissions.SecurityAttribute based types.
4320
4321         * parameter.cs (ApplyAttributeBuilder): Added special handling
4322         for System.Security.Permissions.SecurityAttribute based types.
4323
4324         * rootcontext.cs: Next 2 core types.
4325
4326         * typemanager.cs (TypeManager.security_permission_attr_type):
4327         Built in type for the SecurityPermission Attribute.
4328         (code_access_permission_type): Build in type.
4329
4330 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4331
4332         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4333         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4334         all of this information into
4335         EmitContext.EmitCapturedVariableInstance.
4336         
4337         * codegen.cs (EmitCapturedVariableInstance): move here the
4338         funcionality of emitting an ldarg.0 in the presence of a
4339         remapping.   This centralizes the instance emit code.
4340
4341         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4342         then emit a load of this: it means that we have reached the
4343         topmost ScopeInfo: the one that contains the pointer to the
4344         instance of the class hosting the anonymous method.
4345
4346         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4347         captures to the topmost CaptureContext.
4348
4349 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4350
4351         * expression.cs (LocalVariableReference): Move the knowledge about
4352         the iterators into codegen's EmitCapturedVariableInstance.
4353
4354 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4355
4356         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4357         all code paths return a value from an anonymous method (it is the
4358         same as the 161 error, but for anonymous methods).
4359
4360 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4361
4362         The introduction of anonymous methods in the compiler changed
4363         various ways of doing things in the compiler.  The most
4364         significant one is the hard split between the resolution phase
4365         and the emission phases of the compiler.
4366
4367         For instance, routines that referenced local variables no
4368         longer can safely create temporary variables during the
4369         resolution phase: they must do so from the emission phase,
4370         since the variable might have been "captured", hence access to
4371         it can not be done with the local-variable operations from the runtime.
4372         
4373         * statement.cs 
4374
4375         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4376         is a toplevel block.
4377
4378         (ToplevelBlock): A new kind of Block, these are the blocks that
4379         are created by the parser for all toplevel method bodies.  These
4380         include methods, accessors and anonymous methods.
4381
4382         These contain some extra information not found in regular blocks:
4383         A pointer to an optional CaptureContext (for tracking captured
4384         local variables and parameters).  A pointer to the parent
4385         ToplevelBlock.
4386         
4387         (Return.Resolve): Catch missmatches when returning a value from an
4388         anonymous method (error 1662).
4389         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4390         phase.
4391
4392         (Break.Resolve): ditto.
4393
4394         (SwitchLabel): instead of defining the labels during the
4395         resolution phase, we now turned the public ILLabel and ILLabelCode
4396         labels into methods called GetILLabelCode() and GetILLabel() that
4397         only define the label during the Emit phase.
4398
4399         (GotoCase): Track the SwitchLabel instead of the computed label
4400         (its contained therein).  Emit the code by using
4401         SwitchLabel.GetILLabelCode ().
4402
4403         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4404         whether the Local has been captured or not.
4405
4406         (LocalInfo.IsCaptured): New property, used to tell whether the
4407         local has been captured.
4408         
4409         * anonymous.cs: Vastly updated to contain the anonymous method
4410         support.
4411
4412         The main classes here are: CaptureContext which tracks any
4413         captured information for a toplevel block and ScopeInfo used to
4414         track the activation frames for various local variables.   
4415
4416         Each toplevel block has an optional capture context associated
4417         with it.  When a method contains an anonymous method both the
4418         toplevel method and the anonymous method will create a capture
4419         context.   When variables or parameters are captured, they are
4420         recorded on the CaptureContext that owns them, for example:
4421
4422         void Demo () {
4423              int a;
4424              MyDelegate d = delegate {
4425                  a = 1;
4426              }
4427         }
4428
4429         Here `a' will be recorded as captured on the toplevel
4430         CapturedContext, the inner captured context will not have anything
4431         (it will only have data if local variables or parameters from it
4432         are captured in a nested anonymous method.
4433
4434         The ScopeInfo is used to track the activation frames for local
4435         variables, for example:
4436
4437         for (int i = 0; i < 10; i++)
4438                 for (int j = 0; j < 10; j++){
4439                    MyDelegate d = delegate {
4440                         call (i, j);
4441                    }
4442                 }
4443
4444         At runtime this captures a single captured variable `i', but it
4445         captures 10 different versions of the variable `j'.  The variable
4446         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4447         recorded on a child.  
4448
4449         The toplevel ScopeInfo will also track information like the `this'
4450         pointer if instance variables were referenced (this is necessary
4451         as the anonymous method lives inside a nested class in the host
4452         type of the method). 
4453
4454         (AnonymousMethod): Expanded to track the Toplevel, implement
4455         `AnonymousMethod.Compatible' to tell whether an anonymous method
4456         can be converted to a target delegate type. 
4457
4458         The routine now also produces the anonymous method content
4459
4460         (AnonymousDelegate): A helper class that derives from
4461         DelegateCreation, this is used to generate the code necessary to
4462         produce the delegate for the anonymous method that was created. 
4463
4464         * assign.cs: API adjustments for new changes in
4465         Convert.ImplicitStandardConversionExists.
4466
4467         * class.cs: Adjustments to cope with the fact that now toplevel
4468         blocks are of type `ToplevelBlock'. 
4469
4470         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4471         insteda of standard blocks.
4472
4473         Flag errors if params arguments are passed to anonymous methods.
4474
4475         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4476         `CurrentAnonymousMethod' which points to the current Anonymous
4477         Method.  The variable points to the AnonymousMethod class that
4478         holds the code being compiled.  It is set in the new EmitContext
4479         created for the anonymous method.
4480
4481         (EmitContext.Phase): Introduce a variable and an enumeration to
4482         assist in enforcing some rules about when and where we are allowed
4483         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4484         only one that enfonces this right now).
4485
4486         (EmitContext.HaveCaptureInfo): new helper method that returns
4487         whether we have a CapturedContext initialized.
4488
4489         (EmitContext.CaptureVariable): New method used to register that a
4490         LocalInfo must be flagged for capturing. 
4491
4492         (EmitContext.CapturedParameter): New method used to register that a
4493         parameters must be flagged for capturing. 
4494         
4495         (EmitContext.CapturedField): New method used to register that a
4496         field must be flagged for capturing. 
4497
4498         (EmitContext.HaveCapturedVariables,
4499         EmitContext.HaveCapturedFields): Return whether there are captured
4500         variables or fields. 
4501
4502         (EmitContext.EmitMethodHostInstance): This is used to emit the
4503         instance for the anonymous method.  The instance might be null
4504         (static methods), this (for anonymous methods that capture nothing
4505         and happen to live side-by-side with the current method body) or a
4506         more complicated expression if the method has a CaptureContext.
4507
4508         (EmitContext.EmitTopBlock): Routine that drives the emission of
4509         code: it will first resolve the top block, then emit any metadata
4510         and then emit the code.  The split is done so that we can extract
4511         any anonymous methods and flag any captured variables/parameters.
4512         
4513         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4514         during this phase, the ILGenerator should not be used as labels
4515         and local variables declared here might not be accessible to any
4516         code that is part of an anonymous method.  
4517
4518         Exceptions to this include the temporary variables that are
4519         created by some statements internally for holding temporary
4520         variables. 
4521         
4522         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4523         metadata for a cb
4524
4525         (EmitContext.TemporaryReturn): This method is typically called
4526         from the Emit phase, and its the only place where we allow the
4527         ReturnLabel to be defined other than the EmitMeta.  The reason is
4528         that otherwise we would have to duplicate a lot of logic in the
4529         Resolve phases of various methods that today is on the Emit
4530         phase. 
4531
4532         (EmitContext.NeedReturnLabel): This no longer creates the label,
4533         as the ILGenerator is not valid during the resolve phase.
4534
4535         (EmitContext.EmitThis): Extended the knowledge in this class to
4536         work in anonymous methods in addition to iterators. 
4537
4538         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4539         code is necessary on the stack to access the instance to a local
4540         variable (the variable will be accessed as a field).
4541
4542         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4543         EmitContext.EmitAddressOfParameter): Routines to support
4544         parameters (not completed at this point). 
4545         
4546         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4547         will also remove the parameters.
4548
4549         * convert.cs (Convert): Define a `ConstantEC' which points to a
4550         null.  This is just to prefity some code that uses
4551         ImplicitStandardConversion code and do not have an EmitContext
4552         handy.
4553
4554         The idea is to flag explicitly that at that point in time, it is
4555         known that the conversion will not trigger the delegate checking
4556         code in implicit conversions (which requires a valid
4557         EmitContext). 
4558
4559         Everywhere: pass new EmitContext parameter since
4560         ImplicitStandardConversionExists now requires it to check for
4561         anonymous method conversions. 
4562
4563         (Convert.ImplicitStandardConversionExists): If the type of an
4564         expression is the anonymous_method_type, and the type is a
4565         delegate, we invoke the AnonymousMethod.Compatible method to check
4566         whether an implicit conversion is possible. 
4567
4568         (Convert.ImplicitConversionStandard): Only do implicit method
4569         group conversions if the language level is not ISO_1.
4570
4571         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4572         MethodInfo for the Invoke method.  used by Delegate and
4573         AnonymousDelegate.
4574
4575         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4576         method conversions if the target type is a delegate.
4577
4578         Removed extra debugging nops.
4579
4580         (LocalVariableReference): Turn the `local_info' into a public
4581         field. 
4582
4583         Add `prepared' field, the same hack used for FieldExprs to cope
4584         with composed assignments, as Local variables do not necessarily
4585         operate purely on the stack as they used to: they can be captured
4586         fields. 
4587
4588         Add `temp' for a temporary result, like fields.
4589
4590         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4591
4592         It now copes with Local variables that are captured and emits the
4593         proper instance variable to load it from a field in the captured
4594         case. 
4595
4596         (ParameterReference.DoResolveBase): During the resolve phase,
4597         capture parameters if we are in an anonymous method.
4598
4599         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4600         anonymous method, use the EmitContext helper routines to emit the
4601         parameter reference.
4602
4603         * iterators.cs: Set RemapToProxy to true/false during the
4604         EmitDispose class.
4605
4606         * parameters.cs (GetParameterByName): New helper method. 
4607
4608         * typemanager.cs (anonymous_method_type) a new type that
4609         represents an anonyous method.  This is always an internal type,
4610         used as a fencepost to test against the anonymous-methodness of an
4611         expression. 
4612         
4613 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4614
4615         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4616         561 report.
4617         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4618
4619 2004-10-18  Martin Baulig  <martin@ximian.com>
4620
4621         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4622         `Type' directly, but call ResolveType() on it.
4623         (Catch.Resolve): Likewise.
4624         (Foreach.Resolve): Likewise.
4625
4626 2004-10-18  Martin Baulig  <martin@ximian.com>
4627
4628         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4629         `Type' directly, but call ResolveType() on it.
4630         (Probe.DoResolve): Likewise.
4631         (ArrayCreation.LookupType): Likewise.
4632         (TypeOf.DoResolve): Likewise.
4633         (SizeOf.DoResolve): Likewise.
4634
4635 2004-10-18  Martin Baulig  <martin@ximian.com>
4636
4637         * expression.cs (Invocation.BetterFunction): Put back
4638         TypeManager.TypeToCoreType().
4639
4640 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4641
4642         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4643         the ResolveType.
4644
4645 2004-10-18  Martin Baulig  <martin@ximian.com>
4646
4647         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4648         `Type' directly, but call ResolveType() on it.
4649
4650 2004-10-18  Martin Baulig  <martin@ximian.com>
4651
4652         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4653         `Type' directly, but call ResolveType() on it.
4654         (MemberBase.DoDefine): Likewise.
4655
4656         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4657         `Type' directly, but call ResolveType() on it.
4658         (ComposedCast.DoResolveAsTypeStep): Likewise.
4659
4660         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4661         `Type' directly, but call ResolveType() on it.
4662
4663 2004-10-17  John Luke  <john.luke@gmail.com>
4664
4665         * class.cs (Operator.GetSignatureForError): use CSharpName
4666
4667         * parameter.cs (Parameter.GetSignatureForError): Returns
4668         correct name even if was not defined.
4669
4670 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4671
4672         Fix #65816.
4673         * class.cs (TypeContainer.EmitContext): New property.
4674         (DefineNestedTypes): Create an emitcontext for each part.
4675         (MethodCore.DoDefineParameters): Use container's emitcontext.
4676         Pass type array to InternalParameters.
4677         (MemberBase.DoDefine): Use container's emitcontext.
4678         (FieldMember.Define): Likewise.
4679         (Event.Define): Likewise.
4680         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4681         Pass type array to InternalParameters.
4682         (SetIndexerMethod.GetParameterInfo): Likewise.
4683         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4684         * delegate.cs (Define): Pass emitcontext to
4685         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4686         array to InternalParameters.
4687         * expression.cs (ParameterReference.DoResolveBase): Pass
4688         emitcontext to GetParameterInfo.
4689         (ComposedCast.DoResolveAsTypeStep): Remove check on
4690         ec.ResolvingTypeTree.
4691         * parameter.cs (Parameter.Resolve): Change argument to
4692         EmitContext.  Use ResolveAsTypeTerminal.
4693         (Parameter.GetSignature): Change argument to EmitContext.
4694         (Parameters.ComputeSignature): Likewise.
4695         (Parameters.ComputeParameterTypes): Likewise.
4696         (Parameters.GetParameterInfo): Likewise.
4697         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4698         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4699         * support.cs (InternalParameters..ctor): Remove variant that takes
4700         a DeclSpace.
4701         * typemanager.cs (system_intptr_expr): New.
4702         (InitExpressionTypes): Initialize it.
4703
4704 2004-10-12  Chris Toshok  <toshok@ximian.com>
4705
4706         * cs-parser.jay: fix location for try_statement and catch_clause.
4707
4708 2004-10-11  Martin Baulig  <martin@ximian.com>
4709
4710         * report.cs: Don't make --fatal abort on warnings, we have
4711         -warnaserror for that.
4712
4713 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4714
4715         More DeclSpace.ResolveType avoidance.
4716         * decl.cs (MemberCore.InUnsafe): New property.
4717         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4718         with newly created EmitContext.
4719         (FieldMember.Define): Likewise.
4720         * delegate.cs (Delegate.Define): Likewise.
4721         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4722         only if normal name-lookup fails.
4723         (TypeExpr.DoResolve): Enable error-checking.
4724         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4725         (SizeOf.DoResolve): Likewise.
4726         (ComposedCast.DoResolveAsTypeStep): Likewise.
4727         (StackAlloc.DoResolve): Likewise.
4728         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4729         (Block.Unsafe): New property.
4730         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4731         (Unsafe): Set 'unsafe' flag of contained block.
4732         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4733         (Fixed.Resolve): Likewise.
4734         (Catch.Resolve): Likewise.
4735         (Using.ResolveLocalVariableDecls): Likewise.
4736         (Foreach.Resolve): Likewise.
4737
4738 2004-10-05  John Luke <john.luke@gmail.com>
4739
4740         * cs-parser.jay: add location to error CS0175
4741
4742 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4743
4744         * ecore.cs (Expression.Constantity): Add support for turning null
4745         into a constant.
4746
4747         * const.cs (Const.Define): Allow constants to be reference types
4748         as long as the value is Null.
4749
4750 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4751
4752         * namespace.cs (NamespaceEntry.Using): No matter which warning
4753         level is set, check if this namespace name has already been added.
4754
4755 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4756
4757         * expression.cs: reftype [!=]= null should always use br[true,false].
4758         # 67410
4759
4760 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4761
4762         Fix #67108
4763         * attribute.cs: Enum conversion moved to 
4764         GetAttributeArgumentExpression to be applied to the all
4765         expressions.
4766
4767 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4768
4769         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4770         * class.c (TypeContainer.DefineType): Flag error if
4771         base types aren't accessible due to access permissions.
4772         * decl.cs (DeclSpace.ResolveType): Move logic to
4773         Expression.ResolveAsTypeTerminal.
4774         (DeclSpace.ResolveTypeExpr): Thin layer over
4775         Expression.ResolveAsTypeTerminal.
4776         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4777         Refactor code into NestedAccess.  Use it.
4778         (DeclSpace.NestedAccess): New.
4779         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4780         argument to silence errors.  Check access permissions.
4781         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4782         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4783         (Cast.DoResolve): Likewise.
4784         (New.DoResolve): Likewise.
4785         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4786         (TypeOf.DoResolve): Likewise.
4787
4788         * expression.cs (Invocation.BetterConversion): Return the Type of
4789         the better conversion.  Implement section 14.4.2.3 more faithfully.
4790         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4791         section 14.4.2.2 explicit.
4792         (Invocation.OverloadResolve): Update.
4793         (Invocation): Remove is_base field.
4794         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4795         (Invocation.Emit): Likewise.
4796
4797 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4798
4799         * README: Update to changes.
4800
4801 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4802
4803         * cs-parser.jay: Reverted 642 warning fix.
4804
4805 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4806
4807         Fix bug #66615
4808         * decl.cs (FindMemberWithSameName): Indexer can have more than
4809         1 argument.
4810
4811 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4812
4813         * expression.cs (LocalVariableReference.DoResolveLValue):
4814         Do not report warning 219 for out values.
4815         (EmptyExpression.Null): New member to avoid extra allocations.
4816
4817 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4818
4819         * cs-parser.jay: Fix wrong warning 642 report.
4820
4821         * cs-tokenizer.cs (CheckNextToken): New helper;
4822         Inspect next character if is same as expected.
4823
4824 2004-09-23  Martin Baulig  <martin@ximian.com>
4825
4826         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4827         (Convert.ImplicitReferenceConversionExists): Likewise.
4828
4829 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4830
4831         * class.cs (Operator.Define): Add error 448 and 559 report.
4832
4833 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4834
4835         * class.cs (MemberBase.IsTypePermitted): New protected
4836         method for checking error CS0610.
4837
4838 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4839
4840         * class.cs (TypeContainer.HasExplicitLayout): New property
4841         Returns whether container has StructLayout attribute set Explicit.
4842         (FieldMember): New abstract class for consts and fields.
4843         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4844         (Field): Reuse FieldMember.
4845
4846         * const.cs (Const): Reuse FieldMember.
4847
4848         * rootcontext.cs: EmitConstants call moved to class.
4849
4850 2004-09-22  Martin Baulig  <martin@ximian.com>
4851
4852         Thanks to Peter Sestoft for this bug report.
4853
4854         * expression.cs (Conditional): If both the `trueExpr' and the
4855         `falseExpr' is a NullLiteral, return a NullLiteral.
4856
4857 2004-09-22  Martin Baulig  <martin@ximian.com>
4858
4859         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4860         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4861         for the "get_Current" call.
4862
4863 2004-09-22  Martin Baulig  <martin@ximian.com>
4864
4865         Marek and me just fixed one of our oldest bugs: #28562 :-)
4866
4867         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4868
4869         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4870         we're an EnumConstant, just return that.
4871         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4872         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4873         to get the value which'll actually be written into the attribute.
4874         However, we have to use GetValue() to access the attribute's value
4875         in the compiler.        
4876
4877 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4878
4879         * constant.cs (Constant.IsNegative): New abstract property
4880         IsNegative.
4881
4882         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4883         (StackAlloc.DoResolve): Reused IsNegative.
4884
4885 2004-09-21  Martin Baulig  <martin@ximian.com>
4886
4887         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4888         if we're used in an iterator, we may be called from different
4889         methods.
4890
4891         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4892         we actually have an exception block.
4893
4894 2004-09-20  John Luke <jluke@cfl.rr.com>
4895
4896         * class.cs, cs-parser.jay: Improve the error report for 1520:
4897         report the actual line where the error happens, not where the
4898         class was declared.
4899
4900         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4901         Pass location information that was available elsewhere.
4902
4903 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4904
4905         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4906         runtime to delay sign assemblies.
4907
4908 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4909
4910         * cs-parser.jay: Do not report the stack trace, this is barely
4911         used nowadays.
4912
4913 2004-08-22  John Luke  <john.luke@gmail.com>
4914  
4915         * driver.cs : check that a resource id is not already used
4916         before adding it, report CS1508 if it is, bug #63637
4917
4918 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4919
4920         * ecore.cs: Removed dead code.
4921
4922 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4923
4924         * class.cs: Do not report warning CS0067 on the interfaces.
4925
4926 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4927
4928         * cs-parser.jay: Add error 504 report.
4929
4930 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4931
4932         * rootcontext.cs: WarningLevel is 4 by default now.
4933
4934         * statement.cs (Fixed.Resolve): Do not null
4935         VariableInfo.
4936
4937 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4938
4939         Fixed bug #55780
4940         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4941         deep search when property is not virtual.
4942         (PropertyExpr.ResolveAccessors): Make one call for both
4943         accessors.
4944
4945 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4946
4947         Fixed bug #65766
4948         * statement.cs: Error 152 report constains also location.
4949
4950 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4951
4952         Fixed bug #65766
4953         * const.cs: Explicitly set constant as static.
4954
4955 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4956
4957         Fixed bug #64226
4958         * cs-parser.jay: Add error 1017 report.
4959
4960 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4961
4962         Fixed bug #59980, #64224
4963         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4964
4965         * typemanager.cs (IsSpecialMethod): Simplified
4966
4967 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4968
4969         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4970         condition with better params.
4971
4972 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4973
4974         Fixed bug #65238
4975         * attribute.cs (Resolve): Property has to have both
4976         accessors.
4977
4978 2004-09-14  Martin Baulig  <martin@ximian.com>
4979
4980         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4981
4982 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4983
4984         Fixed bug #61902
4985         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4986         called and is obsolete then this member suppress message
4987         when call is inside next [Obsolete] method or type.
4988
4989         * expression.cs: Use TestObsoleteMethodUsage member.
4990
4991 2004-09-14  Martin Baulig  <martin@ximian.com>
4992
4993         * cs-parser.jay: Sync a bit with the GMCS version.
4994
4995 2004-09-14  Martin Baulig  <martin@ximian.com>
4996
4997         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4998         (CSharpParser.yacc_verbose_flag): New public field.
4999
5000         * genericparser.cs: Removed.
5001
5002 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5003
5004         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5005
5006 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5007
5008         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5009
5010 2004-09-10  Martin Baulig  <martin@ximian.com>
5011
5012         Backported my MemberName changes from GMCS into MCS.
5013
5014         - we are now using a special `MemberName' class instead of using
5015         strings; in GMCS, the `MemberName' also contains the type
5016         arguments.
5017
5018         - changed the grammar rules a bit:
5019           * the old `member_name' is now a `namespace_or_type_name':
5020             The rule is that we use `namespace_or_type_name' everywhere
5021             where we expect either a "member name" (GetEnumerator) or a
5022             "member name" with an explicit interface name
5023             (IEnumerable.GetEnumerator).
5024             In GMCS, the explicit interface name may include type arguments
5025             (IEnumerable<T>.GetEnumerator).
5026           * we use `member_name' instead of just `IDENTIFIER' for
5027             "member names":
5028             The rule is that we use `member_name' wherever a member may
5029             have type parameters in GMCS.       
5030
5031         * decl.cs (MemberName): New public class.
5032         (MemberCore.MemberName): New public readonly field.
5033         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5034         (DeclSpace): Likewise.
5035
5036         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5037         * enum.cs (Enum.ctor): Likewise.
5038
5039         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5040         MemberName.     
5041         (AliasEntry.ctor): Take a MemberName, not an Expression.
5042         (AliasEntry.UsingAlias): Likewise.
5043
5044         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5045         (IMethodData.MemberName): Changed type from string to MemberName.
5046         (MemberBase.ExplicitInterfaceName): Likewise.
5047         (AbstractPropertyEventMethod.SetupName): Make this private.
5048         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5049         argument; compute the member name here.
5050         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5051         on the `member.MemberName' and the `prefix'.
5052
5053         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5054         not `type_name'.
5055         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5056         thus, we get a `MemberName' instead of a `string'.  These
5057         declarations may have type parameters in GMCS.
5058         (interface_method_declaration, delegate_declaration): Likewise.
5059         (class_declaration, interface_declaration): Likewise.
5060         (method_header): Use `namespace_or_type_name' instead of
5061         `member_name'.  We may be an explicit interface implementation.
5062         (property_declaration, event_declaration): Likewise.
5063         (member_name): This is now just an `IDENTIFIER', not a
5064         `namespace_or_type_name'.
5065         (type_name, interface_type): Removed.
5066         (namespace_or_type_name): Return a MemberName, not an Expression.
5067         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5068         call GetTypeExpression() on the MemberName to get an expression.
5069         (IndexerDeclaration.interface_type): Changed type from string to
5070         MemberName.
5071         (MakeName): Operate on MemberName's instead of string's.
5072
5073 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5074
5075         Fix bug #55770.
5076         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5077         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5078         lookup to avoid symbols introduced by 'using'.
5079         * rootcontext.cs (NamespaceLookup): Update.
5080
5081 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5082
5083         * class.cs (TypeContainer.DoDefineMembers): Do not call
5084         DefineDefaultConstructor for static classes.
5085
5086 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5087
5088         * attribute.cs (Attribute.Resolve): Add error 653 report.
5089
5090         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5091         report.
5092         (Method.ApplyAttributeBuilder): Add error 685 report.
5093         (Operator.Define): Add error 564 report.
5094
5095         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5096
5097         * expression.cs (Invocation.DoResolve): Add error
5098         245 and 250 report.
5099
5100         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5101         error 674 report.
5102
5103 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5104
5105         * class.cs (ConstructorInitializer.Resolve):
5106         Wrong error number (515->516).
5107
5108 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5109
5110         * class.cs (Indexer.Define): Add error 631 report.
5111
5112 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5113
5114         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5115
5116 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5117
5118         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5119
5120 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5121
5122         * cs-parser.jay: Added error CS0241 report.
5123
5124 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5125
5126         * cs-parser.jay (fixed_statement): Introduce a scope for the
5127         declaration in the 'fixed' statement.
5128
5129 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5130
5131         * cs-parser.jay: Added CS0230 error report.
5132
5133 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5134
5135         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5136
5137 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5138
5139         * expression.cs (Argument.Resolve): Added error CS0192 and
5140         CS0199 report.
5141
5142 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5143
5144         C# 2.0 #pragma warning feature
5145
5146         * cs-tokenizer.cs (PreProcessPragma): New method; 
5147         Handles #pragma directive.
5148
5149         * report.cs (WarningRegions): New class; Support
5150         class for #pragma warning directive. It tests whether
5151         warning is enabled for a given line.
5152
5153 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5154
5155         * const.cs: Add more descriptive error report, tahnks to
5156         Sebastien. 
5157
5158 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5159
5160         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5161
5162 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5163
5164         * expression.cs: Apply patch from Ben: Remove dead code from
5165         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5166         as that code just threw an exception anwyays.
5167
5168         * const.cs: Remove the call to the turnintoconstant, for details
5169         see bug: #63144
5170         
5171         * literal.cs: The type of the null-literal is the null type;  So
5172         we use a placeholder type (literal.cs:System.Null, defined here)
5173         for it.
5174
5175         * expression.cs (Conditional.DoResolve): Remove some old code that
5176         is no longer needed, conversions have been fixed.
5177
5178         (ArrayCreationExpression.DoResolve): Return false if we fail to
5179         resolve the inner expression.
5180
5181 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5182
5183         Fix test-290.cs.
5184         * cs-parser.jay (delegate_declaration): Record a delegate
5185         declaration as a type declaration.
5186         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5187
5188 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5189
5190         * parameter.cs: Do not crash if the type can not be resolved. 
5191
5192         * expression.cs: Report errors with unsafe pointers, fixes #64896
5193
5194 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5195
5196         * expression.cs: Pointer arith always needs to do a conv.i
5197         if the operand is a long. fix 65320
5198
5199 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5200
5201         Fixed cs0619-37.cs, cs0619-38.cs
5202
5203         * enum.cs (GetObsoleteAttribute): Removed.
5204
5205         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5206         on Enum member is double staged. The first is tested member
5207         and then enum.
5208
5209 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5210
5211         Fixed #56986, #63631, #65231
5212
5213         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5214         adds member to name container.
5215         (TypeContainer.AddToTypeContainer): New method, adds type to
5216         name container.
5217         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5218         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5219         AddOperator): Simplified by reusing AddToMemberContainer.
5220         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5221         instead of field.
5222         (Method.CheckForDuplications): Fixed implementation to test all
5223         possibilities.
5224         (MemberBase): Detection whether member is explicit interface
5225         implementation is now in constructor.
5226         (MemberBase.UpdateMemberName): Handles IndexerName.
5227         (Accessor): Changed to keep also location information.
5228         (AbstractPropertyEventMethod): Is derived from MemberCore.
5229         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5230         will be emited or not.
5231         (PropertyBase.AreAccessorsDuplicateImplementation):
5232         Tests whether accessors are not in collision with some method.
5233         (Operator): Is derived from MethodCore to simplify common
5234         operations.
5235
5236         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5237         must be performed.
5238         (DeclSpace.AddToContainer): Adds the member to defined_names
5239         table. It tests for duplications and enclosing name conflicts.
5240
5241         * enum.cs (EnumMember): Clean up to reuse the base structures
5242
5243 2004-09-03  Martin Baulig  <martin@ximian.com>
5244
5245         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5246         into TypeContainer, to make partial classes work again.
5247
5248 2004-09-03  Martin Baulig  <martin@ximian.com>
5249
5250         * rootcontext.cs (RootContext.V2): Removed.
5251
5252 2004-03-23  Martin Baulig  <martin@ximian.com>
5253
5254         * expression.cs (Invocation.OverloadResolve): Added `bool
5255         may_fail' argument and use it instead of the Location.IsNull() hack.
5256
5257 2004-09-03  Martin Baulig  <martin@ximian.com>
5258
5259         Merged latest changes into gmcs.  Please keep this comment in
5260         here, it makes it easier for me to see what changed in MCS since
5261         the last time I merged.
5262
5263 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5264
5265         Fix #61128.
5266         * expression.cs (BetterConversion): Don't allow either conversion 
5267         to be null.  Remove redundant implicit conversion test when 'q ==
5268         null' -- when this function is invoked, we already know that the
5269         implicit conversion exists.
5270         (BetterFunction): Assume that 'best' is non-null.  Remove
5271         redundant reimplementation of IsApplicable when 'best' is null.
5272         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5273         number of arguments.
5274         (IsAncestralType): Extract from OverloadResolve.
5275         (OverloadResolve): Make robust to the MethodGroupExpr being
5276         unsorted.  Implement all the logic of Section 14.5.5.1, and
5277         support overloading of methods from multiple applicable types.
5278         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5279
5280         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5281         (RealError, Warning): Append type of report to related symbol.
5282
5283 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5284
5285         * enum.cs: Fixed CLS-Compliance checks for enum members.
5286         Error tests cs3008-8.cs, cs3014-8.cs
5287
5288 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5289
5290         Fixed bug #62342, #63102
5291         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5292         like ImplementMethod.
5293
5294 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5295
5296         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5297         Fixed bug #65170.
5298
5299 2004-09-02  Martin Baulig  <martin@ximian.com>
5300
5301         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5302         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5303         on the MethodBase.
5304
5305 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5306
5307         C# 2.0 Static classes implemented
5308
5309         * class.cs (TypeContainer): instance_constructors,
5310         initialized_fields, initialized_static_fields,
5311         default_constructor, base_inteface_types are protected to be
5312         accessible from StaticClass.
5313         (TypeContainer.DefineDefaultConstructor): New virtual method
5314         for custom default constructor generating
5315         (StaticClass): New class to handle "Static classes" feature.
5316
5317         * cs-parser.jay: Handle static keyword on class like instance
5318         of StaticClass.
5319
5320         * driver.cs: Added "/langversion" command line switch with two
5321         options (iso-1, default).
5322
5323 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5324
5325         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5326
5327 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5328
5329         * delegate.cs: Style.
5330
5331 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5332
5333         * delegate.cs: Add seperate instance expr field for miguel.
5334
5335 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5336
5337         * PointerArithmetic (Resolve): make sure we are not doing
5338         pointer arith on void*. Also, make sure we are resolved
5339         by not setting eclass until resolve.
5340
5341         All callers: Make sure that PointerArithmetic gets resolved.
5342
5343 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5344
5345         * ArrayCreation (LookupType): If the type does not resolve 
5346         to an array, give an error.
5347
5348 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5349
5350         * statement.cs (Try.Resolve): Fixed bug #64222
5351
5352 2004-08-27  Martin Baulig  <martin@ximian.com>
5353
5354         * class.cs
5355         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5356         crash here.     
5357
5358 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5359
5360         * ecore.cs (Constantify): Get underlying type via
5361         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5362         Windows in special cases.
5363
5364 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5365
5366         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5367         for obtaining also private methods.
5368         (GetRemoveMethod): Used GetRemoveMethod (true)
5369         for obtaining also private methods.
5370
5371 2004-08-24  Martin Baulig  <martin@ximian.com>
5372
5373         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5374         MethodAttributes.HideBySig for operators.
5375
5376 2004-08-23  Martin Baulig  <martin@ximian.com>
5377
5378         Back to the old error reporting system :-)
5379
5380         * report.cs (Message): Removed.
5381         (Report.MessageData, ErrorData, WarningData): Removed.
5382         (Report.Error, Warning): Back to the old system.
5383
5384 2004-08-23  Martin Baulig  <martin@ximian.com>
5385
5386         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5387
5388         * class.cs (TypeContainer.ParentContainer): New public virtual
5389         method; replaces the explicit interface implementation.
5390         (ClassPart.ParentContainer): Override.
5391
5392 2004-08-23  Martin Baulig  <martin@ximian.com>
5393
5394         * statement.cs (Switch): Added support for constant switches; see
5395         #59428 or test-285.cs.
5396
5397 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5398
5399         Fixed bug #62740.
5400         * statement.cs (GetEnumeratorFilter): Removed useless
5401         logic because C# specs is strict. GetEnumerator must be
5402         public.
5403
5404 2004-08-22  Martin Baulig  <martin@ximian.com>
5405
5406         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5407         a switch and may break, reset the barrier.  Fixes #59867.
5408
5409 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5410
5411         CLS-Compliance speed up (~5% for corlib)
5412
5413         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5414         New method. Tests container for CLS-Compliant names
5415
5416         * class.cs (TypeContainer.VerifyClsName): New method.
5417         Checks whether container name is CLS Compliant.
5418         (Constructor): Implements IMethodData.
5419
5420         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5421         low-case table for CLS Compliance test.
5422         (MemberCache.VerifyClsParameterConflict): New method.
5423         Checks method parameters for CS3006 error.
5424
5425         * enum.cs (EnumMember): Is derived from MemberCore.
5426         (Enum.VerifyClsName): Optimized for better performance.
5427
5428 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5429
5430         * report.cs: Renamed Error_T to Error and changed all
5431         references.
5432
5433 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5434
5435         * class.cs (TypeContainer.IndexerArrayList): New inner class
5436         container for indexers.
5437         (TypeContainer.DefaultIndexerName): New constant for default
5438         indexer name. Replaced all "Item" with this constant.
5439         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5440
5441         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5442         DefaultMemberAttribute constructor.
5443
5444 2004-08-05  Martin Baulig  <martin@ximian.com>
5445
5446         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5447         Fix bug #59429.
5448
5449 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5450
5451         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5452         multi platforms problem.
5453
5454         * compiler.csproj: Included shared files.
5455
5456 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5457
5458         Fix bug 60333, 55971 in the more general way
5459         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5460         Added arg_type argument for constant conversion.
5461         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5462
5463 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5464
5465         Fix bug #59760
5466         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5467         OperatorArrayList, MethodCoreArrayList for typecontainer
5468         containers. Changed class member types to these new types.
5469         (MethodArrayList.DefineMembers): Added test for CS0659.
5470
5471 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5472
5473         * cfold.cs: Synchronize the folding with the code in expression.cs
5474         Binary.DoNumericPromotions for uint operands.
5475
5476         * attribute.cs: Revert patch from Raja, it introduced a regression
5477         while building Blam-1.2.1 (hard to isolate a test case).
5478
5479 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5480
5481         Fix for #55382
5482         * class.cs:
5483         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5484         name collision.
5485         (MethodCore.parent_method): New member. The method we're overriding
5486         if this is an override method.
5487         (MethodCore.CheckBase): Moved from Method class and made common.
5488         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5489         private.
5490         (MethodCore.CheckForDuplications): New abstract method. For custom
5491         member duplication search in a container
5492         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5493         method and its return type.
5494         (Event.conflict_symbol): New member. Symbol with same name in the
5495         parent class.
5496
5497         * decl.cs:
5498         (MemberCache.FindMemberWithSameName): New method. The method
5499         is looking for conflict with inherited symbols.
5500
5501 2004-08-04  Martin Baulig  <martin@ximian.com>
5502
5503         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5504
5505         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5506
5507 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5508
5509         * report.cs (Message): New enum for better error, warning reference in
5510         the code.
5511         (MessageData): New inner abstract class. It generally handles printing of
5512         error and warning messages.
5513         Removed unused Error, Warning, Message methods.
5514
5515 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5516
5517         Fix for cs0592-8.cs test
5518         * attribute.cs
5519         (Attributable.ValidAttributeTargets): Made public.
5520         (Attribute.ExplicitTarget): New member for explicit target value.
5521         (Attribute.CheckTargets): Now we translate explicit attribute
5522         target to Target here.
5523
5524 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5525
5526         * ecore.cs (MethodGroupExpr): new IsBase property.
5527
5528         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5529
5530         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5531         rather than an instance expr.
5532
5533         (DelegateCreation.Emit): Use the method group rather than
5534         the instance expression. Also, if you have base.Foo as the
5535         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5536
5537         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5538
5539         (NewDelegate.DoResolve): Only check for the existance of Invoke
5540         if the method is going to be needed. Use MethodGroupExpr.
5541
5542         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5543
5544         * expression.cs: For pointer arith., make sure to use
5545         the size of the type, not the size of the pointer to
5546         the type.
5547
5548 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5549
5550         Fix for #60722
5551         * class.cs (Class): Added error CS0502 test.
5552
5553 2004-08-03  John Luke  <jluke@cfl.rr.com>
5554             Raja R Harinath  <rharinath@novell.com>
5555
5556         Fix for #60997.
5557         * attribute.cs (Attribute.complained_before): New flag.
5558         (Attribute.ResolveType, Attribute.Resolve),
5559         (Attribute.DefinePInvokeMethod): Set it.
5560         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5561         
5562 2004-08-03  Martin Baulig  <martin@ximian.com>
5563
5564         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5565         use a user-defined operator; we still need to do numeric
5566         promotions in case one argument is a builtin type and the other
5567         one has an implicit conversion to that type.  Fixes #62322.
5568
5569 2004-08-02  Martin Baulig  <martin@ximian.com>
5570
5571         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5572         (LocalInfo.IsThis): New public property.
5573         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5574
5575 2004-08-01  Martin Baulig  <martin@ximian.com>
5576
5577         * class.cs (TypeContainer.GetClassBases): Don't set the default
5578         here since we may get called from GetPartialBases().
5579         (TypeContainer.DefineType): If GetClassBases() didn't return a
5580         parent, use the default one.
5581
5582 2004-07-30  Duncan Mak  <duncan@ximian.com>
5583
5584         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5585
5586 2004-07-30  Martin Baulig  <martin@ximian.com>
5587
5588         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5589
5590         * class.cs (SourceMethod): New public class, derive from the
5591         symbol writer's ISourceMethod.
5592         (Method): Use the new symbol writer API.
5593
5594         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5595         as argument and use the new symbol writer.
5596
5597         * location.cs
5598         (SourceFile): Implement the symbol writer's ISourceFile.
5599         (Location.SymbolDocument): Removed.
5600         (Location.SourceFile): New public property.
5601
5602         * symbolwriter.cs: Use the new symbol writer API.
5603
5604 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5605
5606         * Makefile (install-local): Remove.  Functionality moved to
5607         executable.make.
5608
5609 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5610
5611         * Makefile: Install mcs.exe.config file together with mcs.exe.
5612         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5613         correct runtime version.
5614         
5615 2004-07-25  Martin Baulig  <martin@ximian.com>
5616
5617         * class.cs
5618         (TypeContainer.RegisterOrder): Removed, this was unused.
5619         (TypeContainer, interface_order): Removed.
5620         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5621         TypeContainer as argument since we can also be called with a
5622         `PartialContainer' for a partial class/struct/interface.
5623         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5624         of checking whether we're an `Interface' - we could be a
5625         `PartialContainer'.
5626         (PartialContainer.Register): Override; call
5627         AddClass()/AddStruct()/AddInterface() on our parent.
5628
5629         * cs-parser.jay (interface_member_declaration): Add things to the
5630         `current_container', not the `current_class'.
5631
5632         * rootcontext.cs (RegisterOrder): The overloaded version which
5633         takes an `Interface' was unused, removed.
5634
5635         * typemanager.cs (TypeManager.LookupInterface): Return a
5636         `TypeContainer', not an `Interface'.
5637         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5638         contain a `PartialContainer' for an interface, so check it's
5639         `Kind' to figure out what it is.
5640
5641 2004-07-25  Martin Baulig  <martin@ximian.com>
5642
5643         * class.cs (Class.DefaultTypeAttributes): New public constant.
5644         (Struct.DefaultTypeAttributes): Likewise.
5645         (Interface.DefaultTypeAttributes): Likewise.
5646         (PartialContainer.TypeAttr): Override this and add the
5647         DefaultTypeAttributes.
5648
5649 2004-07-25  Martin Baulig  <martin@ximian.com>
5650
5651         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5652         we can just use the `Parent' field instead.
5653
5654 2004-07-25  Martin Baulig  <martin@ximian.com>
5655
5656         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5657
5658 2004-07-25  Martin Baulig  <martin@ximian.com>
5659
5660         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5661         our parts before defining any methods.
5662         (TypeContainer.VerifyImplements): Make this virtual.
5663         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5664         on our PartialContainer.
5665
5666 2004-07-25  Martin Baulig  <martin@ximian.com>
5667
5668         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5669
5670         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5671         argument, we can just use the `Parent' field instead.
5672
5673         * class.cs
5674         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5675         (MemberBase.DoDefine): Likewise.
5676
5677 2004-07-24  Martin Baulig  <martin@ximian.com>
5678
5679         * decl.cs (MemberCore.Parent): New public field.
5680         (DeclSpace.Parent): Moved to MemberCore.
5681
5682         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5683         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5684         parent's .ctor.
5685         (FieldBase, Field, Operator): Likewise.
5686         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5687         (EventField, Event): Likewise.
5688
5689 2004-07-23  Martin Baulig  <martin@ximian.com>
5690
5691         * class.cs (PartialContainer): New public class.
5692         (ClassPart): New public class.
5693         (TypeContainer): Added support for partial classes.
5694         (TypeContainer.GetClassBases): Splitted some of the functionality
5695         out into GetNormalBases() and GetPartialBases().
5696
5697         * cs-tokenizer.cs (Token.PARTIAL): New token.
5698         (Tokenizer.consume_identifier): Added some hacks to recognize
5699         `partial', but only if it's immediately followed by `class',
5700         `struct' or `interface'.
5701
5702         * cs-parser.jay: Added support for partial clases.
5703
5704 2004-07-23  Martin Baulig  <martin@ximian.com>
5705
5706         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5707         a `DeclSpace' and also made it readonly.
5708         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5709         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5710         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5711
5712         * cs-parser.jay: Pass the `current_class', not the
5713         `current_container' (at the moment, this is still the same thing)
5714         to a new Method, Property, Event, Indexer or Constructor.
5715
5716 2004-07-23  Martin Baulig  <martin@ximian.com>
5717
5718         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5719         and removed the `current_interface' one.
5720         (struct_declaration, class_declaration, interface_declaration):
5721         Set `current_class' to the newly created class/struct/interface;
5722         set their `Bases' and call Register() before parsing their body.
5723
5724 2004-07-23  Martin Baulig  <martin@ximian.com>
5725
5726         * class.cs (Kind): New public enum.
5727         (TypeContainer): Made this class abstract.
5728         (TypeContainer.Kind): New public readonly field.
5729         (TypeContainer.CheckDef): New public method; moved here from
5730         cs-parser.jay.
5731         (TypeContainer.Register): New public abstract method.
5732         (TypeContainer.GetPendingImplementations): New public abstract
5733         method.
5734         (TypeContainer.GetClassBases): Removed the `is_class' and
5735         `is_iface' parameters.
5736         (TypeContainer.DefineNestedTypes): Formerly known as
5737         DoDefineType().
5738         (ClassOrStruct): Made this class abstract.
5739
5740         * tree.cs (RootTypes): New public type. 
5741
5742 2004-07-20  Martin Baulig  <martin@ximian.com>
5743
5744         * tree.cs (Tree.RecordNamespace): Removed.
5745         (Tree.Namespaces): Removed.
5746
5747         * rootcontext.cs (RootContext.IsNamespace): Removed.
5748
5749         * cs-parser.jay (namespace_declaration): Just create a new
5750         NamespaceEntry here.
5751
5752 2004-07-20  Martin Baulig  <martin@ximian.com>
5753
5754         * statement.cs (ExceptionStatement): New abstract class.  This is
5755         now used as a base class for everyone who's using `finally'.
5756         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5757         our local variables before using them.
5758
5759         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5760         virtual method.  This is used by Yield.Resolve() to "steal" an
5761         outer block's `finally' clauses.
5762         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5763         argument.
5764
5765         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5766         version which takes an ExceptionStatement.  This version must be
5767         used to create exception branchings.
5768
5769         * iterator.cs
5770         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5771         (Iterator.EmitMoveNext): Added exception support; protect the
5772         block with a `fault' clause, properly handle 'finally' clauses.
5773         (Iterator.EmitDispose): Run all the `finally' clauses here.
5774
5775 2004-07-20  Martin Baulig  <martin@ximian.com>
5776
5777         * iterator.cs: This is the first of a set of changes in the
5778         iterator code.  Match the spec more closely: if we're an
5779         IEnumerable, then GetEnumerator() must be called.  The first time
5780         GetEnumerator() is called, it returns the current instance; all
5781         subsequent invocations (if any) must create a copy.
5782
5783 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5784
5785         * expression.cs: Resolve the constant expression before returning
5786         it. 
5787
5788 2004-07-19  Martin Baulig  <martin@ximian.com>
5789
5790         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5791         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5792         the return type of the new EmitContext.
5793
5794 2004-07-18  Martin Baulig  <martin@ximian.com>
5795
5796         * class.cs (Property.Define): Fix iterators.
5797
5798         * iterators.cs (Iterator.Define): Moved the
5799         `container.AddInterator (this)' call here from the .ctor; only do
5800         it if we resolved successfully.
5801
5802 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5803
5804         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5805         `true' for preprocessing directives that we parse.  The return
5806         value indicates whether we should return to regular tokenizing or
5807         not, not whether it was parsed successfully.
5808
5809         In the past if we were in: #if false ... #line #endif, we would
5810         resume parsing after `#line'.  See bug 61604.
5811
5812         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5813         building: IsEnumType should return true only for enums, not for
5814         enums or System.Enum itself.  This fixes #61593.
5815
5816         Likely what happened is that corlib was wrong: mcs depended on
5817         this bug in some places.  The bug got fixed, we had to add the
5818         hack, which caused bug 61593.
5819
5820         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5821         that was a workaround for the older conditions.
5822
5823 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5824
5825         * assign.cs: IAssignMethod has a new interface, as documented
5826         inline. All assignment code now uses this new api.
5827
5828         * ecore.cs, expression.cs: All classes which implement
5829         IAssignMethod now use the new interface.
5830
5831         * expression.cs (Invocation): add a hack to EmitCall so that
5832         IndexerAccess can be the target of a compound assignment without
5833         evaluating its arguments twice.
5834
5835         * statement.cs: Handle changes in Invocation api.
5836
5837 2004-07-16  Martin Baulig  <martin@ximian.com>
5838
5839         * iterators.cs: Rewrote this.  We're now using one single Proxy
5840         class for both the IEnumerable and the IEnumerator interface and
5841         `Iterator' derives from Class so we can use the high-level API.
5842
5843         * class.cs (TypeContainer.AddIterator): New method.
5844         (TypeContainer.DoDefineType): New protected virtual method, which
5845         is called from DefineType().
5846         (TypeContainer.DoDefineMembers): Call DefineType() and
5847         DefineMembers() on all our iterators.
5848         (TypeContainer.Emit): Call Emit() on all our iterators.
5849         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5850
5851         * codegen.cs (EmitContext.CurrentIterator): New public field.
5852
5853 2004-07-15  Martin Baulig  <martin@ximian.com>
5854
5855         * typemanager.cs
5856         (TypeManager.not_supported_exception_type): New type.   
5857
5858 2004-07-14  Martin Baulig  <martin@ximian.com>
5859
5860         * iterators.cs: Use real error numbers.
5861
5862 2004-07-14  Martin Baulig  <martin@ximian.com>
5863
5864         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5865         requires this to be a System.Collection.IEnumerable and not a
5866         class implementing that interface.
5867         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5868
5869 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5870
5871         * class.cs: Fixed previous fix, it broke some error tests.
5872
5873 2004-07-12  Martin Baulig  <martin@ximian.com>
5874
5875         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5876         Fixes #61293.
5877
5878 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5879
5880         * assign.cs (LocalTemporary): Add new argument: is_address,If
5881         `is_address' is true, then the value that we store is the address
5882         to the real value, and not the value itself.
5883         
5884         * ecore.cs (PropertyExpr): use the new local temporary
5885         stuff to allow us to handle X.Y += z (where X is a struct)
5886
5887 2004-07-08  Martin Baulig  <martin@ximian.com>
5888
5889         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5890         not always return, just like we're doing in Using.Resolve().
5891
5892 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5893
5894         * cs-parser.jay (fixed_statement): flag this as Pinned.
5895
5896 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5897
5898         * typemanager.cs (TypeManager): Removed MakePinned method, this
5899         mechanism is replaced with the .NET 2.x compatible mechanism of
5900         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5901
5902         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5903         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5904         `IsFixed' property which has a different meaning.
5905
5906 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5907
5908         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5909         visible from inside a nested class, not just the names of the
5910         immediately enclosing class.
5911         Fix for bug #60730.
5912
5913 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5914
5915         * expression.cs (BetterConversion): Remove buggy special-case
5916         handling of "implicit constant expression conversions".  At this
5917         point, we already know that the conversion is possible -- we're
5918         only checking to see which is better.
5919
5920 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5921
5922         * cs-parser.jay: Added error CS0210 test.
5923
5924 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5925
5926         * cs-parser.jay: Added error CS0134 test.
5927
5928 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5929
5930         Fix bug #52507
5931         * cs-parser.jay: Added error CS0145 test.
5932
5933 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5934
5935         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5936
5937 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5938         
5939         * expression.cs (StackAlloc.Resolve): The argument may not
5940         be a constant; deal with this case.
5941         
5942 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5943
5944         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5945         GetIndexerAttributeValue.
5946         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5947
5948         * class.cs (Indexer.Define): Added error tests for CS0415,
5949         CS0609.
5950
5951 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5952
5953         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5954         property code.
5955
5956 2004-06-23  Martin Baulig  <martin@ximian.com>
5957
5958         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5959         neither return nor throw, reset the barrier as well.  Fixes #60457.
5960
5961 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5962
5963         * class.cs : EventAttributes is now set to None by default.
5964           This fixes bug #60459.
5965
5966 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5967
5968         Fix bug #60219
5969         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5970         Don't throw exception but return null (it's sufficient now).
5971
5972 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5973
5974         * typemanager.cs (GetArgumentTypes): Faster implementation.
5975
5976 2004-06-18  Martin Baulig  <martin@ximian.com>
5977
5978         * attribute.cs (Attribute.Resolve): Check whether we're an
5979         EmptyCast which a Constant child.  Fixes #60333.
5980
5981 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5982
5983         * statement.cs (EmitCollectionForeach): Account for the fact that
5984         not all valuetypes are in areas which we can take the address of.
5985         For these variables, we store to a temporary variable. Also, make
5986         sure that we dont emit a `callvirt' on a valuetype method.
5987
5988 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5989
5990         * expression.cs (StackAlloc.DoReSolve): Added test for
5991         negative parameter (CS0247).
5992
5993 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5994
5995         Fix bug #59792
5996         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5997
5998 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5999
6000         Fix bug #59781
6001         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6002         ulong.
6003
6004 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6005
6006         Fix bug #58254 & cs1555.cs, cs1556.cs
6007         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6008
6009 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6010
6011         * cs-parser.jay: Added error CS1669 test for indexers.
6012
6013 2004-06-11  Martin Baulig  <martin@ximian.com>
6014
6015         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6016         call this twice: for params and varargs methods.
6017
6018 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6019
6020         * class.cs:
6021         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6022
6023 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6024
6025         * attribute.cs (Attribute.GetValidTargets): Made public.
6026
6027         * class.cs: 
6028         (AbstractPropertyEventMethod): New class for better code sharing.
6029         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6030         CS1667 report.
6031         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6032
6033 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6034
6035         Fix bug #59477.
6036         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6037         that the call to Resolve is part of a MemberAccess.
6038         (Expression.Resolve): Use it for SimpleName resolution.
6039         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6040         Add 'intermediate' boolean argument.
6041         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6042         error message when the SimpleName can be resolved ambiguously
6043         between an expression and a type.
6044         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6045         public.
6046         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6047         call on the left-side.
6048
6049 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6050
6051         * class.cs:
6052         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6053
6054 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6057
6058 2004-06-11  Martin Baulig  <martin@ximian.com>
6059
6060         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6061         varargs methods if applicable.
6062
6063 2004-06-11  Martin Baulig  <martin@ximian.com>
6064
6065         * expression.cs (Invocation.EmitCall): Don't use
6066         `method.CallingConvention == CallingConventions.VarArgs' since the
6067         method could also have `CallingConventions.HasThis'.
6068
6069 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6070
6071         * class.cs (Event.GetSignatureForError): Implemented.
6072         Fixed crash in error test cs3010.cs
6073
6074 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * cs-tokenizer.cs: Change the way we track __arglist to be
6077         consistent with the other keywords.
6078
6079 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6080
6081         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6082         tomorrow.
6083
6084 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6085
6086         * codegen.cs: Check that all referenced assemblies have a strongname
6087         before strongnaming the compiled assembly. If not report error CS1577.
6088         Fix bug #56563. Patch by Jackson Harper.
6089         * typemanager.cs: Added a method to return all referenced assemblies.
6090         Fix bug #56563. Patch by Jackson Harper.
6091
6092 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6093
6094         * class.cs:
6095         (Method.ApplyAttributeBuilder): Moved and added conditional
6096         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6097
6098         * delegate.cs:
6099         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6100
6101 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6102
6103         Fixed #59640
6104         * class.cs: (EventField.attribute_targets): Changed default target.
6105
6106 2004-06-08  Martin Baulig  <martin@ximian.com>
6107
6108         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6109
6110 2004-06-08  Martin Baulig  <martin@ximian.com>
6111
6112         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6113
6114 2004-06-07  Martin Baulig  <martin@ximian.com>
6115
6116         Added support for varargs methods.
6117
6118         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6119         keyword.
6120
6121         * cs-parser.jay: Added support for `__arglist'.
6122
6123         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6124
6125         * expression.cs (Argument.AType): Added `ArgList'.
6126         (Invocation): Added support for varargs methods.
6127         (ArglistAccess): New public class.
6128         (Arglist): New public class.
6129
6130         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6131
6132         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6133         a method's top-level block if the method has varargs.
6134
6135         * support.cs (ReflectionParameters, InternalParameters): Added
6136         support for varargs methods.    
6137
6138 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6139
6140         * class.cs: Provide location in indexer error report.
6141
6142         * driver.cs: Use standard names.
6143
6144         * namespace.cs: Catch the use of using after a namespace has been
6145         declared also on using aliases.
6146
6147 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6148
6149         Bug #50820.
6150         * typemanager.cs (closure_private_ok, closure_invocation_type)
6151         (closure_qualifier_type, closure_invocation_assembly)
6152         (FilterWithClosure): Move to ...
6153         (Closure): New internal nested class.
6154         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6155         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6156         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6157         (MemberLookup, MemberLookupFailed): Use it.
6158         * expression.cs (New.DoResolve): Treat the lookup for the
6159         constructor as being qualified by the 'new'ed type.
6160         (Indexers.GetIndexersForTypeOrInterface): Update.
6161
6162 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6163
6164         * attribute.cs
6165         (GetConditionalAttributeValue): New method. Returns
6166         condition of ConditionalAttribute.
6167         (SearchMulti): New method.  Returns all attributes of type 't'.
6168         Use it when attribute is AllowMultiple = true.
6169         (IsConditionalMethodExcluded): New method.
6170
6171         * class.cs
6172         (Method.IsExcluded): Implemented. Returns true if method has conditional
6173         attribute and the conditions is not defined (method is excluded).
6174         (IMethodData): Extended interface for ConditionalAttribute support.
6175         (PropertyMethod.IsExcluded): Implemented.
6176
6177         * decl.cs
6178         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6179
6180         * expression.cs
6181         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6182         on the method.
6183
6184 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6185
6186         * expression.cs (ArrayCreationExpression): Make this just an
6187         `expression'. It can't be a statement, so the code here was
6188         dead.
6189
6190 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6191
6192         Fixed #59072
6193         * typemanager.cs (GetFullNameSignature): New method for
6194         MethodBase types.
6195
6196 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6197
6198         Fixed #56452
6199         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6200         Use this method when MethodBuilder is null.
6201         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6202         Added test for error CS0626 (MONO reports error for this situation).
6203         (IMethodData.GetSignatureForError): Extended interface.
6204
6205 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6206
6207         * attribute.cs
6208         (AttributeTester.GetObsoleteAttribute): Returns instance of
6209         ObsoleteAttribute when type is obsolete.
6210
6211         * class.cs
6212         (TypeContainer.VerifyObsoleteAttribute): Override.
6213         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6214         (MethodCode.VerifyObsoleteAttribute): Override.
6215         (MemberBase.VerifyObsoleteAttribute): Override.
6216
6217         * decl.cs
6218         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6219         and report proper error.
6220
6221         *delegate.cs
6222         Delegate.VerifyObsoleteAttribute): Override.
6223
6224         * ecore.cs
6225         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6226         and report proper error.
6227         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6228
6229         * enum.cs
6230         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6231         and enum member.
6232
6233         * expression.cs
6234         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6235         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6236         Added test for ObsoleteAttribute.
6237
6238         * statement.cs
6239         (Catch): Derived from Statement.
6240
6241 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6242  
6243         Fixed bug #59071 & cs0160.cs
6244  
6245         * statement.cs (Try.Resolve): Check here whether order of catch
6246         clauses matches their dependencies.
6247
6248 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6251         caused a regression: #59343.  Referencing nested classes from an
6252         assembly stopped working.
6253
6254 2004-05-31  Martin Baulig  <martin@ximian.com>
6255
6256         MCS is now frozen for beta 2.
6257
6258 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6259
6260         * convert.cs: add a trivial cache for overload operator resolution.
6261
6262 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6263
6264         * decl.cs: If possible, use lookuptypedirect here. We can only do
6265         this if there is no `.' after the namespace. Avoids using
6266         LookupType, which does lots of slow processing.
6267         (FindNestedType) New method, does what it says :-).
6268         * namespace.cs: use LookupTypeDirect.
6269         * rootcontext.cs: use membercache, if possible.
6270         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6271
6272 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6273
6274         * expression.cs:
6275         According to the spec, 
6276
6277         In a member access of the form E.I, if E is a single identifier,
6278         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6279         field, property, localvariable, or parameter with the same type as
6280         the meaning of E as a type-name (§3.8), then both possible
6281         meanings of E are permitted.
6282
6283         We did not check that E as a simple-name had the same type as E as
6284         a type name.
6285
6286         This trivial check gives us 5-7% on bootstrap time.
6287
6288 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6289
6290         * expression.cs (Invocation.OverloadResolve): Avoid the
6291         use of hashtables and boxing here by allocating on demand.
6292
6293 2004-05-30  Martin Baulig  <martin@ximian.com>
6294
6295         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6296         we're doing a silent lookup.  Don't try to lookup nested types in
6297         TypeManager.object_type (thanks to Ben Maurer).
6298
6299 2004-05-30  Martin Baulig  <martin@ximian.com>
6300
6301         Committing a patch from Ben Maurer.
6302
6303         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6304
6305 2004-05-29  Martin Baulig  <martin@ximian.com>
6306
6307         * class.cs (IMethodData.ShouldIgnore): New method.
6308
6309         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6310         `Location' argument, we don't need it anywhere.  Use
6311         `IMethodData.ShouldIgnore ()' instead of
6312         `MethodData.GetMethodFlags ()'.
6313         (TypeManager.AddMethod): Removed.
6314         (TypeManager.AddMethod2): Renamed to AddMethod.
6315
6316 2004-05-29  Martin Baulig  <martin@ximian.com>
6317
6318         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6319
6320         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6321         converting from a class type S to an interface type and we already
6322         have an object on the stack, don't box it again.  Fixes #52578.
6323
6324 2004-05-29  Martin Baulig  <martin@ximian.com>
6325
6326         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6327         Added support for `params' parameters.  Fixes #59267.
6328
6329 2004-05-29  Martin Baulig  <martin@ximian.com>
6330
6331         * literal.cs (NullPointer): Provide a private .ctor which sets
6332         `type' to TypeManager.object_type.  Fixes #59048.
6333
6334 2004-05-29  Martin Baulig  <martin@ximian.com>
6335
6336         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6337         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6338
6339         * ecore.cs (EventExpr.instance_expr): Make the field private.
6340
6341 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6342
6343         Fixed bug #50080 & cs0214-2.cs
6344         * expression.cs (Cast.DoResolve): Check unsafe context here.
6345         
6346         * statement.cs (Resolve.DoResolve): Likewise.
6347
6348 2004-05-26  Martin Baulig  <martin@ximian.com>
6349
6350         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6351
6352         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6353         (RootContext.LookupType): Pass down the `silent' flag.
6354
6355 2004-05-25  Martin Baulig  <martin@ximian.com>
6356
6357         * expression.cs
6358         (MethodGroupExpr.IdenticalTypeName): New public property.
6359         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6360         expression actually refers to a type.
6361
6362 2004-05-25  Martin Baulig  <martin@ximian.com>
6363
6364         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6365         for #56176 and made it actually work.
6366
6367 2004-05-25  Martin Baulig  <martin@ximian.com>
6368
6369         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6370         (FieldExpr, PropertyExpr): Override and implement
6371         CacheTemporaries.  Fixes #52279.
6372
6373 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6374
6375         * location.cs: In the new compiler listing a file twice is a
6376         warning, not an error.
6377
6378 2004-05-24  Martin Baulig  <martin@ximian.com>
6379
6380         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6381         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6382
6383 2004-05-24  Martin Baulig  <martin@ximian.com>
6384
6385         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6386         walking the `using' list.  Fixes #53921.
6387
6388 2004-05-24  Martin Baulig  <martin@ximian.com>
6389
6390         * const.cs (Const.LookupConstantValue): Added support for
6391         EmptyCast's; fixes #55251.
6392
6393 2004-05-24  Martin Baulig  <martin@ximian.com>
6394
6395         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6396         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6397         which does the CS0135 check.  The reason is that we first need to
6398         check whether the variable actually exists.
6399
6400 2004-05-24  Martin Baulig  <martin@ximian.com>
6401
6402         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6403         than RootContext.LookupType() to find the explicit interface
6404         type.  Fixes #58584.
6405
6406 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6407
6408         * Makefile: Simplify.  Use executable.make.
6409         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6410
6411 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6412
6413         * decl.cs:
6414         * enum.cs:
6415         Use the invariant culture when doing String.Compare for CLS case
6416         sensitivity.
6417         
6418 2004-05-23  Martin Baulig  <martin@ximian.com>
6419
6420         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6421         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6422
6423         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6424         
6425 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6426
6427         * class.cs (MemberBase.Define): Reuse MemberType member for 
6428         resolved type. Other methods can use it too.
6429
6430 2004-05-23  Martin Baulig  <martin@ximian.com>
6431
6432         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6433         the variable also exists in the current block (otherwise, we need
6434         to report a CS0103).  Fixes #58670.
6435
6436 2004-05-23  Martin Baulig  <martin@ximian.com>
6437
6438         * flowanalysis.cs (Reachability.Reachable): Compute this
6439         on-the-fly rather than storing it as a field.
6440
6441 2004-05-23  Martin Baulig  <martin@ximian.com>
6442
6443         * flowanalysis.cs (Reachability.And): Manually compute the
6444         resulting `barrier' from the reachability.      
6445        
6446 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6447
6448         Fix bug #57835
6449         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6450         instance of ObsoleteAttribute when symbol is obsolete.
6451
6452         * class.cs
6453         (IMethodData): Extended interface for ObsoleteAttribute support.
6454
6455 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6456
6457         * attribute.cs: Fix bug #55970
6458
6459 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6460
6461         Fix bug #52705
6462         * attribute.cs
6463         (GetObsoleteAttribute): New method. Creates the instance of
6464         ObsoleteAttribute.
6465         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6466         ObsoleteAttribute when member is obsolete.
6467         (AttributeTester.Report_ObsoleteMessage): Common method for
6468         Obsolete error/warning reporting.
6469
6470         * class.cs
6471         (TypeContainer.base_classs_type): New member for storing parent type.
6472
6473         * decl.cs
6474         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6475         for this MemberCore.
6476
6477 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6478
6479         * attribute.cs, const.cs: Fix bug #58590
6480
6481 2004-05-21  Martin Baulig  <martin@ximian.com>
6482
6483         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6484         out parameters if the end of the method is unreachable.  Fixes
6485         #58098. 
6486
6487 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6488
6489         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6490         Hari was right, why extra method.
6491
6492 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6493
6494         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6495
6496 2004-05-20  Martin Baulig  <martin@ximian.com>
6497
6498         Merged this back from gmcs to keep the differences to a minumum.
6499
6500         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6501         instead of a Declspace.
6502         (Attribute.ResolveType): Likewise.
6503         (Attributes.Search): Likewise.
6504         (Attributes.Contains): Likewise.
6505         (Attributes.GetClsCompliantAttribute): Likewise.
6506
6507         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6508         argument.
6509         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6510         DeclSpace.
6511
6512 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6513
6514         Fix bug #58688 (MCS does not report error when the same attribute
6515         is assigned twice)
6516
6517         * attribute.cs (Attribute.Emit): Distinction between null and default.
6518
6519 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6520
6521         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6522         of a top-level attribute without an attribute target.
6523         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6524         Make non-static.
6525         (Attribute.Conditional_GetConditionName), 
6526         (Attribute.Obsolete_GetObsoleteMessage): Update.
6527         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6528         part of ScanForIndexerName.
6529         (Attribute.CanIgnoreInvalidAttribute): New function.
6530         (Attribute.ScanForIndexerName): Move to ...
6531         (Attributes.ScanForIndexerName): ... here.
6532         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6533         (Attributes.Search): New internal variant that can choose not to
6534         complain if types aren't resolved.  The original signature now
6535         complains.
6536         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6537         complaints suppressed.
6538         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6539         only if it not useful.
6540         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6541         top-level for attributes that are shared between the assembly
6542         and a top-level class.
6543         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6544         * class.cs: Update to reflect changes.
6545         (DefineIndexers): Fuse loops.
6546         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6547         a couple more variants of attribute names.
6548
6549 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6550
6551         Fix bug #52585 (Implemented explicit attribute declaration)
6552
6553         * attribute.cs:
6554         (Attributable.ValidAttributeTargets): New abstract method. It gets
6555         list of valid attribute targets for explicit target declaration.
6556         (Attribute.Target): It holds target itself.
6557         (AttributeSection): Removed.
6558         (Attribute.CheckTargets): New method. It checks whether attribute
6559         target is valid for the current element.
6560
6561         * class.cs:
6562         (EventProperty): New class. For events that are declared like
6563         property (with add and remove accessors).
6564         (EventField): New class. For events that are declared like field.
6565         class.cs
6566
6567         * cs-parser.jay: Implemented explicit attribute target declaration.
6568
6569         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6570         Override ValidAttributeTargets.
6571
6572         * parameter.cs:
6573         (ReturnParameter): Class for applying custom attributes on 
6574         the return type.
6575         (ParameterAtribute): New class. Class for applying custom
6576         attributes on the parameter type.
6577
6578 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6579
6580         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6581         definitions. 
6582
6583         (Method): Allow UNSAFE here.
6584
6585         * modifiers.cs: Support unsafe reporting.
6586
6587 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6588
6589         * decl.cs: Fix bug #58478.
6590
6591 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6592
6593         * statement.cs: When checking for unreachable code on an EmptyStatement,
6594         set the location. Fixes bug #58488.
6595
6596 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6597
6598         * driver.cs: Add -pkg handling.
6599
6600         From Gonzalo: UseShelLExecute=false
6601
6602 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6603
6604         * attribute.cs:
6605         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6606         for attribute.
6607         (Attribute.IsClsCompliaceRequired): Moved to base for better
6608         accesibility.
6609         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6610         when attribute is AttributeUsageAttribute.
6611         (Attribute.GetValidTargets): Simplified.
6612         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6613         attribute for this type.
6614         (Attribute.ApplyAttributes): Method renamed to Emit and make
6615         non-static.
6616         (GlobalAttributeSection): New class for special handling of global
6617         attributes (assembly, module).
6618         (AttributeSection.Emit): New method.
6619
6620         * class.cs: Implemented Attributable abstract methods.
6621         (MethodCore.LabelParameters): Moved to Parameter class.
6622         (Accessor): Is back simple class.
6623         (PropertyMethod): Implemented Attributable abstract class.
6624         (DelegateMethod): Implemented Attributable abstract class.
6625         (Event): New constructor for disctintion between normal Event
6626         and Event with accessors.
6627
6628         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6629
6630         * codegen.cs, const.cs, decl.cs, delegate.cs:
6631         (CommonAssemblyModulClass): Implemented Attributable abstract class
6632         and simplified.
6633
6634         * enum.cs: Implement IAttributeSupport interface.
6635         (EnumMember): New class for emum members. Implemented Attributable
6636         abstract class
6637
6638         * parameter.cs:
6639         (ParameterBase): Is abstract.
6640         (ReturnParameter): New class for easier [return:] attribute handling.
6641
6642         * typemanager.cs: Removed builder_to_attr.
6643
6644 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6645
6646         Fix bug #57151.
6647         * attribute.cs (Attribute.GetPositionalValue): New function.
6648         * class.cs (TypeContainer.VerifyMembers): New function.
6649         (TypeContainer.Emit): Use it.
6650         (ClassOrStruct): New base class for Class and Struct.
6651         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6652         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6653         class.
6654         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6655         then each non-static field should have a FieldOffset attribute.
6656         Otherwise, none of the fields should have a FieldOffset attribute.
6657         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6658         and FieldOffset attributes.
6659         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6660         (TypeManager.field_offset_attribute_type): New core types.
6661         (TypeManager.InitCoreTypes): Initialize them.
6662
6663 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6664
6665         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6666         Return correct type.
6667         From bug #58270.
6668
6669 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6670
6671         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6672         be implicitly converted to ulong.
6673         
6674         * expression.cs: The logic for allowing operator &, | and ^ worked
6675         was wrong, it worked before because we did not report an error in
6676         an else branch.  Fixes 57895.
6677
6678         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6679         allow volatile fields to be reference types.
6680
6681 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6682
6683         * driver.cs: Add support for /debug-
6684
6685 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6686
6687         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6688         Add a 'complain' parameter to silence errors.
6689         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6690         silently overlooked type-resolutions.
6691         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6692         to reflect changes.
6693         (Attributes.Search): New function.
6694         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6695         (Attributes.GetAttributeFullName): Remove hack.
6696         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6697         Update to reflect changes.
6698         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6699         Use Attributes.Search instead of nested loops.
6700
6701 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6702
6703         * decl.cs:
6704         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6705         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6706         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6707
6708         * report.cs: (Report.Warning): Renamed to Warning_T because of
6709         parameter collision.
6710
6711 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6712
6713         * expression.cs (MemberAccess.ResolveMemberAccess):
6714         Exit with non-zero status after Report.Error.
6715         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6716         Likewise.
6717         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6718
6719 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6720
6721         * support.cs: Don't hang when the file is empty.
6722
6723 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6724
6725         * support.cs: In SeekableStreamReader, compute the preamble size of the
6726           underlying stream. Position changes should take into account that initial
6727           count of bytes.
6728
6729 2004-05-03  Todd Berman  <tberman@sevenl.net>
6730
6731         * driver.cs: remove unused GetSysVersion function.
6732
6733 2004-05-03  Todd Berman  <tberman@sevenl.net>
6734
6735         * driver.cs: Remove the hack from saturday, as well as the hack
6736         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6737         link_paths to get that bit proper.
6738
6739 2004-05-01  Todd Berman  <tberman@sevenl.net>
6740
6741         * driver.cs: Try a LoadFrom before a Load, this checks the current
6742         path. This is currently a bug in mono that is be fixed, however, this
6743         provides a workaround for now. This will be removed when the bug
6744         is fixed.
6745
6746 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6747
6748         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6749         incomplete key pairs (#57941).
6750
6751 2004-05-01  Todd Berman  <tberman@sevenl.net>
6752
6753         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6754         from the GAC
6755
6756 2004-04-30  Jackson Harper  <jackson@ximian.com>
6757
6758         * codegen.cs: Open keys readonly.
6759         
6760 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6761
6762         * typemanager.cs: don't report cyclic struct layout when a struct
6763         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6764         which has 2 Pango.Rectangle fields.
6765
6766 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6767
6768         * expression.cs: Handle IntPtr comparisons with IL code
6769         rather than a method call.
6770
6771 2004-04-29  Martin Baulig  <martin@ximian.com>
6772
6773         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6774         the list of PropertyInfo's in class hierarchy and find the
6775         accessor.  Fixes #56013.
6776
6777 2004-04-29  Martin Baulig  <martin@ximian.com>
6778
6779         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6780
6781 2004-04-29  Martin Baulig  <martin@ximian.com>
6782
6783         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6784
6785         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6786
6787 2004-04-29  Martin Baulig  <martin@ximian.com>
6788
6789         * class.cs (ConstructorInitializer.Resolve): Check whether the
6790         parent .ctor is accessible.  Fixes #52146.
6791
6792 2004-04-29  Martin Baulig  <martin@ximian.com>
6793
6794         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6795
6796         * statement.cs (Using.EmitLocalVariableDecls): Use
6797         TypeManager.idisposable_type, not typeof (IDisposable).
6798         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6799
6800 2004-04-29  Martin Baulig  <martin@ximian.com>
6801
6802         * class.cs (Event.Define): Don't emit the field and don't set
6803         RTSpecialName and SpecialName for events on interfaces.  Fixes
6804         #57703. 
6805
6806 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6807
6808         Refactor Attribute.ApplyAttributes.
6809         * attribute.cs (Attributable): New base class for objects that can
6810         have Attributes applied on them.
6811         (Attribute): Make AttributeUsage fields public.
6812         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6813         (Attribute.IsInternalCall): New property.
6814         (Attribute.UsageAttr): Convert to a public read-only property.
6815         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6816         (Attribute.ResolveType, Attribute.Resolve)
6817         (Attribute.ScanForIndexerName): Update to reflect changes.
6818         (Attribute.CheckAttributeTarget): Re-format.
6819         (Attribute.ApplyAttributes): Refactor, to various
6820         Attributable.ApplyAttributeBuilder methods.
6821         * decl.cs (MemberCore): Make Attributable.
6822         * class.cs (Accessor): Make Attributable.
6823         (MethodData.ApplyAttributes): Use proper attribute types, not
6824         attribute names.
6825         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6826         (TypeContainer.ApplyAttributeBuilder)
6827         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6828         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6829         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6830         (Operator.ApplyAttributeBuilder): New factored-out methods.
6831         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6832         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6833         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6834         * parameter.cs (ParameterBase): New Attributable base class
6835         that can also represent Return types.
6836         (Parameter): Update to the changes.
6837
6838 2004-04-29  Jackson Harper  <jackson@ximian.com>
6839
6840         * driver.cs: Prefer the corlib system version when looking for
6841         assemblies in the GAC. This is still a hack, but its a better hack
6842         now.
6843         
6844 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6845
6846         * decl.cs, enum.cs: Improved error 3005 reporting.
6847   
6848         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6849         (related_symbols): New private member for list of symbols
6850         related to reported error/warning.
6851         
6852         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6853
6854 2004-04-29  Martin Baulig  <martin@ximian.com>
6855
6856         * ecore.cs (Expression.Constantify): If we're an enum and
6857         TypeManager.TypeToCoreType() doesn't give us another type, use
6858         t.UnderlyingSystemType.  Fixes #56178.  
6859
6860 2004-04-29  Martin Baulig  <martin@ximian.com>
6861
6862         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6863         interfaces and for each interface, only add members directly
6864         declared in that interface.  Fixes #53255.
6865
6866 2004-04-28  Martin Baulig  <martin@ximian.com>
6867
6868         * expression.cs (ConditionalLogicalOperator): Use a temporary
6869         variable for `left' to avoid that we evaluate it more than once;
6870         bug #52588.
6871
6872 2004-04-28  Martin Baulig  <martin@ximian.com>
6873
6874         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6875         `void[]' (CS1547).
6876
6877 2004-04-28  Martin Baulig  <martin@ximian.com>
6878
6879         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6880         void (CS1547).
6881
6882         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6883         whether the type is not void (CS1547).
6884
6885 2004-04-28  Martin Baulig  <martin@ximian.com>
6886
6887         * expression.cs (Unary.DoResolveLValue): Override this and report
6888         CS0131 for anything but Operator.Indirection.
6889
6890 2004-04-28  Martin Baulig  <martin@ximian.com>
6891
6892         Committing a patch from Ben Maurer; see bug #50820.
6893
6894         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6895         check for classes.
6896
6897         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6898         classes.        
6899
6900 2004-04-28  Martin Baulig  <martin@ximian.com>
6901
6902         Committing a patch from Ben Maurer; see bug #50820.
6903
6904         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6905         check for classes.
6906
6907         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6908         classes.        
6909
6910 2004-04-28  Martin Baulig  <martin@ximian.com>
6911
6912         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6913         (Block.AddLabel): Call DoLookupLabel() to only search in the
6914         current block.
6915
6916 2004-04-28  Martin Baulig  <martin@ximian.com>
6917
6918         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6919         comparing StringConstants and NullLiterals in Equality and Inequality.
6920
6921 2004-04-28  Jackson Harper  <jackson@ximian.com>
6922
6923         * driver.cs: Attempt to load referenced assemblies from the
6924         GAC. This is the quick and dirty version of this method that
6925         doesnt take into account versions and just takes the first
6926         canidate found. Will be good enough for now as we will not have more
6927         then one version installed into the GAC until I update this method.
6928
6929 2004-04-28  Martin Baulig  <martin@ximian.com>
6930
6931         * typemanager.cs (TypeManager.CheckStructCycles): New public
6932         static method to check for cycles in the struct layout.
6933
6934         * rootcontext.cs (RootContext.PopulateTypes): Call
6935         TypeManager.CheckStructCycles() for each TypeContainer.
6936         [Note: We only need to visit each type once.]
6937
6938 2004-04-28  Martin Baulig  <martin@ximian.com>
6939
6940         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6941
6942         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6943         success and added `out object value'.  Use a `bool resolved' field
6944         to check whether we've already been called rather than
6945         `ConstantValue != null' since this breaks for NullLiterals.
6946
6947 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6948
6949         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6950         setting of this flag, since the 'set' method may be non-public.
6951
6952 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6953
6954         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6955         check on current_vector.Block.
6956
6957 2004-04-27  Martin Baulig  <martin@ximian.com>
6958
6959         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6960         a field initializer.  Fixes #56459.
6961
6962 2004-04-27  Martin Baulig  <martin@ximian.com>
6963
6964         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6965         we're not attempting to use an indexer.  Fixes #52154.
6966
6967 2004-04-27  Martin Baulig  <martin@ximian.com>
6968
6969         * statement.cs (Return): Don't create a return label if we don't
6970         need it; reverts my change from January 20th.  Thanks to Ben
6971         Maurer for this.
6972
6973 2004-04-27  Martin Baulig  <martin@ximian.com>
6974
6975         According to the spec, `goto' can only leave a nested scope, but
6976         never enter it.
6977
6978         * statement.cs (Block.LookupLabel): Only lookup in the current
6979         block, don't recurse into parent or child blocks.
6980         (Block.AddLabel): Check in parent and child blocks, report
6981         CS0140/CS0158 if we find a duplicate.
6982         (Block): Removed this indexer for label lookups.
6983         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6984         this already does the error reporting for us.
6985
6986         * flowanalysis.cs
6987         (FlowBranching.UsageVector.Block): New public variable; may be null.
6988         (FlowBranching.CreateSibling): Added `Block' argument.
6989         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6990         label for the target of a `goto' and check whether we're not
6991         leaving a `finally'.
6992
6993 2004-04-27  Martin Baulig  <martin@ximian.com>
6994
6995         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6996         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6997         just for returns).
6998
6999 2004-04-27  Martin Baulig  <martin@ximian.com>
7000
7001         * statement.cs (Block.AddLabel): Also check for implicit blocks
7002         and added a CS0158 check.
7003
7004 2004-04-27  Martin Baulig  <martin@ximian.com>
7005
7006         * flowanalysis.cs (FlowBranchingLoop): New class.
7007         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7008         UsageVector's instead of an ArrayList.
7009         (FlowBranching.Label): Likewise.
7010         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7011         (FlowBranching.AddBreakVector): New method.
7012
7013 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7014
7015         * attribute.cs: Small regression fix: only convert the type if we
7016         the type is different, fixes System.Drawing build.
7017
7018 2004-04-27  Martin Baulig  <martin@ximian.com>
7019
7020         * attribute.cs (Attribute.Resolve): If we have a constant value
7021         for a named field or property, implicity convert it to the correct
7022         type.
7023
7024 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7025
7026         * statement.cs (Block.Block): Implicit blocks share
7027         'child_variable_names' fields with parent blocks.
7028         (Block.AddChildVariableNames): Remove.
7029         (Block.AddVariable): Mark variable as "used by a child block" in
7030         every surrounding block.
7031         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7032         been used in a child block, complain about violation of "Invariant
7033         meaning in blocks" rule.
7034         * cs-parser.jay (declare_local_variables): Don't use
7035         AddChildVariableNames.
7036         (foreach_statement): Don't create an implicit block: 'foreach'
7037         introduces a scope.
7038
7039 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7040
7041         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7042         converting from 0L to ulong.  Fixes 57522.
7043
7044 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7045
7046         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7047         derived class hides via 'new' keyword field from base class (test-242.cs).
7048         TODO: Handle this in the more general way.
7049         
7050         * class.cs (CheckBase): Ditto.
7051
7052 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7053
7054         * decl.cs (caching_flags): New member for storing cached values
7055         as bit flags.
7056         (MemberCore.Flags): New enum where bit flags for caching_flags
7057         are defined.
7058         (MemberCore.cls_compliance): Moved to caching_flags.
7059         (DeclSpace.Created): Moved to caching_flags.
7060
7061         * class.cs: Use caching_flags instead of DeclSpace.Created
7062         
7063 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7064
7065         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7066         if we are only a derived class, not a nested class.
7067
7068         * typemanager.cs: Same as above, but do this at the MemberLookup
7069         level (used by field and methods, properties are handled in
7070         PropertyExpr).   Allow for the qualified access if we are a nested
7071         method. 
7072
7073 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7074
7075         * class.cs: Refactoring.
7076         (IMethodData): New inteface; Holds links to parent members
7077         to avoid member duplication (reduced memory allocation).
7078         (Method): Implemented IMethodData interface.
7079         (PropertyBase): New inner classes for get/set methods.
7080         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7081         (Event): New inner classes for add/remove methods.
7082         (Event.DelegateMethod): Implemented IMethodData interface.
7083
7084         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7085         EmitContext (related to class.cs refactoring).
7086
7087 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7088
7089         * delegate.cs (Delegate.VerifyApplicability): If the number of
7090         arguments are the same as the number of parameters, first try to
7091         verify applicability ignoring  any 'params' modifier on the last
7092         parameter.
7093         Fixes #56442.
7094
7095 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7096
7097         * class.cs (TypeContainer.AddIndexer): Use
7098         'ExplicitInterfaceName' to determine if interface name was
7099         explicitly specified.  'InterfaceType' is not initialized at this time.
7100         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7101         Indexers array is already in the required order.  Initialize
7102         'IndexerName' only if there are normal indexers.
7103         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7104         (TypeContainer.Emit): Emit DefaultMember attribute only if
7105         IndexerName is initialized.
7106         Fixes #56300.
7107
7108 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7109
7110         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7111         Fixes #57007
7112
7113 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7114
7115         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7116         attributes.
7117         Fix for #56456.
7118
7119         * attribute.cs (Attribute.Resolve): Check for duplicate named
7120         attributes.
7121         Fix for #56463.
7122
7123 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7124
7125         * iterators.cs (MarkYield): track whether we are in an exception,
7126         and generate code accordingly.  Use a temporary value to store the
7127         result for our state.
7128
7129         I had ignored a bit the interaction of try/catch with iterators
7130         since their behavior was not entirely obvious, but now it is
7131         possible to verify that our behavior is the same as MS .NET 2.0
7132
7133         Fixes 54814
7134
7135 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7136
7137         * iterators.cs: Avoid creating temporaries if there is no work to
7138         do. 
7139
7140         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7141         Enumerations, use TypeManager.EnumToUnderlying and call
7142         recursively. 
7143
7144         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7145         bug #57013
7146
7147         (This.Emit): Use EmitContext.EmitThis to emit our
7148         instance variable.
7149
7150         (This.EmitAssign): Ditto.
7151
7152         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7153         codepaths, we will move all the functionality into
7154         Mono.CSharp.This 
7155
7156         (FieldExpr.EmitAssign): Ditto.
7157
7158         This fixes several hidden bugs that I uncovered while doing a code
7159         review of this today.
7160
7161         * codegen.cs (EmitThis): reworked so the semantics are more clear
7162         and also support value types "this" instances.
7163
7164         * iterators.cs: Changed so that for iterators in value types, we
7165         do not pass the value type as a parameter.  
7166
7167         Initialization of the enumerator helpers is now done in the caller
7168         instead of passing the parameters to the constructors and having
7169         the constructor set the fields.
7170
7171         The fields have now `assembly' visibility instead of private.
7172
7173 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7174
7175         * expression.cs (Argument.Resolve): Check if fields passed as ref
7176         or out are contained in a MarshalByRefObject.
7177
7178         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7179         another compiler type.
7180
7181 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7182
7183         * class.cs (Indexer.Define): use the new name checking method.
7184         Also, return false on an error.
7185         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7186         (is_identifier_[start/part]_character): make static.
7187
7188 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7189
7190         * expression.cs (Binary.ResolveOperator): Do no append strings
7191         twice: since we can be invoked more than once (array evaluation)
7192         on the same concatenation, take care of this here.  Based on a fix
7193         from Ben (bug #56454)
7194
7195 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7196
7197         * codegen.cs: Fix another case where CS1548 must be reported (when 
7198         delay-sign isn't specified and no private is available #56564). Fix
7199         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7200         error when MCS is used on the MS runtime and we need to delay-sign 
7201         (which seems unsupported by AssemblyBuilder - see #56621).
7202
7203 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7204
7205         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7206         (TypeManager.ComputeNamespaces): Faster implementation for
7207         Microsoft runtime.
7208
7209         * compiler.csproj: Updated AssemblyName to mcs.
7210
7211 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7212
7213         * rootcontext.cs: Add new types to the boot resolution.
7214
7215         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7216         MulticastDelegate is not allowed.
7217
7218         * typemanager.cs: Add new types to lookup: System.TypedReference
7219         and ArgIterator.
7220
7221         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7222         check for TypedReference or ArgIterator, they are not allowed. 
7223
7224         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7225         makes us properly catch 1510 in some conditions (see bug 56016 for
7226         details). 
7227
7228 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7229
7230         * CryptoConvert.cs: update from corlib version
7231         with endian fixes.
7232
7233 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7234
7235         * class.cs (Indexer.Define): Check indexername declaration
7236
7237 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7238
7239         * attribute.cs (IsClsCompliant): Fixed problem with handling
7240         all three states (compliant, not-compliant, undetected).
7241
7242 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7243
7244         * attribute.cs (Attribute): Location is now public.
7245         (Resolve): Store resolved arguments (pos_values) in attribute class.
7246         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7247         (GetClsCompliantAttributeValue): New method that gets
7248         CLSCompliantAttribute value.
7249         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7250         if exists else null.
7251         (AttributeTester): New class for CLS-Compliant verification routines.
7252
7253         * class.cs (Emit): Add CLS-Compliant verification.
7254         (Method.GetSignatureForError): Implemented.
7255         (Constructor.GetSignatureForError): Implemented
7256         (Constructor.HasCompliantArgs): Returns if constructor has
7257         CLS-Compliant arguments.
7258         (Constructor.Emit): Override.
7259         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7260         is needed to test only parameters.
7261         (FieldBase.GetSignatureForError): Implemented.
7262         (TypeContainer): New member for storing base interfaces.
7263         (TypeContainer.FindMembers): Search in base interfaces too.
7264
7265         * codegen.cs (GetClsComplianceAttribute): New method that gets
7266         assembly or module CLSCompliantAttribute value.
7267         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7268         for assembly.
7269         (ModuleClass.Emit): Add error 3012 test.
7270
7271         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7272
7273         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7274         state for all decl types.
7275         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7276         if CLS-Compliant tests are required.
7277         (IsClsCompliaceRequired): New method. Analyze whether code
7278         must be CLS-Compliant.
7279         (IsExposedFromAssembly): New method. Returns true when MemberCore
7280         is exposed from assembly.
7281         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7282         value or gets cached value.
7283         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7284         is explicitly marked with CLSCompliantAttribute.
7285         (IsIdentifierClsCompliant): New abstract method. This method is
7286         used to testing error 3005.
7287         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7288         for identifier and parameters CLS-Compliant testing.
7289         (VerifyClsCompliance): New method. The main virtual method for
7290         CLS-Compliant verifications.
7291         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7292         null. I don't know why is null (too many public members !).
7293         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7294         and get value of first CLSCompliantAttribute that found.
7295
7296         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7297         (VerifyClsCompliance): Override and add extra tests.
7298
7299         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7300         clscheck- disable CLS-Compliant verification event if assembly is has
7301         CLSCompliantAttribute(true).
7302
7303         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7304         ApllyAttribute is now called in emit section as in the other cases.
7305         Possible future Emit integration.
7306         (IsIdentifierClsCompliant): New override.
7307         (VerifyClsCompliance): New override.
7308         (GetEnumeratorName): Returns full enum name.
7309
7310         * parameter.cs (GetSignatureForError): Implemented.
7311
7312         * report.cs (WarningData): New struct for Warning message information.
7313         (LocationOfPreviousError): New method.
7314         (Warning): New method. Reports warning based on the warning table.
7315         (Error_T): New method. Reports error based on the error table.
7316
7317         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7318         verifications are done here.
7319
7320         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7321
7322         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7323         CLSCompliantAttribute.
7324         (all_imported_types): New member holds all imported types from other
7325         assemblies.
7326         (LoadAllImportedTypes): New method fills static table with exported types
7327         from all referenced assemblies.
7328         (Modules): New property returns all assembly modules.
7329
7330 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7331
7332         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7333         throwing a parser error.
7334
7335         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7336         which removes the hardcoded get_/set_ prefixes for properties, as
7337         IL allows for the properties to be named something else.  
7338
7339         Bug #56013
7340
7341         * expression.cs: Do not override operand before we know if it is
7342         non-null.  Fix 56207
7343
7344 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7345
7346         * typemanager.cs: support for pinned variables.
7347
7348 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7349
7350         * decl.cs, typemanager.cs: Avoid using an arraylist
7351         as a buffer if there is only one result set.
7352
7353 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7354
7355         * expression.cs: Make sure you cant call a static method
7356         with an instance expression, bug #56174.
7357
7358 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7359
7360         * class.cs (IsDuplicateImplementation): Improve error reporting to
7361         flag 663 (method only differs in parameter modifier).
7362
7363         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7364         in preprocessor directives.
7365
7366         * location.cs (LookupFile): Allow for the empty path.
7367
7368         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7369         better approach for some of that patch, but its failing with the
7370         CharSet enumeration.  For now try/catch will do.
7371
7372         * typemanager.cs: Do not crash if a struct does not have fields.
7373         Fixes 56150.
7374
7375 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7376
7377         * expression.cs: cs0213, cant fix a fixed expression.
7378         fixes 50231.
7379
7380 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7381
7382         * cs-parser.jay: detect invalid embeded statements gracefully.
7383         bug #51113.
7384
7385 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7386
7387         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7388         As a regex:
7389         s/
7390         the invocation type may not be a subclass of the tye of the item/
7391         The type of the item must be a subclass of the invocation item.
7392         /g
7393
7394         Fixes bug #50820.
7395
7396 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7397
7398         * attribute.cs: Added methods to get a string and a bool from an
7399         attribute. Required to information from AssemblyKeyFileAttribute,
7400         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7401         * codegen.cs: Modified AssemblyName creation to include support for
7402         strongnames. Catch additional exceptions to report them as CS1548.
7403         * compiler.csproj: Updated include CryptoConvert.cs.
7404         * compiler.csproj.user: Removed file - user specific configuration.
7405         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7406         Mono.Security assembly. The original class is maintained and tested in
7407         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7408         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7409         like CSC 8.0 (C# v2) supports.
7410         * Makefile: Added CryptoConvert.cs to mcs sources.
7411         * rootcontext.cs: Added new options for strongnames.
7412
7413 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7414
7415         * driver.cs: For --expect-error, report error code `2'
7416         if the program compiled with no errors, error code `1' if
7417         it compiled with an error other than the one expected.
7418
7419 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7420
7421         * compiler.csproj: Updated for Visual Studio .NET 2003.
7422         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7423         * compiler.sln: Updated for Visual Studio .NET 2003.
7424
7425 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7426
7427         * expression.cs: Fix bug #47234. We basically need to apply the
7428         rule that we prefer the conversion of null to a reference type
7429         when faced with a conversion to 'object' (csc behaviour).
7430
7431 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7432
7433         * statement.cs: Shorter form for foreach, eliminates
7434         a local variable. r=Martin.
7435
7436 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7437
7438         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7439         checks if we can use brtrue/brfalse to test for 0.
7440         * expression.cs: use the above in the test for using brtrue/brfalse.
7441         cleanup code a bit.
7442
7443 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7444
7445         * expression.cs: Rewrite string concat stuff. Benefits:
7446
7447         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7448         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7449         rather than a concat chain.
7450
7451         * typemanager.cs: Add lookups for more concat overloads.
7452
7453 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7454
7455         * expression.cs: Emit shorter il code for array init.
7456
7457         newarr
7458         dup
7459         // set 1
7460
7461         // set 2
7462
7463         newarr
7464         stloc.x
7465
7466         ldloc.x
7467         // set 1
7468
7469         ldloc.x
7470         // set 2
7471
7472 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7473
7474         * statement.cs: Before, two switch blocks would be merged if the
7475         total size of the blocks (end_item - begin_item + 1) was less than
7476         two times the combined sizes of the blocks.
7477
7478         Now, it will only merge if after the merge at least half of the
7479         slots are filled.
7480
7481         fixes 55885.
7482
7483 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7484
7485         * class.cs : csc build fix for GetMethods(). See bug #52503.
7486
7487 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7488
7489         * expression.cs: Make sure fp comparisons work with NaN.
7490         This fixes bug #54303. Mig approved this patch a long
7491         time ago, but we were not able to test b/c the runtime
7492         had a related bug.
7493
7494 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7495
7496         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7497
7498 2004-03-19  Martin Baulig  <martin@ximian.com>
7499
7500         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7501         error here and not in our caller.
7502
7503 2004-03-19  Martin Baulig  <martin@ximian.com>
7504
7505         * interface.cs: Completely killed this file.
7506         (Interface): We're now a TypeContainer and live in class.cs.
7507
7508         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7509         argument; we're now also called for interfaces.
7510         (TypeContainer.DefineMembers): Allow this method being called
7511         multiple times.
7512         (TypeContainer.GetMethods): New public method; formerly known as
7513         Interface.GetMethod().  This is used by PendingImplementation.
7514         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7515         it's now private and non-static.
7516         (Interface): Moved this here; it's now implemented similar to
7517         Class and Struct.
7518         (Method, Property, Event, Indexer): Added `bool is_interface'
7519         argument to their .ctor's.
7520         (MemberBase.IsInterface): New public field.
7521
7522         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7523         instances instead of InterfaceMethod, InterfaceProperty, etc.
7524         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7525         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7526
7527 2004-03-19  Martin Baulig  <martin@ximian.com>
7528
7529         * class.cs (MethodCore.IsDuplicateImplementation): New private
7530         method which does the CS0111 checking.
7531         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7532         Use IsDuplicateImplementation().
7533
7534 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7535
7536         * decl.cs (FindMemberToOverride): New method to find the correct
7537         method or property to override in the base class.
7538         * class.cs
7539             - Make Method/Property use the above method to find the
7540               version in the base class.
7541             - Remove the InheritableMemberSignatureCompare as it is now
7542               dead code.
7543
7544         This patch makes large code bases much faster to compile, as it is
7545         O(n) rather than O(n^2) to do this validation.
7546
7547         Also, it fixes bug 52458 which is that nested classes are not
7548         taken into account when finding the base class member.
7549
7550         Reviewed/Approved by Martin.
7551
7552 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7553
7554         * interface.cs: In all interface classes removed redundant
7555         member initialization.
7556
7557 2004-03-16  Martin Baulig  <martin@ximian.com>
7558
7559         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7560
7561 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7562
7563         * decl.cs (DefineTypeAndParents): New helper method to define a
7564         type's containers before the type itself is defined;  This is a
7565         bug exposed by the recent changes to Windows.Forms when an
7566         implemented interface was defined inside a class that had not been
7567         built yet.   
7568
7569         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7570
7571         (Check): Loop correctly to report errors modifiers
7572         (UNSAFE was not in the loop, since it was the same as TOP).
7573
7574         * interface.cs: Every interface member now takes a ModFlags,
7575         instead of a "is_new" bool, which we set on the base MemberCore. 
7576
7577         Every place where we called "UnsafeOk" in the interface, now we
7578         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7579         the unsafe settings from the member declaration instead of the
7580         container interface. 
7581
7582         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7583
7584         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7585         `set_indexer_name' to the pending bits (one per type).
7586
7587         We fixed a bug today that was picking the wrong method to
7588         override, since for properties the existing InterfaceMethod code
7589         basically ignored the method name.  Now we make sure that the
7590         method name is one of the valid indexer names.
7591
7592 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7593  
7594         * support.cs (SeekableStreamReader): Keep track of stream byte
7595         positions and don't mix them with character offsets to the buffer.
7596
7597         Patch from Gustavo Giráldez
7598
7599 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7600
7601         * interface.cs (InterfaceSetGetBase): Removed double member
7602         initialization, base class does it as well.
7603
7604 2004-03-13  Martin Baulig  <martin@ximian.com>
7605
7606         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7607         when compiling corlib.
7608
7609 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7610
7611         * convert.cs (ExplicitConversion): We were reporting an error on
7612         certain conversions (object_type source to a value type, when the
7613         expression was `null') before we had a chance to pass it through
7614         the user defined conversions.
7615
7616         * driver.cs: Replace / and \ in resource specifications to dots.
7617         Fixes 50752
7618
7619         * class.cs: Add check for duplicate operators.  Fixes 52477
7620
7621 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7622
7623         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7624         that are in the middle of the statements, not only at the end.
7625         Fixes #54987
7626
7627         * class.cs (TypeContainer.AddField): No longer set the
7628         `HaveStaticConstructor' flag, now we call it
7629         `UserDefineStaticConstructor' to diferentiate the slightly
7630         semantic difference.
7631
7632         The situation is that we were not adding BeforeFieldInit (from
7633         Modifiers.TypeAttr) to classes that could have it.
7634         BeforeFieldInit should be set to classes that have no static
7635         constructor. 
7636
7637         See:
7638
7639         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7640
7641         And most importantly Zoltan's comment:
7642
7643         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7644
7645         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7646          before its static fields are used', i.e. initialization does not need
7647          to be triggered by the first access to the type. Setting this flag
7648          helps the JIT to compile better code, since it can run the static
7649          constructor at JIT time, and does not need to generate code to call it
7650          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7651          this flag for lots of classes like String. 
7652          
7653          csc sets this flag if the type does not have an explicit static 
7654          constructor. The reasoning seems to be that if there are only static
7655          initalizers for a type, and no static constructor, then the programmer
7656          does not care when this initialization happens, so beforefieldinit
7657          can be used.
7658          
7659          This bug prevents the AOT compiler from being usable, since it 
7660          generates so many calls to mono_runtime_class_init that the AOT code
7661          is much slower than the JITted code. The JITted code is faster, 
7662          because it does not generate these calls if the vtable is type is
7663          already initialized, which is true in the majority of cases. But the
7664          AOT compiler can't do this."
7665
7666 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7667
7668         * class.cs (MethodData.Emit): Refactor the code so symbolic
7669         information is generated for destructors;  For some reasons we
7670         were taking a code path that did not generate symbolic information
7671         before. 
7672
7673 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7674
7675         * class.cs: Create a Constructor.CheckBase method that
7676         takes care of all validation type code. The method
7677         contains some code that was moved from Define.
7678
7679         It also includes new code that checks for duplicate ctors.
7680         This fixes bug #55148.
7681
7682 2004-03-09  Joshua Tauberer <tauberer@for.net>
7683
7684         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7685         a { ... }-style array creation invokes EmitStaticInitializers
7686         which is not good for reference-type arrays.  String, decimal
7687         and now null constants (NullCast) are not counted toward
7688         static initializers.
7689
7690 2004-03-05  Martin Baulig  <martin@ximian.com>
7691
7692         * location.cs (SourceFile.HasLineDirective): New public field;
7693         specifies whether the file contains or is referenced by a "#line"
7694         directive.
7695         (Location.DefineSymbolDocuments): Ignore source files which
7696         either contain or are referenced by a "#line" directive.        
7697
7698 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7699
7700         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7701         direct access to our parent, so check the method inline there.
7702
7703 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7704
7705         * expression.cs (Invocation.EmitCall): Miguel's last commit
7706         caused a regression. If you had:
7707
7708             T t = null;
7709             t.Foo ();
7710
7711         In Foo the implict this would be null.
7712
7713 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7714
7715         * expression.cs (Invocation.EmitCall): If the method is not
7716         virtual, do not emit a CallVirt to it, use Call.
7717
7718         * typemanager.cs (GetFullNameSignature): Improve the method to
7719         cope with ".ctor" and replace it with the type name.
7720
7721         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7722         as an argument the ConstructorBuilder where it is being defined,
7723         to catch the recursive constructor invocations.
7724
7725 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7726
7727         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7728         routines to check if a type is an enumerable/enumerator allow
7729         classes that implement the IEnumerable or IEnumerator interfaces.
7730
7731         * class.cs (Property, Operator): Implement IIteratorContainer, and
7732         implement SetYields.
7733
7734         (Property.Define): Do the block swapping for get_methods in the
7735         context of iterators.   We need to check if Properties also
7736         include indexers or not.
7737
7738         (Operator): Assign the Block before invoking the
7739         OperatorMethod.Define, so we can trigger the Iterator code
7740         replacement. 
7741
7742         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7743         Property and Operator classes are not created when we parse the
7744         declarator but until we have the block completed, so we use a
7745         singleton SimpleIteratorContainer.Simple to flag whether the
7746         SetYields has been invoked.
7747
7748         We propagate this setting then to the Property or the Operator to
7749         allow the `yield' to function.
7750
7751 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7752
7753         * codegen.cs: Implemented attribute support for modules.
7754         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7755         Assembly/Module functionality.
7756
7757         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7758         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7759         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7760
7761 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7762
7763         * interface.cs (FindMembers): The operation is performed on all base
7764         interfaces and not only on the first. It is required for future CLS Compliance patch.
7765
7766 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7767
7768         * statement.cs, codegen.cs:
7769         This patch deals with patterns such as:
7770
7771         public class List : IEnumerable {
7772
7773                 public MyEnumerator GetEnumerator () {
7774                         return new MyEnumerator(this);
7775                 }
7776
7777                 IEnumerator IEnumerable.GetEnumerator () {
7778                         ...
7779                 }
7780                 
7781                 public struct MyEnumerator : IEnumerator {
7782                         ...
7783                 }
7784         }
7785
7786         Before, there were a few things we did wrong:
7787         1) we would emit callvirt on a struct, which is illegal
7788         2) we emited ldarg when we needed to emit ldarga
7789         3) we would mistakenly call the interface methods on an enumerator
7790         type that derived from IEnumerator and was in another assembly. For example:
7791
7792         public class MyEnumerator : IEnumerator
7793
7794         Would have the interface methods called, even if there were public impls of the
7795         method. In a struct, this lead to invalid IL code.
7796
7797 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7798
7799         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7800           renamed to Emit.
7801
7802         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7803
7804 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7805
7806         * cs-parser.jay: Fix small regression: we were not testing V2
7807         compiler features correctly.
7808
7809         * interface.cs: If the emit context is null, then create one
7810
7811 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7812
7813         * decl.cs (GetSignatureForError): New virtual method to get full name
7814           for error messages.
7815
7816         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7817           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7818
7819         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7820           Duplicated members and code in these classes has been removed.
7821           Better encapsulation in these classes.
7822
7823 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * assign.cs (Assign.DoResolve): When dealing with compound
7826         assignments, there is a new rule in ECMA C# 2.4 (might have been
7827         there before, but it is documented here) that states that in:
7828
7829         a op= b;
7830
7831         If b is of type int, and the `op' is a shift-operator, then the
7832         above is evaluated as:
7833
7834         a = (int) a op b 
7835
7836         * expression.cs (Binary.ResolveOperator): Instead of testing for
7837         int/uint/long/ulong, try to implicitly convert to any of those
7838         types and use that in pointer arithmetic.
7839
7840         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7841         method to print information for from the type, not from the
7842         null-method we were given.
7843
7844 2004-02-01  Duncan Mak  <duncan@ximian.com>
7845
7846         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7847         parsing for cmd, fixes bug #53694.
7848
7849 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7850
7851         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7852         in the member name duplication tests. Property and operator name duplication
7853         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7854
7855 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7856
7857         * interface.cs (PopulateMethod): Fixed crash when interface method
7858         returns not existing type (error test cs0246-3.cs).
7859
7860 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7861
7862         * cs-parser.jay (interface_accessors): Re-write actions to also
7863         store attributes attached to get and set methods. Fix spelling
7864         while at it.
7865
7866         (inteface_property_declaration): Modify accordingly.
7867
7868         (InterfaceAccessorInfo): New helper class to store information to pass
7869         around between rules that use interface_accessors.
7870
7871         * interface.cs (Emit): Apply attributes on the get and set
7872         accessors of properties and indexers too.
7873
7874         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7875         right MethodBuilder when applying attributes to the get and set accessors.
7876
7877 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7878
7879         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7880
7881 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7882
7883         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7884
7885 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7888         changes that treat `yield' specially when present before `break'
7889         or `return' tokens.
7890
7891         * cs-tokenizer.cs: yield is no longer a keyword.
7892
7893 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7894
7895         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7896         setting for default constructors.
7897         For default constructors are almost every time set wrong Modifier. The
7898         generated IL code has been alright. But inside mcs this values was
7899         wrong and this was reason why several of my CLS Compliance tests
7900         failed.
7901
7902 2004-01-22  Martin Baulig  <martin@ximian.com>
7903
7904         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7905         not a QualifiedIdentifier.  This is what `type_name_expression'
7906         was previously doing.
7907         (type_name_expression): Removed; the code is now in
7908         `namespace_or_type_name'.
7909         (qualified_identifier): Removed, use `namespace_or_type_name'
7910         instead.
7911         (QualifiedIdentifier): Removed this class.      
7912
7913 2004-01-22  Martin Baulig  <martin@ximian.com>
7914
7915         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7916         not a string as alias name.
7917
7918 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7919
7920         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7921         #52730 bug, and instead compute correctly the need to use a
7922         temporary variable when requesting an address based on the
7923         static/instace modified of the field and the constructor.
7924  
7925 2004-01-21  Martin Baulig  <martin@ximian.com>
7926
7927         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7928         class and namespace before looking up aliases.  Fixes #52517.
7929
7930 2004-01-21  Martin Baulig  <martin@ximian.com>
7931
7932         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7933         assinged in a 'try'; fixes exception4.cs.
7934
7935 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7936         * class.cs : Implemented parameter-less constructor for TypeContainer
7937
7938         * decl.cs: Attributes are now stored here. New property OptAttributes
7939
7940         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7941
7942         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7943
7944 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7947           (CSharpSignature): New method for indexer and property signature.
7948
7949 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7950
7951         * pending.cs (IsVirtualFilter): Faster implementation.
7952
7953 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7954
7955         * typemanager.cs: Avoid inclusion of same assembly more than once.
7956
7957 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7958
7959         * cs-parser.jay: Fixed problem where the last assembly attribute
7960           has been applied also to following declaration (class, struct, etc.)
7961           
7962 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7963
7964         * class.cs: Added error CS0538, CS0539 reporting.
7965         Fixed crash on Microsoft runtime when field type is void.
7966
7967         * cs-parser.jay: Added error CS0537 reporting.
7968
7969         * pending.cs: Added error CS0535 reporting.
7970         Improved error report for errors CS0536, CS0534.
7971
7972 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7973
7974         Merge a few bits from the Anonymous Method MCS tree.
7975
7976         * statement.cs (ToplevelBlock): New class for toplevel methods,
7977         will hold anonymous methods, lifted variables.
7978
7979         * cs-parser.jay: Create toplevel blocks for delegates and for
7980         regular blocks of code. 
7981
7982 2004-01-20  Martin Baulig  <martin@ximian.com>
7983
7984         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7985         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7986         and `NeedExplicitReturn'; added `IsLastStatement'.
7987         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7988         have a `ReturnLabel' or we're not unreachable.
7989
7990         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7991         child's reachability; don't just override ours with it.  Fixes
7992         #58058 (lluis's example).
7993         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7994         InFinally(), InLoop(), InSwitch() and
7995         BreakCrossesTryCatchBoundary() methods.
7996
7997         * statement.cs (Return): Do all error checking in Resolve().
7998         Unless we are the last statement in a top-level block, always
7999         create a return label and jump to it.
8000         (Break, Continue): Do all error checking in Resolve(); also make
8001         sure we aren't leaving a `finally'.
8002         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8003         statement in a top-level block.
8004         (Block.Flags): Added `IsDestructor'.
8005         (Block.IsDestructor): New public property.
8006
8007 2004-01-20  Martin Baulig  <martin@ximian.com>
8008
8009         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8010
8011 2004-01-20  Martin Baulig  <martin@ximian.com>
8012
8013         * statement.cs (Statement.ResolveUnreachable): New public method.
8014         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8015         (Block.Resolve): Resolve unreachable statements.
8016
8017 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8018
8019         * expression.cs: We need to fix the case where we do
8020         not have a temp variable here.
8021
8022         * assign.cs: Only expression compound assignments need
8023         temporary variables.
8024
8025 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8026
8027         * flowanalysis.cs: Reduce memory allocation in a few ways:
8028           - A block with no variables should not allocate a bit
8029             vector for itself.
8030           - A method with no out parameters does not need any tracking
8031             for assignment of the parameters, so we need not allocate
8032             any data for it.
8033           - The arrays:
8034                 public readonly Type[] VariableTypes;
8035                 public readonly string[] VariableNames;
8036             Are redundant. The data is already stored in the variable
8037             map, so we need not allocate another array for it.
8038           - We need to add alot of checks for if (params | locals) == null
8039             due to the first two changes.
8040
8041 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8042
8043         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8044         implement IMemoryLocation, we store a copy on a local variable and
8045         take the address of it.  Patch from Benjamin Jemlich
8046
8047         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8048         to use a special "type_name_expression" rule which reduces the
8049         number of "QualifiedIdentifier" classes created, and instead
8050         directly creates MemberAccess expressions.
8051
8052 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8053
8054         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8055         that fixes #52853.  Null literal assignment to ValueType
8056
8057         * class.cs (MethodData.Emit): Instead of checking the name of the
8058         method to determine if its a destructor, create a new derived
8059         class from Method called Destructor, and test for that.  
8060
8061         * cs-parser.jay: Create a Destructor object instead of a Method.  
8062
8063         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8064
8065         Fixes: 52933
8066
8067 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8068
8069         * expression.cs (Binary.ResolveOperator): Perform an implicit
8070         conversion from MethodGroups to their delegate types on the
8071         Addition operation.
8072
8073         * delegate.cs: Introduce a new class DelegateCreation that is the
8074         base class for `NewDelegate' and `ImplicitDelegateCreation',
8075         factor some code in here.
8076
8077         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8078         conversion from MethodGroups to compatible delegate types. 
8079
8080         * ecore.cs (Expression.Resolve): Do not flag error 654
8081         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8082         we allow conversions from MethodGroups to delegate types now.
8083
8084         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8085         assignments in v2 either.
8086
8087 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8088
8089         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8090         static read-only fields in ctors.
8091
8092         Applied patch from Benjamin Jemlich 
8093
8094         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8095
8096 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8097
8098         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8099         here to return true, as they can be used like this:
8100
8101                 (XXX) int.MEMBER ()
8102
8103         Fixed 49836 and all the other dups
8104
8105 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8106
8107         * driver.cs: Implement /win32res and /win32icon.
8108
8109 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8110
8111         * cs-parser.jay: Add a rule to improve error handling for the
8112         common mistake of placing modifiers after the type.
8113
8114 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8115
8116         * cs-parser.jay (interface_event_declaration): Catch
8117         initialization of events on interfaces, and report cs0068
8118
8119         * cs-parser.jay (interface_event_declaration): Catch
8120         initialization of events. 
8121
8122         * ecore.cs: Better report missing constructors.
8123
8124         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8125         the error reporting done in the wrong place.  Fix.
8126
8127         * expression.cs (Binary.ResolveOperator): Catch the 
8128         operator + (E x, E y) error earlier, and later allow for implicit
8129         conversions in operator +/- (E e, U x) from U to the underlying
8130         type of E.
8131
8132         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8133         52596, if the container class is abstract, the default constructor
8134         is protected otherwise its public (before, we were always public).
8135
8136         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8137         fixed statement.
8138
8139         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8140         Jemlich that fixes bug #52597, MCS was generating invalid code for
8141         idisposable structs.   Thanks to Ben for following up with this
8142         bug as well.
8143
8144 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8145
8146         * driver.cs: Allow assemblies without code to be generated, fixes
8147         52230.
8148
8149 2004-01-07  Nick Drochak <ndrochak@gol.com>
8150
8151         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8152
8153 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8154
8155         * cs-parser.jay: Add rules to improve error reporting if fields or
8156         methods are declared at the namespace level (error 116)
8157
8158         * Add rules to catch event add/remove
8159
8160 2004-01-04  David Sheldon <dave-mono@earth.li>
8161
8162   * expression.cs: Added matching ")" to error message for 
8163   CS0077
8164
8165 2004-01-03 Todd Berman <tberman@gentoo.org>
8166
8167         * ecore.cs, attribute.cs:
8168         Applying fix from #52429.
8169
8170 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8171
8172         * ecore.cs, expression.cs, statement.cs:
8173         Total rewrite of how we handle branching. We
8174         now handle complex boolean expressions with fewer
8175         jumps. As well if (x == 0) no longer emits a ceq.
8176
8177         if (x is Foo) is much faster now, because we generate
8178         better code.
8179
8180         Overall, we get a pretty big improvement on our benchmark
8181         tests. The code we generate is smaller and more readable.
8182
8183         I did a full two-stage bootstrap. The patch was reviewed
8184         by Martin and Miguel.
8185
8186 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8187
8188         * cs-parser.jay: Make primary_expression not take a QI.
8189         we dont need this because the member_access rule covers
8190         us here. So we replace the rule with just IDENTIFIER.
8191
8192         This has two good effects. First, we remove a s/r conflict.
8193         Second, we allocate many fewer QualifiedIdentifier objects.
8194
8195 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8196
8197         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8198         set the correct information via SRE. This prevents
8199         hanging on the MS runtime. Fixes #29374.
8200
8201 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8202
8203         * convert.cs: correctly handle conversions to value types
8204         from Enum and ValueType as unboxing conversions.
8205
8206         Fixes bug #52569. Patch by Benjamin Jemlich.
8207
8208 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8209
8210         * expression.cs (BetterConversion): Prefer int -> uint
8211         over int -> ulong (csc's behaviour). This fixed bug #52046.
8212
8213 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8214
8215         * decl.cs (MemberCache.FindMembers): now returns a
8216         MemberInfo [].
8217
8218         * typemanager.cs: In general, go with with ^^.
8219         (CopyNewMethods): take an IList.
8220         (RealMemberLookup): Only allocate an arraylist
8221         if we copy from two sets of methods.
8222
8223         This change basically does two things:
8224         1) Fewer array lists allocated due to CopyNewMethods.
8225         2) the explicit cast in MemberList costed ALOT.
8226
8227 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8228
8229         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8230         a hashtable to avoid needless string allocations when an identifier is
8231         used more than once (the common case).
8232
8233 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8234
8235         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8236         is broken, it will not return anything. So, we
8237         have to use the information we have in mcs to
8238         do the task.
8239
8240         * typemanager.cs: Add a cache for GetInterfaces,
8241         since this will now be used more often (due to ^^)
8242
8243         (GetExplicitInterfaces) New method that gets the
8244         declared, not effective, interfaces on a type
8245         builder (eg, if you have interface IFoo, interface
8246         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8247         { IBar }.
8248
8249         This patch makes MCS able to bootstrap itself on
8250         Windows again.
8251
8252 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8253
8254         * expression.cs: Remove the Nop's that Miguel put
8255         in by mistake.
8256
8257 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8258
8259         * report.cs, codegen.cs: Give the real stack trace to
8260         the error when an exception is thrown.
8261
8262 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8263
8264         * decl.cs: only allocate hashtables for ifaces if 
8265         it is an iface!
8266
8267 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8268
8269         * expression.cs: fix the error from cs0121-2.cs
8270         (a parent interface has two child interfaces that
8271         have a function with the same name and 0 params
8272         and the function is called through the parent).
8273
8274 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8275
8276         * class.cs, rootcontext.cs, typmanager.cs: do not
8277         leak pointers.
8278
8279 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8280
8281         * codegen.cs: remove stack for the ec flow branching.
8282         It is already a linked list, so no need.
8283
8284 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8285
8286         * Makefile: Allow custom profiler here.
8287
8288 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8289
8290         * typemanager.cs (LookupType):
8291           - Use a static char [], because split takes
8292             a param array for args, so it was allocating
8293             every time.
8294           - Do not store true in a hashtable, it boxes.
8295
8296 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8297
8298         * flowanalysis.cs: bytify common enums.
8299
8300 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8301
8302         * modifiers.cs: Add a new set of flags for the
8303         flags allowed on explicit interface impls.
8304         * cs-parser.jay: catch the use of modifiers in
8305         interfaces correctly.
8306         * class.cs: catch private void IFoo.Blah ().
8307
8308         All related to bug #50572.
8309
8310 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8311
8312         * decl.cs: Rewrite the consistant accessability checking.
8313         Accessability is not linear, it must be implemented in
8314         a tableish way. Fixes #49704.
8315
8316 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8317
8318         * expression.cs: Handle negation in a checked context.
8319         We must use subtraction from zero. Fixes #38674.
8320
8321 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8322
8323         * class.cs: Ignore static void main in DLLs.
8324         * rootcontext.cs: Handle the target type here,
8325         since we are have to access it from class.cs
8326         * driver.cs: account for the above.
8327
8328 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8329
8330         * report.cs: Give line numbers and files if available.
8331
8332 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8333
8334         * driver.cs: Implement /addmodule.
8335
8336         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8337         ModuleBuilders.
8338
8339 2003-12-20  Martin Baulig  <martin@ximian.com>
8340
8341         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8342         (FieldBase.IsAssigned): Removed this field.
8343         (FieldBase.SetAssigned): New public method.
8344         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8345
8346 2003-12-20  Martin Baulig  <martin@ximian.com>
8347
8348         * expression.cs (LocalVariableReference.DoResolve): Don't set
8349         `vi.Used' if we're called from DoResolveLValue().
8350
8351         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8352         returns the usage vector it just merged into the current one -
8353         pass this one to UsageWarning().
8354         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8355         of the `EmitContext', don't call this recursively on our children.
8356
8357 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8358
8359         * driver.cs: Implement /target:module.
8360
8361 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8362
8363         * support.cs (CharArrayHashtable): New helper class.
8364
8365         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8366         char arrays, not strings, so we can avoid creating a string in
8367         consume_identifier if the identifier is a keyword.
8368
8369 2003-12-16  Martin Baulig  <martin@ximian.com>
8370
8371         * statement.cs (LocalInfo.Assigned): Removed this property.
8372         (LocalInfo.Flags): Removed `Assigned'.
8373         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8374         and uses flow analysis.
8375         (Block.UsageWarning): Made this method private.
8376         (Block.Resolve): Call UsageWarning() if appropriate.
8377
8378         * expression.cs (LocalVariableReference.DoResolve): Always set
8379         LocalInfo.Used here.
8380
8381 2003-12-13  Martin Baulig  <martin@ximian.com>
8382
8383         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8384         any value here; we're now using flow analysis to figure out
8385         whether a statement/block returns a value.
8386
8387 2003-12-13  Martin Baulig  <martin@ximian.com>
8388
8389         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8390         working again.
8391         (FlowBranching.MergeFinally): Don't call
8392         `branching.CheckOutParameters()' here, this is called in
8393         MergeTopBlock().
8394         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8395         when adding the `finally' vector.       
8396
8397 2003-12-13  Martin Baulig  <martin@ximian.com>
8398
8399         * flowanalysis.cs
8400         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8401         actually work and also fix #48962.
8402
8403 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8404
8405         * decl.cs: Do not check System.Object for nested types,
8406         since we know it does not have any. Big bang for buck:
8407
8408         BEFORE:
8409            Run 1:   8.35 seconds
8410            Run 2:   8.32 seconds
8411            corlib:  17.99 seconds
8412         AFTER:
8413            Run 1:   8.17 seconds
8414            Run 2:   8.17 seconds
8415            corlib:  17.39 seconds
8416
8417 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8418
8419         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8420         time we are returning 0 members, so we save alot here.
8421
8422 2003-12-11  Martin Baulig  <martin@ximian.com>
8423
8424         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8425         `MergeChild()', also just take the `FlowBranching' as argument;
8426         call Merge() on it and return the result.
8427         (FlowBranching.Merge): We don't need to do anything if we just
8428         have one sibling.
8429
8430 2003-12-11  Martin Baulig  <martin@ximian.com>
8431
8432         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8433         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8434         Maurer for this idea.
8435
8436 2003-12-11  Martin Baulig  <martin@ximian.com>
8437
8438         * flowanalysis.cs (MergeResult): This class is now gone; we now
8439         use the `UsageVector' for this.  The reason for this is that if a
8440         branching just has one sibling, we don't need to "merge" them at
8441         all - that's the next step to do.
8442         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8443         `MergeResult'.
8444
8445 2003-12-11  Martin Baulig  <martin@ximian.com>
8446
8447         Reworked flow analyis and made it more precise and bug-free.  The
8448         most important change is that we're now using a special `Reachability'
8449         class instead of having "magic" meanings of `FlowReturns'.  I'll
8450         do some more cleanups and optimizations and also add some more
8451         documentation this week.
8452
8453         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8454         largely reworked this class.
8455         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8456         the new `Reachability' class instead of having "magic" values here.
8457         (FlowBranching): We're now using an instance of `Reachability'
8458         instead of having separate `Returns', `Breaks' etc. fields.
8459
8460         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8461         based on flow analysis; ignore the return value of block.Emit ().
8462
8463 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8464
8465         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8466         if they are private.
8467
8468 2003-12-09  Martin Baulig  <martin@ximian.com>
8469
8470         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8471         call them directly on the UsageVector.
8472
8473 2003-12-09  Martin Baulig  <martin@ximian.com>
8474
8475         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8476         Changed return type from `FlowReturns' to `Reachability'.
8477
8478 2003-12-09  Martin Baulig  <martin@ximian.com>
8479
8480         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8481         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8482         `Reachable' fields with a single `Reachability' one.
8483
8484 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8485
8486         * class.cs (FindMembers): Remove foreach's.
8487
8488         Bootstrap times:
8489
8490         BEFORE
8491                 Run 1:   8.74 seconds
8492                 Run 2:   8.71 seconds
8493
8494         AFTER
8495                 Run 1:   8.64 seconds
8496                 Run 2:   8.58 seconds
8497
8498
8499 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8500
8501         * cs-parser.jay:
8502         * gen-treedump.cs:
8503         * statement.cs:
8504         This patch does a few things:
8505                 1. EmptyStatement is now a singleton, so it is never reallocated.
8506                 2. All blah is EmptyStatement constructs have been changed to
8507                    blah == EmptyStatement.Value, which is much faster and valid
8508                    now that EmptyStatement is a singleton.
8509                 3. When resolving a block, rather than allocating a new array for
8510                    the non-empty statements, empty statements are replaced with
8511                    EmptyStatement.Value
8512                 4. Some recursive functions have been made non-recursive.
8513         Mainly the performance impact is from (3), however (1) and (2) are needed for
8514         this to work. (4) does not make a big difference in normal situations, however
8515         it makes the profile look saner.
8516
8517         Bootstrap times:
8518
8519         BEFORE
8520         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8521         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8522         Total memory allocated: 56397 KB
8523
8524         AFTER
8525         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8526         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8527         Total memory allocated: 55666 KB
8528
8529 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8530
8531         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8532         than the hashtable in a hashtable version
8533
8534         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8535         we always end up concating a string. This results in a huge perf
8536         loss, because many strings have to be tracked by the GC. In this
8537         patch, we first use a hashtable that works with two keys, so that
8538         the strings do not need to be concat'ed.
8539
8540         Bootstrap times:
8541         BEFORE
8542                 Run 1:   8.74 seconds
8543                 Run 2:   8.71 seconds
8544
8545         AFTER
8546                 Run 1:   8.65 seconds
8547                 Run 2:   8.56 seconds
8548
8549 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8550
8551         * Makefile: Add a new target `do-time' that does a quick and simple
8552         profile, leaving easy to parse output.
8553
8554 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8555
8556         * codegen.cs (Init): Create the dynamic assembly with 
8557         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8558
8559 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8560
8561         * support.cs: Make the PtrHashtable use only one
8562         instance of its comparer.
8563
8564 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8565
8566         * typemanager.cs: Fix lookup of GetNamespaces.
8567
8568 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8569
8570         * expression.cs: Removed redundant line.
8571
8572         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8573         ArrayLists, use for loops with bounds.  
8574
8575         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8576         arraylist.
8577
8578         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8579         arraylists, use for loop with bounds.
8580
8581         The above three changes give us a 0.071 second performance
8582         improvement out of 3.294 seconds down to 3.223.  On my machine
8583         the above changes reduced the memory usage by 1,387 KB during
8584         compiler bootstrap.
8585
8586         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8587         QualifiedIdentifiers.  Before we created a new string through
8588         concatenation, and mostly later on, the result would be
8589         manipulated by DecomposeQI through string manipulation.
8590
8591         This reduced the compiler memory usage for bootstrapping from
8592         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8593         compile times in 0.05 seconds.
8594
8595 2003-11-28  Dick Porter  <dick@ximian.com>
8596
8597         * support.cs: Do string compares with the Invariant culture.
8598
8599         * rootcontext.cs: 
8600         * gen-treedump.cs: 
8601         * expression.cs: 
8602         * driver.cs: 
8603         * decl.cs: 
8604         * codegen.cs: 
8605         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8606         the comparison is done with the Invariant culture.
8607
8608 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8609
8610         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8611         GetEnumerator method.
8612
8613         (ProbeCollectionType): Iterate starting at the most specific type
8614         upwards looking for a GetEnumerator
8615
8616         * expression.cs: Shift count can be up to 31 for int/uint and 63
8617         for long/ulong.
8618
8619 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8620
8621         * statement.cs (Block.LookupLabel): Also look for the label on the
8622         children blocks.  Use a hash table to keep track of visited
8623         nodes. 
8624
8625         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8626         we actually did transform the other operand, otherwise fall back
8627         to the common codepath that casts to long.
8628
8629         * cs-tokenizer.cs: Use the same code pattern as the int case.
8630         Maybe I should do the parsing myself, and avoid depending on the
8631         Parse routines to get this done.
8632
8633 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8634
8635         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8636         which fixes bug 51347.  This time test it.
8637
8638         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8639         attributes for example can not tell the difference between these.
8640         The difference was only a syntax feature of the language. 
8641
8642         * attribute.cs: Apply attributes to delegates.
8643
8644         * delegate.cs: Call the apply attributes method.
8645
8646 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8647
8648         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8649         comparing 0 vs Byte.MinValue, not the value
8650
8651         (ImplicitConversionRequired): When reporting a conversion error,
8652         use error 31 to print out the constant error instead of the
8653         simpler 29.
8654
8655         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8656         which fixes bug 51347.
8657
8658 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8659
8660         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8661         which fixes the -warnaserror command line option.
8662
8663 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8664
8665         * cfold.cs (DoNumericPromotions): During constant folding of
8666         additions on UIntConstant, special case intconstants with
8667         IntConstants like we do on the expression binary operator. 
8668
8669 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8670
8671         * convert.cs (ImplicitReferenceConversion): We were missing a case
8672         (System.Enum are not value types or class types, so we need to
8673         classify them separatedly).
8674
8675         * driver.cs: We do not support error 2007.
8676
8677 2003-11-12 Jackson Harper <jackson@ximian.com>
8678
8679         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8680         system directory. Also use the full file name so users can
8681         libraries names mscorlib-o-tron.dll in a non system dir.
8682
8683 2003-11-10  Martin Baulig  <martin@ximian.com>
8684
8685         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8686         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8687         calling `ResolveType()' on them, directly assign their `Type'.
8688
8689 2003-11-08  Martin Baulig  <martin@ximian.com>
8690
8691         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8692         return value and the `out parent' parameter.
8693         (TypeContainer.DefineType): Moved the CS0644 check into
8694         GetClassBases().  Don't pass the interface types to the
8695         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8696         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8697
8698         * ecore.cs (TypeExpr.IsAttribute): New property.
8699         (TypeExpr.GetInterfaces): New method.
8700
8701         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8702         TypeExpr instead of a Type.
8703         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8704         (Interface.DefineType): Don't pass the interface types to the
8705         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8706         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8707
8708         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8709         instead of a `Type[]'.
8710         (TypeManager.RegisterBuilder): Likewise.
8711         (TypeManager.AddUserInterface): Likewise.
8712         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8713         `Type[]' and also return a `TypeExpr[]'.
8714         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8715
8716 2003-11-08  Martin Baulig  <martin@ximian.com>
8717
8718         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8719         Expression.     
8720
8721 2003-11-08  Martin Baulig  <martin@ximian.com>
8722
8723         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8724         TypeManager.ResolveExpressionTypes().
8725
8726         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8727         instead of an Expression.
8728         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8729         (TypeExpression): New public class; formerly known as `TypeExpr'.
8730
8731         * expression.cs (ComposedCast): Derive from TypeExpr.
8732
8733         * typemanager.cs (TypeManager.system_*_expr): These are now
8734         TypExpr's instead of Expression's.
8735         (TypeManager.ResolveExpressionTypes): New public static function;
8736         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8737         of them.        
8738
8739 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8740
8741         * expression.cs (New.DoResolve): Do not dereference value that
8742         might be a null return.
8743
8744         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8745         sure that the constant value has the right type.  Fixes an
8746         unreported bug, similar to 50425.
8747
8748         * const.cs (Const.LookupConstantValue): Call
8749         ImplicitStandardConversionExists before doing a conversion to
8750         avoid havng the TypeManager.ChangeType do conversions.
8751
8752         Reduced the number of casts used
8753
8754         (Const.ChangeType): New routine to enable reuse of the constant
8755         type changing code from statement.
8756
8757         * typemanager.cs (ChangeType): Move common initialization to
8758         static global variables.
8759
8760         Fixes #50425.
8761
8762         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8763         every value type to go through, even if it was void.  Fix that. 
8764
8765         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8766         character of the define, and the is_identifier_part_character for
8767         the rest of the string.
8768
8769 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8770
8771         * expression.cs (UnaryMutator.EmitCode): When I updated
8772         LocalVariableReference.DoResolve, I overdid it, and dropped an
8773         optimization done on local variable references.
8774
8775 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * ecore.cs: Convert the return from Ldlen into an int.
8778
8779 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8782         the accessibility, this is a special case for toplevel non-public
8783         classes (internal for instance).
8784
8785 2003-10-20  Nick Drochak <ndrochak@gol.com>
8786
8787         * ecore.cs: Fix typo and build.  Needed another right paren.
8788
8789 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8790
8791         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8792         `internal' case regular and protected, but not allowing protected
8793         to be evaluated later.  Bug 49840
8794
8795 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8796
8797         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8798         to kb.Nlast, and not the kb.nFirst to isolate the switch
8799         statement.
8800
8801         Extract the underlying type, so enumerations of long/ulong are
8802         treated like long/ulong.
8803
8804 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8805
8806         * expression.cs (New): Overload the meaning of RequestedType to
8807         track the possible creation of the NewDelegate type, since
8808         DoResolve is invoked more than once for new constructors on field
8809         initialization.
8810
8811         See bugs: #48800 and #37014
8812
8813         * cs-parser.jay (declare_local_constants): Take an arraylist
8814         instead of a single constant.
8815
8816         (local_constant_declaration): It should take a
8817         constant_declarators, not a constant_declarator.  Fixes 49487
8818
8819         * convert.cs: Fix error report.
8820
8821 2003-10-13 Jackson Harper <jackson@ximian.com>
8822
8823         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8824         bug #49611
8825
8826 2003-10-09  Martin Baulig  <martin@ximian.com>
8827
8828         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8829         to the .ctor.
8830         (MethodCore.DoDefineParameters): Removed the TypeContainer
8831         argument; use the DeclSpace which was passed to the .ctor instead.
8832         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8833         TypeContainer; we only need a DeclSpace here.
8834
8835 2003-10-09  Martin Baulig  <martin@ximian.com>
8836
8837         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8838         to the .ctor.
8839         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8840         EmitContext's .ctor.    
8841
8842 2003-10-09  Martin Baulig  <martin@ximian.com>
8843
8844         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8845         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8846         AsAccessible(), moved them as well.
8847
8848         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8849
8850 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8851
8852         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8853
8854 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8855
8856         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8857         generation for >=, as spotted by Paolo, bug 48679.  
8858         Patch from David Waite.
8859
8860         * cs-tokenizer.cs: Add handling for #pragma.
8861
8862         * cs-parser.jay: Allow for both yield and yield return in the
8863         syntax.  The anti-cobolization of C# fight will go on!
8864
8865         * class.cs (TypeBuilder.DefineType): Catch error condition here
8866         (Parent.DefineType erroring out and returning null).
8867
8868         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8869         coping with enumerations variables, we were mistakenly processing
8870         them as a regular value type instead of built-in types.  Fixes the
8871         bug #48063
8872
8873         * typemanager.cs (IsBuiltinOrEnum): New method.
8874
8875 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8876
8877         * cs-parser.jay: Upgrade: yield now needs the return clause.
8878
8879 2003-09-19  Martin Baulig  <martin@ximian.com>
8880
8881         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8882         `MemberCache parent' argument.  Normally, an interface doesn't
8883         have a parent type except System.Object, but we use this in gmcs
8884         for generic type parameters.
8885
8886 2003-09-18  Martin Baulig  <martin@ximian.com>
8887
8888         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8889         on `type.IsInterface'; don't check whether the type has a parent
8890         to determine whether it's an interface.
8891
8892 2003-09-15  Martin Baulig  <martin@ximian.com>
8893
8894         * class.cs (TypeContainer.DefineType): Added an error flag to
8895         avoid reporting duplicate CS0146's ("class definition is
8896         circular.").
8897
8898         * driver.cs (Driver.MainDriver): Abort if
8899         RootContext.ResolveTree() reported any errors.
8900
8901 2003-09-07  Martin Baulig  <martin@ximian.com>
8902
8903         * report.cs (Error, Warning): Added overloaded versions which take
8904         a `params object[] args' and call String.Format().
8905
8906 2003-09-07  Martin Baulig  <martin@ximian.com>
8907
8908         * decl.cs (DeclSpace..ctor): Don't call
8909         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8910         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8911         (DeclSpace.RecordDecl): New method.
8912
8913         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8914
8915 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8916
8917         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8918         value attributes to be applied to ParameterBuilders.
8919
8920         * class.cs (MethodCore.LabelParameters): Make static and more
8921         generic so that it can be used from other places - like interface
8922         methods, for instance.
8923
8924         * interface.cs (Interface.Emit): Call LabelParameters before
8925         emitting attributes on the InterfaceMethod.
8926
8927 2003-08-26  Martin Baulig  <martin@ximian.com>
8928
8929         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8930         resolving aliases; fixes #47927.
8931
8932 2003-08-26  Martin Baulig  <martin@ximian.com>
8933
8934         * statement.cs (Using.DoResolve): This is internally emitting a
8935         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8936         do not always return.  Fixes #47681.
8937
8938 2003-08-26  Martin Baulig  <martin@ximian.com>
8939
8940         * decl.cs (MemberCore): Moved WarningNotHiding(),
8941         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8942         into MemberBase.
8943         (AdditionResult): Make this nested in DeclSpace.
8944         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8945         argument; call NamespaceEntry.Define() unless we're nested in a
8946         class or struct.
8947
8948         * namespace.cs (Namespace.DefineName): New public function.  This
8949         is called from DeclSpace's .ctor to add 
8950         (Namespace.Lookup): Include DeclSpaces in the lookup.
8951
8952         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8953
8954         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8955
8956 2003-08-25  Martin Baulig  <martin@ximian.com>
8957
8958         * convert.cs (Convert.ExplicitReferenceConversion): When
8959         converting from an interface type to a class, unbox if the target
8960         type is a struct type.  Fixes #47822.
8961
8962 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8963
8964         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8965         #47854.
8966
8967 2003-08-22  Martin Baulig  <martin@ximian.com>
8968
8969         * class.cs (TypeManager.DefineType): When defining a nested type,
8970         call DefineType() on our parent; fixes #47801.
8971
8972 2003-08-22  Martin Baulig  <martin@ximian.com>
8973
8974         * class.cs (MethodData.Define): While checking if a method is an
8975         interface implementation, improve the test a bit more to fix #47654.
8976
8977 2003-08-22  Martin Baulig  <martin@ximian.com>
8978
8979         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8980         correctly; fixes #47722.
8981
8982 2003-08-22  Martin Baulig  <martin@ximian.com>
8983
8984         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8985         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8986
8987         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8988
8989 2003-08-22  Martin Baulig  <martin@ximian.com>
8990
8991         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8992         can only be assigned in static constructors.  Fixes #47161.
8993
8994 2003-08-22  Martin Baulig  <martin@ximian.com>
8995
8996         Rewrote and improved the flow analysis code.
8997
8998         * flowbranching.cs (FlowBranching): Make this class abstract.
8999         (FlowBranching.CreateBranching): New static function to create a
9000         new flow branching.
9001         (FlowBranchingBlock, FlowBranchingException): New classes.
9002         (FlowBranching.UsageVector.Type): New public readonly field.
9003         (FlowBranching.UsageVector.Breaks): Removed the setter.
9004         (FlowBranching.UsageVector.Returns): Removed the setter.
9005         (FlowBranching.UsageVector): Added Break(), Return(),
9006         NeverReachable() and Throw() methods to modify the reachability.
9007         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9008         done by FlowBranching.Merge().
9009         (FlowBranching.UsageVector.MergeChild): New method; merges the
9010         merge result into the current vector.
9011         (FlowBranching.Merge): New abstract method to merge a branching.
9012
9013 2003-08-12  Martin Baulig  <martin@ximian.com>
9014
9015         * expression.cs (Indirection.CacheTemporaries): Create the
9016         LocalTemporary with the pointer type, not its element type.
9017
9018 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9019
9020         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9021         token was a keyword or not.
9022
9023         Add `error' options where an IDENTIFIER was expected;  Provide
9024         CheckToken and CheckIdentifierToken convenience error reporting
9025         functions. 
9026
9027         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9028
9029         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9030         NameSpaceEntry NameSpaceEntry.
9031
9032         (LookupInterfaceOrClass): Avoid creating a full qualified name
9033         from namespace and name: avoid doing lookups when we know the
9034         namespace is non-existant.   Use new Tree.LookupByNamespace which
9035         looks up DeclSpaces based on their namespace, name pair.
9036
9037         * driver.cs: Provide a new `parser verbose' to display the
9038         exception thrown during parsing.  This is turned off by default
9039         now, so the output of a failure from mcs is more graceful.
9040
9041         * namespace.cs: Track all the namespaces defined in a hashtable
9042         for quick lookup.
9043
9044         (IsNamespace): New method
9045
9046 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9047
9048         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9049         we know that we need to concatenate (full typename can never be
9050         null). 
9051
9052         * class.cs: ditto.
9053
9054         * statement.cs: Use a bitfield;  Do not initialize to null things
9055         which are done by the constructor by default.
9056
9057         * cs-parser.jay: bug fix, parameter was 4, not 3.
9058
9059         * expression.cs: Just use the property;
9060
9061         * statement.cs: No need for GetVariableInfo method.
9062
9063 2003-08-08  Martin Baulig  <martin@ximian.com>
9064
9065         * flowanalysis.cs (FlowReturns): This is now nested in the
9066         `FlowBranching' class.
9067         (MyBitVector): Moved this here from statement.cs.
9068         (FlowBranching.SiblingType): New enum type.
9069         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9070
9071 2003-08-07  Martin Baulig  <martin@ximian.com>
9072
9073         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9074         `FlowBranching' class and called `BranchingType'.
9075
9076 2003-08-07  Martin Baulig  <martin@ximian.com>
9077
9078         * flowanalysis.cs: Moved all the control flow analysis code into
9079         its own file.
9080
9081 2003-08-07  Martin Baulig  <martin@ximian.com>
9082
9083         * assign.cs (Assign.DoResolve): `target' must either be an
9084         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9085         #37319.
9086
9087 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9088
9089         * expression.cs (BinaryMethod): This kind of expression is created by the
9090         Binary class if it determines that the operator has to be handled
9091         by a method.
9092
9093         (BinaryDelegate): This kind of expression is created if we are
9094         dealing with a + or - operator on delegates.
9095
9096         (Binary): remove method, argumetns, and DelegateOperator: when
9097         dealing with methods, 
9098
9099         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9100
9101         * statement.cs (Block): use bitfields for the three extra booleans
9102         we had in use.   Remove unused topblock parameter.
9103
9104         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9105
9106         * assign.cs: Drop extra unneeded tests.
9107
9108 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9109
9110         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9111
9112         * statement.cs (Foreach): Use VariableStorage instead of
9113         LocalBuilders.   
9114
9115         * codegen.cs (VariableStorage): New class used by clients that
9116         require a variable stored: locals or fields for variables that
9117         need to live across yield.
9118
9119         Maybe provide a convenience api for EmitThis+EmitLoad?
9120
9121         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9122         these bad boys.
9123
9124 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9125
9126         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9127         RemapParameterLValue): New methods that are used to turn a
9128         precomputed FieldInfo into an expression like this:
9129
9130                 instance.FieldInfo
9131
9132         The idea is to use this instead of making LocalVariableReference
9133         have more than one meaning.
9134
9135         * cs-parser.jay: Add error production to BASE.
9136
9137         * ecore.cs: Deal with TypeManager.GetField returning null, which
9138         is now a valid return value.
9139
9140         (FieldExprNoAddress): New expression for Fields whose address can
9141         not be taken.
9142
9143         * expression.cs (LocalVariableReference): During the resolve
9144         phases, create new expressions if we are in a remapping context.
9145         Remove code that dealt with remapping here.
9146
9147         (ParameterReference): same.
9148
9149         (ProxyInstance): New expression, like the `This' expression, but
9150         it is born fully resolved.  We know what we are doing, so remove
9151         the errors that are targeted to user-provided uses of `this'.
9152
9153         * statement.cs (Foreach): our variable is now stored as an
9154         Expression;  During resolution, follow the protocol, dont just
9155         assume it will return this.
9156
9157 2003-08-06  Martin Baulig  <martin@ximian.com>
9158
9159         * support.cs (SeekableStreamReader.cs): New public class.
9160
9161         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9162         SeekableStreamReader instead of the normal StreamReader.
9163
9164 2003-08-04  Martin Baulig  <martin@ximian.com>
9165
9166         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9167         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9168         deambiguate casts and delegate invocations.
9169         (parenthesized_expression): Use the new tokens to ensure this is
9170         not a cast of method invocation.
9171
9172         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9173         when reading a `)' and Deambiguate_CloseParens () was previously
9174         called.
9175
9176         * expression.cs (ParenthesizedExpression): New class.  This is
9177         just used for the CS0075 test.
9178         (Binary.DoResolve): Check for CS0075.   
9179
9180 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9181
9182         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9183         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9184         reference comparison.
9185
9186         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9187         examine the ReturnType for equality - this is necessary in the
9188         cases of implicit and explicit operators whose signature also
9189         includes the return type.
9190
9191 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9192
9193         * namespace.cs: Cache the result of the namespace computation,
9194         instead of computing it every time.
9195
9196 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9197
9198         * decl.cs: Use a global arraylist that we reuse over invocations
9199         to avoid excesive memory consumption.  Reduces memory usage on an
9200         mcs compile by one meg (45 average).
9201
9202         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9203         private, work around that.
9204
9205 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9206
9207         * literal.cs (IntLiteral): Define Zero and One static literals. 
9208
9209         * cs-parser.jay (integer_literal): use static literals to reduce
9210         memory usage for the most used literals (0, 1 and -1).  211kb
9211         reduced in memory usage.
9212
9213         Replace all calls to `new ArrayList' with `new
9214         ArrayList(4)' which is a good average number for most allocations,
9215         and also requires only 16 bytes of memory for its buffer by
9216         default. 
9217
9218         This reduced MCS memory usage in seven megabytes for the RSS after
9219         bootstrapping.
9220
9221 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9222
9223         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9224         handle params methods the correct way by forming only one
9225         applicable set with params and normal methods in them. Earlier we
9226         were looking at params methods only if we found no normal methods
9227         which was not the correct thing to do.
9228
9229         (Invocation.BetterFunction): Take separate arguments indicating
9230         when candidate and the best method are params methods in their
9231         expanded form.
9232
9233         This fixes bugs #43367 and #46199.
9234
9235         * attribute.cs: Documentation updates.
9236
9237         (CheckAttribute): Rename to CheckAttributeTarget.
9238         (GetValidPlaces): Rename to GetValidTargets.
9239
9240         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9241         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9242
9243         Fixes bug #44468.
9244
9245 2003-07-28  Martin Baulig  <martin@ximian.com>
9246
9247         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9248         name when looking up the base class of a nested class.  Fixes #46977.
9249
9250 2003-07-26  Martin Baulig  <martin@ximian.com>
9251
9252         * expression.cs (Indexers.Indexer): New nested struct; contains
9253         getter, setter and the indexer's type.
9254         (Indexers.Properties): This is now an ArrayList of
9255         Indexers.Indexer's.
9256         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9257         indexer doesn't have any getters.
9258
9259         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9260         for embedded property and indexer assignments.
9261
9262 2003-07-26  Martin Baulig  <martin@ximian.com>
9263
9264         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9265         preprocessor directive is not the first non-whitespace character
9266         on a line.
9267
9268 2003-07-26  Martin Baulig  <martin@ximian.com>
9269
9270         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9271         namespace parsing, follow the spec more closely.
9272
9273         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9274         NamespaceEntry.Lookup().
9275
9276 2003-07-25  Martin Baulig  <martin@ximian.com>
9277
9278         * MethodCore.cs (OverridesSomething): New public field; it's set
9279         from TypeContainer.DefineMembers if this method overrides
9280         something (which doesn't need to be a method).  Fix #39462.
9281
9282 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9283
9284         * typemanager.cs (GetMembers): Ensure that the list of members is
9285         reversed. This keeps things in sync.
9286
9287         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9288         find an AttributeUsage attribute.
9289
9290         * expression.cs (Invocation.OverloadResolve): Perform the check
9291         which disallows Invoke to be directly called on a Delegate.
9292
9293         (Error_InvokeOnDelegate): Report error cs1533.
9294
9295 2003-07-25  Martin Baulig  <martin@ximian.com>
9296
9297         * expression.cs (Indexers.GetIndexersForType): Only look in the
9298         interface hierarchy if the requested type is already an
9299         interface.  Fixes #46788 while keeping #46502 fixed.
9300
9301 2003-07-25  Martin Baulig  <martin@ximian.com>
9302
9303         * class.cs (TypeContainer.DefineMembers): Check whether all
9304         readonly fields have been assigned and report warning CS0649 if
9305         not.
9306
9307         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9308         a valuetype.
9309
9310 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9311
9312         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9313         returned from GetMethods to make things consistent with the
9314         assumptions MCS makes about ordering of methods.
9315
9316         This should comprehensively fix bug #45127 and it does :-)
9317
9318         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9319         ordering is actually reverse.
9320
9321         * Clean up some debug messages I left lying around.
9322
9323         * interface.cs (Populate*): Get rid of code which emits attributes
9324         since the stage in which we emit attributes is the 'Emit' stage,
9325         not the define stage.
9326
9327         (Emit): Move attribute emission for interface members here.
9328
9329 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9330
9331         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9332         closely: we eliminate methods in base types when we have an
9333         applicable method in a top-level type.
9334
9335         Please see section 14.5.5.1 for an exact description of what goes
9336         on. 
9337
9338         This fixes bug #45127 and a host of other related to corlib compilation.
9339
9340         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9341         array is the method corresponding to the top-level type (this is
9342         because of the changes made to icall.c) so we change this
9343         accordingly.
9344
9345         (MethodGroupExpr.Name): This too.
9346
9347         * typemanager.cs (GetElementType): New method which does the right
9348         thing when compiling corlib. 
9349
9350         * everywhere: Make use of the above in the relevant places.
9351
9352 2003-07-22  Martin Baulig  <martin@ximian.com>
9353
9354         * cs-parser.jay (invocation_expression): Moved
9355         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9356         `cast_expression', but create a InvocationOrCast which later
9357         resolves to either an Invocation or a Cast.
9358
9359         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9360         method; call this before EmitStatement() to make sure that this
9361         expression can be used as a statement.
9362
9363         * expression.cs (InvocationOrCast): New class; resolves to either
9364         an Invocation or a Cast.
9365
9366         * statement.cs (StatementExpression): Call ResolveStatement() on
9367         the ExpressionStatement before emitting it.
9368
9369 2003-07-21  Martin Baulig  <martin@ximian.com>
9370
9371         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9372         `ref' and `out' attributes match; fixes #46220.
9373         (MemberAccess.ResolveMemberAccess): You can't reference a type
9374         through an expression; fixes #33180.
9375         (Indexers.GetIndexersForType): Don't return the indexers from
9376         interfaces the class implements; fixes #46502.
9377
9378 2003-07-21  Martin Baulig  <martin@ximian.com>
9379
9380         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9381         CS0661 checks; fixes bug #30442.
9382
9383 2003-07-21  Martin Baulig  <martin@ximian.com>
9384
9385         * decl.cs (AdditionResult): Added `Error'.
9386
9387         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9388
9389         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9390         makes cs0031.cs actually work.
9391
9392 2003-07-20  Martin Baulig  <martin@ximian.com>
9393
9394         * namespace.cs: Fixed that bug which caused a crash when compiling
9395         the debugger's GUI.
9396
9397 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9398
9399         * typemanager.cs (LookupTypeReflection): Never expose types which
9400         are NotPublic, NestedPrivate, NestedAssembly, or
9401         NestedFamANDAssem.  We used to return these, and later do a check
9402         that would report a meaningful error, but the problem is that we
9403         would not get the real match, if there was a name override.
9404
9405 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9406
9407         * namespace.cs (Namespace, Name): Do not compute the namespace
9408         name dynamically, compute it in the constructor.  This reduced
9409         memory usage by 1697 KB.
9410
9411         * driver.cs: Use --pause to pause at the end.
9412
9413 2003-07-17  Peter Williams  <peter@newton.cx>
9414
9415         * Makefile: Change the name of the test target so that it doesn't
9416         conflict with the recursive test target.
9417
9418 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9419
9420         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9421         AddressOf): Do not use EmitThis, that was wrong, use the actual
9422         this pointer.
9423
9424 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9425
9426         * class.cs (MethodData.Define): While checking if a method is an
9427         interface implementation, improve the test: If we are not public
9428         (use new test here: use the computed MethodAttributes directly,
9429         instead of the parsed modifier flags) check if the `implementing'
9430         method comes from an interface or not.
9431
9432         * pending.cs (VerifyPendingMethods): Slightly better error
9433         message.
9434
9435         * makefile: add test target that does the mcs bootstrap.
9436
9437 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9438
9439         * interface.cs (Define): Do nothing here since there are no
9440         members to populate etc. Move the attribute emission out of here
9441         since this was just totally the wrong place to put it. Attribute
9442         application happens during the 'Emit' phase, not in the 'Define'
9443         phase.
9444
9445         (Emit): Add this method and move the attribute emission here
9446
9447         * rootcontext.cs (EmitCode): Call the Emit method on interface
9448         types too.
9449
9450 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9451
9452         * expression.cs (OverloadResolve): Report error only if Location
9453         is not 'Null' which means that there was a probe going on.
9454
9455 2003-07-14  Martin Baulig  <martin@ximian.com>
9456
9457         * expression.cs (ConditionalLogicalOperator): New public class to
9458         implement user defined conditional logical operators.
9459         This is section 14.11.2 in the spec and bug #40505.
9460
9461 2003-07-14  Martin Baulig  <martin@ximian.com>
9462
9463         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9464
9465 2003-07-14  Martin Baulig  <martin@ximian.com>
9466
9467         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9468
9469         * ecore.cs (IVariable.VerifyFixed): New interface method.
9470
9471         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9472         operator, check whether the variable is actually fixed.  Fixes bug
9473         #36055.  Set a variable definitely assigned when taking its
9474         address as required by the spec.
9475
9476         * statement.cs (LocalInfo.IsFixed): New field.
9477         (LocalInfo.MakePinned): Set `IsFixed' to true.
9478
9479 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9480
9481         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9482         for .ctors, ensure that we only ask for members declared in the
9483         attribute type (BindingFlags.DeclaredOnly).
9484
9485         Fixes bug #43632.
9486
9487         * expression.cs (Error_WrongNumArguments): Report error 1501
9488         correctly the way CSC does.
9489
9490 2003-07-13  Martin Baulig  <martin@ximian.com>
9491
9492         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9493         lookup on the fully qualified name, to make things like "X.X" work
9494         where "X.X" is a fully qualified type name, but we also have a
9495         namespace "X" in the using list.  Fixes #41975.
9496
9497 2003-07-13  Martin Baulig  <martin@ximian.com>
9498
9499         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9500         function. If we're a CompoundAssign, we need to create an embedded
9501         CompoundAssign, not an embedded Assign.
9502         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9503         Fixes #45854.
9504
9505 2003-07-13  Martin Baulig  <martin@ximian.com>
9506
9507         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9508         work to fix bug #46088.
9509
9510 2003-07-13  Ravi Pratap <ravi@ximian.com>
9511
9512         * class.cs (Operator.Emit): Do not emit attributes here - it is
9513         taken care of by the Method class that we delegate too. This takes
9514         care of bug #45876.
9515
9516 2003-07-10  Martin Baulig  <martin@ximian.com>
9517
9518         * expression.cs (TypeOfVoid): New class.
9519         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9520
9521 2003-07-10  Martin Baulig  <martin@ximian.com>
9522
9523         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9524         bug #35957.
9525
9526 2003-07-10  Martin Baulig  <martin@ximian.com>
9527
9528         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9529         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9530
9531         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9532
9533         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9534
9535 2003-07-10  Martin Baulig  <martin@ximian.com>
9536
9537         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9538         of decimal.  Fixes #42850.
9539
9540         NOTE: I also fixed the created byte blob, but this doesn't work on
9541         the MS runtime and csc never produces any byte blobs for decimal
9542         arrays.
9543
9544 2003-07-10  Martin Baulig  <martin@ximian.com>
9545
9546         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9547         structs; fixes #32068.
9548         (Block.AddChildVariableNames): Fixed #44302.
9549
9550 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9551
9552         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9553
9554 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9555
9556         * attribute.cs: And this test is onger needed.
9557
9558 2003-07-08  Martin Baulig  <martin@ximian.com>
9559
9560         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9561         inaccessible types.  Fixes #36313.
9562
9563         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9564
9565         * namespace.cs (NamespaceEntry): Create implicit entries for all
9566         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9567         implicit entries for N1.N2 and N1.
9568
9569 2003-07-08  Martin Baulig  <martin@ximian.com>
9570
9571         Rewrote the handling of namespaces to fix a lot of the issues
9572         wrt. `using' aliases etc.
9573
9574         * namespace.cs (Namespace): Splitted this class into a
9575         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9576
9577         * typemanager.cs (TypeManager.IsNamespace): Removed.
9578         (TypeManager.ComputeNamespaces): Only compute namespaces from
9579         loaded assemblies here, not the namespaces from the assembly we're
9580         currently compiling.
9581
9582 2003-07-08  Martin Baulig  <martin@ximian.com>
9583
9584         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9585
9586 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9587
9588         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9589         already fixed it.  
9590
9591         I thought about the memory savings here, but LookupTypeReflection
9592         is used under already very constrained scenarios.  Compiling
9593         corlib or mcs only exposes one hit, so it would not really reduce
9594         any memory consumption.
9595
9596 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9597
9598         * typemanager.cs: fixes bug #45889 by only adding public types from
9599         other assemblies to the list of known types.
9600
9601 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9604         on the type we resolved.
9605
9606 2003-07-05  Martin Baulig  <martin@ximian.com>
9607
9608         * pending.cs (PendingImplementation.ParentImplements): Don't
9609         create the proxy if the parent is abstract.
9610
9611         * class.cs (TypeContainer.DefineIndexers): Process explicit
9612         interface implementations first.  Fixes #37714.
9613
9614 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9615
9616         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9617         defined recursively;  but since we modify the input parameters
9618         (left is set to `this' temporarily), we reset this value if the
9619         left_is_explicit is false, which gives the original semantics to
9620         the code.  
9621
9622         * literal.cs (NullPointer): new class used to represent a null
9623         literal in a pointer context.
9624
9625         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9626         type is a pointer, use a NullPointer object instead of a
9627         NullLiteral.   Closes 43687
9628
9629         (ExplicitConversion): Convert pointer values using
9630         the conv opcode to the proper type.
9631
9632         * ecore.cs (New): change ValueTypeVariable property into a method,
9633         that returns whether the valuetype is suitable for being used.
9634
9635         * expression.cs (Binary.DoNumericPromotions): Only return if we
9636         the int constant was a valid uint, and we can return both left and
9637         right as uints.  If not, we continue processing, to trigger the
9638         type conversion.  This fixes 39018.
9639
9640         * statement.cs (Block.EmitMeta): During constant resolution, set
9641         the CurrentBlock property on the emitcontext, so that we resolve
9642         constants propertly.
9643
9644 2003-07-02  Martin Baulig  <martin@ximian.com>
9645
9646         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9647         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9648
9649         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9650         than emitting it here.
9651
9652         * statement.cs: Fixed some more flow analysis bugs.
9653
9654 2003-07-02  Martin Baulig  <martin@ximian.com>
9655
9656         * class.cs (MethodData.Define): When implementing interface
9657         methods, set Final unless we're Virtual.
9658
9659         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9660         check work for interface methods.
9661
9662 2003-07-01  Martin Baulig  <martin@ximian.com>
9663
9664         * ecore.cs (EmitContext.This): Replaced this property with a
9665         GetThis() method which takes a Location argument.  This ensures
9666         that we get the correct error location for a CS0188.
9667
9668 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9669
9670         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9671         ImplicitStandardConversion.
9672
9673         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9674
9675 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9676
9677         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9678         optimization.
9679
9680 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9681
9682         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9683         constructors.
9684
9685         (MethodData.Define): Turn off initlocals for unsafe methods.
9686
9687 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9688
9689         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9690         complete;  Fixes #37521.
9691
9692         * delegate.cs: Use Modifiers.TypeAttr to compute the
9693         TypeAttributes, instead of rolling our own.  This makes the flags
9694         correct for the delegates.
9695
9696 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * class.cs (Constructor.Define): Set the private flag for static
9699         constructors as well.
9700
9701         * cs-parser.jay (statement_expression): Set the return value to
9702         null, to avoid a crash when we catch an error.
9703
9704 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9705
9706         * cs-parser.jay: Applied patch from Jackson that adds support for
9707         extern and unsafe modifiers to destructor declarations.
9708
9709         * expression.cs: Report error 21 if the user is trying to index a
9710         System.Array.
9711
9712         * driver.cs: Add an error message, suggested by the bug report.
9713
9714         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9715         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9716
9717 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * namespace.cs: Add some information to reduce FAQs.
9720
9721 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9722
9723         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9724         underlying enumeration types.  Fixes #43915.
9725
9726         * expression.cs: Treat ushort/short as legal values to be used in
9727         bitwise operations.
9728
9729 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9730
9731         * delegate.cs: transfer custom attributes for paramenters from
9732         the delegate declaration to Invoke and BeginInvoke.
9733
9734 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9735
9736         * attribute.cs: handle custom marshalers and emit marshal info
9737         for fields, too.
9738
9739 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9740
9741         * makefile.gnu: Added anonymous.cs to the compiler sources.
9742
9743 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9744
9745         * iterators.cs: Change the name of the proxy class to include two
9746         underscores.
9747
9748         * cs-parser.jay: Update grammar to include anonymous methods.
9749
9750         * anonymous.cs: new file.
9751
9752 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * class.cs (Field.Define): Add missing test for pointers and
9755         safety. 
9756
9757 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9758
9759         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9760         we use the stobj opcode.
9761
9762         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9763         since it wasn't the correct fix. 
9764
9765         It still is puzzling that we are required to use stobj for IntPtr
9766         which seems to be a ValueType.
9767
9768 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9769
9770         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9771         during regular simple name resolution.   Now, the trick is that
9772         instead of returning for processing the simplename, we do a
9773         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9774         contextual lookup type).   If a match is found, return that, if
9775         not, return for further composition.
9776
9777         This fixes long-standing 30485.
9778
9779         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9780         using the address to initialize an object, do an Stobj instead of
9781         using the regular Stelem.
9782
9783         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9784         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9785         Because if we are a BaseIndexerAccess that value will be true.
9786         Fixes 43643.
9787
9788         * statement.cs (GotoCase.Resolve): Return after reporting an
9789         error, do not attempt to continue. 
9790
9791         * expression.cs (PointerArithmetic.Emit): If our operand is a
9792         long, convert our constants to match the operand before
9793         multiplying.  Convert to I type before adding.   Fixes 43670.
9794
9795 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9796
9797         * enum.cs (ImplicitConversionExists) : Rename to
9798         ImplicitEnumConversionExists to remove ambiguity. 
9799
9800         * ecore.cs (NullCast): New type of cast expression class which
9801         basically is very similar to EmptyCast with the difference being
9802         it still is a constant since it is used only to cast a null to
9803         something else
9804         (eg. (string) null)
9805
9806         * convert.cs (ImplicitReferenceConversion): When casting a null
9807         literal, we return a NullCast.
9808
9809         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9810         should be around anymore.
9811
9812         The renaming (reported was slightly wrong). Corrections:
9813
9814         ConvertImplicitStandard -> ImplicitConversionStandard
9815         ConvertExplicitStandard -> ExplicitConversionStandard
9816
9817         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9818         before passing them in !
9819
9820         * convert.cs (ImplicitConversionStandard): When comparing for
9821         equal expr and target types, ensure that expr is not a
9822         NullLiteral.
9823
9824         In general, we must not be checking (expr_type ==
9825         target_type) in the top level conversion methods
9826         (ImplicitConversion, ExplicitConversion etc). This checking is
9827         done in the methods that they delegate to.
9828
9829 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * convert.cs: Move Error_CannotConvertType,
9832         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9833         ImplicitNumericConversion, ImplicitConversionExists,
9834         ImplicitUserConversionExists, StandardConversionExists,
9835         FindMostEncompassedType, FindMostSpecificSource,
9836         FindMostSpecificTarget, ImplicitUserConversion,
9837         ExplicitUserConversion, GetConversionOperators,
9838         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9839         TryImplicitIntConversion, Error_CannotConvertImplicit,
9840         ConvertImplicitRequired, ConvertNumericExplicit,
9841         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9842         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9843         its own file.
9844
9845         Perform the following renames:
9846
9847         StandardConversionExists -> ImplicitStandardConversionExists
9848         ConvertImplicit -> ImplicitConversion
9849         ConvertImplicitStandard -> ImplicitStandardConversion
9850         TryImplicitIntConversion -> ImplicitIntConversion
9851         ConvertImplicitRequired -> ImplicitConversionRequired
9852         ConvertNumericExplicit -> ExplicitNumericConversion
9853         ConvertReferenceExplicit -> ExplicitReferenceConversion
9854         ConvertExplicit -> ExplicitConversion
9855         ConvertExplicitStandard -> ExplicitStandardConversion
9856
9857 2003-05-19  Martin Baulig  <martin@ximian.com>
9858
9859         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9860         (TypeInfo): Added support for structs having structs as fields.
9861
9862         * ecore.cs (FieldExpr): Implement IVariable.
9863         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9864         VariableInfo for the field.
9865
9866 2003-05-18  Martin Baulig  <martin@ximian.com>
9867
9868         * expression.cs (This.DoResolve): Report a CS0027 if we're
9869         emitting a field initializer.
9870
9871 2003-05-18  Martin Baulig  <martin@ximian.com>
9872
9873         * expression.cs (This.ResolveBase): New public function.
9874         (This.DoResolve): Check for CS0188.
9875
9876         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9877         This.Resolve().
9878
9879         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9880         `instance_expression' to null if we don't have any non-static
9881         methods.
9882
9883 2003-05-18  Martin Baulig  <martin@ximian.com>
9884
9885         Reworked the way how local variables and parameters are handled by
9886         the flow analysis code.
9887
9888         * statement.cs (TypeInfo, VariableMap): New public classes.
9889         (VariableInfo): New public class.  This is now responsible for
9890         checking whether a variable has been assigned.  It is used for
9891         parameters and local variables.
9892         (Block.EmitMeta): Take the InternalParameters as argument; compute
9893         the layout of the flow vectors here.
9894         (Block.LocalMap, Block.ParameterMap): New public properties.
9895         (FlowBranching): The .ctor doesn't get the InternalParameters
9896         anymore since Block.EmitMeta() now computes the layout of the flow
9897         vector.
9898         (MyStructInfo): This class is now known as `StructInfo' and nested
9899         in `TypeInfo'; we don't access this directly anymore.
9900
9901         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9902         property and removed IsAssigned(), IsFieldAssigned(),
9903         SetAssigned() and SetFieldAssigned(); we now call them on the
9904         VariableInfo so we don't need to duplicate this code everywhere.
9905
9906         * expression.cs (ParameterReference): Added `Block block' argument
9907         to the .ctor.
9908         (LocalVariableReference, ParameterReference, This): The new
9909         VariableInfo class is now responsible for all the definite
9910         assignment stuff.
9911
9912         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9913         IsParameterAssigned, SetParameterAssigned): Removed.
9914
9915 2003-05-18  Martin Baulig  <martin@ximian.com>
9916
9917         * typemanager.cs (InitCoreTypes): Try calling
9918         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9919         the 3-args-version.  Corlib now also needs our `void_type'.
9920         (GetMethod): Added overloaded version which takes an optional
9921         `bool report_errors' to allow lookups of optional methods.
9922
9923 2003-05-12  Martin Baulig  <martin@ximian.com>
9924
9925         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9926         only used for locals and not for parameters.
9927
9928 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9929
9930         * support.cs (InternalParameters.ParameterType): Return the
9931         ExternalType of the parameter.
9932
9933         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9934         they were unused.
9935
9936 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9937
9938         * class.cs (MethodData.Define): Do not set the `newslot' on
9939         interface members, if they are also flagged as "override".
9940
9941         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9942         better code for ++i and i++.  This only works for static fields
9943         and local variables.
9944
9945         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9946         want to pull the DeclSpace out of the builder_to_declspace instead
9947         of the TypeBuilder (like in TypeContainer.FindMembers).
9948
9949         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9950         instead of LookupTypeContainer.  Fixes the crash on .NET for
9951         looking up interface members.
9952
9953         * const.cs: Create our own emit context during the Definition
9954         stage, so that constants are evaluated in the proper context, when
9955         a recursive definition happens.
9956
9957 2003-05-11  Martin Baulig  <martin@ximian.com>
9958
9959         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9960         new block for a switch section.
9961         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9962         the adding/lookup in the switch block.  Fixes #39828.
9963
9964 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9967         functionality: I needed to convert the data after I had performed
9968         the add/sub operation into the operands type size.
9969
9970         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9971         pass the type for the box operation, otherwise the resulting
9972         object would have been of type object.
9973
9974         (BoxedCast): Add constructor to specify the type to box as.
9975
9976 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9977
9978         * iterators.cs: I was reusing the `count' variable inadvertently,
9979         take steps to not allow this to happen.
9980
9981 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9982
9983         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9984         by creating an array at the point where the params starts and
9985         putting all those arguments there, then adjusting the size of the
9986         array.
9987
9988 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9989
9990         * expression.cs (New.AddressOf): Implement interface
9991         IMemoryLocation.  This is used when the `new' operator is used in
9992         the context of an invocation to a method on a value type.
9993
9994         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9995         example. 
9996
9997         * namespace.cs: Also check the using aliases here.
9998
9999         * driver.cs: Move the test for using validity after the types have
10000         been entered, so we do a single pass that also includes the using
10001         aliases. 
10002
10003         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10004         in the regular case.   CreateSiblingForFinally is doing extra
10005         error checking.
10006
10007         * attribute.cs (GetAttributeArgumentExpression): Store the result
10008         on an out value, and use the return value to indicate failure
10009         instead of using null (which is a valid return for Constant.GetValue).
10010
10011         * statement.cs: Perform the analysis flow for the increment
10012         portion after the statement, because this will be the real flow of
10013         execution.  Fixes #42385
10014
10015         * codegen.cs (EmitContext.EmitArgument,
10016         EmitContext.EmitStoreArgument): New helper functions when the
10017         RemapToProxy flag is set.
10018
10019         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10020         function.
10021
10022         Add support for remapping parameters. 
10023
10024         * iterators.cs: Propagate parameter values;  Store parameter
10025         values in the proxy classes.
10026
10027 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10030         need a proxy reference;  I do not know what I was thinking
10031
10032         * cs-parser.jay (constructor_initializer): catch another error,
10033         and display nice message.
10034
10035         (field_declaration): catch void field declaration
10036         to flag a better error. 
10037
10038         * class.cs (MemberBase.CheckBase): Report an error instead of a
10039         warning if a new protected member is declared in a struct. 
10040         (Field.Define): catch the error of readonly/volatile.
10041
10042         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10043
10044         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10045         volatile variable is taken
10046
10047 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10048
10049         * statement.cs (Fixed.Resolve): Report an error if we are not in
10050         an unsafe context.
10051
10052 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10053
10054         * typemanager.cs: reuse the code that handles type clashes for
10055         delegates and enumerations.
10056
10057         * class.cs (Report28): Always report.
10058
10059         * expression.cs (EncodeAsAttribute): Allow nulls here.
10060
10061 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10062
10063         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10064         the functionality for testing whether an expression is valid for
10065         an attribute here.  Also handle the case of arrays of elements
10066         being stored. 
10067
10068         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10069         encoding a linear array into an array of objects that are suitable
10070         to be passed to an CustomAttributeBuilder.
10071
10072         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10073
10074         * ecore.cs: (FieldExpr): Handle field remapping here.
10075
10076         * iteratators.cs: Pass the instance variable (if the method is an
10077         instance method) to the constructors, so we can access the field
10078         variables on the class.
10079
10080         TODO: Test this with structs.  I think the THIS variable on
10081         structs might have to be a pointer, and not a refenrece
10082
10083 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10084
10085         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10086         local variables to fields in a proxy class.
10087
10088         * iterators.cs (PopulateProxy): Rename our internal fields to
10089         <XXX>.  
10090         Create a <THIS> field if we are an instance method, so we can
10091         reference our parent container variables.
10092         (MapVariable): Called back from the EmitContext code to enter a
10093         new variable to field mapping into the proxy class (we just create
10094         a FieldBuilder).
10095
10096         * expression.cs
10097         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10098         for using the remapped locals to fields.
10099
10100         I placed the code here, because that gives the same semantics to
10101         local variables, and only changes the Emit code.
10102
10103         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10104         statements inside iterators.
10105         (VariableInfo): Add a FieldBuilder for the cases when we are
10106         remapping local variables to fields in a proxy class
10107
10108         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10109         current_block != null.
10110
10111         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10112         not cope with strings, as it has been moved to the
10113         TableSwitchEmit.  Fixed bug in switch generation.
10114
10115         * expression.cs (New.DoResolve): Provide more context for the user
10116         when reporting an error.
10117
10118         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10119         pointers. 
10120
10121         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10122         check the permissions for it.  Note than in a type-resolution
10123         context the check was already present in DeclSpace.ResolveType,
10124         but was missing from the MemberAccess.
10125
10126         (ArrayCreation.CheckIndices): warn if the user has
10127         more nested levels of expressions, but there are no more
10128         dimensions specified.  Avoids crash on bug 41906.
10129
10130 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10131
10132         * statement.cs (Block): replace Implicit bool, for a generic
10133         flags.   
10134         New flag: `Unchecked'.  This is used during the EmitMeta phase
10135         (which is out-of-line with the regular Resolve/Emit process for a
10136         statement, as this is done ahead of time, but still gets a chance
10137         to call constant resolve).
10138
10139         (Block.Flags): new enum for adding a new flag.
10140
10141         (Block.EmitMeta): track the state of unchecked.
10142
10143         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10144         to enable constant resolution to work there as well.
10145
10146 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10147
10148         * typemanager.cs (ienumerable_type): Also look up
10149         System.Collections.IEnumerable. 
10150
10151 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10152
10153         TODO: Test more than one conditional per method.
10154
10155         * class.cs (Indexer.Define): Report the location where the user is
10156         referencing the unsupported feature.
10157
10158         (MethodData): Overload the use of `conditionals' to
10159         minimize the creation of needless ArrayLists.   This saves roughly
10160         212kb on my machine.
10161
10162         (Method): Implement the new IIteratorContainer interface.
10163         (Method.SetYields): Implement the method by setting the ModFlags
10164         to contain METHOD_YIELDS.
10165
10166         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10167         which just got set to null.
10168
10169         * iterators.cs: New file.
10170
10171         (Yield, YieldBreak): New statements.
10172
10173         * statement.cs (Return.Resolve): Flag an error if we are used in
10174         an iterator method.
10175
10176         * codegen.cs (InIterator): New flag set if the code is being
10177         compiled in an iterator method.
10178
10179         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10180         internal modifier, and we just use it to avoid adding extra
10181         fields, as this is seldom used.  
10182
10183         * cs-parser.jay: Add yield_statement (yield and yield break).
10184
10185         * driver.cs: New flag -v2 to turn on version 2 features. 
10186
10187         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10188         hashtable when v2 is enabled.
10189
10190 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10191
10192         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10193         there is already a namespace defined with this name.
10194
10195         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10196         people upgraded their corlibs.
10197
10198         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10199         always use fully qualified types, no need to use the compiler
10200         front end.
10201
10202         (TypeManager.IsNamespace): Use binarysearch.
10203
10204         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10205         AddDelegate): I did not quite use the new IsValid API properly: I
10206         have to pass the short-name and the fullname.  I was passing only
10207         the basename instead of the fullname sometimes. 
10208
10209         (TypeContainer.DefineType): call NamespaceClash.
10210
10211         * interface.cs (Interface.DefineType): use NamespaceClash before
10212         defining the type.
10213
10214         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10215         defining the type.
10216
10217         * enum.cs: (Enum.DefineType): use NamespaceClash before
10218         defining the type.
10219
10220         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10221         speed increase.  First, use the negative_hits cache when we get a
10222         negative.  Second, add the type with its full original name
10223         instead of the new . and + encoded name (reflection uses + to
10224         separate type from a nested type).  Use LookupTypeReflection
10225         directly which bypasses the type->name hashtable (that we already
10226         know does not contain the type.
10227
10228         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10229         location/container type. 
10230
10231         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10232
10233 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10236
10237         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10238         method is being referenced in the method group from a static
10239         context, and report error 120 if so.
10240
10241         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10242         Error118. 
10243
10244         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10245         is created, we create the A namespace).
10246
10247         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10248         Fixes #41591
10249
10250 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10251
10252         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10253         invocation to ModuleBuilder.GetType with the same values will
10254         return a new type instance, so we need to cache its return
10255         values. 
10256
10257         * expression.cs (Binary.ResolveOperator): Only allow the compare
10258         operators on enums if they are of the same type.
10259
10260         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10261         types of ValueType on their own case.  Before we were giving them
10262         the same treatment as objects.
10263
10264         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10265         fullname.  Short name is used to compare against container name.
10266         Fullname is used to check against defined namespace names.
10267
10268         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10269         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10270
10271         (Method.CheckBase): Call parent.
10272         (MemberBase.CheckBase): Check for protected members on sealed
10273         classes.
10274         (PropertyBase.CheckBase): Call parent.
10275         (Field.Define): Call parent.
10276
10277         * report.cs: Negative error codes are now mapped to 8000 - code,
10278         so that the display is render more nicely.
10279
10280         * typemanager.cs: Do not use try/catch, instead report a regular
10281         error. 
10282
10283         (GetPointerType, GetReferenceType): These methods provide
10284         mechanisms to obtain the T* and T& from a T.  We had the code
10285         previously scattered around the code base, and it also used
10286         TypeManager.LookupType that would go through plenty of caches.
10287         This one goes directly to the type source.
10288
10289         In some places we did the Type.GetType followed by
10290         ModuleBuilder.GetType, but not in others, so this unifies the
10291         processing as well.
10292
10293         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10294         statements now that we have namespace information.
10295
10296         * typemanager.cs (IsNamespace): New method, returns whether the
10297         string presented is a namespace or not.
10298
10299         (ComputeNamespaces): New public entry point, computes the list of
10300         available namespaces, using the GetNamespaces API call in Mono, or
10301         the slower version in MS.NET.   
10302
10303         Now before we start the semantic analysis phase, we have a
10304         complete list of namespaces including everything that the user has
10305         provided.
10306
10307         Deleted old code to cache namespaces in .nsc files.
10308
10309 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10312         class/struct location definition Location for the implicit
10313         constructor location.
10314
10315         (Operator.Define): Use the location of the operator for the
10316         implicit Method definition.
10317
10318         (Constructor.Emit): use the constructor location for the implicit
10319         base initializer constructor.
10320
10321         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10322         and the Expression class now contains two new methods:
10323
10324         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10325         isolate type lookup from the rest of the resolution process.
10326
10327         Since we use Expressions to hold type definitions due to the way
10328         we parse the input we have historically overloaded Resolve to
10329         perform the Type lookups if a special flag is passed.  Now this is
10330         eliminated and two methods take their place. 
10331
10332         The differences in the two methods between xStep and xTerminal is
10333         that xStep is involved in our current lookup system that uses
10334         SimpleNames to compose a name, while xTerminal is used just to
10335         catch the case where the simplename lookup failed.
10336
10337 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10338
10339         * expression.cs (ResolveMemberAccess): Remove redundant code.
10340         TypeExpr expressions are always born fully resolved.
10341
10342         * interface.cs (PopulateMethod): Do not lookup the types twice.
10343         We were doing it once during SemanticAnalysis and once during
10344         PopulateMethod.
10345
10346         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10347         in local variable type definitions, were being returned as a
10348         SimpleName (we decomposed everything into a string), that is
10349         because primary_expression was being used instead of a type in the
10350         grammar (reduce/reduce conflicts).
10351
10352         The part that was wrong is that we converted the expression into a
10353         string (an oversimplification in one hand, compounded with primary
10354         expressions doing string concatenation).
10355
10356         So things like:
10357
10358         A.B.C [] x;
10359
10360         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10361         using clauses from working on this particular context.  And a type
10362         was being matched directly against "A.B.C[]".
10363
10364         We now use the correct approach, and allow for ComposedCast to be
10365         part of the unary expression.  So the "A.B.C []" become a composed
10366         cast of "A.B.C" (as a nested group of MemberAccess with a
10367         SimpleName at the end) plus the rank composition "[]". 
10368
10369         Also fixes 35567
10370
10371 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10372
10373         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10374         for the access level checking.
10375
10376         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10377         `TypeContainer container', because I kept getting confused when I
10378         was debugging this code.
10379
10380         * expression.cs (Indexers): Instead of tracking getters/setters,
10381         we now track them in parallel.  We create one arraylist less, but
10382         most importantly it is possible now for the LValue code to find a
10383         matching get for a set.
10384
10385         (IndexerAccess.DoResolveLValue): Update the code.
10386         GetIndexersForType has been modified already to extract all the
10387         indexers from a type.  The code assumed it did not.
10388
10389         Also make the code set the correct return type for the indexer.
10390         This was fixed a long time ago for properties, but was missing for
10391         indexers.  It used to be void_type.
10392
10393         (Binary.Emit): Test first for doubles instead of
10394         floats, as they are more common.
10395
10396         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10397         when dealing with floats and the <=, >= operators.  This fixes bug
10398         #39314 
10399
10400         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10401         to load the array value by emitting a load on the foreach variable
10402         type.  This was incorrect.  
10403
10404         We now emit the code to load an element using the the array
10405         variable type, and then we emit the conversion operator.
10406
10407         Fixed #40176
10408
10409 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10410
10411         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10412
10413 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10414
10415         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10416         test for protection before we test for signatures. 
10417
10418         (MethodSignature.ToString): implement.
10419
10420         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10421         to the case where we reduced into a LongConstant.
10422
10423         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10424         depend on whether the information is acurrate, because the
10425         Microsoft runtime will always claim that the array type is public,
10426         regardless of the real state.
10427
10428         If the type is a pointer, another problem happens: the type is
10429         reported as non-public in Microsoft.  
10430
10431         In both cases we have to call CheckAccessLevel recursively with
10432         the underlying type as the argument to be tested.
10433
10434 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10435
10436         * assign.cs (Assign.Emit): If we are dealing with a compound
10437         assignment expression, we should use the code path that stores the
10438         intermediate result in a temporary value.  This fixes #40903.
10439
10440         *expression.cs (Indirection.ToString): Provide ToString method for
10441         debugging. 
10442
10443 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10444
10445         * class.cs: Null out fields holding references to Block objects so
10446         they can be garbage collected.
10447
10448         * expression.cs (OverloadResolve): Remove unused local.
10449
10450 2003-04-07  Martin Baulig  <martin@ximian.com>
10451
10452         * codegen.cs (EmitContext.CurrentFile): New public field.
10453         (EmitContext.Mark): Use the CurrentFile to check whether the
10454         location is in the correct file.
10455         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10456
10457 2003-04-07  Martin Baulig  <martin@ximian.com>
10458
10459         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10460
10461         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10462         location.  [FIXME: The location argument which gets passed to this
10463         method is sometimes wrong!]
10464
10465 2003-04-07  Nick Drochak <ndrochak@gol.com>
10466
10467         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10468
10469 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10470
10471         * expression.cs (Indirection.EmitAssign): We were using the
10472         temporary, but returning immediately instead of continuing the
10473         EmitAssing flow.
10474
10475 2003-04-06  Martin Baulig  <martin@ximian.com>
10476
10477         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10478         if it's a nested child, but also deriving from the outer class.
10479         See test 190.cs.
10480
10481         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10482         nested child, but also deriving from the outer class.  See
10483         test-190.cs.
10484         (FilterWithClosure): We may access private members of the outer
10485         class if we're a nested child and deriving from the outer class.
10486         (RealMemberLookup): Only set `closure_private_ok' if the
10487         `original_bf' contained BindingFlags.NonPublic.
10488
10489 2003-04-05  Martin Baulig  <martin@ximian.com>
10490
10491         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10492
10493 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10494
10495         * class.cs (Event.Define): Do not allow abstract events to have
10496         initializers. 
10497
10498 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10499
10500         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10501         block in event declarations.
10502
10503         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10504         value type, get its address.
10505
10506         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10507         leaving a class on the stack instead of a boolean value (int
10508         0/1).  Change the code so we compare against null, and then the
10509         result against zero.
10510
10511         * class.cs (TypeContainer.GetClassBases): We were checking for the
10512         parent class being sealed too late.
10513
10514         * expression.cs (Binary.Emit): For <= and >= when dealing with
10515         floating point values, use cgt.un and clt.un instead of cgt and
10516         clt alone.
10517
10518 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10519
10520         * statement.cs: Apply the same optimization as MS: skip the 
10521         GetEnumerator returning an IEnumerator, and use the one returning a 
10522         CharEnumerator instead. This allows us to avoid the try-finally block 
10523         and the boxing.
10524
10525 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10526
10527         * cs-parser.jay: Attributes cannot be applied to
10528                          namespaces. Fixes #40473
10529
10530 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10531
10532         * class.cs:
10533         (Add*): check if the name is valid using the full name for constants,
10534         fields, properties and events.
10535
10536 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10537
10538         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10539         char constants to be part of the enumeration.
10540
10541         * expression.cs (Conditional.DoResolve): Add support for operator
10542         true. Implements the missing functionality from 14.12
10543
10544         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10545         operator true/false as required by the spec.
10546
10547         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10548         implicit conversion to boolean.
10549
10550         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10551         also one where the type implements `operator true'. 
10552
10553         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10554         get an expression that will invoke operator true based on an
10555         expression.  
10556
10557         (GetConversionOperators): Removed the hack that called op_True
10558         here.  
10559
10560         (Expression.ResolveBoolean): Move this from Statement.
10561
10562 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10563
10564         * ecore.cs (FieldExpr): do not allow initialization of initonly
10565         fields on derived classes
10566
10567 2003-03-13  Martin Baulig  <martin@ximian.com>
10568
10569         * statement.cs (Block.Emit): Call ig.BeginScope() and
10570         ig.EndScope() when compiling with debugging info; call
10571         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10572
10573 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10574
10575         * expression.cs (Indexers): Do not construct immediately, allow
10576         for new members to be appended as we go.  Fixes 38143
10577
10578 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10579
10580         * expression.cs: save/restore context when resolving an unchecked
10581         expression.
10582
10583 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10584
10585         * cfold.cs: Catch division by zero in modulus operator during
10586         constant folding.
10587
10588 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * interface.cs (Interface.DefineMembers): Avoid defining members
10591         twice. 
10592
10593 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10594
10595         * driver.cs: handle the +/- options for -noconfig
10596
10597         * statement.cs (Unckeched.Resolve): Also track the state of
10598         unchecked in the Resolve phase.
10599
10600 2003-02-27  Martin Baulig  <martin@ximian.com>
10601
10602         * ecore.cs (Expression.MemberLookup): Don't create a
10603         MethodGroupExpr for something which is not a method.  Fixes #38291.
10604
10605 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10606
10607         * class.cs (MemberBase.CheckParameters): Also check that the type
10608         is unmanaged if it is a pointer.
10609
10610         * expression.cs (SizeOf.Resolve): Add location information.
10611
10612         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10613         a managed type is declared.
10614
10615         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10616         parameter modifiers as well.  Fixes bug 38606
10617
10618         * class.cs: Very sad.  Am backing out the speed up changes
10619         introduced by the ArrayList -> Array in the TypeContainer, as they
10620         were not actually that much faster, and introduced a bug (no error
10621         reports on duplicated methods).
10622
10623         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10624         source first, this will guarantee that we have a valid expression
10625         before calling in lower levels functions that will require a
10626         resolved object.  Then use this original_source in the
10627         target.ResolveLValue instead of the original source that was
10628         passed to us.
10629
10630         Another change.  Use target.Resolve instead of LValueResolve.
10631         Although we are resolving for LValues, we will let the Assign code
10632         take care of that (it will be called again from Resolve).  This
10633         basically allows code like this:
10634
10635         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10636         class Y { void A (X x) { x [0] += o; }
10637
10638         The problem was that the indexer was trying to resolve for
10639         set_Item (idx, object o) and never finding one.  The real set_Item
10640         was set_Item (idx, X).  By delaying the process we get the right
10641         semantics. 
10642
10643         Fixes bug 36505
10644
10645 2003-02-23  Martin Baulig  <martin@ximian.com>
10646
10647         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10648         while calling DoEmit ().
10649
10650         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10651         source files; if you use the #line directive inside a method, the
10652         compiler stops emitting line numbers for the debugger until it
10653         reaches the end of the method or another #line directive which
10654         restores the original file.
10655
10656 2003-02-23  Martin Baulig  <martin@ximian.com>
10657
10658         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10659
10660 2003-02-23  Martin Baulig  <martin@ximian.com>
10661
10662         * statement.cs (Block.AddChildVariableNames): We need to call this
10663         recursively, not just for our immediate children.
10664
10665 2003-02-23  Martin Baulig  <martin@ximian.com>
10666
10667         * class.cs (Event.Define): Always make the field private, like csc does.
10668
10669         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10670         actually work, fixes bug #37521.
10671
10672 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10673
10674         * delegate.cs: When creating the various temporary "Parameters"
10675         classes, make sure that we call the ComputeAndDefineParameterTypes
10676         on those new parameters (just like we do with the formal ones), to
10677         allow them to be resolved in the context of the DeclSpace.
10678
10679         This fixes the bug that Dick observed in Bugzilla #38530.
10680
10681 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10682
10683         * expression.cs (ResolveMemberAccess): When resolving a constant,
10684         do not attempt to pull a constant if the value was not able to
10685         generate a valid constant.
10686
10687         * const.cs (LookupConstantValue): Do not report more errors than required.
10688
10689 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10690
10691         * expression.cs: fixes bug #38328.
10692
10693 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * class.cs: Changed all the various members that can be part of a
10696         class from being an ArrayList to be an Array of the right type.
10697         During the DefineType type_list, interface_list, delegate_list and
10698         enum_list are turned into types, interfaces, delegates and enums
10699         arrays.  
10700
10701         And during the member population, indexer_list, event_list,
10702         constant_list, field_list, instance_constructor_list, method_list,
10703         operator_list and property_list are turned into their real arrays.
10704
10705         Although we could probably perform this operation earlier, for
10706         good error reporting we need to keep the lists and remove the
10707         lists for longer than required.
10708
10709         This optimization was triggered by Paolo profiling the compiler
10710         speed on the output of `gen-sample-program.pl' perl script. 
10711
10712         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10713         not crash in methods like MemberLookupFailed that use this field.  
10714
10715         This problem arises when the compiler fails to resolve a type
10716         during interface type definition for example.
10717
10718 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10719
10720         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10721         inherit from System.Object, so we have to stop at null, not only
10722         when reaching System.Object.
10723
10724 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10725
10726         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10727         DeclaredOnly because the parent indexer might have had a different
10728         name, but did not loop until the top of the hierarchy was reached.
10729
10730         The problem this one fixes is 35492: when a class implemented an
10731         indexer from an interface, we were getting the interface method
10732         (which was abstract) and we were flagging an error (can not invoke
10733         abstract method).
10734
10735         This also keeps bug 33089 functioning, and test-148 functioning.
10736
10737         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10738         out if a method is special is to see if it is declared in a
10739         property or event, or whether it is one of the predefined operator
10740         names.   This should fix correctly #36804.
10741
10742 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10743
10744         The goal here is to remove the dependency on EmptyCast.Peel ().
10745         Killing it completely.
10746
10747         The problem is that currently in a number of places where
10748         constants are expected, we have to "probe" for an EmptyCast, and
10749         Peel, which is not the correct thing to do, as this will be
10750         repetitive and will likely lead to errors. 
10751
10752         The idea is to remove any EmptyCasts that are used in casts that
10753         can be reduced to constants, so we only have to cope with
10754         constants. 
10755
10756         This bug hunt was triggered by Bug 37363 and the desire to remove
10757         the duplicate pattern where we were "peeling" emptycasts to check
10758         whether they were constants.  Now constants will always be
10759         constants.
10760
10761         * ecore.cs: Use an enumconstant here instead of wrapping with
10762         EmptyCast.  
10763
10764         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10765         throwing me off.  By handling this we can get rid of a few hacks.
10766
10767         * statement.cs (Switch): Removed Peel() code.
10768
10769 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10770
10771         * class.cs: Location information for error 508
10772
10773         * expression.cs (New.DoResolve): Add a guard against double
10774         resolution of an expression.  
10775
10776         The New DoResolve might be called twice when initializing field
10777         expressions (see EmitFieldInitializers, the call to
10778         GetInitializerExpression will perform a resolve on the expression,
10779         and later the assign will trigger another resolution
10780
10781         This leads to bugs (#37014)
10782
10783         * delegate.cs: The signature for EndInvoke should contain any ref
10784         or out parameters as well.  We were not doing this in the past. 
10785
10786         * class.cs (Field.Define): Do not overwrite the type definition
10787         inside the `volatile' group.  Turns out that volatile enumerations
10788         were changing the type here to perform a validity test, which
10789         broke conversions. 
10790
10791 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10794         and structs, we do not want to load the instance variable
10795
10796         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10797         enum_type has to be handled like an object reference (implicit
10798         conversions exists from this to object), but the regular IsClass
10799         and IsValueType tests will never return true for this one.
10800
10801         Also we use TypeManager.IsValueType instead of type.IsValueType,
10802         just for consistency with the rest of the code (this is only
10803         needed if we ever use the construct exposed by test-180.cs inside
10804         corlib, which we dont today).
10805
10806 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10807
10808         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10809         just InternalCall.
10810
10811 2003-02-09  Martin Baulig  <martin@ximian.com>
10812
10813         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10814         (Namespace.DefineNamespaces): New static public method; this is
10815         called when we're compiling with debugging to add all namespaces
10816         to the symbol file.
10817
10818         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10819         pass it to the Namespace's .ctor.
10820
10821         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10822         and MethodBase arguments; pass the namespace ID to the symwriter;
10823         pass the MethodBase instead of the token to the symwriter.
10824         (SymbolWriter.DefineNamespace): New method to add a namespace to
10825         the symbol file.
10826
10827 2003-02-09  Martin Baulig  <martin@ximian.com>
10828
10829         * symbolwriter.cs: New file.  This is a wrapper around
10830         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10831         methods here in near future.
10832
10833 2003-02-09  Martin Baulig  <martin@ximian.com>
10834
10835         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10836         ILGenerator.MarkSequencePoint() which are actually used by the
10837         symbol writer.
10838
10839 2003-02-09  Martin Baulig  <martin@ximian.com>
10840
10841         * location.cs (SourceFile): New public sealed class.  This
10842         contains the name and an index which is used in the location's token.
10843         (Location): Reserve an appropriate number of bits in the token for
10844         the source file instead of walking over that list, this gives us a
10845         really huge performance improvement when compiling with debugging.
10846
10847         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10848         `SourceFile' argument instead of a string.
10849         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10850         but don't parse/tokenize here, we need to generate the list of all
10851         source files before we do that.
10852         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10853         the files.
10854
10855         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10856         instead of a string.
10857
10858         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10859         of a string.
10860
10861 2003-02-09  Martin Baulig  <martin@ximian.com>
10862
10863         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10864         filename on `#line default'.
10865
10866 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10867
10868         * statement.cs: don't clear the pinned var when the fixed statement
10869         returns from the method (fixes bug#37752).
10870
10871 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10872
10873         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10874         to IsValueType.
10875
10876 2003-02-07  Martin Baulig  <martin@ximian.com>
10877
10878         * driver.cs: Removed the `--debug-args' command line argument.
10879
10880         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10881         automatically by the AsssemblyBuilder.
10882         (CodeGen.InitializeSymbolWriter): We don't need to call any
10883         initialization function on the symbol writer anymore.  This method
10884         doesn't take any arguments.
10885
10886 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10887
10888         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10889         from referenced assemblies as well.
10890
10891 2003-02-02  Martin Baulig  <martin@ximian.com>
10892
10893         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10894
10895 2003-02-02  Martin Baulig  <martin@ximian.com>
10896
10897         * class.cs (Constructor.Emit): Open the symbol writer before
10898         emitting the constructor initializer.
10899         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10900         single-stepping through constructor initializers.
10901
10902 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10903
10904         * class.cs: Handle error 549: do not allow virtual methods in
10905         sealed classes. 
10906
10907 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10908
10909         * decl.cs: Check access levels when resolving types
10910
10911 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10912
10913         * statement.cs: Add parameters and locals set in catch blocks that might 
10914         return to set vector
10915
10916 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * class.cs (Operator): Set the SpecialName flags for operators.
10919
10920         * expression.cs (Invocation.DoResolve): Only block calls to
10921         accessors and operators on SpecialName methods.
10922
10923         (Cast.TryReduce): Handle conversions from char constants.
10924
10925
10926 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10927
10928         * statement.cs: small memory and time optimization in FlowBranching.
10929
10930 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10931
10932         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10933         problem that the last fix but in the other sid (Set).
10934
10935         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10936         access when there is no indexer in the hierarchy.
10937
10938 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10939
10940         * class.cs: Combine some if statements.
10941
10942 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10943
10944         * driver.cs: fixed bug #37187.
10945
10946 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10947
10948         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10949         any indexer, it's needed to build a list with all the indexers in the
10950         hierarchy (AllGetters), else we have problems. Fixes #35653.
10951
10952 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10953
10954         * class.cs (MethodData.Define): It is wrong for an interface
10955         implementation to be static in both cases: explicit and implicit.
10956         We were only handling this in one case.
10957
10958         Improve the if situation there to not have negations.
10959
10960         * class.cs (Field.Define): Turns out that we do not need to check
10961         the unsafe bit on field definition, only on usage.  Remove the test.
10962
10963 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10964
10965         * driver.cs: use assembly.Location instead of Codebase (the latest
10966         patch made mcs fail when using MS assemblies).
10967
10968 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10969
10970         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10971         get the path to *corlib.dll.
10972
10973 2003-01-21  Nick Drochak <ndrochak@gol.com>
10974
10975         * cs-tokenizer.cs:
10976         * pending.cs:
10977         * typemanager.cs: Remove compiler warnings
10978
10979 2003-01-20  Duncan Mak  <duncan@ximian.com>
10980
10981         * AssemblyInfo.cs: Bump the version number to 0.19.
10982
10983 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10984
10985         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10986
10987 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10988
10989         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10990
10991 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * cs-parser.jay: Small fix: we were not comparing the constructor
10994         name correctly.   Thanks to Zoltan for the initial pointer.
10995
10996 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10997
10998         * cs-tokenizer.cs: Set file name when specified with #line
10999
11000 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * cs-parser.jay: Only perform the constructor checks here if we
11003         are named like the class;  This will help provider a better
11004         error.  The constructor path is taken when a type definition is
11005         not found, but most likely the user forgot to add the type, so
11006         report that rather than the constructor error.
11007
11008 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11009
11010         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11011         allocations.
11012
11013 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11014
11015         * cs-parser.jay: Add cleanup call.
11016
11017 2003-01-13  Duncan Mak  <duncan@ximian.com>
11018
11019         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11020         consistent with other methods.
11021
11022 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11023
11024         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11025
11026 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11027
11028         * attribute.cs: only set GuidAttr to true when we have a
11029         GuidAttribute.
11030
11031 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11032
11033         * ecore.cs:
11034         * expression.cs:
11035         * typemanager.cs: fixes to allow mcs compile corlib with the new
11036         Type.IsSubclassOf fix.
11037
11038 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11039
11040         * expression.cs (LocalVariableReference.DoResolve): Classify a
11041         constant as a value, not as a variable.   Also, set the type for
11042         the variable.
11043
11044         * cs-parser.jay (fixed_statement): take a type instead of a
11045         pointer_type, so we can produce a better error message later.
11046
11047         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11048         as an error.  
11049
11050         (For.DoEmit): Make inifinite loops have a
11051         non-conditional branch back.
11052
11053         (Fixed.DoEmit): First populate the pinned variables, then emit the
11054         statement, then clear the variables.  Before I was emitting the
11055         code once for each fixed piece.
11056
11057
11058 2003-01-08  Martin Baulig  <martin@ximian.com>
11059
11060         * statement.cs (FlowBranching.MergeChild): A break in a
11061         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11062
11063 2003-01-08  Martin Baulig  <martin@ximian.com>
11064
11065         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11066         lives in the same number space than `param_map'.  Fixes #36154.
11067
11068 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * cs-parser.jay (constructor_declaration): Set the
11071         Constructor.ModFlags before probing for it.  This makes the
11072         compiler report 514, 515 and 132 (the code was there, but got
11073         broken). 
11074
11075         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11076         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11077         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11078
11079 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11080
11081         * enum.cs: create the enum static fields using the enum type.
11082
11083 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11084
11085         * class.cs: don't try to create the ParamBuilder for the return
11086         type if it's not needed (and handle it breaking for the ms runtime
11087         anyway).
11088
11089 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11090
11091         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11092
11093 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11094
11095         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11096         the command.   This showed up while compiling the JANET source
11097         code, which used \r as its only newline separator.
11098
11099 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11100
11101         * class.cs (Method.Define): If we are an operator (because it
11102         reuses our code), then set the SpecialName and HideBySig.  #36128
11103
11104 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11107         exception, report error 120 `object reference required'.
11108
11109         * driver.cs: Add --pause option, used during to measure the size
11110         of the process as it goes with --timestamp.
11111
11112         * expression.cs (Invocation.DoResolve): Do not allow methods with
11113         SpecialName to be invoked.
11114
11115 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11118         number before adding it.
11119
11120 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11121
11122         * ecore.cs (StandardImplicitConversion): When in an unsafe
11123         context, we allow conversion between void * to any other pointer
11124         type. This fixes bug #35973.
11125
11126 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11127
11128         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11129         is not thrown when extensionless outputs are used 
11130
11131 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11132
11133         * rootcontext.cs: fixed compilation of corlib.
11134
11135 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11136
11137         * attribute.cs (Attributes.Contains): Add new method.
11138
11139         * class.cs (MethodCore.LabelParameters): if the parameter is an
11140         `out' parameter, check that no attribute `[In]' has been passed.
11141
11142         * enum.cs: Handle the `value__' name in an enumeration.
11143
11144 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11145
11146         * decl.cs: Added special case to allow overrides on "protected
11147         internal" methods
11148
11149 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11150
11151         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11152         since it makes much more sense.
11153
11154         (Attributes.ctor): Don't require a Location parameter.
11155
11156         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11157
11158         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11159         since we already have that information per attribute.
11160
11161         * everywhere : make appropriate changes.
11162
11163         * class.cs (LabelParameters): Write the code which actually
11164         applies attributes to the return type. We can't do this on the MS
11165         .NET runtime so we flag a warning in the case an exception is
11166         thrown.
11167
11168 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11169
11170         * const.cs: Handle implicit null conversions here too.
11171
11172 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11173
11174         * class.cs (MethodCore.LabelParameters): Remove the extra
11175         Type [] parameter since it is completely unnecessary. Instead
11176         pass in the method's attributes so that we can extract
11177         the "return" attribute.
11178
11179 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11180
11181         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11182         of ignoring it and letting the compile continue.
11183
11184         * typemanager.cs (ChangeType): use an extra argument to return an
11185         error condition instead of throwing an exception.
11186
11187 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * expression.cs (Unary.TryReduce): mimic the code for the regular
11190         code path.  Perform an implicit cast in the cases where we can
11191         implicitly convert to one of the integral types, and then reduce
11192         based on that constant.   This fixes bug #35483.
11193
11194 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11195
11196         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11197
11198 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11199
11200         * namespace.cs: fixed bug #35489.
11201
11202 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11203
11204         * class.cs: Remove some dead code.
11205
11206         * cs-parser.jay: Estimate the number of methods needed
11207         (RootContext.MethodCount);
11208
11209         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11210         numbers instead of StringBuilders.
11211
11212         * support.cs (PtrHashtable): Add constructor with initial size;
11213         We can now reduce reallocations of the method table.
11214
11215 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11216
11217         * attribute.cs (ApplyAttributes): Keep track of the emitted
11218         attributes on a per-target basis. This fixes bug #35413.
11219
11220 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11221
11222         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11223         default to the Windows 1252 encoding.
11224
11225         (UnixParseOption): Support version, thanks to Alp for the missing
11226         pointer. 
11227
11228         * AssemblyInfo.cs: Add nice assembly information.
11229
11230         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11231         (bug 35169).
11232
11233         * cs-parser.jay: Allow a trailing comma before the close bracked
11234         in the attribute_section production.
11235
11236         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11237         address of the instance was being taken, I will take this out,
11238         because we take the address of the object immediately here.
11239
11240 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11241
11242         * typemanager.cs (AreMultipleAllowed): Take care of the most
11243         obvious case where attribute type is not in the current assembly -
11244         stupid me ;-)
11245
11246 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11247
11248         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11249         definitions, instead of doing that afterwards.  
11250
11251         Also we use a nice little hack, depending on the constructor, we
11252         know if we are a "composed" name or a simple name.  Hence, we
11253         avoid the IndexOf test, and we avoid 
11254
11255         * codegen.cs: Add code to assist in a bug reporter to track down
11256         the source of a compiler crash. 
11257
11258 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11259
11260         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11261         types have been emitted for a given element and flag an error
11262         if something which does not have AllowMultiple set is used more
11263         than once.
11264
11265         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11266         attribute types and their corresponding AllowMultiple properties
11267
11268         (AreMultipleAllowed): Check the property for a given type.
11269
11270         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11271         property in the case we have a TypeContainer.
11272
11273         (Attributes.AddAttribute): Detect duplicates and just skip on
11274         adding them. This trivial fix catches a pretty gross error in our
11275         attribute emission - global attributes were being emitted twice!
11276
11277         Bugzilla bug #33187 is now fixed.
11278
11279 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11280
11281         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11282         instead of pp_and).
11283
11284         * expression.cs (Binary.ResolveOperator): I can only use the
11285         Concat (string, string, string) and Concat (string, string,
11286         string, string) if the child is actually a concatenation of
11287         strings. 
11288
11289 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11290
11291         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11292         context where we need a 2-character lookahead.
11293
11294         * pending.cs (PendingImplementation): Rework so we can keep track
11295         of interface types all the time, and flag those which were
11296         implemented by parents as optional.
11297
11298 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11299
11300         * expression.cs (Binary.ResolveOperator): Use
11301         String.Concat(string,string,string) or
11302         String.Concat(string,string,string,string) when possible. 
11303
11304         * typemanager: More helper methods.
11305
11306
11307 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11308
11309         * pending.cs: remove the bogus return from GetMissingInterfaces()
11310         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11311
11312 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11313
11314         * namespace.cs: avoid duplicated 'using xxx' being added to
11315         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11316         when we get more than one 'using' statement for the same namespace.
11317         Report a CS0105 warning for it.
11318
11319 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11320
11321         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11322         of calling getChar/putback, uses internal knowledge of it.    
11323
11324         (xtoken): Reorder tokenizer so most common patterns are checked
11325         first.  This reduces the compilation time in another 5% (from 8.11s
11326         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11327
11328         The parsing time is 22% of the compilation in mcs, and from that
11329         64% is spent on the tokenization process.  
11330
11331         I tried using a binary search for keywords, but this is slower
11332         than the hashtable.  Another option would be to do a couple of
11333         things:
11334
11335                 * Not use a StringBuilder, instead use an array of chars,
11336                   with a set value.  Notice that this way we could catch
11337                   the 645 error without having to do it *afterwards*.
11338
11339                 * We could write a hand-parser to avoid the hashtable
11340                   compares altogether.
11341
11342         The identifier consumption process takes 37% of the tokenization
11343         time.  Another 15% is spent on is_number.  56% of the time spent
11344         on is_number is spent on Int64.Parse:
11345
11346                 * We could probably choose based on the string length to
11347                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11348                   computations. 
11349
11350         Another 3% is spend on wrapping `xtoken' in the `token' function.
11351
11352         Handle 0xa0 as whitespace (#34752)
11353
11354 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11355
11356         * typemanager.cs (IsCLRType): New routine to tell whether a type
11357         is one of the builtin types.  
11358
11359         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11360         typecode in more places instead of doing pointer comparissions.
11361         We could leverage some knowledge about the way the typecodes are
11362         laid out.
11363
11364         New code to cache namespaces in assemblies, it is currently not
11365         invoked, to be used soon.
11366
11367         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11368
11369         * expression.cs (Binary.ResolveOperator): specially handle
11370         strings, and do not perform user-defined operator overloading for
11371         built-in types.
11372
11373 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11374
11375         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11376         internalcall as it is a pretty simple operation;  Avoid whenever
11377         possible to call Char.IsLetter.
11378
11379         (consume_identifier): Cut by half the number of
11380         hashtable calls by merging the is_keyword and GetKeyword behavior.
11381
11382         Do not short-circuit, because if we do, we
11383         report errors (ie, #if false && true would produce an invalid
11384         directive error);
11385
11386
11387 2002-11-24  Martin Baulig  <martin@ximian.com>
11388
11389         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11390         check constant ranges and report a CS0221.  Fixes #33186.
11391
11392 2002-11-24  Martin Baulig  <martin@ximian.com>
11393
11394         * cs-parser.jay: Make this work for uninitialized variable
11395         declarations in the `for' initializer.  Fixes #32416.
11396
11397 2002-11-24  Martin Baulig  <martin@ximian.com>
11398
11399         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11400         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11401
11402 2002-11-24  Martin Baulig  <martin@ximian.com>
11403
11404         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11405         argument; if true, we also check for user-defined conversions.
11406         This is only needed if both arguments are of a user-defined type.
11407         Fixes #30443, added test-175.cs.
11408         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11409
11410         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11411
11412 2002-11-24  Martin Baulig  <martin@ximian.com>
11413
11414         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11415         function to get the store opcode.
11416         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11417         only emit the Ldelema if the store opcode is Stobj.  You must run
11418         both test-34 and test-167 to test this.  Fixes #34529.
11419
11420 2002-11-23  Martin Baulig  <martin@ximian.com>
11421
11422         * ecore.cs (Expression.MemberLookup): Added additional
11423         `qualifier_type' argument which is used when we're being called
11424         from MemberAccess.DoResolve() and null if we're called from a
11425         SimpleName lookup.
11426         (Expression.MemberLookupFailed): New method to report errors; this
11427         does the CS1540 check and reports the correct error message.
11428
11429         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11430         argument for the CS1540 check and redone the way how we're dealing
11431         with private members.  See the comment in the source code for details.
11432         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11433         `closure_start_type' to `closure_qualifier_type' and check whether
11434         it's not null.  It was not this filter being broken, it was just
11435         being called with the wrong arguments.
11436
11437         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11438         and pass it the correct `qualifier_type'; this also does the error
11439         handling for us.
11440
11441 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11442
11443         * expression.cs (Invocation.EmitParams): If the we are dealing
11444         with a non-built-in value type, load its address as well.
11445
11446         (ArrayCreation): Use a a pretty constant instead
11447         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11448         static initializers.  
11449
11450         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11451         because they are not really value types, just glorified integers. 
11452
11453         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11454
11455         * ecore.cs: Remove redundant code for enumerations, make them use
11456         the same code path as everything else, fixes the casting issue
11457         with enumerations in Windows.Forms.
11458
11459         * attribute.cs: Do only cast to string if it is a string, the
11460         validation happens later.
11461
11462         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11463         people upgrade their corlibs.
11464
11465         * ecore.cs: Oops, enumerations were not following the entire code path
11466
11467 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11468
11469         * typemanager.cs (FilterWithClosure): Commented out the test for
11470         1540 in typemanager.cs, as it has problems when accessing
11471         protected methods from a parent class (see test-174.cs). 
11472
11473         * attribute.cs (Attribute.ValidateGuid): new method.
11474         (Attribute.Resolve): Use above.
11475
11476 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11479
11480         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11481         handling for enumerations, as we only needed the TypeContainer
11482         functionality to begin with (this is required for the fix below to
11483         work for enums that reference constants in a container class for
11484         example). 
11485
11486         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11487
11488         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11489         a valid TypeBuilder to perform lookups on.o
11490
11491         * class.cs (InheritableMemberSignatureCompare): Use true in the
11492         call to GetGetMethod and GetSetMethod, because we are comparing
11493         the signature, and we need to get the methods *even* if they are
11494         private. 
11495
11496         (PropertyBase.CheckBase): ditto.
11497
11498         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11499         GotoCase.Resolve): Use Peel on EmpytCasts.
11500
11501         * ecore.cs (EmptyCast): drop child, add Peel method.
11502
11503 2002-11-17  Martin Baulig  <martin@ximian.com>
11504
11505         * ecore.cs (EmptyCast.Child): New public property.
11506
11507         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11508         label resolved to an EmptyCast.  Fixes #34162.
11509         (GotoCase.Resolve): Likewise.
11510         (Block.EmitMeta): Likewise.
11511
11512 2002-11-17  Martin Baulig  <martin@ximian.com>
11513
11514         * expression.cs (Invocation.BetterConversion): Prefer int over
11515         uint; short over ushort; long over ulong for integer literals.
11516         Use ImplicitConversionExists instead of StandardConversionExists
11517         since we also need to check for user-defined implicit conversions.
11518         Fixes #34165.  Added test-173.cs.
11519
11520 2002-11-16  Martin Baulig  <martin@ximian.com>
11521
11522         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11523         with the `true' and `false' literals.  Fixes #33151.
11524
11525 2002-11-16  Martin Baulig  <martin@ximian.com>
11526
11527         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11528         October 22nd; don't do the cs1540 check for static members.
11529
11530         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11531         now using our own filter here and doing the cs1540 check again.
11532
11533 2002-11-16  Martin Baulig  <martin@ximian.com>
11534
11535         * support.cs (InternalParameters): Don't crash if we don't have
11536         any fixed parameters.  Fixes #33532.
11537
11538 2002-11-16  Martin Baulig  <martin@ximian.com>
11539
11540         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11541         when looking up static methods to make this work on Windows.
11542         Fixes #33773.
11543
11544 2002-11-16  Martin Baulig  <martin@ximian.com>
11545
11546         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11547         a setter rather than using PropertyInfo.CanWrite.
11548
11549 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11550
11551         * class.cs: Allow acces to block member by subclasses. Fixes build
11552         breaker.
11553
11554 2002-11-14  Martin Baulig  <martin@ximian.com>
11555
11556         * class.cs (Constructor.Emit): Added the extern/block check.
11557         Fixes bug #33678.
11558
11559 2002-11-14  Martin Baulig  <martin@ximian.com>
11560
11561         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11562         iteration while looking for indexers, this is needed because the
11563         indexer may have a different name in our base classes.  Fixed the
11564         error reporting (no indexers at all, not get accessor, no
11565         overloaded match).  Fixes bug #33089.
11566         (IndexerAccess.DoResolveLValue): Likewise.
11567
11568 2002-11-14  Martin Baulig  <martin@ximian.com>
11569
11570         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11571         indexers.  Fixes the first part of bug #33089.
11572         (MethodSignature.InheritableMemberSignatureCompare): Added support
11573         for properties.
11574
11575 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11576
11577         * attribute.cs (Attribute.Resolve): Catch the
11578         NullReferenceException and report it since it isn't supposed to
11579         happen. 
11580
11581 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11582
11583         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11584         LogicalOr and LogicalAnd that can benefit from recursively
11585         handling EmitBranchable.  The code now should be nice for Paolo.
11586
11587 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11590         the Type lookups, as we perform quite a number of lookups on
11591         non-Types.  This can be removed once we can deterministically tell
11592         whether we have a type or a namespace in advance.
11593
11594         But this might require special hacks from our corlib.
11595
11596         * TODO: updated.
11597
11598         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11599         and double which avoids a conversion from an integer to a double.
11600
11601         * expression.cs: tiny optimization, avoid calling IsConstant,
11602         because it effectively performs the lookup twice.
11603
11604 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11605
11606         But a bogus return here to keep the semantics of the old code
11607         until the Mono runtime is fixed.
11608
11609         * pending.cs (GetMissingInterfaces): New method used to remove all
11610         the interfaces that are already implemented by our parent
11611         classes from the list of pending methods. 
11612
11613         * interface.cs: Add checks for calls after ResolveTypeExpr.
11614
11615 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11616
11617         * class.cs (Class.Emit): Report warning 67: event not used if the
11618         warning level is beyond 3.
11619
11620         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11621         being a NullLiteral.
11622
11623         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11624         specifiers. 
11625
11626         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11627         path that might fail if a type can not be resolved.
11628
11629         * expression.cs (Binary.Emit): Emit unsigned versions of the
11630         operators. 
11631
11632         * driver.cs: use error 5.
11633
11634 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11635
11636         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11637
11638 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11639
11640         * cs-parser.jay (switch_section): A beautiful patch from Martin
11641         Baulig that fixed 33094.
11642
11643 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11646         Check whether the base is abstract and report an error if so.
11647
11648         * expression.cs (IndexerAccess.DoResolveLValue,
11649         IndexerAccess.DoResolve): ditto. 
11650
11651         (Invocation.DoResolve): ditto.
11652
11653         (Invocation.FullMethodDesc): Improve the report string.
11654
11655         * statement.cs (Block): Eliminate IsVariableDefined as it is
11656         basically just a wrapper for GetVariableInfo.
11657
11658         * ecore.cs (SimpleName): Use new 
11659
11660         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11661         type, as we return the actual parameter ref/unref state on a
11662         different call.
11663
11664 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11665
11666         * support.cs: Return proper flags REF/OUT fixing the previous
11667         commit.  
11668
11669         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11670         not used to mean `ref' but `ref or out' in ParameterReference
11671
11672         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11673         full type signature instead of calling TypeManger.CSharpName
11674         ourselves. 
11675
11676         * support.cs (InternalParameters.ParameterDesc): Do not compare
11677         directly to the modflags, because REF/OUT will actually be bitsets
11678         if set. 
11679
11680         * delegate.cs (VerifyMethod): Check also the modifiers.
11681
11682         * cs-tokenizer.cs: Fix bug where floating point values with an
11683         exponent where a sign was missing was ignored.
11684
11685         * driver.cs: Allow multiple assemblies to be specified in a single
11686         /r: argument
11687
11688 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11689
11690         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11691         because identifiers after a parenthesis would end up in this kind
11692         of production, and we needed to desamiguate it for having casts
11693         like:
11694
11695                 (UserDefinedType *) xxx
11696
11697 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11698
11699         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11700         we should set on the Bindingflags.NonPublic, but not turn on
11701         private_ok.  private_ok controls whether a Private member is
11702         returned (this is chekced on the filter routine), while the
11703         BindingFlags.NonPublic just controls whether private/protected
11704         will be allowed.   This fixes the problem part of the problem of
11705         private properties being allowed to be used in derived classes.
11706
11707         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11708         so we can call the children DoResolveLValue method (this will
11709         properly signal errors on lvalue assignments to base properties)
11710
11711         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11712         getter are null, and we have a property info, we know that this
11713         happened because the lookup failed, so we report an error 122 for
11714         protection level violation.
11715
11716         We also silently return if setter and getter are null in the
11717         resolve functions, this condition only happens if we have flagged
11718         the error before.  This is the other half of the problem. 
11719
11720         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11721         not have accessibility information, that is why we were returning
11722         true in the filter function in typemanager.cs.
11723
11724         To properly report 122 (property is inaccessible because of its
11725         protection level) correctly, we report this error in ResolveAccess
11726         by failing if both the setter and the getter are lacking (ie, the
11727         lookup failed). 
11728
11729         DoResolve and DoLResolve have been modified to check for both
11730         setter/getter being null and returning silently, the reason being
11731         that I did not want to put the knowledge about this error in upper
11732         layers, like:
11733
11734         int old = Report.Errors;
11735         x = new PropertyExpr (...);
11736         if (old != Report.Errors)
11737                 return null;
11738         else
11739                 return x;
11740
11741         So the property expr is returned, but it is invalid, so the error
11742         will be flagged during the resolve process. 
11743
11744         * class.cs: Remove InheritablePropertySignatureCompare from the
11745         class, as we no longer depend on the property signature to compute
11746         whether it is possible to implement a method or not.
11747
11748         The reason is that calling PropertyInfo.GetGetMethod will return
11749         null (in .NET, in Mono it works, and we should change this), in
11750         cases where the Get Method does not exist in that particular
11751         class.
11752
11753         So this code:
11754
11755         class X { public virtual int A { get { return 1; } } }
11756         class Y : X { }
11757         class Z : Y { public override int A { get { return 2; } } }
11758
11759         Would fail in Z because the parent (Y) would not have the property
11760         defined.  So we avoid this completely now (because the alternative
11761         fix was ugly and slow), and we now depend exclusively on the
11762         method names.
11763
11764         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11765         reference method, instead of using the property.
11766
11767         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11768         routines are gone now.
11769
11770         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11771         names, they were incorrectly named.
11772
11773         * cs-tokenizer.cs: Return are more gentle token on failure. 
11774
11775         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11776         had an out-of-sync index variable, which caused it to remove from
11777         the list of pending methods the wrong method sometimes.
11778
11779 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11780
11781         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11782         CanWrite, because those refer to this particular instance of the
11783         property, and do not take into account the fact that we can
11784         override single members of a property.
11785
11786         Constructor requires an EmitContext.  The resolution process does
11787         not happen here, but we need to compute the accessors before,
11788         because the resolution does not always happen for properties.
11789
11790         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11791         subclass, before we did not update this flag, but we did update
11792         bindingflags. 
11793
11794         (GetAccessors): Drop this routine, as it did not work in the
11795         presence of partially overwritten set/get methods. 
11796
11797         Notice that this broke the cs1540 detection, but that will require
11798         more thinking. 
11799
11800 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11801
11802         * class.cs:
11803         * codegen.cs:
11804         * driver.cs: issue a warning instead of an error if we don't support
11805         debugging for the platform. Also ignore a couple of errors that may
11806         arise when trying to write the symbols. Undo my previous patch.
11807
11808 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11809
11810         * driver.cs: ignore /debug switch except for Unix platforms.
11811
11812 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11813
11814         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11815
11816 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * driver.cs: Do not make mcs-debug conditional, so we do not break
11819         builds that use it.
11820
11821         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11822         review this patch.  But basically after all the children variables
11823         have been merged, the value of "Breaks" was not being set to
11824         new_breaks for Switch blocks.  I think that it should be set after
11825         it has executed.  Currently I set this to the value of new_breaks,
11826         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11827         conservative, but I do not understand this code very well.
11828
11829         I did not break anything in the build, so that is good ;-)
11830
11831         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11832
11833 2002-10-20  Mark Crichton  <crichton@gimp.org>
11834
11835         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11836
11837 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11838
11839         * cfold.cs: Fixed compile blocker.
11840
11841 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11842
11843         * driver.cs: I was chekcing the key, not the file.
11844
11845 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11846
11847         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11848         message that we were generating - we just need to silently return
11849         a null.
11850
11851 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11852
11853         * class.cs (Event.Define): Change my previous commit, as this
11854         breaks the debugger.  This is a temporary hack, as it seems like
11855         the compiler is generating events incorrectly to begin with.
11856
11857         * expression.cs (Binary.ResolveOperator): Added support for 
11858         "U operator - (E x, E y)"
11859
11860         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11861         y)".
11862
11863         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11864         init-only variables, but this path did not take into account that
11865         there might be also instance readonly variables.  Correct this
11866         problem. 
11867
11868         This fixes bug 32253
11869
11870         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11871         delegates as well.
11872
11873         * driver.cs: Change the extension for modules to `netmodule'
11874
11875         * cs-parser.jay: Improved slightly the location tracking for
11876         the debugger symbols.
11877
11878         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11879         modifiers that were specified instead of the hardcoded value
11880         (FamAndAssem).  This was basically ignoring the static modifier,
11881         and others.  Fixes 32429.
11882
11883         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11884         fixed a bug in the process (32476)
11885
11886         * expression.cs (ArrayAccess.EmitAssign): Patch from
11887         hwang_rob@yahoo.ca that fixes bug 31834.3
11888
11889 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * driver.cs: Make the module extension .netmodule.
11892
11893 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11894
11895         * driver.cs: Report an error if the resource file is not found
11896         instead of crashing.
11897
11898         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11899         false, like Emit does.
11900
11901 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11902
11903         * typemanager.cs: Remove unused private member.  Also reported mcs
11904         bug to report this as a warning like csc.
11905
11906 2002-10-15  Martin Baulig  <martin@gnome.org>
11907
11908         * statement.cs (Statement.Emit): Made this a virtual method; emits
11909         the line number info and calls DoEmit().
11910         (Statement.DoEmit): New protected abstract method, formerly knows
11911         as Statement.Emit().
11912
11913         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11914
11915 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11918         have fixed a remaining problem: not every AddXXXX was adding a
11919         fully qualified name.  
11920
11921         Now everyone registers a fully qualified name in the DeclSpace as
11922         being defined instead of the partial name.  
11923
11924         Downsides: we are slower than we need to be due to the excess
11925         copies and the names being registered this way.  
11926
11927         The reason for this is that we currently depend (on the corlib
11928         bootstrap for instance) that types are fully qualified, because
11929         we dump all the types in the namespace, and we should really have
11930         types inserted into the proper namespace, so we can only store the
11931         basenames in the defined_names array.
11932
11933 2002-10-10  Martin Baulig  <martin@gnome.org>
11934
11935         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11936         from bug #31834, see the bug report for a testcase which is
11937         miscompiled.
11938
11939 2002-10-10  Martin Baulig  <martin@gnome.org>
11940
11941         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11942         flow analysis code for this.
11943
11944         * statement.cs (Do, While, For): Tell the flow analysis code about
11945         infinite loops.
11946         (FlowBranching.UsageVector): Added support for infinite loops.
11947         (Block.Resolve): Moved the dead code elimination here and use flow
11948         analysis to do it.
11949
11950 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11951
11952         * class.cs (Field.Define): Catch cycles on struct type
11953         definitions. 
11954
11955         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11956         fields if the fields are static.  We only need to check instance
11957         fields. 
11958
11959         * expression.cs (As.DoResolve): Test for reference type.
11960
11961         * statement.cs (Using.ResolveExpression): Use
11962         ConvertImplicitRequired, not ConvertImplicit which reports an
11963         error on failture
11964         (Using.ResolveLocalVariableDecls): ditto.
11965
11966         * expression.cs (Binary.ResolveOperator): Report errors in a few
11967         places where we had to.
11968
11969         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11970
11971 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * expression.cs: Use StoreFromPtr instead of extracting the type
11974         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11975
11976         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11977         an enumeration value to a System.Enum, but System.Enum is not a
11978         value type, but an class type, so we need to box.
11979
11980         (Expression.ConvertExplicit): One codepath could return
11981         errors but not flag them.  Fix this.  Fixes #31853
11982
11983         * parameter.cs (Resolve): Do not allow void as a parameter type.
11984
11985 2002-10-06  Martin Baulig  <martin@gnome.org>
11986
11987         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11988         if it's a class type and not a struct.  Fixes #31815.
11989
11990 2002-10-06  Martin Baulig  <martin@gnome.org>
11991
11992         * statement.cs: Reworked the flow analysis code a bit to make it
11993         usable for dead code elimination.
11994
11995 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11996
11997         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11998
11999 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12002         to fix the test 165, will investigate deeper.
12003
12004 2002-10-04  Martin Baulig  <martin@gnome.org>
12005
12006         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12007         finally blocks actually work.
12008         (Try.Resolve): We don't need to create a sibling for `finally' if
12009         there is no finally block.
12010
12011 2002-10-04  Martin Baulig  <martin@gnome.org>
12012
12013         * class.cs (Constructor.Define): The default accessibility for a
12014         non-default constructor is private, not public.
12015
12016 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12017
12018         * class.cs (Constructor): Make AllowedModifiers public, add
12019         EXTERN.
12020
12021         * cs-parser.jay: Perform the modifiers test here, as the
12022         constructor for the Constructor class usually receives a zero
12023         because of the way we create it (first we create, later we
12024         customize, and we were never checking the modifiers).
12025
12026         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12027         is a version of LookupTypeReflection that includes the type-name
12028         cache.  This can be used as a fast path for functions that know
12029         the fully qualified name and are only calling into *.GetType() to
12030         obtain a composed type.
12031
12032         This is also used by TypeManager.LookupType during its type
12033         composition.
12034
12035         (LookupType): We now also track the real type name, as sometimes
12036         we can get a quey for the real type name from things like
12037         ComposedCast.  This fixes bug 31422.
12038
12039         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12040         complete type fullname, it does not have to go through the type
12041         resolution system to obtain the composed version of the type (for
12042         obtaining arrays or pointers).
12043
12044         (Conditional.Emit): Use the EmitBoolExpression to
12045         generate nicer code, as requested by Paolo.
12046
12047         (ArrayCreation.CheckIndices): Use the patch from
12048         hwang_rob@yahoo.ca to validate the array initializers. 
12049
12050 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12051
12052         * class.cs (ConstructorInitializer.Emit): simplify code by using
12053         Invocation.EmitCall, and at the same time, fix the bugs in calling
12054         parent constructors that took variable arguments. 
12055
12056         * ecore.cs (Expression.ConvertNumericExplicit,
12057         Expression.ImplicitNumericConversion): Remove the code that
12058         manually wrapped decimal (InternalTypeConstructor call is now gone
12059         as well).
12060
12061         * expression.cs (Cast.TryReduce): Also handle decimal types when
12062         trying to perform a constant fold on the type.
12063
12064         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12065
12066         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12067         that only turned off an error report, and did nothing else. 
12068
12069 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12070
12071         * driver.cs: Handle and ignore /fullpaths
12072
12073 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12074
12075         * expression.cs (Binary.ResolveOperator): Catch the case where
12076         DoNumericPromotions returns true, 
12077
12078         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12079
12080 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12081
12082         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12083         report error 70.
12084
12085 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12086
12087         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12088         conversion exists, but it is also required that the conversion be
12089         performed.  This manifested in "(Type64Enum) 2".  
12090
12091         * class.cs (TypeManager.AddMethod): The fix is not to change
12092         AddEnum, because that one was using a fully qualified name (every
12093         DeclSpace derivative does), but to change the AddMethod routine
12094         that was using an un-namespaced name.  This now correctly reports
12095         the duplicated name.
12096
12097         Revert patch until I can properly fix it.  The issue
12098         is that we have a shared Type space across all namespaces
12099         currently, which is wrong.
12100
12101         Options include making the Namespace a DeclSpace, and merge
12102         current_namespace/current_container in the parser.
12103
12104 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12105
12106         * cs-parser.jay: Improve error reporting when we get a different
12107         kind of expression in local_variable_type and
12108         local_variable_pointer_type. 
12109
12110         Propagate this to avoid missleading errors being reported.
12111
12112         * ecore.cs (ImplicitReferenceConversion): treat
12113         TypeManager.value_type as a target just like object_type.   As
12114         code like this:
12115
12116         ValueType v = 1;
12117
12118         Is valid, and needs to result in the int 1 being boxed before it
12119         is assigned to the value type v.
12120
12121         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12122         to validate the enumeration name.
12123
12124         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12125         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12126         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12127
12128         * ecore.cs (TryImplicitIntConversion): When doing an
12129         implicit-enumeration-conversion, check if the type is 64-bits and
12130         perform a conversion before passing to EnumConstant.
12131
12132 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12135         report ambiguous type references.  Unlike the MS version, we
12136         report what the ambiguity is.   Innovation at work ;-)
12137
12138         (DeclSpace.FindType): Require a location argument to
12139         display when we display an ambiguous error.
12140
12141         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12142
12143         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12144
12145         * expression.cs (EmitDynamicInitializers): Apply patch from
12146         hwang_rob@yahoo.ca that fixes the order in which we emit our
12147         initializers. 
12148
12149 2002-09-21  Martin Baulig  <martin@gnome.org>
12150
12151         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12152         delegate takes no arguments.
12153
12154 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12155
12156         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12157         from integers.
12158
12159         * expression.cs: Extract the underlying type.
12160
12161         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12162
12163         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12164
12165 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12166
12167         * class.cs (TypeContainer.DefineType): We can not use the nice
12168         PackingSize with the size set to 1 DefineType method, because it
12169         will not allow us to define the interfaces that the struct
12170         implements.
12171
12172         This completes the fixing of bug 27287
12173
12174         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12175         means also structs.  This fixes part of the problem. 
12176         (Expresion.ImplicitReferenceConversionExists): ditto.
12177
12178         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12179         error if there were no errors reported during the type lookup
12180         process, to avoid duplicates or redundant errors.  Without this
12181         you would get an ambiguous errors plus a type not found.  We have
12182         beaten the user enough with the first error.  
12183
12184         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12185         reference. 
12186
12187         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12188         during the resolution process, stop the lookup, this avoids
12189         repeated error reports (same error twice).
12190
12191         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12192
12193         * typemanager.cs (LookupType): Redo the type lookup code to match
12194         the needs of System.Reflection.  
12195
12196         The issue is that System.Reflection requires references to nested
12197         types to begin with a "+" sign instead of a dot.  So toplevel
12198         types look like: "NameSpace.TopLevelClass", and nested ones look
12199         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12200         levels. 
12201
12202 2002-09-19  Martin Baulig  <martin@gnome.org>
12203
12204         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12205         says that a method always returns or always throws an exception,
12206         don't report the CS0161.
12207
12208         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12209         set `Returns = new_returns'.
12210
12211 2002-09-19  Martin Baulig  <martin@gnome.org>
12212
12213         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12214         to an enum constant, check for a CS0176.
12215
12216 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12219         for operators that must be in pairs and report errors.
12220
12221         * ecore.cs (SimpleName.DoResolveType): During the initial type
12222         resolution process, when we define types recursively, we must
12223         check first for types in our current scope before we perform
12224         lookups in the enclosing scopes.
12225
12226         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12227
12228         (Invocation.VerifyArgumentsCompat): Call
12229         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12230         I thought we were supposed to always call this, but there are a
12231         few places in the code where we dont do it.
12232
12233 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12234
12235         * driver.cs: Add support in -linkres and -resource to specify the
12236         name of the identifier.
12237
12238 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12239
12240         * ecore.cs (StandardConversionExists): Sync with the conversion
12241         code: allow anything-* to void* conversions.
12242
12243         (FindMostSpecificSource): Use an Expression argument
12244         instead of a Type, because we might be handed over a Literal which
12245         gets a few more implicit conversions that plain types do not.  So
12246         this information was being lost.
12247
12248         Also, we drop the temporary type-holder expression when not
12249         required.
12250
12251 2002-09-17  Martin Baulig  <martin@gnome.org>
12252
12253         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12254         this is an explicit interface implementation.
12255
12256 2002-09-17  Martin Baulig  <martin@gnome.org>
12257
12258         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12259         different `IndexerName' attributes.
12260
12261         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12262         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12263         virtual CommonResolve().
12264
12265 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12266
12267         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12268         and convert that to the UnderlyingType.
12269
12270         * statement.cs (Foreach.Resolve): Indexers are just like variables
12271         or PropertyAccesses.
12272
12273         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12274         inside quoted strings, we were not doing this before.
12275
12276 2002-09-16  Martin Baulig  <martin@gnome.org>
12277
12278         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12279         resolve it.  This is needed for the definite assignment check of the
12280         instance expression, fixes bug #29846.
12281         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12282
12283 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12284
12285         * parameter.cs: Fix compile error.  Cannot reference static member
12286         from an instance object.  Is this an mcs bug?
12287
12288 2002-09-14  Martin Baulig  <martin@gnome.org>
12289
12290         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12291         multiple times.  Fixes bug #30295, added test-166.cs.
12292
12293 2002-09-14  Martin Baulig  <martin@gnome.org>
12294
12295         * statement.cs (Block.Emit): Don't emit unreachable code.
12296         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12297         `break' statements.
12298         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12299
12300 2002-09-14  Martin Baulig  <martin@gnome.org>
12301
12302         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12303         is set.
12304
12305 2002-09-14  Martin Baulig  <martin@gnome.org>
12306
12307         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12308         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12309         be false on the ms runtime.
12310
12311 2002-09-13  Martin Baulig  <martin@gnome.org>
12312
12313         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12314         the CS0038 error message.
12315
12316 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12317
12318         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12319         constant inside, return it.
12320
12321 2002-09-12  Martin Baulig  <martin@gnome.org>
12322
12323         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12324         implicit conversion can be done between enum types.
12325
12326         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12327         check whether an implicit conversion to the current enum's UnderlyingType
12328         exists and report an error if not.
12329
12330         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12331         without debugging support.
12332
12333         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12334         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12335
12336 2002-09-12  Martin Baulig  <martin@gnome.org>
12337
12338         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12339
12340         * ecore.cs (IMemberExpr.DeclaringType): New property.
12341         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12342         nonstatic member of an outer type (CS0038).
12343
12344 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12345
12346         * driver.cs: Activate the using-error detector at warning level
12347         4 (at least for MS-compatible APIs).
12348
12349         * namespace.cs (VerifyUsing): Small buglett fix.
12350
12351         * pending.cs (PendingImplementation): pass the container pointer. 
12352
12353         * interface.cs (GetMethods): Allow for recursive definition.  Long
12354         term, I would like to move every type to support recursive
12355         definitions, not the current ordering mechanism that we have right
12356         now.
12357
12358         The situation is this: Attributes are handled before interfaces,
12359         so we can apply attributes to interfaces.  But some attributes
12360         implement interfaces, we will now handle the simple cases
12361         (recursive definitions will just get an error).  
12362
12363         * parameter.cs: Only invalidate types at the end if we fail to
12364         lookup all types.  
12365
12366 2002-09-09  Martin Baulig  <martin@gnome.org>
12367
12368         * ecore.cs (PropertyExpr.Emit): Also check for
12369         TypeManager.system_int_array_get_length so this'll also work when
12370         compiling corlib.  Fixes #30003.
12371
12372 2002-09-09  Martin Baulig  <martin@gnome.org>
12373
12374         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12375         and throw an exception if we can't get the type's size.  Fixed #30040,
12376         added test-165.cs.
12377
12378 2002-09-09  Martin Baulig  <martin@gnome.org>
12379
12380         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12381
12382         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12383         context.  Fixes bug #30027.
12384
12385         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12386         virtual functions.  Fixes bug #30043, added test-164.cs.
12387
12388 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12389
12390         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12391
12392 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12393
12394         * driver.cs: Use an object to get the windows codepage since it's not a
12395         static property.
12396
12397 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12398
12399         * statement.cs (For.Emit): for infinite loops (test == null)
12400         return whether there is a break inside, not always "true".
12401
12402         * namespace.cs (UsingEntry): New struct to hold the name of the
12403         using definition, the location where it is defined, and whether it
12404         has been used in a successful type lookup.
12405
12406         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12407         strings.
12408
12409         * decl.cs: ditto.
12410
12411 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12412
12413         * attribute.cs : Fix incorrect code which relied on catching
12414         a NullReferenceException to detect a null being passed in
12415         where an object was expected.
12416
12417 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * statement.cs (Try): flag the catch variable as assigned
12420
12421         * expression.cs (Cast): Simplified by using ResolveType instead of
12422         manually resolving.
12423
12424         * statement.cs (Catch): Fix bug by using ResolveType.
12425
12426 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12427
12428         * expression.cs (BetterConversion): Special case for when we have
12429         a NullLiteral as the argument and we have to choose between string
12430         and object types - we choose string the way csc does.
12431
12432         * attribute.cs (Attribute.Resolve): Catch the
12433         NullReferenceException and report error #182 since the Mono
12434         runtime no more has the bug and having this exception raised means
12435         we tried to select a constructor which takes an object and is
12436         passed a null.
12437
12438 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12439
12440         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12441         message (1502, 1503) when we can't locate a method after overload
12442         resolution. This is much more informative and closes the bug
12443         Miguel reported.
12444
12445         * interface.cs (PopulateMethod): Return if there are no argument
12446         types. Fixes a NullReferenceException bug.
12447
12448         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12449         expressions too. Previously we were checking only in one place for
12450         positional arguments leaving out named arguments.
12451
12452         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12453         type to the enum type is not allowed. Remove code corresponding to
12454         that.
12455
12456         (ConvertNumericExplicit): Allow explicit conversions from
12457         the underlying type to enum type. This precisely follows the spec
12458         and closes a bug filed by Gonzalo.
12459
12460 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12461
12462         * compiler.csproj:
12463         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12464
12465 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12466
12467         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12468         it was important that we stored the right value after the
12469         reduction in `converted'.
12470
12471 2002-09-04  Martin Baulig  <martin@gnome.org>
12472
12473         * location.cs (Location.SymbolDocument): Use full pathnames for the
12474         source files.
12475
12476 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12479         of the expression resolve mechanism, because that will catch the
12480         SimpleName error failures.
12481
12482         (Conditional): If we can not resolve the
12483         expression, return, do not crash.
12484
12485 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12486
12487         * cs-tokenizer.cs:
12488         (location): display token name instead of its number.
12489
12490 2002-08-28  Martin Baulig  <martin@gnome.org>
12491
12492         * expression.cs (Binary.ResolveOperator): Don't silently return
12493         but return an error if an operator cannot be applied between two
12494         enum types.
12495
12496 2002-08-28  Martin Baulig  <martin@gnome.org>
12497
12498         * class.cs (Constructor.Define): Set the permission attributes
12499         correctly instead of making all constructors public.
12500
12501 2002-08-28  Martin Baulig  <martin@gnome.org>
12502
12503         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12504         for private members before reporting a CS0103; if we find anything,
12505         it's a CS0122.
12506
12507 2002-08-28  Martin Baulig  <martin@gnome.org>
12508
12509         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12510         to check whether `closure_start_type == closure_invocation_type',
12511         we also need to check whether `m.DeclaringType == closure_invocation_type'
12512         before bypassing the permission checks.  We might be accessing
12513         protected/private members from the base class.
12514         (TypeManager.RealMemberLookup): Only set private_ok if private
12515         members were requested via BindingFlags.NonPublic.
12516
12517         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12518
12519         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12520         MethodGroupExpr.IsExplicitImpl if appropriate.
12521         (Invocation.DoResolve): Don't report the CS0120 for explicit
12522         interface implementations.
12523
12524 2002-08-27  Martin Baulig  <martin@gnome.org>
12525
12526         * expression.cs (Invocation.DoResolve): If this is a static
12527         method and we don't have an InstanceExpression, we must report
12528         a CS0120.
12529
12530 2002-08-25  Martin Baulig  <martin@gnome.org>
12531
12532         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12533         `==' between a valuetype and an object.
12534
12535 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12536
12537         * ecore.cs (TypeExpr): Provide a ToString method.
12538
12539 2002-08-24  Martin Baulig  <martin@gnome.org>
12540
12541         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12542         now called proggie.dbg and it's a binary file.
12543
12544 2002-08-23  Martin Baulig  <martin@gnome.org>
12545
12546         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12547
12548 2002-08-23  Martin Baulig  <martin@gnome.org>
12549
12550         * struct.cs (MyStructInfo.ctor): Make this work with empty
12551         structs; it's not allowed to use foreach() on null.
12552
12553 2002-08-23  Martin Baulig  <martin@gnome.org>
12554
12555         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12556         writer the full pathname of the generated assembly.
12557
12558 2002-08-23  Martin Baulig  <martin@gnome.org>
12559
12560         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12561         A `finally' block never returns or breaks; improved handling of
12562         unreachable code.
12563
12564 2002-08-23  Martin Baulig  <martin@gnome.org>
12565
12566         * statement.cs (Throw.Resolve): Allow `throw null'.
12567
12568 2002-08-23  Martin Baulig  <martin@gnome.org>
12569
12570         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12571         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12572         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12573         MemberLookup would return a wrong event if this is an explicit
12574         interface implementation and the class has an event with the same
12575         name.
12576
12577 2002-08-23  Martin Baulig  <martin@gnome.org>
12578
12579         * statement.cs (Block.AddChildVariableNames): New public method.
12580         (Block.AddChildVariableName): Likewise.
12581         (Block.IsVariableNameUsedInChildBlock): Likewise.
12582         (Block.AddVariable): Check whether a variable name has already
12583         been used in a child block.
12584
12585         * cs-parser.jay (declare_local_variables): Mark all variable names
12586         from the current block as being used in a child block in the
12587         implicit block.
12588
12589 2002-08-23  Martin Baulig  <martin@gnome.org>
12590
12591         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12592         find the symbol writer.
12593
12594         * driver.cs: csc also allows the arguments to /define being
12595         separated by commas, not only by semicolons.
12596
12597 2002-08-23  Martin Baulig  <martin@gnome.org>
12598
12599         * interface.cs (Interface.GetMembers): Added static check for events.
12600
12601 2002-08-15  Martin Baulig  <martin@gnome.org>
12602
12603         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12604         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12605
12606         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12607         why the MethodData.EmitDestructor() change was necessary.
12608
12609 2002-08-20  Martin Baulig  <martin@gnome.org>
12610
12611         * class.cs (TypeContainer.FindMembers): Added static check for events.
12612
12613         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12614
12615         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12616         use Type.GetEvents(), not Type.FindMembers().
12617
12618 2002-08-20  Martin Baulig  <martin@gnome.org>
12619
12620         * decl.cs (MemberCache): Added a special method cache which will
12621         be used for method-only searched.  This ensures that a method
12622         search will return a MethodInfo with the correct ReflectedType for
12623         inherited methods.      
12624
12625 2002-08-20  Martin Baulig  <martin@gnome.org>
12626
12627         * decl.cs (DeclSpace.FindMembers): Made this public.
12628
12629 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12630
12631         * delegate.cs: fixed build on windows.
12632         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12633
12634 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12635
12636         * ecore.cs (StandardConversionExists): Return a false
12637         if we are trying to convert the void type to anything else
12638         since that is not allowed.
12639
12640         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12641         we flag error 70 in the event an event is trying to be accessed
12642         directly from outside the declaring type.
12643
12644 2002-08-20  Martin Baulig  <martin@gnome.org>
12645
12646         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12647         MemberCache from typemanager.cs to decl.cs.
12648
12649 2002-08-19  Martin Baulig  <martin@gnome.org>
12650
12651         * class.cs (TypeContainer): Implement IMemberContainer.
12652         (TypeContainer.DefineMembers): Create the MemberCache.
12653         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12654         return public members if BindingFlags.Public was given, check
12655         whether members are static.
12656
12657 2002-08-16  Martin Baulig  <martin@gnome.org>
12658
12659         * decl.cs (DeclSpace.Define): Splitted this in Define and
12660         DefineMembers.  DefineMembers is called first and initializes the
12661         MemberCache.
12662
12663         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12664         DefineMembers() on all our DeclSpaces.
12665
12666         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12667         but call DefineMembers() on all nested interfaces.  We call their
12668         Define() in our new Define() function.
12669
12670         * interface.cs (Interface): Implement IMemberContainer.
12671         (Interface.Define): Moved all code except the attribute stuf to
12672         DefineMembers().
12673         (Interface.DefineMembers): Initialize the member cache.
12674
12675         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12676         need this anymore since we can use MemberCache.FindMembers directly.
12677
12678 2002-08-19  Martin Baulig  <martin@gnome.org>
12679
12680         * typemanager.cs (MemberCache): When creating the cache for an
12681         interface type, add all inherited members.
12682         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12683         to `out bool used_cache' and documented it.
12684         (TypeManager.MemberLookup): If we already used the cache in the first
12685         iteration, we don't need to do the interfaces check.
12686
12687 2002-08-19  Martin Baulig  <martin@gnome.org>
12688
12689         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12690         here from IMemberFinder and don't implement this interface anymore.
12691         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12692
12693         * typemanager.cs (IMemberFinder): This interface is now only used by
12694         classes which actually support the member cache.
12695         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12696         since we only put DeclSpaces into this Hashtable.
12697         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12698         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12699
12700 2002-08-16  Martin Baulig  <martin@gnome.org>
12701
12702         * typemanager.cs (ICachingMemberFinder): Removed.
12703         (IMemberFinder.MemberCache): New property.
12704         (TypeManager.FindMembers): Merged this with RealFindMembers().
12705         This function will never be called from TypeManager.MemberLookup()
12706         so we can't use the cache here, just the IMemberFinder.
12707         (TypeManager.MemberLookup_FindMembers): Check whether the
12708         IMemberFinder has a MemberCache and call the cache's FindMembers
12709         function.
12710         (MemberCache): Rewrote larger parts of this yet another time and
12711         cleaned it up a bit.
12712
12713 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * driver.cs (LoadArgs): Support quoting.
12716
12717         (Usage): Show the CSC-like command line arguments.
12718
12719         Improved a few error messages.
12720
12721 2002-08-15  Martin Baulig  <martin@gnome.org>
12722
12723         * typemanager.cs (IMemberContainer.Type): New property.
12724         (IMemberContainer.IsInterface): New property.
12725
12726         The following changes are conditional to BROKEN_RUNTIME, which is
12727         defined at the top of the file.
12728
12729         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12730         class'es members, but add all members from TypeHandle.ObjectType
12731         if we're an interface.
12732         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12733         is the current type.
12734         (MemberCache.CacheEntry.Container): Removed this field.
12735         (TypeHandle.GetMembers): Include inherited members.
12736
12737 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12738
12739         * typemanager.cs: fixed compilation and added a comment on a field that
12740         is never used.
12741
12742 2002-08-15  Martin Baulig  <martin@gnome.org>
12743
12744         * class.cs (ConstructorInitializer.Resolve): In the
12745         Expression.MemberLookup call, use the queried_type as
12746         invocation_type.
12747
12748         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12749         declared' attribute, it's always true.
12750         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12751         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12752         temporary wrapper for FindMembers which tells MemberLookup whether
12753         members from the base classes are included in the return value.
12754         This will go away soon.
12755         (TypeManager.MemberLookup): Use this temporary hack here; once the
12756         new MemberCache is completed, we don't need to do the DeclaredOnly
12757         looping here anymore since the MemberCache will take care of this.
12758         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12759         (MemberCache): When creating the MemberCache for a class, get
12760         members from the current class and all its base classes.
12761         (MemberCache.CacheEntry.Container): New field.  This is a
12762         temporary hack until the Mono runtime is fixed to distinguish
12763         between ReflectedType and DeclaringType.  It allows us to use MCS
12764         with both the MS runtime and the unfixed Mono runtime without
12765         problems and without accecting performance.
12766         (MemberCache.SearchMembers): The DeclaredOnly looping from
12767         TypeManager.MemberLookup is now done here.      
12768
12769 2002-08-14  Martin Baulig  <martin@gnome.org>
12770
12771         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12772         Type.GetFields on dynamic types but get the fields from the
12773         corresponding TypeContainer.
12774         (MyStructInfo.GetStructInfo): Added check for enum types.
12775
12776         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12777         (MemberList.SyncRoot): Implemented.
12778         (TypeManager.FilterWithClosure): No need to check permissions if
12779         closure_start_type == closure_invocation_type, don't crash if
12780         closure_invocation_type is null.
12781
12782 2002-08-13  Martin Baulig  <martin@gnome.org>
12783
12784         Rewrote TypeContainer.FindMembers to use a member cache.  This
12785         gives us a speed increase of about 35% for the self-hosting MCS
12786         build and of about 15-20% for the class libs (both on GNU/Linux).
12787
12788         * report.cs (Timer): New class to get enhanced profiling.  This
12789         whole class is "TIMER" conditional since it remarkably slows down
12790         compilation speed.
12791
12792         * class.cs (MemberList): New class.  This is an IList wrapper
12793         which we're now using instead of passing MemberInfo[]'s around to
12794         avoid copying this array unnecessarily.
12795         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12796         (ICachingMemberFinder, IMemberContainer): New interface.
12797         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12798         has already been checked, otherwise use it for the name comparision.
12799         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12800         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12801         if possible.  Returns a MemberList, not a MemberInfo [].
12802         (TypeHandle): New class, implements IMemberContainer.  We create
12803         one instance of this class per type, it contains a MemberCache
12804         which is used to do the member lookups.
12805         (MemberCache): New class.  Each instance of this class contains
12806         all members of a type and a name-based hash table.
12807         (MemberCache.FindMembers): This is our new member lookup
12808         function.  First, it looks up all members of the requested name in
12809         the hash table.  Then, it walks this list and sorts out all
12810         applicable members and returns them.
12811
12812 2002-08-13  Martin Baulig  <martin@gnome.org>
12813
12814         In addition to a nice code cleanup, this gives us a performance
12815         increase of about 1.4% on GNU/Linux - not much, but it's already
12816         half a second for the self-hosting MCS compilation.
12817
12818         * typemanager.cs (IMemberFinder): New interface.  It is used by
12819         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12820         Enum, Delegate or Interface.
12821         (TypeManager.finder_to_member_finder): New PtrHashtable.
12822         (TypeManager.finder_to_container): Removed.
12823         (TypeManager.finder_to_delegate): Removed.
12824         (TypeManager.finder_to_interface): Removed.
12825         (TypeManager.finder_to_enum): Removed.
12826
12827         * interface.cs (Interface): Implement IMemberFinder.
12828
12829         * delegate.cs (Delegate): Implement IMemberFinder.
12830
12831         * enum.cs (Enum): Implement IMemberFinder.
12832
12833         * class.cs (TypeContainer): Implement IMemberFinder.
12834
12835 2002-08-12  Martin Baulig  <martin@gnome.org>
12836
12837         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12838
12839 2002-08-12  Martin Baulig  <martin@gnome.org>
12840
12841         * ecore.cs (ITypeExpression): New interface for expressions which
12842         resolve to a type.
12843         (TypeExpression): Renamed to TypeLookupExpression.
12844         (Expression.DoResolve): If we're doing a types-only lookup, the
12845         expression must implement the ITypeExpression interface and we
12846         call DoResolveType() on it.
12847         (SimpleName): Implement the new ITypeExpression interface.
12848         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12849         hack, the situation that we're only looking up types can't happen
12850         anymore when this method is called.  Moved the type lookup code to
12851         DoResolveType() and call it.
12852         (SimpleName.DoResolveType): This ITypeExpression interface method
12853         is now doing the types-only lookup.
12854         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12855         (ResolveFlags): Added MaskExprClass.
12856
12857         * expression.cs (MemberAccess): Implement the ITypeExpression
12858         interface.
12859         (MemberAccess.DoResolve): Added support for a types-only lookup
12860         when we're called via ITypeExpression.DoResolveType().
12861         (ComposedCast): Implement the ITypeExpression interface.
12862
12863         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12864         Expression.Resolve() with ResolveFlags.Type instead.
12865
12866 2002-08-12  Martin Baulig  <martin@gnome.org>
12867
12868         * interface.cs (Interface.Define): Apply attributes.
12869
12870         * attribute.cs (Attribute.ApplyAttributes): Added support for
12871         interface attributes.
12872
12873 2002-08-11  Martin Baulig  <martin@gnome.org>
12874
12875         * statement.cs (Block.Emit): Only check the "this" variable if we
12876         do not always throw an exception.
12877
12878         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12879         whether the property has a set accessor.
12880
12881 2002-08-11  Martin Baulig  <martin@gnome.org>
12882
12883         Added control flow analysis support for structs.
12884
12885         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12886         with control flow analysis turned off.
12887         (IVariable): New interface.
12888         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12889         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12890         (FieldExpr.DoResolve): Resolve the instance expression with flow
12891         analysis turned off and do the definite assignment check after the
12892         resolving when we know what the expression will resolve to.
12893
12894         * expression.cs (LocalVariableReference, ParameterReference):
12895         Implement the new IVariable interface, only call the flow analysis
12896         code if ec.DoFlowAnalysis is true.
12897         (This): Added constructor which takes a Block argument.  Implement
12898         the new IVariable interface.
12899         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12900         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12901         This does the definite assignment checks for struct members.
12902
12903         * class.cs (Constructor.Emit): If this is a non-static `struct'
12904         constructor which doesn't have any initializer, call
12905         Block.AddThisVariable() to tell the flow analysis code that all
12906         struct elements must be initialized before control returns from
12907         the constructor.
12908
12909         * statement.cs (MyStructInfo): New public class.
12910         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12911         argument to this indexer.  If non-zero, check an individual struct
12912         member, not the whole struct.
12913         (FlowBranching.CheckOutParameters): Check struct members.
12914         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12915         overloaded versions of these methods which take an additional
12916         `int field_idx' argument to check struct members.
12917         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12918         overloaded versions of these methods which take an additional
12919         `string field_name' argument to check struct member.s
12920         (VariableInfo): Implement the IVariable interface.
12921         (VariableInfo.StructInfo): New public property.  Returns the
12922         MyStructInfo instance of the variable if it's a struct or null.
12923         (Block.AddThisVariable): New public method.  This is called from
12924         Constructor.Emit() for non-static `struct' constructor which do
12925         not have any initializer.  It creates a special variable for the
12926         "this" instance variable which will be checked by the flow
12927         analysis code to ensure that all of the struct's fields are
12928         initialized before control returns from the constructor.
12929         (UsageVector): Added support for struct members.  If a
12930         variable/parameter is a struct with N members, we reserve a slot
12931         in the usage vector for each member.  A struct is considered fully
12932         initialized if either the struct itself (slot 0) or all its
12933         members are initialized.
12934
12935 2002-08-08  Martin Baulig  <martin@gnome.org>
12936
12937         * driver.cs (Driver.MainDriver): Only report an error CS5001
12938         if there were no compilation errors.
12939
12940         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12941         `UnsafeContext' property to determine whether the parent is in
12942         unsafe context rather than checking the parent's ModFlags:
12943         classes nested in an unsafe class are unsafe as well.
12944
12945 2002-08-08  Martin Baulig  <martin@gnome.org>
12946
12947         * statement.cs (UsageVector.MergeChildren): Distinguish between
12948         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12949         we return.  Added test17() and test18() to test-154.cs.
12950
12951 2002-08-08  Martin Baulig  <martin@gnome.org>
12952
12953         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12954         Family access, make sure the invoking type isn't a subclass of the
12955         queried type (that'd be a CS1540).
12956
12957         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12958         this method which takes an additional `Type invocation_type'.
12959
12960         * expression.cs (BaseAccess.DoResolve): Use the base type as
12961         invocation and query type.
12962         (MemberAccess.DoResolve): If the lookup failed and we're about to
12963         report a CS0122, try a lookup with the ec.ContainerType - if this
12964         succeeds, we must report a CS1540.
12965
12966 2002-08-08  Martin Baulig  <martin@gnome.org>
12967
12968         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12969         (MethodGroupExpr): Implement the IMemberExpr interface.
12970
12971         * expression (MemberAccess.ResolveMemberAccess): No need to have
12972         any special code for MethodGroupExprs anymore, they're now
12973         IMemberExprs.   
12974
12975 2002-08-08  Martin Baulig  <martin@gnome.org>
12976
12977         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12978         Family, FamANDAssem and FamORAssem permissions.
12979         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12980
12981 2002-08-08  Martin Baulig  <martin@gnome.org>
12982
12983         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12984         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12985         or loop block.
12986
12987 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12988
12989         * driver.cs: implemented /resource option to embed managed resources.
12990
12991 2002-08-07  Martin Baulig  <martin@gnome.org>
12992
12993         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12994         (FieldBase.HasFieldInitializer): New public property.
12995         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12996         returns the field initializer and makes sure it is only resolved once.
12997         (TypeContainer.EmitFieldInitializers): Call
12998         FieldBase.GetInitializerExpression to get the initializer, this ensures
12999         that it isn't resolved multiple times.
13000
13001         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13002         the resolving process (SimpleName/MemberLookup) that we're currently
13003         emitting a field initializer (which must not access any instance members,
13004         this is an error CS0236).
13005
13006         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13007         argument, if the `IsFieldInitializer' flag is set, we must report and
13008         error CS0236 and not an error CS0120.   
13009
13010 2002-08-07  Martin Baulig  <martin@gnome.org>
13011
13012         * ecore.cs (IMemberExpr): New public interface.
13013         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13014         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13015         if the expression is an IMemberExpr.
13016
13017         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13018         to be null, implicitly default to `this' if we're non-static in
13019         this case.  Simplified the code a lot by using the new IMemberExpr
13020         interface.  Also fixed bug #28176 here.
13021
13022 2002-08-06  Martin Baulig  <martin@gnome.org>
13023
13024         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13025         ParameterReferences during semantic analysis so that we can do a
13026         type-only search when resolving Cast, TypeOf and SizeOf.
13027         (block): Pass the `current_local_parameters' to the Block's
13028         constructor.
13029
13030         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13031         argument to the constructor.
13032         (ConstructorInitializer.Resolve): Create a temporary implicit
13033         block with the parameters.
13034
13035         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13036         references here if we aren't doing a type-only search.
13037
13038         * statement.cs (Block): Added constructor which takes a
13039         `Parameters parameters' argument.
13040         (Block.Parameters): New public property.
13041
13042         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13043         to `Parameters' and made it public readonly.
13044
13045 2002-08-06  Martin Baulig  <martin@gnome.org>
13046
13047         * ecore.cs (Expression.Warning): Made this public as well.
13048
13049         * report.cs (Report.Debug): Print the contents of collections.
13050
13051 2002-08-06  Martin Baulig  <martin@gnome.org>
13052
13053         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13054         used to tell Resolve() which kinds of expressions it may return.
13055         (Expression.Resolve): Added overloaded version of this method which
13056         takes a `ResolveFlags flags' argument.  This can be used to tell
13057         Resolve() which kinds of expressions it may return.  Reports a
13058         CS0118 on error.
13059         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13060         ResolveFlags.SimpleName.
13061         (Expression.Error118): Added overloaded version of this method which
13062         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13063         which kinds of expressions are allowed.
13064
13065         * expression.cs (Argument.ResolveMethodGroup): New public method.
13066         Resolves an argument, but allows a MethodGroup to be returned.
13067         This is used when invoking a delegate.
13068
13069         * TODO: Updated a bit.
13070
13071 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13072
13073         Fixed compilation with csc.
13074
13075         * ecore.cs: Expression.Error made public. Is this correct? Should
13076         Warning be made public too?
13077
13078         * expression.cs: use ea.Location instead of ea.loc.
13079         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13080
13081 2002-08-06  Martin Baulig  <martin@gnome.org>
13082
13083         * ecore.cs (Expression.loc): Moved the location here instead of
13084         duplicating it in all derived classes.
13085         (Expression.Location): New public property.
13086         (Expression.Error, Expression.Warning): Made them non-static and
13087         removed the location argument.
13088         (Expression.Warning): Added overloaded version which takes an
13089         `int level' argument.
13090         (Expression.Error118): Make this non-static and removed the
13091         expression and location arguments.
13092         (TypeExpr): Added location argument to the constructor.
13093
13094         * expression.cs (StaticCallExpr): Added location argument to
13095         the constructor.
13096         (Indirection, PointerArithmetic): Likewise.
13097         (CheckedExpr, UnCheckedExpr): Likewise.
13098         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13099         (StringPtr): Likewise.
13100
13101
13102 2002-08-05  Martin Baulig  <martin@gnome.org>
13103
13104         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13105
13106         * assign.cs (Assign.DoResolve): Check whether the source
13107         expression is a value or variable.
13108
13109         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13110         while resolving the corresponding blocks.
13111
13112         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13113         an error, don't silently return null.
13114
13115         * statement.cs (Block.AddVariable): Do the error reporting here
13116         and distinguish between CS0128 and CS0136.
13117         (Block.DoResolve): Report all unused labels (warning CS0164).
13118         (LabeledStatement): Pass the location to the constructor.
13119         (LabeledStatement.HasBeenReferenced): New property.
13120         (LabeledStatement.Resolve): Set it to true here.
13121
13122         * statement.cs (Return.Emit): Return success even after reporting
13123         a type mismatch error (CS0126 or CS0127), this is what csc does and
13124         it avoids confusing the users with any consecutive errors.
13125
13126 2002-08-05  Martin Baulig  <martin@gnome.org>
13127
13128         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13129
13130         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13131
13132         * expression.cs (MemberAccess.DoResolve): Silently return if an
13133         error has already been reported.
13134
13135         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13136         error has already been reported.
13137
13138 2002-08-05  Martin Baulig  <martin@gnome.org>
13139
13140         * statement.cs (UsageVector): Only initialize the `parameters'
13141         vector if we actually have any "out" parameters.
13142
13143 2002-08-05  Martin Baulig  <martin@gnome.org>
13144
13145         * expression.cs (Binary.ResolveOperator): When combining delegates,
13146         they must have the same type.
13147
13148 2002-08-05  Martin Baulig  <martin@gnome.org>
13149
13150         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13151         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13152         work with the ms runtime and we also don't need it: if we're a
13153         PropertyBuilder and not in the `indexer_arguments' hash, then we
13154         are a property and not an indexer.
13155
13156         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13157         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13158         since the latter one doesn't work with the ms runtime.
13159
13160 2002-08-03  Martin Baulig  <martin@gnome.org>
13161
13162         Fixed bugs #27998 and #22735.
13163
13164         * class.cs (Method.IsOperator): New public field.
13165         (Method.CheckBase): Report CS0111 if there's already a method
13166         with the same parameters in the current class.  Report CS0508 when
13167         attempting to change the return type of an inherited method.
13168         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13169         and it's not marked abstract or extern.
13170         (PropertyBase): New abstract base class for Property and Indexer.
13171         (PropertyBase.CheckBase): Moved here from Property and made it work
13172         for indexers.
13173         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13174         the same so we can reuse it there.
13175         (Property, Indexer): Derive from PropertyBase.
13176         (MethodSignature.inheritable_property_signature_filter): New delegate
13177         to find properties and indexers.
13178
13179         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13180         argument and improved error reporting.
13181
13182         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13183         EmptyReadOnlyParameters and made it a property.
13184
13185         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13186         version of this method which takes a `PropertyInfo indexer'.
13187         (TypeManager.RegisterIndexer): New method.
13188
13189         * class.cs: Added myself as author of this file :-)
13190
13191 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13192
13193         * class.cs: fixed compilation on windoze.
13194
13195 2002-08-03  Martin Baulig  <martin@gnome.org>
13196
13197         * interface.cs (Interface.GetInterfaceBases): Check whether all
13198         base interfaces are at least as accessible than the current one.
13199
13200         * class.cs (TypeContainer.GetClassBases): Check whether base types
13201         are at least as accessible than the current type.
13202         (TypeContainer.AsAccessible): Implemented and made non-static.
13203         (MemberBase.CheckParameters): Report errors if the accessibility
13204         checks fail.
13205
13206         * delegate.cs (Delegate.Delegate): The default visibility is
13207         internal for top-level types and private for nested types.
13208         (Delegate.Define): Report errors if the accessibility checks fail.
13209
13210         * enum.cs (Enum.Enum): The default visibility is internal for
13211         top-level types and private for nested types.
13212         (Enum.DefineType): Compute the correct visibility.
13213
13214         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13215         function which takes a `bool is_toplevel' instead of a TypeContainer.
13216
13217         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13218         builtin type.
13219
13220 2002-08-02  Martin Baulig  <martin@gnome.org>
13221
13222         * expression.cs (LocalVariableReferenc): Added constructor which
13223         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13224         (LocalVariableReference.IsReadOnly): New property.
13225         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13226         variable is readonly, use our own readonly flag to do this; you can
13227         use the new constructor to get a writable reference to a read-only
13228         variable.
13229
13230         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13231         reference to the local variable.
13232
13233 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13234
13235         * rootcontext.cs (ResolveCore): Also include System.Exception
13236
13237         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13238         we reach an EmptyStatement.
13239
13240         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13241         is also fine.
13242
13243         * expression.cs (Binary.ResolveOperator): Check error result in
13244         two places.
13245
13246         use brtrue/brfalse directly and avoid compares to null.
13247
13248 2002-08-02  Martin Baulig  <martin@gnome.org>
13249
13250         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13251         Fixes bug #28407, added test-155.cs.
13252
13253 2002-08-01  Martin Baulig  <martin@gnome.org>
13254
13255         * class.cs (Event.EmitDefaultMethod): Make this work with static
13256         events.  Fixes #28311, added verify-3.cs.
13257
13258 2002-08-01  Martin Baulig  <martin@gnome.org>
13259
13260         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13261         `is_disposable' fields.
13262         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13263         `hm.is_disposable' if we're using the collection pattern.
13264         (Foreach.EmitCollectionForeach): Use the correct type for the
13265         enumerator's local variable, only emit the try/finally block if
13266         necessary (fixes #27713).
13267
13268 2002-08-01  Martin Baulig  <martin@gnome.org>
13269
13270         * ecore.cs (Expression.report118): Renamed to Error118 and made
13271         it public static.
13272
13273         * statement.cs (Throw.Resolve): Check whether the expression is of
13274         the correct type (CS0118) and whether the type derives from
13275         System.Exception (CS0155).
13276         (Catch.Resolve): New method.  Do the type lookup here and check
13277         whether it derives from System.Exception (CS0155).
13278         (Catch.CatchType, Catch.IsGeneral): New public properties.
13279
13280         * typemanager.cs (TypeManager.exception_type): Added.
13281
13282 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13283
13284         * driver.cs: Updated About function.
13285
13286 2002-07-31  Martin Baulig  <martin@gnome.org>
13287
13288         Implemented Control Flow Analysis.
13289
13290         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13291         (EmitContext.CurrentBranching): Added.
13292         (EmitContext.StartFlowBranching): Added.
13293         (EmitContext.EndFlowBranching): Added.
13294         (EmitContext.KillFlowBranching): Added.
13295         (EmitContext.IsVariableAssigned): Added.
13296         (EmitContext.SetVariableAssigned): Added.
13297         (EmitContext.IsParameterAssigned): Added.
13298         (EmitContext.SetParameterAssigned): Added.
13299         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13300         Added control flow analysis stuff here.
13301
13302         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13303         resolve the expression as lvalue.
13304         (LocalVariableReference.DoResolve): Check whether the variable has
13305         already been assigned.
13306         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13307         the parameter as assigned here.
13308         (ParameterReference.DoResolve): Check whether the parameter has already
13309         been assigned.
13310         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13311         expression as lvalue.
13312
13313         * statement.cs (FlowBranching): New class for the flow analysis code.
13314         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13315         (LabeledStatement.IsDefined): New public property.
13316         (LabeledStatement.AddUsageVector): New public method to tell flow
13317         analyis that the label may be reached via a forward jump.
13318         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13319         flow analysis.
13320         (VariableInfo.Number): New public field.  This is used by flow analysis
13321         to number all locals of a block.
13322         (Block.CountVariables): New public property.  This is the number of
13323         local variables in this block (including the locals from all parent
13324         blocks).
13325         (Block.EmitMeta): Number all the variables.
13326
13327         * statement.cs: Added flow analysis support to all classes.
13328
13329 2002-07-31  Martin Baulig  <martin@gnome.org>
13330
13331         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13332         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13333         then use this argument.
13334
13335         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13336
13337         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13338         use this to specify /define options.
13339
13340 2002-07-29  Martin Baulig  <martin@gnome.org>
13341
13342         * statement.cs (Fixed): Moved all code that does variable lookups
13343         and resolvings from Emit to Resolve.
13344
13345         * statement.cs (For): Moved all code that does variable lookups
13346         and resolvings from Emit to Resolve.
13347
13348         * statement.cs (Using): Moved all code that does variable lookups
13349         and resolvings from Emit to Resolve.
13350
13351 2002-07-29  Martin Baulig  <martin@gnome.org>
13352
13353         * attribute.cs (Attribute.Resolve): Explicitly catch a
13354         System.NullReferenceException when creating the
13355         CustromAttributeBuilder and report a different warning message.
13356
13357 2002-07-29  Martin Baulig  <martin@gnome.org>
13358
13359         * support.cs (ParameterData.ParameterName): Added method to
13360         get the name of a parameter.
13361
13362         * typemanager.cs (TypeManager.IsValueType): New public method.
13363
13364 2002-07-29  Martin Baulig  <martin@gnome.org>
13365
13366         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13367         is a flag which specifies that it's either ref or out.
13368         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13369         the out parameter to `out Parameter.Modifier mod', also set the
13370         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13371
13372         * support.cs (InternalParameters.ParameterModifier): Distinguish
13373         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13374         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13375
13376         * expression.cs (Argument.GetParameterModifier): Distinguish
13377         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13378         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13379
13380 2002-07-29  Martin Baulig  <martin@gnome.org>
13381
13382         * expression.cs (ParameterReference.ParameterReference): Added
13383         `Location loc' argument to the constructor.
13384
13385         * cs-parser.jay: Pass location to ParameterReference.
13386
13387 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13388
13389         * statement.cs (Try): Initialize the location.
13390
13391         * cs-parser.jay: pass location to Try.
13392
13393         * expression.cs (Unary.Reduce): Change the prototype to return
13394         whether a constant fold could be performed or not.  The result is
13395         returned in an out parameters.  In the case of Indirection and
13396         AddressOf, we want to perform the full tests.
13397
13398 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * statement.cs (Statement.Emit): Flag dead code.
13401
13402 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13403
13404         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13405
13406 2002-07-27  Martin Baulig  <martin@gnome.org>
13407
13408         * class.cs (MethodData.Define): Put back call to
13409         TypeManager.AddMethod(), accidentally commented this out.
13410
13411         * report.cs (Debug): New public method to print debugging information,
13412         this is `[Conditional ("DEBUG")]'.
13413
13414 2002-07-26  Martin Baulig  <martin@gnome.org>
13415
13416         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13417         (switch_statement): Push the current_block to the switch_stack and
13418         pop it again when we're done with the switch.
13419         (switch_section): The new block is a child of the current_block.
13420         Fixes bug #24007, added test-152.cs.
13421
13422 2002-07-27  Martin Baulig  <martin@gnome.org>
13423
13424         * expression.cs (Invocation.EmitArguments): When calling a varargs
13425         function with only its fixed arguments, we need to pass an empty
13426         array.
13427
13428 2002-07-27  Martin Baulig  <martin@gnome.org>
13429
13430         Mono 0.13 has been released.
13431
13432 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * driver.cs: Rename --resource to --linkres, because that is what
13435         we do currently, we dont support --resource yet.
13436
13437         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13438
13439 2002-07-25  Martin Baulig  <martin@gnome.org>
13440
13441         * class.cs (MethodData): New public class.  This is a `method builder'
13442         class for a method or one accessor of a Property/Indexer/Event.
13443         (MethodData.GetMethodFlags): Moved here from MemberBase.
13444         (MethodData.ApplyAttributes): Likewise.
13445         (MethodData.ApplyObsoleteAttribute): Likewise.
13446         (MethodData.ApplyConditionalAttribute): Likewise.
13447         (MethodData.ApplyDllImportAttribute): Likewise.
13448         (MethodData.CheckAbstractAndExternal): Likewise.
13449         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13450         (MethodData.Emit): Formerly known as Method.Emit().
13451         (MemberBase): Moved everything which was specific to a single
13452         accessor/method to MethodData.
13453         (Method): Create a new MethodData and call Define() and Emit() on it.
13454         (Property, Indexer, Event): Create a new MethodData objects for each
13455         accessor and call Define() and Emit() on them.
13456
13457 2002-07-25  Martin Baulig  <martin@gnome.org>
13458
13459         Made MethodCore derive from MemberBase to reuse the code from there.
13460         MemberBase now also checks for attributes.
13461
13462         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13463         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13464         as virtual.
13465         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13466         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13467         (MemberBase.ApplyAttributes): New virtual method; applies the
13468         attributes to a method or accessor.
13469         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13470         (MemberBase.ApplyConditionalAttribute): Likewise.
13471         (MemberBase.ApplyDllImportAttribute): Likewise.
13472         (MemberBase.CheckAbstractAndExternal): Likewise.
13473         (MethodCore.ParameterTypes): This is now a property instead of a
13474         method, it's initialized from DoDefineParameters().
13475         (MethodCore.ParameterInfo): Removed the set accessor.
13476         (MethodCore.DoDefineParameters): New protected virtual method to
13477         initialize ParameterTypes and ParameterInfo.
13478         (Method.GetReturnType): We can now simply return the MemberType.
13479         (Method.GetMethodFlags): Override the MemberBase version and add
13480         the conditional flags.
13481         (Method.CheckBase): Moved some code from Define() here, call
13482         DoDefineParameters() here.
13483         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13484         here to avoid some larger code duplication.
13485         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13486         ensure that abstract and external accessors don't declare a body.
13487
13488         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13489         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13490         lookup in the attribute's parent classes, so we need to abort as soon
13491         as we found the first match.
13492         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13493         the attribute has no arguments.
13494
13495         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13496         of a Method.
13497
13498 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13499
13500         * cs-parser.jay: reverted previous patch.
13501
13502 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13503
13504         * cs-parser.jay: fixed bug #22119.
13505
13506 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13507
13508         * attribute.cs: fixed compilation. The error was:
13509         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13510         be assigned to before control leaves the current method."
13511         [FIXME:  Filed as bug #28186: MCS must report this error.]
13512
13513 2002-07-25  Martin Baulig  <martin@gnome.org>
13514
13515         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13516         method to pull the condition name ouf of a Conditional attribute.
13517         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13518         the obsolete message and error flag out of an Obsolete attribute.
13519
13520         * class.cs (Method.GetMethodFlags): New public method to get the
13521         TypeManager.MethodFlags for this method.
13522         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13523         private methods.
13524         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13525         if we're overriding a virtual function, set the new private variable
13526         `parent_method'; call the new TypeManager.AddMethod().
13527
13528         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13529         the MethodBuilder and the Method in a PtrHashtable.
13530         (TypeManager.builder_to_method): Added for this purpose.
13531         (TypeManager.MethodFlags): Added IsObsoleteError.
13532         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13533         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13534         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13535         the message from the attribute.
13536
13537 2002-07-24  Martin Baulig  <martin@gnome.org>
13538
13539         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13540         preprocessor directives, ensure that the argument to #define/#undef is
13541         exactly one identifier and that it's actually an identifier.
13542
13543         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13544         did not work ....
13545
13546 2002-07-24  Martin Baulig  <martin@gnome.org>
13547
13548         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13549         initialize it to TypeManager.object_type in the constructor.
13550         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13551         of the `hm.get_current' method if we're using the collection pattern.
13552         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13553         for the explicit conversion to make it work when we're using the collection
13554         pattern and the `Current' property has a different return type than `object'.
13555         Fixes #27713.
13556
13557 2002-07-24  Martin Baulig  <martin@gnome.org>
13558
13559         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13560         does not match, but don't report any errors.  This method is called in
13561         order for all methods in a MethodGroupExpr until a matching method is
13562         found, so we don't want to bail out if the first method doesn't match.
13563         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13564         matches, report the 123.  Fixes #28070.
13565
13566 2002-07-24  Martin Baulig  <martin@gnome.org>
13567
13568         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13569         TypeManager.TypeToCoreType() to the top of the method so the
13570         following equality checks will work.  Fixes #28107.
13571
13572 2002-07-24  Martin Baulig  <martin@gnome.org>
13573
13574         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13575         operand is of type uint, and the other operand is of type sbyte,
13576         short or int, the operands are converted to type long." -
13577         Actually do what this comment already told us.  Fixes bug #28106,
13578         added test-150.cs.
13579
13580 2002-07-24  Martin Baulig  <martin@gnome.org>
13581
13582         * class.cs (MethodBase): New abstract class.  This is now a base
13583         class for Property, Indexer and Event to avoid some code duplication
13584         in their Define() and DefineMethods() methods.
13585         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13586         generic methods for Define() and DefineMethods().
13587         (FieldBase): Derive from MemberBase, not MemberCore.
13588         (Property): Derive from MemberBase, not MemberCore.
13589         (Property.DefineMethod): Moved all the code from this method to the
13590         new MethodBase.DefineAccessor(), just call it with appropriate
13591         argumetnts.
13592         (Property.Define): Call the new Property.DoDefine(), this does some
13593         sanity checks and we don't need to duplicate the code everywhere.
13594         (Event): Derive from MemberBase, not MemberCore.
13595         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13596         accessors, this will also make them work with interface events.
13597         (Indexer): Derive from MemberBase, not MemberCore.
13598         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13599         (Indexer.Define): Use the new MethodBase functions.
13600
13601         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13602         argument to the constructor.
13603         (Interface.FindMembers): Added support for interface events.
13604         (Interface.PopluateEvent): Implemented.
13605
13606         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13607
13608 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13611         but this is required to check for a method name being the same as
13612         the containing class.  
13613
13614         Handle this now.
13615
13616 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13617
13618         * interface.cs: initialize variable.
13619
13620 2002-07-23  Martin Baulig  <martin@gnome.org>
13621
13622         Implemented the IndexerName attribute in interfaces.
13623
13624         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13625         name if this is an explicit interface implementation.
13626         (Indexer.InterfaceIndexerName): New public variable.  If we're
13627         implementing an interface indexer, this is the IndexerName in that
13628         interface.  Otherwise, it's the IndexerName.
13629         (Indexer.DefineMethod): If we're implementing interface indexer,
13630         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13631         and Pending.ImplementIndexer methods.
13632         (Indexer.Define): Also define the PropertyBuilder if we're
13633         implementing an interface indexer and this is neither an explicit
13634         interface implementation nor do the IndexerName match the one in
13635         the interface.
13636
13637         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13638         If a method is defined here, then we always need to create a proxy
13639         for it.  This is used when implementing interface indexers.
13640         (Pending.IsInterfaceIndexer): New public method.
13641         (Pending.ImplementIndexer): New public method.
13642         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13643         This is used when implementing interface indexers to define a proxy
13644         if necessary.
13645         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13646         define a proxy if necessary.
13647
13648         * interface.cs (Interface.IndexerName): New public variable.
13649         (Interface.PopulateIndexer): Set the IndexerName.
13650         (Interface.DefineIndexers): New private method.  Populate all the
13651         indexers and make sure their IndexerNames match.
13652
13653         * typemanager.cs (IndexerPropertyName): Added support for interface
13654         indexers.
13655
13656 2002-07-22  Martin Baulig  <martin@gnome.org>
13657
13658         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13659         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13660         ret if HasReturnLabel.
13661         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13662         variables.
13663
13664         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13665         and set the ec.LoopBeginTryCatchLevel.
13666         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13667         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13668         the current ec.TryCatchLevel, the branch goes out of an exception
13669         block.  In this case, we need to use Leave and not Br.
13670
13671 2002-07-22  Martin Baulig  <martin@gnome.org>
13672
13673         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13674         block unless the block does not always return or it is contained in
13675         another try { ... } catch { ... } block.  Fixes bug #26506.
13676         Added verify-1.cs to the test suite.
13677
13678 2002-07-22  Martin Baulig  <martin@gnome.org>
13679
13680         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13681         then we do not always return.  Fixes bug #24985.
13682
13683 2002-07-22  Martin Baulig  <martin@gnome.org>
13684
13685         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13686         lookup on a per-class level; ie. walk up the class hierarchy until we
13687         found at least one applicable method, then choose the best among them.
13688         Fixes bug #24463 and test-29.cs.
13689
13690 2002-07-22  Martin Baulig  <martin@gnome.org>
13691
13692         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13693         return types of the methods.  The return type is not part of the
13694         signature and we must not check it to make the `new' modifier work.
13695         Fixes bug #27999, also added test-147.cs.
13696         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13697
13698         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13699         on the method's return type.
13700
13701 2002-07-21  Martin Baulig  <martin@gnome.org>
13702
13703         * assign.cs: Make this work if the rightmost source is a constant and
13704         we need to do an implicit type conversion.  Also adding a few more tests
13705         to test-38.cs which should have caught this.
13706
13707         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13708         target in the makefile for this.  The makefile.gnu is primarily intended
13709         for end-users who don't want to debug the compiler.
13710
13711 2002-07-21  Martin Baulig  <martin@gnome.org>
13712
13713         * assign.cs: Improved the Assign class so it can now handle embedded
13714         assignments (X = Y = Z = something).  As a side-effect this'll now also
13715         consume less local variables.  test-38.cs now passes with MCS, added
13716         a few new test cases to that test.
13717
13718 2002-07-20  Martin Baulig  <martin@gnome.org>
13719
13720         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13721         instructions.  Fixes bug #27977, also added test-146.cs.
13722
13723 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13724
13725         * cs-tokenizer.cs: fixed getHex ().
13726
13727 2002-07-19  Martin Baulig  <martin@gnome.org>
13728
13729         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13730         not Type.GetType() to lookup the array type.  This is needed when
13731         we're constructing an array of a user-defined type.
13732         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13733         single-dimensional arrays, but also for single-dimensial arrays of
13734         type decimal.
13735
13736 2002-07-19  Martin Baulig  <martin@gnome.org>
13737
13738         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13739         this function is called, it's not allowed to share LocalBuilders
13740         among ILGenerators.
13741
13742 2002-07-19  Martin Baulig  <martin@gnome.org>
13743
13744         * expression.cs (Argument.Resolve): Report an error 118 when trying
13745         to pass a type as argument.
13746
13747 2002-07-18  Martin Baulig  <martin@gnome.org>
13748
13749         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13750         Conv_R_Un for the signed `long' type.
13751
13752 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13755         `expr' for the temporary result, as that will fail if we do
13756         multiple resolves on the same expression.
13757
13758 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13759
13760         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13761         ec.TypeContainer for looking up aliases. 
13762
13763         * class.cs (TypeContainer): Remove LookupAlias from here.
13764
13765         * decl.cs (DeclSpace); Move here.
13766
13767 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * class.cs (FindMembers): Only call filter if the constructor
13770         bulider is not null.
13771
13772         Also handle delegates in `NestedTypes' now.  Now we will perform
13773         type lookups using the standard resolution process.  This also
13774         fixes a bug.
13775
13776         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13777         This uses Expressions (the limited kind that can be parsed by the
13778         tree) instead of strings.
13779
13780         * expression.cs (ComposedCast.ToString): Implement, used to flag
13781         errors since now we have to render expressions.
13782
13783         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13784         FormArrayType. 
13785
13786         * ecore.cs (SimpleName.ToString): ditto.
13787
13788         * cs-parser.jay: Instead of using strings to assemble types, use
13789         Expressions to assemble the type (using SimpleName, ComposedCast,
13790         MemberAccess).  This should fix the type lookups in declarations,
13791         because we were using a different code path for this.
13792
13793         * statement.cs (Block.Resolve): Continue processing statements
13794         even when there is an error.
13795
13796 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * class.cs (Event.Define): Also remove the `remove' method from
13799         the list of pending items.
13800
13801         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13802         generate more compact code. 
13803
13804 2002-07-17  Martin Baulig  <martin@gnome.org>
13805
13806         * const.cs (Const.LookupConstantValue): Add support for constant
13807         `unchecked' and `checked' expressions.
13808         Also adding test case test-140.cs for this.
13809
13810 2002-07-17  Martin Baulig  <martin@gnome.org>
13811
13812         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13813         check whether mi.ReturnType implements the IEnumerator interface; the
13814         `==' and the IsAssignableFrom() will fail in this situation.
13815
13816 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13817
13818         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13819         here too.
13820
13821 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13822
13823         * expression.cs: fixed bug #27811.
13824
13825 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13826
13827         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13828         Molaro: when we are a ref, the value already contains a pointer
13829         value, do not take the address of it.
13830
13831 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13832         * removed mb-parser.jay and mb-tokenizer.cs
13833
13834 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13835
13836         * expression.cs: check against the building corlib void type.
13837
13838 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13839
13840         * ecore.cs: fix for valuetype static readonly fields: when 
13841         initializing them, we need their address, not the address of a copy.
13842
13843 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13844
13845         * typemanager.cs: register also enum_type in corlib.
13846
13847 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13848
13849         * class.cs: allow calling this (but not base) initializers in structs.
13850
13851 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13852
13853         * ecore.cs: make sure we compare against the building base types
13854         in GetTypeSize ().
13855
13856 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13857
13858         * typemanager.cs: fix TypeToCoreType() to handle void and object
13859         (corlib gets no more typerefs after this change).
13860
13861 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * expression.cs (ArrayCreation.EmitArrayArguments): use
13864         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13865
13866         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13867         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13868         array indexes, the runtime actually forbids them.
13869
13870         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13871         for array arguments here.
13872
13873         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13874         instead of the default for ValueTypes.
13875
13876         (New.DoEmit): Use IsValueType instead of
13877         IsSubclassOf (value_type)
13878         (New.DoResolve): ditto.
13879         (Invocation.EmitCall): ditto.
13880
13881         * assign.cs (Assign): ditto.
13882
13883         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13884         Statements *are* currently doing part of their resolution during
13885         Emit.  
13886
13887         Expressions do always resolve during resolve, but statements are
13888         only required to propagate resolution to their children.
13889
13890 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13891
13892         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13893
13894         (LoadAssembly): Do not add the dll if it is already specified
13895
13896         (MainDriver): Add the System directory to the link path at the end,
13897         after all the other -L arguments. 
13898
13899         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13900         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13901         ldelem.u1) and using the opposite for sbytes.
13902
13903         This fixes Digger, and we can finally run it.
13904
13905         * driver.cs (UnixParseOption): Move the option parsing here.  
13906         (CSCParseOption): Implement CSC-like parsing of options.
13907
13908         We now support both modes of operation, the old Unix way, and the
13909         new CSC-like way.  This should help those who wanted to make cross
13910         platform makefiles.
13911
13912         The only thing broken is that /r:, /reference: and /lib: are not
13913         implemented, because I want to make those have the same semantics
13914         as the CSC compiler has, and kill once and for all the confussion
13915         around this.   Will be doing this tomorrow.
13916
13917         * statement.cs (Unsafe.Resolve): The state is checked during
13918         resolve, not emit, so we have to set the flags for IsUnsfe here.
13919
13920 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13921
13922         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13923         not catch the Error_ObjectRefRequired in SimpleName (as it is
13924         possible to have a class/instance variable name that later gets
13925         deambiguated), we have to check this here.      
13926
13927 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13928
13929         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13930         make static and put into Expression.
13931
13932         (Event.Define): Register the private field of the event with the 
13933         TypeManager so that GetFieldFromEvent can get at it.
13934
13935         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13936         keep track of the private field associated with an event which
13937         has no accessors.
13938
13939         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13940         private field.
13941
13942         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13943
13944 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * expression.cs (Binary.EmitBranchable): this routine emits the
13947         Binary expression in a branchable context.  This basically means:
13948         we need to branch somewhere, not just get the value on the stack.
13949
13950         This works together with Statement.EmitBoolExpression.
13951
13952         * statement.cs (Statement.EmitBoolExpression): Use
13953         EmitBranchable. 
13954
13955 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * statement.cs (For): Reduce the number of jumps in loops.
13958
13959         (For): Implement loop inversion for the For statement.
13960
13961         (Break): We can be breaking out of a Try/Catch controlled section
13962         (foreach might have an implicit try/catch clause), so we need to
13963         use Leave instead of Br.
13964
13965         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13966         now).  If the instace expression supports IMemoryLocation, we use
13967         the AddressOf method from the IMemoryLocation to extract the
13968         address instead of emitting the instance.
13969
13970         This showed up with `This', as we were emitting the instance
13971         always (Emit) instead of the Address of This.  Particularly
13972         interesting when This is a value type, as we dont want the Emit
13973         effect (which was to load the object).
13974
13975 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13978
13979         * statement.cs (Checked): Set the CheckedState during the resolve
13980         process too, as the ConvCast operations track the checked state on
13981         the resolve process, and not emit.
13982
13983         * cs-parser.jay (namespace_member_declaration): Flag that we have
13984         found a declaration when we do.  This is used to flag error 1529
13985
13986         * driver.cs: Report ok when we display the help only.
13987
13988 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13989
13990         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13991
13992 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * cs-tokenizer.cs (define): We also have to track locally the
13995         defines.  AllDefines is just used for the Conditional Attribute,
13996         but we also need the local defines for the current source code. 
13997
13998 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13999
14000         * statement.cs (While, For, Do): These loops can exit through a
14001         Break statement, use this information to tell whether the
14002         statement is the last piece of code.
14003
14004         (Break): Flag that we break.
14005
14006         * codegen.cs (EmitContexts): New `Breaks' state variable.
14007
14008 2002-07-03  Martin Baulig  <martin@gnome.org>
14009
14010         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14011         modifiers in method declarations in structs.  Otherwise, you won't
14012         be able to override things like Object.Equals().
14013
14014 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14015
14016         * class.cs (Method, Property, Indexer): Do not allow the public
14017         modifier to be used in explicit interface implementations.
14018
14019         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14020         override modifiers in method declarations in structs
14021
14022 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14023
14024         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14025         integer or real overflow, report an error
14026
14027 2002-07-02  Martin Baulig  <martin@gnome.org>
14028
14029         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14030         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14031         to tell the runtime about our newly created System.Object and
14032         System.ValueType types.
14033
14034 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14037         struct instead of Ldarg/Starg.
14038
14039 2002-07-02  Martin Baulig  <martin@gnome.org>
14040
14041         * expression.cs (Indirection.Indirection): Call
14042         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14043
14044 2002-07-02  Martin Baulig  <martin@gnome.org>
14045
14046         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14047         ValueType, call TypeManager.TypeToCoreType() on it.
14048         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14049         the OpCodes.Newarr argument.
14050
14051 2002-07-02  Martin Baulig  <martin@gnome.org>
14052
14053         * expression.cs (Invocation.EmitCall): When compiling corlib,
14054         replace all calls to the system's System.Array type to calls to
14055         the newly created one.
14056
14057         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14058         System.Array methods.
14059         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14060         from the system's System.Array type which must be replaced.
14061
14062 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14063
14064         * typemanager.cs: load unverifiable_code_ctor so we can build
14065         corlib using the correct type. Avoid using GetTypeCode() with
14066         TypeBuilders.
14067         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14068         TypeManager.object_type to allow building corlib.
14069
14070 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14071
14072         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14073
14074 2002-07-01  Martin Baulig  <martin@gnome.org>
14075
14076         * class.cs: Make the last change actually work, we need to check
14077         whether `ifaces != null' to avoid a crash.
14078
14079 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14080
14081         * class.cs: when we build structs without fields that implement
14082         interfaces, we need to add the interfaces separately, since there is
14083         no API to both set the size and add the interfaces at type creation
14084         time.
14085
14086 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14087
14088         * expression.cs: the dimension arguments to the array constructors
14089         need to be converted if they are a long.
14090
14091 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14092
14093         * class.cs: don't emit ldarg.0 if there is no parent constructor
14094         (fixes showstopper for corlib).
14095
14096 2002-06-29  Martin Baulig  <martin@gnome.org>
14097
14098         MCS now compiles corlib on GNU/Linux :-)
14099
14100         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14101         ie. check for MethodImplOptions.InternalCall.
14102
14103         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14104         and TypeManager.attribute_type are null, so we must explicitly check
14105         whether parent is not null to find out whether it's an attribute type.
14106         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14107         and SetBuilder, not only if the property is neither abstract nor external.
14108         This is necessary to set the MethodImplOptions on the accessor methods.
14109         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14110         SetBuilder, see Property.Emit().
14111
14112         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14113         populate "System.Object", "System.ValueType" and "System.Attribute" since
14114         they've already been populated from BootCorlib_PopulateCoreTypes().
14115
14116 2002-06-29  Martin Baulig  <martin@gnome.org>
14117
14118         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14119         is the NullLiteral, we also need to make sure that target_type is not
14120         an enum type.   
14121
14122 2002-06-29  Martin Baulig  <martin@gnome.org>
14123
14124         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14125         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14126         before calling BootstrapCorlib_ResolveDelegate ().
14127
14128 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14129
14130         * statement.cs: fixed build-breaker. All tests passed ok.
14131
14132 2002-06-27  Martin Baulig  <martin@gnome.org>
14133
14134         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14135         for System.Decimal when compiling corlib.
14136
14137 2002-06-27  Martin Baulig  <martin@gnome.org>
14138
14139         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14140         switch blocks which contain nothing but a default clause.
14141
14142 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14143
14144        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14145
14146 2002-06-27  Martin Baulig  <martin@gnome.org>
14147
14148         * ecore.cs (PropertyExpr.PropertyExpr): Call
14149         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14150
14151         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14152         is already a TypeBuilder.
14153
14154 2002-06-27  Martin Baulig  <martin@gnome.org>
14155
14156         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14157         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14158         the "from an array-type to System.Array" case.  This makes it work
14159         when compiling corlib.
14160
14161 2002-06-27  Martin Baulig  <martin@gnome.org>
14162
14163         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14164         non-static PropertyExpr, set its InstanceExpression.  This makes
14165         the `ICollection.Count' property work in System/Array.cs.
14166
14167 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14168
14169         * driver.cs: Made error handling more consistent.  Errors now
14170         tracked by Report class, so many methods which used to return int
14171         now return void.  Main() now prints success/failure and 
14172         errors/warnings message.
14173
14174         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14175         the magic number return values (123 and 124).  Now, if the
14176         expected error occurs, the compiler exits with success (exit value
14177         0).  If the compilation completes without seeing that particular
14178         error, the compiler exits with failure (exit value 1).  The
14179         makefile in mcs/errors has been changed to handle the new behaviour.
14180
14181         * report.cs: Made 'expected error' number a property and renamed
14182         it from 'Probe' to 'ExpectedError'.
14183
14184         * genericparser.cs: Removed error handling support, since it is
14185         now all done by Report class.
14186
14187         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14188         class, so parse() no longer returns an int.
14189
14190         * namespace.cs: Use Report.Error instead of GenericParser.error
14191
14192 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14193
14194         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14195         TypeContainer.AddOperator): At the front of the list put the
14196         explicit implementations, so they get resolved/defined first. 
14197
14198 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14199
14200         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14201         interface type is implemented by this TypeContainer.  Used during
14202         explicit interface implementation.
14203
14204         (Property.Define, Indexer.Define, Method.Define): Validate that
14205         the given interface in the explicit implementation is one of the
14206         base classes for the containing type.
14207
14208         Also if we are explicitly implementing an interface, but there is
14209         no match in the pending implementation table, report an error.
14210
14211         (Property.Define): Only define the property if we are
14212         not explicitly implementing a property from an interface.  Use the
14213         correct name also for those properties (the same CSC uses,
14214         although that is really not needed).
14215
14216         (Property.Emit): Do not emit attributes for explicitly implemented
14217         properties, as there is no TypeBuilder.
14218
14219         (Indexer.Emit): ditto.
14220
14221         Hiding then means that we do not really *implement* a pending
14222         implementation, which makes code fail.
14223
14224 2002-06-22  Martin Baulig  <martin@gnome.org>
14225
14226         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14227         the return value of Object.GetType().  [FIXME: we need to do this whenever
14228         we get a type back from the reflection library].
14229
14230 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14231
14232         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14233
14234 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * attribute.cs: Return null if we can not look up the type.
14237
14238         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14239         the interface types found.
14240
14241         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14242         interface types found.
14243
14244         * typemanager.cs (GetInterfaces): Make this routine returns alll
14245         the interfaces and work around the lame differences between
14246         System.Type and System.Reflection.Emit.TypeBuilder in the results
14247         result for GetInterfaces.
14248
14249         (ExpandInterfaces): Given an array of interface types, expand and
14250         eliminate repeated ocurrences of an interface.  This expands in
14251         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14252         be IA, IB, IC.
14253
14254 2002-06-21  Martin Baulig  <martin@gnome.org>
14255
14256         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14257         on System.Enum.
14258
14259 2002-06-21  Martin Baulig  <martin@gnome.org>
14260
14261         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14262         and called with one of the core types, return the corresponding typebuilder for
14263         that type.
14264
14265         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14266         element type.
14267
14268 2002-06-21  Martin Baulig  <martin@gnome.org>
14269
14270         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14271         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14272         (Expression.ConvertReferenceExplicit): Likewise.
14273
14274         * expression.cs (ElementAccess.DoResolve): Likewise.
14275         (ElementAccess.DoResolveLValue): Likewise.
14276
14277 2002-06-10  Martin Baulig  <martin@gnome.org>
14278
14279         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14280         add the "value" parameter to the parameter list.
14281
14282         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14283         to our caller.
14284
14285 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14288         the argument to an int, uint, long or ulong, per the spec.  Also
14289         catch negative constants in array creation.
14290
14291 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14292
14293         * class.cs: do not allow the same interface to appear twice in
14294         the definition list.
14295
14296 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14297
14298         * ecore.cs: don't use ldlen with System.Array.
14299
14300 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14301
14302         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14303
14304 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14305
14306         * modifiers.cs: produce correct field attributes for protected
14307         internal. Easy fix so miguel can work on ther harder stuff:-)
14308
14309 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * pending.cs: New file.  Move the code from class.cs here.
14312         Support clearning the pending flag for all methods (when not doing
14313         explicit interface implementation).
14314
14315 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14316
14317         * rootcontext.cs: added a couple more types needed to bootstrap.
14318
14319 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14322         constructor in the type, instead of any constructor in the type
14323         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14324         a bug in the Mono runtime when applying the params attribute). 
14325
14326 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14327         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14328
14329 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14330
14331         * expression.cs (Unary.ResolveOperator): Use TypeManager
14332         to resolve the type.
14333
14334 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14335
14336         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14337         attached.
14338
14339         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14340         with each member too.
14341
14342         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14343         field builders too - this takes care of the enum member case.
14344
14345 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14346
14347         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14348         address-of operator on both value types and pointers.
14349
14350 2002-06-10  Martin Baulig  <martin@gnome.org>
14351
14352         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14353         PropertyBuilder to the `property_builders' list.
14354
14355         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14356         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14357         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14358         find any indexers which are inherited from an interface.
14359
14360 2002-06-09  Martin Baulig  <martin@gnome.org>
14361
14362         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14363         the same type as the constant if necessary.  There's also a test-130.cs
14364         for this.
14365
14366         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14367
14368         * typemanager.cs (TypeManager.ChangeType): Previously known as
14369         Enum.ChangeEnumType().
14370
14371 2002-06-09  Martin Baulig  <martin@gnome.org>
14372
14373         * expression.cs (Cast.TryReduce): Added support for consts.
14374
14375 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14376
14377         * class.cs (Accessor): Hold attributes information so we can pass
14378         it along.
14379
14380         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14381         Modify to pass in attributes attached to the methods.
14382
14383         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14384
14385         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14386         to handle the Accessor kind :-)
14387
14388         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14389
14390 2002-06-08  Martin Baulig  <martin@gnome.org>
14391
14392         * expression.cs (Unary.TryReduceNegative): Added support for
14393         ULongConstants.
14394
14395 2002-06-08  Martin Baulig  <martin@gnome.org>
14396
14397         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14398         name can't be found in the `defined_names' - the caller will do a
14399         MemberLookup in this case and thus find methods in System.Enum
14400         such as Enum.IsDefined().
14401
14402 2002-06-08  Martin Baulig  <martin@gnome.org>
14403
14404         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14405         Convert.ChangeType() which works with TypeBuilder created types.
14406         (Enum.LookupEnumValue, Enum.Define): Use it here.
14407
14408         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14409         `TypeBuilder.BaseType != null' check.
14410         (TypeContainer.FindMembers): Only lookup parent members if we
14411         actually have a parent.
14412         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14413         (ConstructorInitializer.Resolve): Likewise.
14414
14415         * interface.cs (Interface.FindMembers): Added
14416         `TypeBuilder.BaseType != null' check.
14417
14418         * rootcontext.cs (RootContext.ResolveCore): Added
14419         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14420         classes_second_stage.
14421
14422         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14423         debug_type and trace_type when compiling with --nostdlib.       
14424
14425 2002-06-07  Martin Baulig  <martin@gnome.org>
14426
14427         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14428         (AddField): Set it to true when adding a non-static field.
14429         (DefineType): Use `have_nonstatic_fields' to find out whether we
14430         have non-static fields, not `Fields != null'.
14431
14432 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14435         dereferencing a null on the static-field code path)
14436
14437 2002-05-30  Martin Baulig  <martin@gnome.org>
14438
14439         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14440         to take command line arguments.  Use reflection to call the new
14441         custom `Initialize' function on the symbol writer and pass it the
14442         command line arguments.
14443
14444         * driver.cs (--debug-args): New command line argument to pass command
14445         line arguments to the symbol writer.
14446
14447 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14448
14449         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14450         the target type for indexers and properties.  Thanks to Joe for
14451         catching this.
14452
14453 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14454
14455         * typemanager.cs (MethodFlags): returns the method flags
14456         (Obsolete/ShouldIgnore) that control warning emission and whether
14457         the invocation should be made, or ignored. 
14458
14459         * expression.cs (Invocation.Emit): Remove previous hack, we should
14460         not do this on matching a base type, we should do this based on an attribute
14461
14462         Only emit calls to System.Diagnostics.Debug and
14463         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14464         on the command line.
14465
14466         * rootcontext.cs: Global settings for tracing and debugging.
14467
14468         * cs-tokenizer.cs (define): New utility function to track
14469         defines.   Set the global settings for TRACE and DEBUG if found.
14470
14471 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14472
14473         * interface.cs (Populate*): Pass in the TypeContainer as well as
14474         the DeclSpace as parameters so that we can create EmitContexts and
14475         then use that to apply attributes etc.
14476
14477         (PopulateMethod, PopulateEvent, PopulateProperty)
14478         (PopulateIndexer): Apply attributes everywhere.
14479
14480         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14481         etc.
14482
14483         (ApplyAttributes): Update accordingly.
14484
14485         We now apply interface attributes for all members too.
14486
14487 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * class.cs (Indexer.Define); Correctly check if we are explicit
14490         implementation (instead of checking the Name for a ".", we
14491         directly look up if the InterfaceType was specified).
14492
14493         Delay the creation of the PropertyBuilder.
14494
14495         Only create the PropertyBuilder if we are not an explicit
14496         interface implementation.   This means that explicit interface
14497         implementation members do not participate in regular function
14498         lookups, and hence fixes another major ambiguity problem in
14499         overload resolution (that was the visible effect).
14500
14501         (DefineMethod): Return whether we are doing an interface
14502         implementation. 
14503
14504         * typemanager.cs: Temporary hack until we get attributes in
14505         interfaces (Ravi is working on that) and we get IndexerName
14506         support in interfaces.
14507
14508         * interface.cs: Register the indexers as properties.
14509
14510         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14511         warning, I have verified that this is a bug in the .NET runtime
14512         (JavaScript suffers of the same problem).
14513
14514         * typemanager.cs (MemberLookup): When looking up members for
14515         interfaces, the parent of an interface is the implicit
14516         System.Object (so we succeed in searches of Object methods in an
14517         interface method invocation.  Example:  IEnumerable x;  x.ToString
14518         ()) 
14519
14520 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * class.cs (Event): Events should also register if they do
14523         implement the methods that an interface requires.
14524
14525         * typemanager.cs (MemberLookup); use the new GetInterfaces
14526         method. 
14527
14528         (GetInterfaces): The code used to lookup interfaces for a type is
14529         used in more than one place, factor it here. 
14530
14531         * driver.cs: Track the errors at the bottom of the file, we kept
14532         on going.
14533
14534         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14535         instance if the method we are calling is static!
14536
14537 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * attribute.cs (ApplyAttributes): Make this function filter out
14540         the IndexerName attribute (as that attribute in reality is never
14541         applied) and return the string constant for the IndexerName
14542         attribute. 
14543
14544         * class.cs (TypeContainer.Emit): Validate that all the indexers
14545         have the same IndexerName attribute, and if so, set the
14546         DefaultName attribute on the class. 
14547
14548         * typemanager.cs: The return value might contain other stuff (not
14549         only methods).  For instance, consider a method with an "Item"
14550         property and an Item method.
14551
14552         * class.cs: If there is a problem with the parameter types,
14553         return. 
14554
14555 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14556
14557         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14558         looks at user defined conversion after making a call to 
14559         StandardConversionExists - we need this for overload resolution.
14560
14561         * expression.cs : Update accordingly the various method calls.
14562
14563         This fixes 2 bugs filed against implicit user defined conversions 
14564
14565 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14566
14567         * statement.cs: Track the result of the assignment.
14568
14569 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14570
14571         * expression.cs (MemberAccess): Improved error reporting for
14572         inaccessible members.
14573
14574 2002-05-22  Martin Baulig  <martin@gnome.org>
14575
14576         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14577         itself with debugging support.
14578
14579 2002-05-22  Martin Baulig  <martin@gnome.org>
14580
14581         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14582         Removed, this isn't needed anymore.
14583
14584 2002-05-20  Martin Baulig  <martin@gnome.org>
14585
14586         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14587         be underlying type for an enum.
14588
14589 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14592         that splits out the loading of just the core types.
14593
14594         * rootcontext.cs (ResolveCore): Split the struct resolution in
14595         two, so we can load the enumeration underlying types before any
14596         enums are used.
14597
14598         * expression.cs (Is): Bandaid until we fix properly Switch (see
14599         bug #24985 for details).
14600
14601         * typemanager.cs (ImplementsInterface): The hashtable will contain
14602         a null if there are no interfaces implemented.
14603
14604 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * cs-parser.jay (indexer_declarator): It is fine to have array
14607         parameters
14608
14609 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * typemanager.cs: (RegisterBuilder): New function used to register
14612         TypeBuilders that implement interfaces.  Since
14613         TypeBuilder.GetInterfaces (as usual) does not work with lame
14614         Reflection.Emit. 
14615         (AddUserType): register interfaces.
14616
14617         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14618         dealing with TypeBuilder.  Also, arrays are showing up as
14619         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14620         methods can not be invoked on them!
14621
14622         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14623         (ImplicitReferenceConversionExists): Split out from
14624         StandardConversionExists. 
14625
14626         * expression.cs (As): We were only implementing one of the three
14627         cases for the as operator.  We now implement them all.
14628         (Is): Implement the various other cases for Is as well.
14629
14630         * typemanager.cs (CACHE): New define used to control if we want or
14631         not the FindMembers cache.  Seems to have a negative impact on
14632         performance currently
14633
14634         (MemberLookup): Nested types have full acess to
14635         enclosing type members
14636
14637         Remove code that coped with instance/static returns for events, we
14638         now catch this in RealFindMembers.
14639
14640         (RealFindMembers): only perform static lookup if the instance
14641         lookup did not return a type or an event.  
14642
14643 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14644
14645         * assign.cs (CompoundAssign): We pass more semantic information
14646         now to Compound Assignments than we did before: now we have all
14647         the information at hand, and now we resolve the target *before* we
14648         do the expression expansion, which allows the "CacheValue" method
14649         to have the effect we intended (before, a [x] += 1 would generate
14650         two differen ArrayAccess expressions from the ElementAccess,
14651         during the resolution process).
14652
14653         (CompoundAssign.DoResolve): Resolve target and original_source here.
14654
14655 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14656
14657         * expression.cs (ArrayAccess): dropped debugging information. 
14658
14659         * typemanager.cs: Small bug fix: I was always returning i_members,
14660         instead of one of i_members or s_members (depending on which had
14661         the content).
14662
14663         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14664         method is invoked before any code generation takes place, and it
14665         is a mechanism to inform that the expression will be invoked more
14666         than once, and that the method should use temporary values to
14667         avoid having side effects
14668
14669         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14670
14671         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14672         implementation.
14673
14674         * expression.cs (Indirection, ArrayAccess): Add support for
14675         CacheTemporaries in these two bad boys. 
14676
14677         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14678         ldobj or ldind_ref.  
14679         (StoreFromPtr): Handle stobj as well.
14680
14681         * expression.cs (UnaryMutator): Share more code.
14682
14683         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14684         down: I was not tracking the Filter function as well, which
14685         was affecting the results of the cache.
14686
14687 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * attribute.cs: Remove the hack to handle the CharSet property on
14690         StructLayouts. 
14691
14692 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14693
14694         * attribute.cs (DoResolve): More uglyness, we now only try to
14695         resolve the attribute partially, to extract the CharSet
14696         information (only if we are a StructLayout attribute).  Otherwise 
14697
14698         (GetExtraTypeInfo): Add some code to conditionally kill in the
14699         future this.   I am more and more convinced that the .NET
14700         framework has special code to handle the attribute setting on
14701         certain elements.
14702
14703         * expression.cs (IsParamsMethodApplicable): Revert my previous
14704         foreach change here, it was wrong.
14705
14706 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14707
14708         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14709         (pp_expr): do not abort on unknown input, just return.
14710         (eval): abort if there are pending chars.
14711
14712         * attribute.cs (Attribute.Resolve): Positional parameters are
14713         optional.  Deal with that case.
14714
14715         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14716         the Ansi/Unicode/Auto information for the type.
14717
14718         (TypeContainer.DefineType): instantiate the EmitContext here, as
14719         we will be using it during the type definition (to resolve
14720         attributes) and during the emit phase.
14721
14722         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14723         to pull type information out of the attributes
14724
14725         (Attribute.Resolve): track the constructor builder, and allow for
14726         multiple invocations (structs and classes will use this).
14727
14728         * ecore.cs (MemberLookupFinal): new version with all the
14729         parameters customizable.
14730
14731         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14732         constructors.  Return if the result value is null (as the error
14733         would have been flagged already by MemberLookupFinal)
14734
14735         Do not allow instances of abstract classes or interfaces to be
14736         created.
14737
14738         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14739         We have to compare the assembly property here when dealing with
14740         FamANDAssem and Assembly access modifiers, because we might be
14741         creating an assembly from *modules* (that means that we are not
14742         getting TypeBuilders for types defined in other modules that are
14743         part of this assembly).
14744
14745         (Method.Emit): If the method is marked abstract and has a body,
14746         emit an error. 
14747
14748         (TypeContainer.DefineMembers): If both the defined member and the
14749         parent name match are methods, then do not emit any warnings: let
14750         the Method.Define routine take care of flagging warnings.  But if
14751         there is a mismatch (method overrides something else, or method is
14752         overriwritten by something, then emit warning).
14753
14754         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14755         set to null, this means `do not check for the return type on the
14756         signature'. 
14757
14758         (Method.Define): set the return type for the method signature to
14759         null, so that we get methods with the same name and parameters and
14760         different return types.  This is used to flag warning 114 (you are
14761         hiding a method, and you probably want to use the new/override
14762         keywords instead).
14763
14764         * typemanager.cs (MemberLookup): Implemented proper access
14765         control, closing a long standing set of bug reports.  The problem
14766         was that the Framework only has two bits: Public and NonPublic,
14767         and NonPublic includes private and protected methods, but we need
14768         to enforce the FamANDAssem, FamOrAssem and Family. 
14769
14770 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14771
14772         * statement.cs (GotoCase): Return true: Ammounts to giving up
14773         knowledge on whether we return or not, and letting the other case
14774         be responsible for it.
14775
14776 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * driver.cs: Do not load directories for each file processed, only
14779         do it if there is a pattern.
14780
14781         * ecore.cs: Report readonly assigns here as well, as we might have
14782         been resolved only by MemberAccess.
14783
14784         (SimpleName.SimpleNameResolve): Also be useful for LValue
14785         resolution.   We need this to propagate assign to local readonly variables
14786
14787         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14788         do not want to reuse potential criteria memory.
14789
14790         * class.cs (MyEventBuilder): Set reflected_type;
14791
14792         * ecore.cs (Constantify): Added support for constifying bools.
14793
14794         (RootContext.LookupType): Added a cache for values looked up in
14795         the declaration space.
14796
14797         * typemanager.cs (FindMembers): Now is a front-end to
14798         RealFindMembers, and provides a two-level hashtable-based cache to
14799         the request.  
14800
14801         15% performance improvement: from 22.5 to 19.2 seconds.
14802
14803         * expression.cs (IsParamsMethodApplicable): use foreach.
14804         (Invocation.DoResolve): ditto.
14805         (New.DoResolve): ditto.
14806         (ArrayCreation.DoResolve): ditto.
14807
14808         * ecore.cs (FindMostEncompassingType): use foreach.
14809
14810         * delegate.cs (NewDelegate.DoResolve): Use foreach
14811
14812         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14813         (RemoveMethods): use foreach.
14814
14815         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14816         nested foreach statements instead of for, and also break out of
14817         the inner loop once a match is found.
14818
14819         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14820
14821 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14822
14823         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14824         we actually unwrap the expression to allow for extra information
14825         to be extracted. 
14826
14827         * expression.cs: Use Shr_Un on unsigned operations. 
14828
14829 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14830
14831         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14832         applicable operators was not being considered correctly. This closes
14833         the bug Miguel reported.
14834
14835 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14836
14837         * attribute.cs: check that the type derives from System.Attribute
14838         and report the correct error in that case (moved the duplicate code to
14839         its own method, too).
14840
14841 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14842
14843         * attribute.cs: lookup attribute type name as the spec says: first the
14844         bare attribute name and then name + "Attribute" (nant compiles with
14845         mcs after this fix).
14846
14847 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14848
14849         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14850         Because of the way we parse things, we should try to see if a
14851         UIntConstant can fit in an integer.
14852
14853 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14854
14855         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14856         when we are in an explicit context.
14857
14858         (ConvertReferenceExplicit): When converting from Iface type S to Class
14859         T make sure the rules are implemented as an OR.
14860
14861         * parameter.cs (ParameterType): Make it a property for now although the
14862         purpose really isn't anything immediate.
14863
14864         * expression.cs (Is*Applicable): Do better checking on the parameter type
14865         of a ref/out parameter. The ones from the system assemblies are already 
14866         marked with the correct type so we don't need to do any correction.
14867
14868         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14869         the object type is standard too so include that.
14870
14871 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14872
14873         * ecore.cs (StandardConversionExists): Augment with missing code:
14874         deal with IntConstant, LongConstants and Enumerations.
14875
14876         * assign.cs: Report the error, instead of failing silently
14877
14878         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14879         typecontainer that they are declared, because the
14880         typecontainer/namespace will have the list of using clauses that
14881         need to be applied.
14882
14883         Assembly Attributes were escaping the normal registration
14884         mechanism. 
14885
14886         (EmitCode): Apply attributes within an EmitContext that represents
14887         the container they were declared on.
14888
14889         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14890
14891 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14892
14893         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14894         Revamp completely - make much cleaner as we now operate only
14895         on a set of Types.
14896
14897         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14898         to implement the logic detailed in the spec more correctly.
14899
14900         (UserDefinedConversion): Update accordingly.
14901
14902 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14903
14904         * statement.cs: Return flow analysis information up.
14905
14906         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14907         and the default.
14908
14909         (token): Do not consume an extra character before calling
14910         decimal_digits.
14911
14912 2002-05-06  Piers Haken <piersh@friskit.com>
14913
14914         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14915
14916 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14919         EmitContext during the instance constructor initializer
14920         resolution, to stop access to instance variables.
14921
14922         This is mandated by the spec, last paragraph of the `constructor
14923         initializers' section. 
14924
14925 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14926
14927         * cs-parser.jay, class.cs (Accessor): new class used to represent
14928         an accessor (get or set).  In the past we used `null' to represent
14929         a missing accessor.  But this is ambiguous because there was no
14930         way to tell in abstract indexers/properties if one of them was
14931         specified.
14932
14933         Now there is a way of addressing that.
14934
14935         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14936         instead of FindMembers.
14937
14938         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14939         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14940
14941         * attribute.cs: Treat indexers and properties as the same in terms
14942         of applying attributes
14943
14944         * ecore.cs (FindMostEncompassedType): Use statically initialized
14945         EmptyExpressions()s like we do elsewhere to avoid creating useless
14946         objects (and we take this out of the tight loop).
14947
14948         (GetConversionOperators): Move the code to extract the actual
14949         operators to a separate routine to clean things up.
14950
14951 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14952
14953         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14954         events are always registered FieldBuilders.
14955
14956         * class.cs (FieldBase): New class shared by Fields 
14957
14958         * delegate.cs: If we are a toplevel delegate, use our full name.
14959         If we are a nested delegate, then only use our tail name.
14960
14961 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14962
14963         * expression.cs (IsApplicable): Ensure that we add the "&" to
14964         ref/out types before comparing it with the type of the argument.
14965
14966         (IsParamsMethodApplicable): Ditto.
14967
14968         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14969         silly me ;-)
14970
14971         * delegate.cs : Handle the case when we have more than one applicable
14972         method. Flag an error only when we finish checking all.
14973
14974 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * expression.cs: Add support for boolean static initializers.
14977
14978 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14979
14980         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14981
14982         * parameter.cs (ComputeParameterTypes,
14983         ComputeAndDefineParameterTypes): Better error handling: now we
14984         clear the `types' cache if we fail during any of the type lookups.
14985         We also return the status code correctly to our caller
14986
14987         * delegate.cs: If we fail to define a delegate, abort the extra
14988         steps. 
14989
14990         * expression.cs (Binary.ResolveOperator): for
14991         operator==(object,object) and operator !=(object, object) we also
14992         have to verify that there is an implicit conversion from one to
14993         the other.
14994
14995         (ArrayAccess.DoResolve): Array Access can operate on
14996         non-variables. 
14997
14998 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14999
15000         * assign.cs (CompoundAssign): A new class used as a "flag" that
15001         the assignment actually is happening as part of a compound
15002         assignment operator.
15003
15004         During compound assignment, a few new rules exist to enable things
15005         like:
15006
15007         byte b |= 1 + 2
15008
15009         From the spec:
15010
15011         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15012         to the type of x) if y is implicitly convertible to the type of x,
15013         and the operator is a builtin operator and the return type of the
15014         operator is explicitly convertible to the type of x. 
15015
15016         * rootcontext.cs: Reset warning level to 2.  4 catches various
15017         "interesting" features in mcs, we must clean this up at some
15018         point, but currently am trying to kill other bugs ;-)
15019
15020         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15021         in container classes as well.  
15022
15023         * expression.cs (Binary.ResolveOperator): Handle string case
15024         before anything else (as operator overloading does emit an error
15025         before doing anything else).
15026
15027         This code could go away when we move to a table driven model, but
15028         i could not come up with a good plan last night.
15029
15030 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15031
15032         * typemanager.cs (CSharpName): reimplementation using regex.
15033         * class.cs: added null check for fields in Emit
15034         * rootcontext.cs: set warninglevel to 4
15035
15036 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15037
15038         * typemanager.cs (CSharpName): reimplemented with Lupus
15039         suggestion.
15040
15041 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * statement.cs (If): correclty implement Resolve, because we were
15044         not catching sem errors in there.  The same process is needed
15045         everywhere else. 
15046         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15047
15048
15049         (Statement.Warning_DeadCodeFound): Factorize code.
15050         (While): Report dead code here too.
15051
15052         (Statement): Added Resolve virtual method to allow
15053         for resolution split from the emit code.
15054
15055 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15056
15057         * statement.cs (EmitBoolExpression): No longer try to resolve the
15058         expression here.    
15059         (MakeBoolean): New utility function that resolve, implicitly
15060         converts to boolean and tags the expression. 
15061
15062
15063         (If, Do): Implement dead code elimination.
15064         (While): Implement loop inversion
15065
15066         (Do, While, For, If): Resolve the expression prior to calling our
15067         code generation.
15068
15069 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15070
15071         * class.cs:
15072           - added method Report28 (warning: program has more than one entry point)
15073           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15074           - modified method Method.Define, the part at the end of the method
15075
15076         * rootcontext.cs: added static public Location EntryPointLocation;
15077           
15078         * ../errors/cs0028.cs : Add test case for the above warning.              
15079
15080         * typemanager.cs:
15081           - modified method CSharpName to allow arrays of primitive type to
15082             be printed nicely (e.g. instead of System.Int32[][] it now prints
15083             int[][])
15084           - added method CSharpSignature: returns the signature of a method
15085             in string format to be used in reporting errors, warnings, etc.
15086
15087         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15088         with String.Empty.
15089
15090 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15091
15092         * delegate.cs (Define): Fix extremely silly bug where I was
15093         setting the type of the 'object' parameter of the BeginInvoke
15094         method to System.IAsyncResult instead of System.Object ;-)
15095
15096 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15099         here. 
15100
15101         (Constructor.Emit): return if we fail to initialize the
15102         constructor.  Another door closed!  
15103
15104         * expression.cs (New.DoResolve): Improve error message (from -6 to
15105         1501).  Use DeclaredOnly lookup to find the exact constructor.
15106
15107         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15108         loop.  This is useful.
15109
15110         * cs-parser.jay: Adjust the default parameters so that destructors
15111         have the proper signature.
15112
15113 2002-04-26  Martin Baulig  <martin@gnome.org>
15114
15115         * driver.cs (LoadAssembly): If `assembly' contains any characters
15116         which are only valid in path names and not in assembly names
15117         (currently slash, backslash and point), use Assembly.LoadFrom ()
15118         instead of Assembly.Load () on the `assembly' (before iteration
15119         over the link_paths).
15120
15121 2002-04-26  Martin Baulig  <martin@gnome.org>
15122
15123         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15124
15125 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15126
15127         * class.cs (Property): use the new typemanager.MemberLookup
15128
15129         (TypeContainer.MemberLookup): Implement using the
15130         TypeManager.MemberLookup now. 
15131
15132         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15133         and return MemberInfos, so that these can be used without an
15134         EmitContext (what we had before).
15135
15136 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15137
15138         * expression.cs: Fix the case where the argument to params if the
15139         type of the params.  I omitted handling this before.   Fixed
15140
15141 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * driver.cs: Call BootCorlib_PopulateCoreType
15144
15145         * class.cs (Property.CheckBase): Check for properties only, not
15146         for all members. 
15147
15148         * interface.cs: Temporary hack: try/catch around the
15149         CustomAttributeBuilder, because I am getting an exception that I
15150         do not understand.
15151
15152         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15153         types whose definitions are required to be there (attributes are
15154         defined before standard types).
15155
15156         Compute definitions as we boot the various types, as they are used
15157         immediately (value_type class will need object_type, but if we do
15158         not initialize object_type, we will pass a null, which will let
15159         the runtime pick the System.Object from the existing corlib, which
15160         is not what we want).
15161
15162 2002-04-22  Patrik Torstensson <totte@labs2.com>
15163
15164         * cs-tokenizer.cs: fixed a number of trim() issues.
15165
15166 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15167
15168         * expression.cs (Argument.Type): Ensure that we return the correct
15169         type when we have out or ref parameters [in which case we 
15170         append a "&"].
15171
15172 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * class.cs (Property, Indexer): Allow extern modifier in there. 
15175
15176         * typemanager.cs (InitBaseTypes): Initializes object_type and
15177         value_type, since those will be used early on during the bootstrap
15178         process to compile corlib.
15179
15180         (InitCoreTypes): Move code from here to InitBaseTypes.
15181
15182 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15183
15184         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15185         single-dimension arrays as using the ldlen opcode.  
15186
15187         Daniel Lewis discovered this optimization.  
15188
15189         * typemanager.cs: Add signature for System.Array::get_Length
15190
15191 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15192
15193         * statement.cs: report the error when the foreach does not apply to an
15194         array nor a collection.
15195
15196 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15197
15198         * expression.cs: Add implicit conversions to the operator ~.
15199
15200         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15201
15202         * typemanager.cs: Locate the decimal constructor.
15203
15204 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15205
15206         * attribute.cs: use the new property of TypeOf.
15207         * expression.cs: added 'get' property around typearg.
15208
15209         These changes fix a build breaker reported by NickD. Is this the
15210         correct way to fix?  If not, please, revert my changes and make it
15211         work :-).
15212
15213 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * attribute.cs: Add support for typeof in attribute invocations.
15216         I am not sure that this is right though.
15217
15218 2002-04-14  Duncan Mak  <duncan@ximian.com>
15219
15220         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15221         Binary.Operator.Division case.
15222
15223 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15224
15225         * class.cs (DefineType): Ensure that we do a proper check on
15226         attribute types and also register it with the TypeManager.
15227
15228         (TypeContainer.Targets): The default for attribute types is
15229         AttributeTargets.All.
15230
15231         * attribute.cs (ApplyAttributes): Registering the attribute type
15232         is done elsewhere, not when we discover we have a Usage attribute.
15233
15234 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15235
15236         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15237         and get rid of is_delegate parameter.
15238
15239         * everywhere : update.
15240
15241 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15242
15243         * cs-parser.jay (compilation_unit): Revamp completely to use
15244         some new ideas that I got from Rhys' grammar to solve the problems
15245         with assembly level attributes.
15246
15247         (outer_declaration): New grammar production.
15248
15249         (attribute_sections): Add.
15250
15251         (opt_attributes): Base on attribute_sections
15252
15253         (namespace_declaration): Allow opt_attributes to tackle the case
15254         when we have assembly level attributes - we are clever in this
15255         regard now ;-)
15256
15257         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15258         attributes in the non-global context.
15259
15260         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15261         instead of SetGlobalAttributes.
15262
15263         * class.cs, rootcontext.cs : Ensure we define and generate 
15264         attribute types before anything else.
15265
15266         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15267         and flag the new error -20 for the case when the attribute type
15268         does not have valid targets specified. csc does not catch this.
15269
15270         * ../errors/errors.txt : update for error # -20
15271
15272 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15273
15274         * support.cs (InternalParameters.ParameterModifier): Do some null
15275         checking and return sane values.
15276
15277         * class.cs (Method.Define): If we are a PInvoke method, ensure
15278         that we are static and extern. Report error # 601
15279
15280         * ../errors/cs0601.cs : Add test case for the above error.
15281
15282 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15283
15284         * rootcontext.cs (attribute_types): We need to keep type of
15285         all attribute types separately and emit code for them first.
15286
15287         (RegisterAttribute) : Implement.
15288
15289         * class.cs (DefineType): Check if the current Type is a custom
15290         attribute type and register it accordingly.
15291
15292         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15293         adding the first attribute twice and rename to
15294
15295         (SetGlobalAttributes): this.
15296
15297         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15298         lookups.
15299
15300         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15301         if we are processing global arguments. Hmm, I am unsure of this.
15302
15303 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15304
15305         * expression.cs: added static array of strings to avoid calling
15306         Enum.ToString () for Operator in Binary. Significant recover of
15307         performance.
15308
15309 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * class.cs (FindMembers): Allow the Builders of the various
15312         members to be null.  If they are skip them.  This only happens
15313         during the PInvoke declaration.
15314
15315 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15318         failure, so we do not keep going afterwards.
15319
15320         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15321         wanted to pass `false' as the `is_delegate' argument.  If this is
15322         the case, why not use delegate_type == null to mean `is_delegate =
15323         false' and anything else as is_delegate = true.
15324
15325 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15326
15327         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15328         code for the section, not the beginning of the tests.
15329
15330 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15333
15334         * expression.cs (Binary): same.  Warn about errors where we have
15335         Enum/Enum in operator + as well.
15336
15337 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15338
15339         * statement.cs:
15340                 - added support for switch(bool)
15341                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15342                 - add TableSwitchEmit() to handle table-based switch statements
15343
15344 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15345
15346         * expression.cs (Invocation.OverloadResolve): Factor out code which
15347         does parameter compatibility checking with arguments so that we can 
15348         re-use the code even from Delegate.VerifyApplicability
15349
15350         (VerifyArgumentsCompat): Move above code here.
15351
15352         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15353         and instead make a call to the above method.
15354
15355 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15356
15357         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15358         We use it to keep track of classes which are attribute types.
15359
15360 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * delegate.cs (Delegate.Define): Correctly define the types in the
15363         presence of fixed and array parameters.
15364
15365         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15366         doing FindMembers.
15367
15368         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15369         include NonPublic after the first iteration.
15370
15371         * class.cs (Indexer.CheckBase): Only check if both parents are
15372         non-null. 
15373
15374         * cs-parser.jay (accessor_body): If empty, set to null.
15375
15376         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15377         same code path here to resolve constants names that we did have in
15378         MemberAccess.DoResolve.  There is too much code duplicated here.
15379
15380 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15381
15382         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15383
15384         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15385         to MakeUnionSet.
15386
15387         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15388         tokens, numbers and strings.
15389
15390         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15391         parenthesis.
15392
15393         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15394         asyncronous parameters and the regular parameters.  
15395
15396         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15397         specify the target directory.
15398
15399         * expression.cs: (This.DoResolve): Simplify
15400         (As.Emit): Optimize, do not generate IsInst if the expression is
15401         always of the given type.
15402
15403         (Is.DoResolve): Bug fix, we were reporting both always/never for
15404         the is expression.
15405
15406         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15407         creating too many unnecessary arrays.
15408
15409 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15412         fields instead of rolling our own initializer.   Takes care of all
15413         implicit conversions, and drops unnecessary static checks/argument.
15414
15415 2002-03-31  Dick Porter  <dick@ximian.com>
15416
15417         * driver.cs: use the GetDirectories() return values properly, and
15418         use "/" as path separator.
15419
15420 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15421
15422         * expression.cs (Unary): Optimize - - expr into expr.
15423         (Binary): Optimize a + (-b) into a -b.
15424
15425         * codegen.cs (CodeGen): Made all methods static.
15426
15427 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15428
15429         * rootcontext.cs: 
15430
15431         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15432         TypeBuilder property.
15433
15434         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15435         instead. 
15436
15437         * tree.cs: Removed the various RecordXXXX, and replaced with a
15438         single RecordDecl.  Removed all the accessor methods, and just
15439         left a single access point Type 
15440
15441         * enum.cs: Rename DefineEnum to DefineType.
15442
15443         * decl.cs: New abstract method `DefineType' used to unify the
15444         Defines for Enumerations, Interfaces, TypeContainers and
15445         Delegates.
15446
15447         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15448         LookupBaseClasses method that used to live in class.cs and
15449         interface.cs here, and renamed to FindType.
15450
15451         * delegate.cs: Implement DefineType.  Take advantage of the
15452         refactored pattern for locating the parent builder without taking
15453         the parent_builder argument (which we know does not work if we are
15454         nested, and triggering a toplevel definition).
15455
15456 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15457
15458         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15459         accessibility of a member has changed during override and report
15460         an error if so.
15461
15462         * class.cs (Method.Define, Property.Define): Only complain on
15463         overrides if the method is private, any other accessibility is
15464         fine (and since we just checked the permission is the same, we are
15465         good to go).
15466
15467         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15468         and elif are processed always.  The other pre-processing
15469         directives are only processed if we are "taking" the path
15470
15471 2002-03-29  Martin Baulig  <martin@gnome.org>
15472
15473         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15474         current location is not Null.
15475
15476         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15477         a separate method so we can profile it.
15478
15479         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15480         `span.Seconds' are just seconds, but no minutes or hours.
15481         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15482
15483 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15486         Remove the gratuitous set of Final:
15487
15488                                 // If an interface implementation, then we can set Final.
15489                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15490                                     implementing.DeclaringType.IsInterface)
15491                                         flags |= MethodAttributes.Final;
15492
15493         I do not know what I was smoking when I used that.
15494
15495
15496         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15497         step into fixing the name resolution issues for delegates and
15498         unifying the toplevel name resolution.
15499
15500 2002-03-28  Martin Baulig  <martin@gnome.org>
15501
15502         * class.cs (Method.Emit): If we have a symbol writer, call its
15503         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15504         tell it about the current method.
15505
15506         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15507         writer that we're going to emit the first byte of IL code for a new
15508         statement (a new source line).
15509         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15510         EmitContext.Mark() before emitting any code.
15511
15512         * location.cs (SymbolDocument): Return null when we're Null.
15513
15514         * statement.cs (Statement): Moved the `Location loc' variable here.
15515         (Statement.EmitBoolExpression): If we have a symbol writer, call
15516         ec.Mark() before emitting any code to tell it that we're at the
15517         beginning of a new statement.
15518         (StatementExpression): Added `Location' argument to the constructor.
15519         (Block): Added public readonly variable `StartLocation' and public
15520         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15521         (Block): Added constructor which takes a start and end location.
15522         (Block.SetEndLocation): New method. This sets the end location.
15523         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15524         local variables we create.
15525         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15526         each statement and do also mark the begin and end of the block.
15527
15528         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15529         tell it the current lexer.Location, use Location.Null for the end of the
15530         block.
15531         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15532         current block, set its end location using SetEndLocation().
15533         (statement_expression): StatementExpression constructor now takes the
15534         lexer.Location as additional argument.
15535         (for_statement, declare_local_variables): Likewise.
15536         (declare_local_variables): When creating a new implicit block, use the
15537         new Block constructor and pass it the lexer.Location.
15538
15539 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15542         members also on the parent interfaces recursively.
15543
15544 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * report.cs: Use new formats, since Gonzalo finished the missing
15547         bits. 
15548
15549         * expression.cs (Binary.ResolveOperator): added missing operator|
15550         operator& and operator^ for bool/bool.
15551
15552         * cs-parser.jay: CheckDef now takes a Location argument that is
15553         used to report errors more precisly (instead of reporting the end
15554         of a definition, we try to track something which is a lot closer
15555         to the source of the problem).
15556
15557         * cs-tokenizer.cs: Track global token use, so we can properly flag
15558         the use of #define/#undef after the first token has been seen.
15559
15560         Also, rename the reportXXXX to Error_DescriptiveName
15561
15562         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15563         TypeContainer, so that Enum and Interface can use this too.
15564
15565         * class.cs (TypeContainer.LookupInterfaceOrClass,
15566         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15567         `builder' argument.  Typically this was used to pass the parent
15568         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15569         the definition).  
15570
15571         The problem is that a nested class could trigger the definition of
15572         a toplevel class, and the builder would be obviously wrong in that
15573         case. 
15574
15575         So we drop this argument, and we compute dynamically the
15576         TypeBuilder/ModuleBuilder (the correct information was available
15577         to us anyways from DeclSpace.Parent)
15578
15579         * interface.cs (Interface.DefineInterface): Drop builder
15580         parameter cleanup like class.cs
15581
15582         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15583         like class.cs
15584
15585         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15586         values. 
15587
15588         (Try.Emit): Propagate the returns value from the statement.
15589
15590         (Return.Emit): Even if we are leavning 
15591
15592         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15593
15594         * modifiers.cs: Fix the computation of MethodAttributes flags.
15595
15596 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15597
15598         * driver.cs: allow compilation of files that start with '/'.
15599         Add a default case when checking the argument of --target.
15600
15601 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * interface.cs: Implement the same search algorithm for types in
15604         the interface code.
15605
15606         * delegate.cs: Do not allow multiple definition.
15607
15608         * Recovered ChangeLog that got accidentally amputated
15609
15610         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15611
15612         * rootcontext.cs: Load manually enum to allow core classes to
15613         contain enumerations.
15614
15615         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15616         Update to new static methods in TypeManager.
15617
15618         * typemanager.cs (GetMethod, GetConstructor): Use our
15619         implementation of FindMembers to find the members, since during
15620         corlib compilation, the types are TypeBuilders and GetMethod and
15621         GetConstructor do not work.
15622
15623         Make all methods in TypeManager static.
15624
15625         (InitCodeHelpers): Split the functionality from
15626         the InitCodeTypes function.
15627
15628         * driver.cs: Call InitCodeHelpers after we have populated the
15629         types. 
15630
15631         * cs-parser.jay (delegate_declaration): we did not used to compute
15632         the delegate name correctly for void delegates.
15633
15634 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15635
15636         * rootcontext.cs (RootContext): Init the interface_resolve_order
15637         and type_container_resolve_order always.
15638
15639         (ResolveCore, BootstrapCorlib_ResolveClass,
15640         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15641         compiler when compiling with --nostdlib
15642
15643         * class.cs (TypeContainer.DefineType): Check that our parent is
15644         not null.  This test is most important when we are bootstraping
15645         the core types.
15646
15647         * codegen.cs: Split out the symbol writing code.
15648
15649 2002-03-25  Martin Baulig  <martin@gnome.org>
15650
15651         * driver.cs (-g): Made -g an alias for --debug.
15652
15653 2002-03-24  Martin Baulig  <martin@gnome.org>
15654
15655         * codegen.cs (SymbolWriter): New public variable. Returns the
15656         current symbol writer.
15657         (CodeGen): Added `bool want_debugging_support' argument to the
15658          constructor. If true, tell the ModuleBuild that we want debugging
15659         support and ask it for the ISymbolWriter.
15660         (Save): If we have a symbol writer, call it's Close() method after
15661         saving the assembly.
15662
15663         * driver.c (--debug): New command line argument to create a
15664         debugger information file.
15665
15666         * location.cs (SymbolDocument): New public property. Returns an
15667         ISymbolDocumentWriter object for the current source file or null
15668         if we don't have a symbol writer.
15669
15670 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15671
15672         * driver.cs (LoadAssembly): Correctly return when all the paths
15673         have been tried and not before.
15674
15675         * statement.cs (Switch.Emit): return the actual coverage for this
15676         statement (returns/not-returns)
15677
15678         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15679         switch of the statement if we are the last switch section.  That
15680         kills two problems: try/catch problems (we used to emit an empty
15681         nop at the end) and switch statements where all branches would
15682         return. 
15683
15684 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15685
15686         * driver.cs: Add default assemblies (the equivalent to the
15687         Microsoft CSC.RSP file)
15688
15689         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15690         also update tokens_seen and set it to false.
15691
15692         * driver.cs: Implement --recurse for Mike.
15693
15694         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15695         correctly splitting out the paths.
15696
15697 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * interface.cs (Interface.PopulateProperty): Instead of using
15700         `parent' as the declaration space for the set parameters, use
15701         `this' 
15702
15703         * support.cs (InternalParameters): InternalParameters constructor
15704         takes a DeclSpace instead of a TypeContainer.
15705
15706         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15707         types are being initialized, load the address of it before calling
15708         the function.  
15709
15710         (New): Provide a mechanism to disable the generation of local
15711         value type temporaries when the caller will be providing us with
15712         an address to store it.
15713
15714         (ArrayCreation.EmitDynamicInitializers): Use it.
15715
15716 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * expression.cs (Invocation.EmitArguments): Only probe for array
15719         property if there is more than one argument.  Sorry about that.
15720
15721         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15722         empty param arrays.
15723
15724         * class.cs (Method.LabelParameters): Fix incorrect code path that
15725         prevented the `ParamArrayAttribute' from being applied to the
15726         params attribute.
15727
15728 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15729
15730         * support.cs (ReflectionParameters): Correctly compute whether the
15731         last argument is a params array.  Fixes the problem with
15732         string.Split ('a')
15733
15734         * typemanager.cs: Make the assemblies array always be non-null
15735         (empty, but non-null)
15736
15737         * tree.cs (RecordDecl): New function that abstracts the recording
15738         of names.  This reports error 101, and provides a pointer to the
15739         previous declaration.  Fixes a crash in the compiler.
15740
15741         * cs-parser.jay (constructor_declaration): Update to new grammar,
15742         and provide a constructor_body that can be empty.
15743
15744 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15745
15746         * driver.cs: Add support for --resources.
15747
15748         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15749         Make all types for the various array helper methods be integer.
15750
15751         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15752         CheckState to ConvCast.
15753
15754         (ConvCast): Now it takes a `checked' state argument, to avoid
15755         depending on the emit context for the conversion, and just using
15756         the resolve time setting.
15757
15758         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15759         instead of Invocation.EmitArguments.  We do not emit the original
15760         arguments, instead we emit those which have been converted to
15761         unsigned int expressions.
15762
15763         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15764
15765         * codegen.cs: ditto.
15766
15767         * expression.cs (LocalVariableReference): Drop the use of the
15768         Store function that depended on the variable index.
15769
15770         * statement.cs (VariableInfo): Drop the `Idx' property from this
15771         class, as this is not taking into account the indexes for
15772         temporaries tat we generate during the execution, getting the
15773         indexes wrong.
15774
15775         * class.cs: First emit class initializers, then call the parent
15776         constructor. 
15777
15778         * expression.cs (Binary): Fix opcode emision.
15779         (UnaryMutator.EmitCode): Support checked code generation
15780
15781         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15782         matches for events for both the Static and Instance scans,
15783         pointing to the same element.   Fix that.
15784
15785 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15786
15787         * rootcontext.cs (ResolveTree): Always set the
15788         interface_resolve_order, because nested interfaces will be calling
15789         into us.
15790
15791         * class.cs (GetInterfaceOrClass): Track the same resolution
15792         process used by TypeManager.LookupType.  This fixes the nested
15793         type lookups in class declarations (separate path from
15794         LookupType). 
15795
15796         (TypeContainer.DefineType): Also define nested interfaces.
15797         (TypeContainer.RegisterOrder): New public function used to
15798         register the order in which child interfaces need to be closed.
15799
15800         Nested interfaces need to be closed after their parents have been
15801         created. 
15802
15803         * interface.cs (InterfaceAttr): Put all the logic for computing
15804         the interface attribute here. 
15805
15806         (DefineInterface): Register our interface order with the
15807         RootContext or with the TypeContainer depending on the case.
15808
15809 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15810
15811         * cs-parser.jay: rework foreach statement to work with the new
15812         changes to the policy on SimpleNames.
15813
15814         * report.cs: support Stacktrace on warnings as well.
15815
15816         * makefile: drop --unsafe and /unsafe from the compile.
15817
15818 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15819
15820         * ecore.cs (StandardConversionExists): Modify to take an Expression
15821         as the first parameter. Ensure we do null -> reference type conversion
15822         checking.
15823
15824         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15825         temporary Expression objects.
15826
15827 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15828
15829         * interface.cs: workaround bug in method overloading resolution
15830         (there is already a bugzilla bug for it).
15831
15832 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15833
15834         We could also solve this problem by having a separate path for
15835         performing type lookups, instead of DoResolve, we could have a
15836         ResolveType entry point, and only participating pieces of the
15837         production (simplename, deref, array) would implement this. 
15838
15839         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15840         signal SimpleName to only resolve type names and not attempt to
15841         resolve anything else.
15842
15843         * expression.cs (Cast): Set the flag.
15844
15845         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15846
15847         * class.cs: Only report 108 if there is no `new' modifier.
15848
15849         * cs-parser.jay: rework foreach statement to work with the new
15850         changes to the policy on SimpleNames.
15851
15852         * report.cs: support Stacktrace on warnings as well.
15853
15854         * makefile: drop --unsafe and /unsafe from the compile.
15855
15856 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15857
15858         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15859         lookups here, instead of doing that at parse time.  This means
15860         that our grammar will not introduce `LocalVariableReferences' as
15861         expressions at this point.  That solves the problem of code like
15862         this:
15863
15864         class X {
15865            static void Main ()
15866            { int X = 1;
15867             { X x = null }}}
15868
15869         This is only half the fix.  The full fix requires parameters to
15870         also be handled in this way.
15871
15872         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15873         makes the use more obvious of the DeclSpace.  The
15874         ec.TypeContainer.TypeBuilder is now only used to pull the
15875         TypeBuilder for it.
15876
15877         My theory is that I can get rid of the TypeBuilder completely from
15878         the EmitContext, and have typecasts where it is used (from
15879         DeclSpace to where it matters).  
15880
15881         The only pending problem is that the code that implements Aliases
15882         is on TypeContainer, and probably should go in DeclSpace.
15883
15884         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15885         lookups here, instead of doing that at parse time.  This means
15886         that our grammar will not introduce `LocalVariableReferences' as
15887         expressions at this point.  That solves the problem of code like
15888         this:
15889
15890         class X {
15891            static void Main ()
15892            { int X = 1;
15893             { X x = null }}}
15894
15895         This is only half the fix.  The full fix requires parameters to
15896         also be handled in this way.
15897
15898         * class.cs (Property.DefineMethod): When implementing an interface
15899         method, set newslot, when implementing an abstract method, do not
15900         set the flag (before we tried never setting it, or always setting
15901         it, which is the difference).
15902         (Indexer.DefineMethod): same.
15903         (Method.DefineMethod): same.
15904
15905         * ecore.cs: Only set the status used flag if we get back a Field.
15906
15907         * attribute.cs: Temporary hack, so Paolo can keep working.
15908
15909 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15910
15911         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15912         the unmanaged type in the case we have a MarshalAs attribute.
15913
15914         (Resolve): Handle the case when we are parsing the special MarshalAs
15915         attribute [we need to store the unmanaged type to use later]
15916
15917         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15918         MarshalAs Attribute.
15919
15920         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15921         on parameters and accordingly set the marshalling info.
15922
15923 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15924
15925         * class.cs: Optimizing slightly by removing redundant code after
15926         we switched to the `NoTypes' return value.
15927         (Property.DefineMethod): use NoTypes here too.
15928
15929         This fixes the bug I introduced in my last batch of changes.
15930
15931 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15932
15933         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15934
15935         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15936         Enums since those are types too. 
15937
15938         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15939
15940         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15941         thanks to a call during the lookup process.
15942
15943 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * statement.cs (Foreach): Lots of work to accomodate a particular
15946         kind of foreach statement that I had not kept in mind.  It is
15947         possible to have foreachs on classes that provide a GetEnumerator
15948         method that return objects that implement the "pattern" for using
15949         a foreach, there is no need to support GetEnumerator
15950         specifically. 
15951
15952         This is needed to compile nant.
15953
15954         * decl.cs: Only report 114 if the member is not `Finalize' and if
15955         the warning level is at least 2.
15956
15957         * class.cs: Moved the compare function from Method to
15958         MethodSignature. 
15959
15960         (MethodSignature.InheritableMemberSignatureCompare): Add new
15961         filter function that is used to extract inheritable methods from a
15962         class. 
15963
15964         (Method.Define): Use the new `inheritable_method_signature_filter'
15965         delegate
15966
15967         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15968         command. 
15969
15970 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15971
15972         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15973
15974         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15975
15976         * expression.cs: Pass location information to
15977         ConvertImplicitStandard. 
15978
15979         * class.cs: Added debugging code to track return values from
15980         interfaces. 
15981
15982 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15983
15984         * expression.cs (Is.DoResolve): If either side of the `is' is an
15985         interface, do not flag the warning.
15986
15987         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15988         for interfaces
15989
15990         * report.cs: Allow for --fatal to be used with --probe.
15991
15992         * typemanager.cs (NoTypes): Move the definition for the empty Type
15993         array here. 
15994
15995         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15996         properties. 
15997         (TypeContainer.DefineProxy): New function used to proxy to parent
15998         implementations when implementing interfaces.
15999         (TypeContainer.ParentImplements): used to lookup if our parent
16000         implements a public function that is required by an interface.
16001         (TypeContainer.VerifyPendingMethods): Hook this up.
16002
16003         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16004         `modules' and `assemblies' arraylists into arrays.  We only grow
16005         these are the very early start up of the program, so this improves
16006         the speedof LookupType (nicely measured).
16007
16008         * expression.cs (MakeByteBlob): Replaced unsafe code with
16009         BitConverter, as suggested by Paolo.
16010
16011         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16012         folding of string concatenation, but if either side is a string,
16013         and the other is not, then return null, and let the runtime use
16014         the concatenation on the string plus the object (using
16015         `Object.ToString'). 
16016
16017 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16018
16019         Constant Folding has been implemented now.
16020
16021         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16022         the error instead on types that are not supported in one's
16023         complement. 
16024
16025         * constant.cs (Constant and all children): New set of functions to
16026         perform implict and explicit conversions.
16027
16028         * ecore.cs (EnumConstant): Implement the new functions to perform
16029         conversion by proxying to the child expression.
16030
16031         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16032         own separate setting that can not be turned off from the command
16033         line using --unchecked or --checked and is only controlled using
16034         the checked/unchecked statements and expressions.  This setting is
16035         used by the constant folder to flag errors.
16036
16037         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16038         ConstantCheckState as well.   
16039
16040         During Resolve, they also have to flag the state, because the
16041         constant folder runs completely in the Resolve phase.
16042
16043         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16044         well.
16045
16046 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16047
16048         * cfold.cs: New file, this file contains the constant folder.
16049
16050         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16051         argument to track whether we are using the resulting address to
16052         load or store a value and provide better error messages. 
16053
16054         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16055         new AddressOf arguments.
16056
16057         * statement.cs (Foreach.EmitCollectionForeach): Update
16058
16059         * expression.cs (Argument.Emit): Call AddressOf with proper
16060         arguments to track usage.
16061
16062         (New.DoEmit): Call AddressOf with new arguments.
16063
16064         (Unary.Emit): Adjust AddressOf call.
16065
16066 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16067
16068         * cs-parser.jay (member_access): Change the case for pre-defined types
16069         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16070         this suggestion.
16071
16072         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16073         a method body.
16074
16075         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16076         essentially like methods and apply attributes like MethodImplOptions to them too.
16077
16078         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16079         not being null.
16080
16081         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16082         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16083         is the DeclSpace.
16084
16085         * Update code everywhere accordingly.
16086
16087         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16088
16089         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16090
16091 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16092
16093         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16094         try performing lookups against those instead of jumping straight into using
16095         the 'using' clauses.
16096
16097         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16098
16099         (LookupType): Perform lookups in implicit parents too.
16100
16101         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16102         sequence as RootContext.LookupType. 
16103
16104         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16105         the various cases of namespace lookups into this method.
16106
16107 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16110         in positional arguments)
16111
16112         * class.cs (Operator): Update the AllowedModifiers to contain
16113         extern. 
16114
16115         * cs-parser.jay: Update operator declaration to allow for the
16116         operator body to be empty.
16117
16118         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16119         values. 
16120
16121 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16122
16123         * class.cs (Method.Emit): Label parameters.
16124
16125         * driver.cs: Return 1 or 0 as the program exit code.
16126
16127 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16128
16129         * expression.cs: Special case the `null' object when trying to
16130         auto-compute the type, as anything can be explicitly converted to
16131         that. 
16132
16133         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16134         spotting this Paolo.
16135
16136         (Expression.ImplicitNumericConversion): Perform comparissions of
16137         the type using the underlying type in the case of an enumeration
16138         rather than using the enumeration type for the compare.
16139
16140         Cope with the underlying == type case, which is not possible to
16141         catch before. 
16142
16143         (Expression.ConvertNumericExplicit): Perform comparissions of
16144         the type using the underlying type in the case of an enumeration
16145         rather than using the enumeration type for the compare.
16146
16147         * driver.cs: If the user does not supply an extension, assume .exe
16148
16149         * cs-parser.jay (if_statement): Rewrote so that we can track the
16150         location for the if statement.
16151
16152         * expression.cs (Binary.ConstantFold): Only concat strings when
16153         the operation is "+", not everything ;-)
16154
16155         * statement.cs (Statement.EmitBoolExpression): Take a location
16156         argument. 
16157         (If, While, Do): Track location.
16158
16159         * expression.cs (Binary.ResolveOperator): In the object + string
16160         case, I was missing a call to ConvertImplicit
16161
16162 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16163
16164         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16165         Location arguments. Ensure we use RootContext.LookupType to do our work
16166         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16167
16168         * interface.cs (PopulateMethod): Handle the type of the parameter being
16169         null gracefully.
16170
16171         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16172         have a params method with no fixed arguments and a call is made with no
16173         arguments.
16174
16175 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16176
16177         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16178         the verbatim-string-literal
16179
16180         * support.cs (InternalParameters.ParameterModifier): handle null
16181         fixed parameters.
16182         (InternalParameters.ParameterType): ditto.
16183
16184         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16185         duplicating the name of the variable parameter.
16186         (GetParameterByName): Fix bug where we were not looking up array
16187         paramters if they were the only present (thanks Paolo!).
16188         (GetParameterInfo): We only have an empty set of types if both
16189         fixed and array are set to null.
16190         (GetParameterInfo-idx): Handle FixedParameter == null
16191
16192         * cs-parser.jay: Handle the case where there is no catch
16193         statements (missing null test).
16194
16195 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16196
16197         * driver.cs (MainDriver): Be conservative on our command line
16198         handling.
16199
16200         Catch DirectoryNotFoundException when calling GetFiles.
16201
16202         (SplitPathAndPattern): Used to split the input specification into
16203         a path and a pattern that we can feed to Directory.GetFiles.
16204
16205 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16206
16207         * statement.cs (Fixed): Implement the last case of the Fixed
16208         statement (string handling).
16209
16210         * expression.cs (StringPtr): New class used to return a char * to
16211         a string;  Used by the Fixed statement.
16212
16213         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16214
16215         * expression.cs (Binary.ResolveOperator): Remove redundant
16216         MemberLookup pn parent type.
16217         Optimize union call, we do not need a union if the types are the same.
16218         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16219         type.
16220
16221         Specialize the use of MemberLookup everywhere, instead of using
16222         the default settings. 
16223
16224         (StackAlloc): Implement stackalloc keyword.
16225
16226         * cs-parser.jay: Add rule to parse stackalloc.
16227
16228         * driver.cs: Handle /h, /help, /?
16229
16230         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16231         before we supported unsafe code.
16232
16233         * makefile: add --unsafe to the self compilation of mcs.
16234
16235 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * expression.cs (PointerArithmetic): New class that is used to
16238         perform pointer arithmetic.
16239         (Binary.Resolve): Handle pointer arithmetic
16240         Handle pointer comparission.
16241         (ArrayPtr): Utility expression class that is used to take the
16242         address of an array.
16243
16244         (ElementAccess): Implement array access for pointers
16245
16246         * statement.cs (Fixed): Implement fixed statement for arrays, we
16247         are missing one more case before we are done.
16248
16249         * expression.cs (Indirection): Implement EmitAssign and set the
16250         ExprClass to Variable.  This allows pointer dereferences to be
16251         treated as variables, and to have values assigned to them.
16252
16253         * ecore.cs (Expression.StoreFromPtr): New utility function to
16254         store values dereferencing.
16255
16256 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16257
16258         * expression.cs (Binary.ResolveOperator): Ensure that we are
16259         not trying to operate on a void type - this fixes the reported
16260         bug.
16261
16262         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16263         the parent implementation is sealed.
16264
16265         * ../errors/cs0239.cs : Add.
16266
16267         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16268
16269         * typemanager.cs (unverifiable_code_type): Corresponds to 
16270         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16271         which have unsafe code in them.
16272
16273         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16274         unsafe context.
16275
16276 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * cs-tokenizer.cs: Add support for @"litreal strings"
16279
16280         Make tokenizer accept pre-processor directives
16281         on any column (remove the old C-like limitation). 
16282
16283         * rootcontext.cs (EmitCode): Emit any global attributes.
16284         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16285
16286         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16287
16288         * cs-parser.jay: Add support for global attributes.  
16289
16290 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * expression.cs (Indirection): New helper class.  Unary will
16293         create Indirection classes to be able to implement the
16294         IMemoryLocation interface on it.
16295
16296 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * cs-parser.jay (fixed_statement): reference the right statement.
16299
16300         * statement.cs (Fixed.Emit): Finish implementing the fixed
16301         statement for the &x case.
16302
16303 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16304
16305         * class.cs (Property.Define, Method.Define): Remove newslot when
16306         `implementing'.  
16307
16308         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16309         wrong.  NewSlot should only be used if the `new' keyword is present.
16310
16311         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16312         locating our system dir.  Sorry about this.
16313
16314 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16315
16316         * driver.cs (GetSystemDir): Compute correctly the location of our
16317         system assemblies.  I was using the compiler directory instead of
16318         the library directory.
16319
16320 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16321
16322         * expression.cs (BetterFunction): Put back in what Miguel commented out
16323         since it is the correct fix. The problem is elsewhere ;-)
16324
16325         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16326         parameters of the parms method are themselves compatible or not !
16327
16328         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16329         to check that a class implements an interface before saying that an implicit
16330         conversion was allowed. Use ImplementsInterface to do the checking.
16331
16332 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16333
16334         * class.cs (Method.Define): Track whether we are an explicit
16335         implementation or not.  And only call DefineMethodOverride if we
16336         are an explicit implementation.
16337
16338         (Property.DefineMethod): Ditto.
16339
16340 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16341
16342         * expression.cs (BetterFunction): Catch hideous bug which was
16343          preventing us from detecting ambiguous calls due to implicit casts i.e
16344         cs0121.
16345
16346 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16347
16348         * support.cs (Pair): Remove un-needed method.  I figured why I was
16349         getting the error in cs-parser.jay, the variable in a foreach loop
16350         is readonly, and the compiler does not really treat this as a variable.
16351
16352         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16353         instead of EQUALS in grammar.  
16354
16355         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16356
16357         * expression.cs (Unary.DoResolve): Check whether the argument is
16358         managed or not.
16359
16360 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * support.cs: Api for Pair to set a value.  Despite the fact that
16363         the variables are public the MS C# compiler refuses to compile
16364         code that accesses the field if the variable is part of a foreach
16365         statement. 
16366
16367         * statement.cs (Fixed): Begin implementation of the fixed
16368         statement.
16369
16370         (Block.AddVariable): Return the VariableInfo on success and null
16371         on failure instead of true/false. 
16372
16373         * cs-parser.jay (foreach): Catch errors on variables already
16374         defined (we were ignoring this value before) and properly unwind
16375         the block hierarchy
16376
16377         (fixed_statement): grammar for the fixed statement.
16378
16379 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16380
16381         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16382         pointer types to be incretemented.
16383
16384         (SizeOf): Implement.
16385
16386         * cs-parser.jay (pointer_member_access): Implement
16387         expr->IDENTIFIER production.
16388
16389         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16390         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16391         on safe contexts.
16392
16393         (Unary): Implement indirection.
16394
16395         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16396         use in non-unsafe context).
16397
16398         (SimpleName.DoResolve): Check for pointers in field access on safe
16399         contexts. 
16400
16401         (Expression.LoadFromPtr): Factor the load-indirect code in this
16402         function.  This was duplicated in UnboxCast and ParameterReference
16403
16404 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16405
16406         * expression.cs (ComposedCast): report an error if a pointer cast
16407         is used in a safe region.
16408
16409         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16410         pointer type casts in unsafe context.
16411
16412         * codegen.cs (EmitContext): Set up IsUnsafe.
16413
16414         * cs-parser.jay (non_expression_type): Add productions for pointer
16415         casts. 
16416
16417         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16418         code.  We should not use force into static mode if the method is
16419         not virtual.  Fixes bug in MIS
16420
16421         * statement.cs (Do.Emit, While.Emit, For.Emit,
16422         Statement.EmitBoolExpression): Add support to Do and While to
16423         propagate infinite loop as `I do return' semantics.
16424
16425         Improve the For case to also test for boolean constants.
16426
16427         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16428         to the list of attributes we can add.
16429
16430         Remove `EmitContext' argument.
16431
16432         * class.cs (Method.Define): Apply parameter attributes.
16433         (Constructor.Define): Apply parameter attributes.
16434         (MethodCore.LabelParameters): Move here the core of labeling
16435         parameters. 
16436
16437         * support.cs (ReflectionParameters.ParameterModifier,
16438         InternalParameters.ParameterModifier): Use IsByRef on the type and
16439         only return the OUT bit for these parameters instead of in/out/ref
16440         flags.
16441
16442         This is because I miss-understood things.  The ParameterInfo.IsIn
16443         and IsOut represent whether the parameter has the [In] and [Out]
16444         attributes set.  
16445
16446 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16447
16448         * ecore.cs (FieldExpr.Emit): Release temporaries.
16449
16450         * assign.cs (LocalTemporary.Release): new function.
16451
16452         * codegen.cs (EmitContext.GetTemporaryStorage,
16453         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16454         temporary storage.  Now we can "put back" localbuilders when we
16455         are done with them
16456
16457 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16458
16459         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16460         need to make a copy of the variable to generate verifiable code.
16461
16462 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16463
16464         * driver.cs: Compute dynamically the system directory.
16465
16466         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16467         Slower, but more generally useful.  Used by the abstract
16468         registering implementation. 
16469
16470         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16471         the rules for the special rule on Type/instances.  First check if
16472         we have the same name, and if so, try that special static path
16473         rather than the instance path.
16474
16475 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16478         for, while and if.
16479
16480         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16481         Enum, ValueType, Delegate or Array for non-corlib compiles.
16482
16483         * cs-tokenizer.cs: Catch long identifiers (645)
16484
16485         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16486         piece of code.
16487
16488         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16489         fix, we were returning too early, so we were not registering
16490         pending methods from abstract classes.
16491
16492         Do not register pending methods if the class is abstract.
16493
16494         * expression.cs (Conditional.DoResolve): Report circular implicit
16495         conversions when we neecd to compute it for conditional
16496         expressions. 
16497
16498         (Is.DoResolve): If the expression is always of the provided type,
16499         flag warning 183.  If the expression can not ever be of the
16500         provided type flag warning 184.
16501
16502         * class.cs: Catch 169 as well.
16503
16504         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16505         read. 
16506
16507 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16508
16509         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16510
16511 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16512
16513         * interface.cs: (PopulateMethod): Check for pointers being defined
16514         only if the unsafe context is active.
16515         (PopulateProperty): ditto.
16516         (PopulateIndexer): ditto.
16517
16518         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16519         specified.  If pointers are present, make sure that they are
16520         present in an unsafe context.
16521         (Constructor, Constructor.Define): ditto.
16522         (Field, Field.Define): ditto.
16523         (Property, Property.Define): ditto.
16524         (Event, Event.Define): ditto.
16525
16526         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16527         hashtable if there are classes or structs defined.
16528
16529         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16530         code, as the constant resolution moved.
16531
16532         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16533         the metadata, so we can flag error 133. 
16534
16535         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16536         pointer is being declared in an unsafe context.
16537
16538 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * modifiers.cs (Modifiers.Check): Require a Location argument.
16541         Report error 227 for Unsafe use.
16542
16543         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16544
16545         * statement.cs (For.Emit): If the test is null, then report that
16546         we do `return', as we wont reach anything afterwards.
16547
16548         (Switch.SwitchGoverningType): Track the expression that matched
16549         the conversion.
16550
16551         * driver.cs: Allow negative numbers as an error code to flag.
16552
16553         * cs-parser.jay: Handle 1551.
16554
16555         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16556
16557 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16558
16559         * cs-parser.jay: Report 1518 (type declaration can only contain
16560         class, struct, interface, enum or delegate)
16561
16562         (switch_label): Report 1523 (keywords `case' or `default' must
16563         preced code)
16564
16565         (opt_switch_sections): Report 1522 (empty switch)
16566
16567         * driver.cs: Report 1515 (response file specified multiple times)
16568         Report 1516 (Source file specified multiple times).
16569
16570         * expression.cs (Argument.Resolve): Signal 1510
16571
16572         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16573         access not allowed in static code)
16574
16575 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16576
16577         * typemanager.cs (IsPointerType): Utility method which we are going
16578         to need a lot.
16579
16580         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16581         the object type, so we take care of that.
16582
16583         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16584
16585         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16586         added to non-params parameters :-)
16587
16588         * typemanager.cs (CSharpName): Include 'void' type too. 
16589
16590         (void_ptr_type): Include in the set of core types.
16591
16592         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16593         duplicating code.
16594
16595         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16596         an unsafe context.
16597
16598         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16599         completely forgotten about it.
16600
16601 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16602
16603         * cs-parser.jay (pointer_type): Add. This begins our implementation
16604         of parsing rules for unsafe code.
16605
16606         (unsafe_statement): Implement.
16607
16608         (embedded_statement): Modify to include the above.
16609
16610         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16611
16612         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16613         if the current context is an unsafe one.
16614
16615         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16616         are handled differently, we need separate rules for them.
16617
16618         (local_variable_declaration): Update to use local_variable_pointer_type
16619         to allow variable declarations of unmanaged pointer types.
16620
16621         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16622         in unsafe contexts.
16623
16624         * ../errors/cs0214.cs : Add.
16625
16626 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16627
16628         * makefile: remove 'response' file when cleaning.
16629
16630 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * cs-parser.jay: Report 1524.
16633
16634 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16635
16636         * typemanager.cs (RegisterMethod): drop checking if we have
16637         registered this from here
16638
16639 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * class.cs (Method.EmitDestructor): Implement calling our base
16642         destructor. 
16643
16644         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16645         value of InFinally.
16646
16647         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16648         this routine and will wrap the call in a try/catch block.  Deal
16649         with the case.
16650
16651 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16652
16653         * ecore.cs (Expression.MemberLookup): instead of taking a
16654         parameter `same_type' that was used to tell whether we could
16655         access private members we compute our containing type from the
16656         EmitContext.
16657
16658         (FieldExpr): Added partial support for volatile fields.  This does
16659         not work for volatile fields exposed from assemblies, as I can not
16660         figure out how to extract the modreq from it.
16661
16662         Updated all the source files to use this.
16663
16664         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16665         because it is referenced by MemberLookup very often. 
16666
16667 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16668
16669         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16670         TypeBuilder.GetCustomAttributes to retrieve what we need.
16671
16672         Get rid of redundant default_member_attr_type as this is the same as
16673         default_member_type which already exists.
16674
16675         * interface.cs, attribute.cs : Update accordingly.
16676
16677 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16678
16679         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16680         work for TYpeBuilders though.  Ravi, can you please fix this?
16681
16682         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16683
16684         * expression.cs (Argument.Emit): Handle the case of ref objects
16685         being passed to ref functions;  
16686
16687         (ParameterReference.EmitLoad): Loads the content of the pointer
16688         without dereferencing.
16689
16690 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16693
16694 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16695
16696         * class.cs (Indexer.DefineMethod): Incorporate the interface
16697         type in the name of the method if we are doing explicit interface
16698         implementation.
16699
16700         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16701
16702         (BetterConversion): Fix extremely trivial bug where we were referring to
16703         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16704         again !
16705
16706         * ../errors/bug16.cs : Add although we have fixed it.
16707
16708 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16709
16710         * expression.cs (BaseIndexer): Begin implementation.
16711
16712         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16713
16714         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16715         production directly to remove a shift/reduce, and implement
16716         explicit interface implementation.
16717
16718         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16719         after a floating point suffix.
16720
16721         * expression.cs (DoNumericPromotions): Improved the conversion for
16722         uint/uint.  If we have a constant, we avoid doing a typecast to a
16723         larger type.
16724
16725         * class.cs (Indexer): Implement explicit interface implementation
16726         for indexers.
16727
16728 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16729
16730         * class.cs: make the default instance constructor public and hidebysig.
16731
16732 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16733
16734         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16735         so we can call it from elsewhere.
16736
16737         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16738         we emit it internally if the class has a defined indexer; otherwise the user
16739         emits it by decorating the class definition with the DefaultMemberAttribute.
16740
16741         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16742         attribute is not used on a type which defines an indexer.
16743
16744         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16745         character when we skip whitespace.
16746
16747         * ../errors/cs0646.cs : Add.
16748
16749 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16752         again. 
16753
16754         * makefile: Add practical target `mcs3.exe' which builds the third
16755         generation compiler. 
16756
16757         * expression.cs (New): Fix structures constructor calling.
16758
16759         * class.cs (Property, Method, Indexer): Emit Final flag on the
16760         method if we are an interface implementation and we are not
16761         abstract. 
16762
16763         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16764         whether this property is referencing a `base' method.
16765
16766         * expression.cs (Invocation.EmitCall): take an extra argument:
16767         is_base, this is used to determine whether the `call' or
16768         `callvirt' opcode should be used.
16769
16770
16771         * delegate.cs: update EmitCall.
16772
16773         * class.cs (Method.Define): Set NewSlot for the cases where we are
16774         not implementing an interface method.
16775
16776         (Property.Define): ditto.
16777
16778 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16781         'r'.  Allows mcs to parse itself fully.
16782
16783 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16784
16785         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16786         of the number of initializers that require the InitializeArray method.
16787
16788         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16789         update the above field where necessary.
16790
16791         (MakeByteBlob): Update accordingly.
16792
16793         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16794         greater than 2.
16795
16796         (EmitDynamicInitializers): Update in accordance with the new optimization.
16797
16798         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16799         same OpCode applies.
16800
16801         * cs-parser.jay : Fix some glaring errors I introduced.
16802
16803 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16804
16805         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16806         so that we can check for name clashes there too.
16807
16808         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16809         for interface indexers.
16810
16811         * interfaces.cs (Define): Emit the default member attribute.
16812
16813         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16814         variable was being referred to while setting the value ;-)
16815
16816 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16817
16818         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16819         byte-by-byte information when we know the data is zero.
16820
16821         Make the block always a multiple of 4, because
16822         DefineInitializedData has a bug.
16823
16824         * assign.cs: Fix, we should assign from the temporary, not from
16825         the source. 
16826
16827         * expression.cs (MakeByteBlob): Fix my incorrect code.
16828
16829 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16830
16831         * typemanager.cs (EnumToUnderlying): This function is used to get
16832         the underlying type from an enumeration, because it does not
16833         always work. 
16834
16835         * constant.cs: Use the I4_S form for values between -128 and 127.
16836
16837         * statement.cs (Block.LookupLabel): Looks up a label.
16838         (Block): Drop support for labeled blocks.
16839
16840         (LabeledStatement): New kind of statement that represents a label
16841         only.
16842
16843         (Goto): Finally implement this bad boy.
16844
16845         * cs-parser.jay: Update to reflect new mechanism to implement
16846         labels.
16847
16848 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * codegen.cs (EmitContext.This): a codegen property that keeps the
16851         a single instance of this instead of creating many different this
16852         instances. 
16853
16854         * delegate.cs (Delegate.DoResolve): Update to use the property;
16855
16856         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16857
16858         * expression.cs (BaseAccess.DoResolve): Ditto.
16859
16860 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16861
16862         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16863         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16864
16865         (InitCoreTypes): Update accordingly.
16866
16867         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16868         so we can quickly store the state.
16869
16870         (ApplyAttributes): Set the correct implementation flags
16871         for InternalCall methods.
16872
16873 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * expression.cs (EmitCall): if a method is not virtual, then do
16876         not use callvirt on it.
16877
16878         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16879         user defined stuff) requires the use of stobj, which takes an
16880         address on the stack instead of an array and an index.  So emit
16881         the Ldelema operation for it.
16882
16883         (EmitStoreOpcode): Use stobj for valuetypes.
16884
16885         (UnaryMutator.EmitCode): Use the right 1 value depending on
16886         whether we are dealing with int64/uint64, float or doubles.
16887
16888         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16889         constructors that I implemented last night.
16890
16891         (Constructor.IsDefault): Fix to work properly for static
16892         constructors.
16893
16894         * cs-parser.jay (CheckDef): report method signature errors.
16895         Update error number 103 to be 132.
16896
16897         * decl.cs: New AdditionResult enumeration value: MethodExists.
16898         Although we do this check for methods later on in the semantic
16899         analysis, catching repeated default constructors is so easy that
16900         we catch these here. 
16901
16902         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16903         promotions code.
16904
16905         (ParameterReference.EmitAssign, Emit): handle
16906         bools as bytes.
16907
16908         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16909         (ArrayAccess.EmitStoreOpcode): ditto.
16910
16911         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16912
16913         * expression.cs (MakeByteBlob): Complete all the missing types
16914         (uint, short, ushort, byte, sbyte)
16915
16916         * class.cs: Only init instance field initializers on instance
16917         constructors. 
16918
16919         Rename `constructors' to instance_constructors. 
16920
16921         (TypeContainer.AddConstructor): Only add constructors to the list
16922         if it is not static.
16923
16924         Make sure that we handle default_static_constructor independently
16925         everywhere where we handle instance_constructors
16926
16927 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16928
16929         * class.cs: Do not lookup or create a base initializer for a
16930         static constructor.
16931
16932         (ConstructorInitializer.Resolve): use the proper type to lookup
16933         for constructors.
16934
16935         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16936
16937         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16938         in DeclSpace. 
16939
16940         * decl.cs: CloseType is now an virtual method, the default
16941         implementation just closes this type.
16942
16943 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16944
16945         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16946         to PreserveSig by default. Also emit HideBySig on such methods.
16947
16948         Basically, set the defaults to standard values.
16949
16950         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16951         argument, if candidate is better, it can't be worse than the best !
16952
16953         (Invocation): Re-write bits to differentiate between methods being
16954         applicable in their expanded form and their normal form - for params
16955         methods of course.
16956
16957         Get rid of use_standard everywhere as only standard conversions are allowed
16958         in overload resolution. 
16959
16960         More spec conformance.
16961
16962 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16963
16964         * driver.cs: Add --timestamp, to see where the compiler spends
16965         most of its time.
16966
16967         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16968         `this' in static code.
16969
16970         (SimpleName.DoResolve): Implement in terms of a helper function
16971         that allows static-references to be passed upstream to
16972         MemberAccess.
16973
16974         (Expression.ResolveWithSimpleName): Resolve specially simple
16975         names when called by MemberAccess to implement the special
16976         semantics. 
16977
16978         (Expression.ImplicitReferenceConversion): Handle conversions from
16979         Null to reference types before others, as Null's type is
16980         System.Object. 
16981
16982         * expression.cs (Invocation.EmitCall): Handle the special case of
16983         calling methods declared on a reference type from a ValueType
16984         (Base classes System.Object and System.Enum)
16985
16986         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16987         the left hand side is a TypeExpr, not on every enumeration. 
16988
16989         (Binary.Resolve): If types are reference types, then do a cast to
16990         object on operators != and == of both arguments.
16991
16992         * typemanager.cs (FindMembers): Extract instance and static
16993         members if requested.
16994
16995         * interface.cs (PopulateProperty): Use void_type instead of null
16996         as the return type for the setter method.
16997
16998         (PopulateIndexer): ditto.
16999
17000 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17001
17002         * support.cs (ReflectionParameters): Fix minor bug where we
17003         were examining the wrong parameter for the ParamArray attribute.
17004
17005         Cope with requests for the type of the parameter at position
17006         greater than the params parameter's. We now return the element
17007         type of the params array as that makes more sense.
17008
17009         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17010         accordingly as we no longer have to extract the element type
17011         ourselves.
17012
17013         (Invocation.OverloadResolve): Update.
17014
17015 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17016
17017         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17018         against IEnumerator, test whether the return value is a descendant
17019         of the IEnumerator interface.
17020
17021         * class.cs (Indexer.Define): Use an auxiliary method to implement
17022         the other bits of the method definition.  Begin support for
17023         explicit interface implementation.
17024
17025         (Property.DefineMethod): Use TypeManager.void_type instead of null
17026         for an empty return value.
17027
17028 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17029
17030         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17031         dealing with a FieldExpr which is composed of a FieldBuilder, in
17032         the code path we did extract the constant, but we should have
17033         obtained the underlying value to be able to cast it (otherwise we
17034         end up in an infinite loop, this is what Ravi was running into).
17035
17036         (ArrayCreation.UpdateIndices): Arrays might be empty.
17037
17038         (MemberAccess.ResolveMemberAccess): Add support for section
17039         14.5.4.1 that deals with the special case of E.I when E is a type
17040         and something else, that I can be a reference to a static member.
17041
17042         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17043         handle a particular array type to create byte blobs, it is just
17044         something we dont generate byteblobs for.
17045
17046         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17047         arguments. 
17048
17049         * location.cs (Push): remove the key from the hashtable that we
17050         are about to add.   This happens for empty files.
17051
17052         * driver.cs: Dispose files after we have parsed them.
17053
17054         (tokenize): new function that only runs the tokenizer on its
17055         input, for speed testing.
17056
17057 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17058
17059         * class.cs (Event.Define): Define the private field only if there
17060         are no accessors defined.
17061
17062         * expression.cs (ResolveMemberAccess): If there is no associated
17063         field with the event, that means we have an event defined with its
17064         own accessors and we should flag error cs0070 since transforming
17065         ourselves into a field is not valid in that case.
17066
17067         * ecore.cs (SimpleName.DoResolve): Same as above.
17068
17069         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17070         and charset to sane values.
17071
17072 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17073
17074         * assign.cs (DoResolve): Perform check on events only if they 
17075         are being accessed outside the declaring type.
17076
17077         * cs-parser.jay (event_declarations): Update rules to correctly
17078         set the type of the implicit parameter etc.
17079
17080         (add_accessor, remove_accessor): Set current local parameters.
17081
17082         * expression.cs (Binary): For delegate addition and subtraction,
17083         cast the return value from the method into the appropriate delegate
17084         type.
17085
17086 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17087
17088         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17089         of these as the workaround is unnecessary.
17090
17091         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17092         delegate data - none of that is needed at all.
17093
17094         Re-write bits to extract the instance expression and the delegate method
17095         correctly.
17096
17097         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17098         on delegates too.
17099
17100         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17101         of attaching attributes instead of duplicating code everywhere.
17102
17103         * everywhere : Update code to do attribute emission using the above method.
17104
17105 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * expression.cs (IsParamsMethodApplicable): if there are not
17108         parameters, return immediately.
17109
17110         * ecore.cs: The 0 literal can be implicity converted to an enum
17111         type. 
17112
17113         (SimpleName.DoResolve): First lookup the type, then lookup the
17114         members. 
17115
17116         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17117         want to get its address.  If the InstanceExpression is not
17118         addressable, store the result in a temporary variable, then get
17119         the address of it.
17120
17121         * codegen.cs: Only display 219 errors on warning level or above. 
17122
17123         * expression.cs (ArrayAccess): Make it implement the
17124         IMemoryLocation interface.
17125
17126         (Binary.DoResolve): handle the operator == (object a, object b)
17127         and operator != (object a, object b) without incurring into a
17128         BoxedCast (because 5 != o should never be performed).
17129
17130         Handle binary enumerator operators.
17131
17132         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17133         value type, otherwise use Ldelem_ref.
17134
17135         Use precomputed names;
17136
17137         (AddressOf): Implement address of
17138
17139         * cs-parser.jay (labeled_statement): Fix recursive block
17140         addition by reworking the production.
17141
17142         * expression.cs (New.DoEmit): New has a special case:
17143                 
17144                  If we are dealing with a ValueType, we have a few
17145                  situations to deal with:
17146                 
17147                     * The target of New is a ValueType variable, that is
17148                       easy, we just pass this as the variable reference
17149                 
17150                     * The target of New is being passed as an argument,
17151                       to a boxing operation or a function that takes a
17152                       ValueType.
17153                 
17154                       In this case, we need to create a temporary variable
17155                       that is the argument of New.
17156
17157
17158 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17159
17160         * rootcontext.cs (LookupType): Check that current_type is not null before
17161         going about looking at nested types.
17162
17163         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17164         not implement the IAssignMethod interface any more.
17165
17166         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17167         where we tranform them into FieldExprs if they are being resolved from within
17168         the declaring type.
17169
17170         * ecore.cs (SimpleName.DoResolve): Do the same here.
17171
17172         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17173
17174         * ../errors/bug10.cs : Add.
17175
17176         * ../errors/cs0070.cs : Add.
17177
17178         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17179
17180         * assign.cs : Get rid of EventIsLocal everywhere.
17181
17182 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17183
17184         * ecore.cs (ConvertIntLiteral): finished the implementation.
17185
17186         * statement.cs (SwitchLabel): Convert the value we are using as a
17187         key before looking up the table.
17188
17189 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17190
17191         * codegen.cs (EmitTopBlock): Require a Location argument now.
17192
17193         * cs-parser.jay (constructor_declarator): We need to setup
17194         current_local_parameters before we parse the
17195         opt_constructor_initializer, to allow the variables to be bound
17196         to the constructor arguments.
17197
17198         * rootcontext.cs (LookupType): First lookup nested classes in our
17199         class and our parents before we go looking outside our class.
17200
17201         * expression.cs (ConstantFold): Extract/debox the values at the
17202         beginnning. 
17203
17204         * rootcontext.cs (EmitCode): Resolve the constants first before we
17205         resolve the types.  This is not really needed, but it helps debugging.
17206
17207         * statement.cs: report location.
17208
17209         * cs-parser.jay: pass location to throw statement.
17210
17211         * driver.cs: Small bug fix.
17212
17213         * report.cs: Updated format to be 4-zero filled digits.
17214
17215 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17216
17217         * expression.cs (CheckIndices): Fix minor bug where the wrong
17218         variable was being referred to ;-)
17219
17220         (DoEmit): Do not call EmitStaticInitializers when the 
17221         underlying type is System.Object.
17222
17223 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17224
17225         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17226         and do the usual workaround for SRE.
17227
17228         * class.cs (MyEventBuilder.EventType): New member to get at the type
17229         of the event, quickly.
17230
17231         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17232
17233         * assign.cs (Assign.DoResolve): Handle the case when the target
17234         is an EventExpr and perform the necessary checks.
17235
17236         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17237         interface.
17238
17239         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17240
17241         (EventExpr): Set the type in the constructor itself since we 
17242         are meant to be born fully resolved.
17243
17244         (EventExpr.Define): Revert code I wrote earlier.
17245                 
17246         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17247         instance expression is null. The instance expression is a This in that case
17248         or a null, depending on whether it is a static method or not.
17249
17250         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17251         refers to more than one method.
17252
17253         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17254         and accordingly flag errors.
17255
17256 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17257
17258         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17259
17260 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * location.cs (ToString): Provide useful rutine.
17263
17264 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17265
17266         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17267         objects, return the actual integral boxed.
17268
17269         * statement.cs (SwitchLabel): define an ILLabel for each
17270         SwitchLabel. 
17271
17272         (Switch.CheckSwitch): If the value is a Literal, extract
17273         the underlying literal.
17274
17275         Also in the unused hashtable we had, add the SwitchLabel so we can
17276         quickly look this value up.
17277
17278         * constant.cs: Implement a bunch of new constants.  Rewrite
17279         Literal based on this.  Made changes everywhere to adapt to this.
17280
17281         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17282         dereferencing array only once, and also copes with enumrations.
17283
17284         bytes are two bytes wide, not one.
17285
17286         (Cast): Perform constant conversions.
17287
17288         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17289         wrappers to the literals here.
17290
17291         * expression.cs (DoNumericPromotions): long literals can converted
17292         to ulong implicity (this is taken care of elsewhere, but I was
17293         missing this spot).
17294
17295         * ecore.cs (Expression.Literalize): Make the return type Literal,
17296         to improve type checking.
17297
17298         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17299
17300 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17301
17302         * literal.cs: Revert code from ravi that checked the bounds.  The
17303         bounds are sane by the definition of the type itself. 
17304
17305         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17306         need to actually look up in our parent hierarchy for interfaces
17307         implemented. 
17308
17309         * const.cs: Use the underlying type for enumerations
17310
17311         * delegate.cs: Compute the basename for the delegate creation,
17312         that should fix the delegate test case, and restore the correct
17313         Type Lookup semantics in rootcontext
17314
17315         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17316         referencing a nested type with the Reflection API is using the "+"
17317         sign. 
17318
17319         * cs-parser.jay: Do not require EOF token at the end.
17320
17321 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17322
17323         * rootcontext.cs (LookupType): Concatenate type names with
17324         a '.' instead of a '+' The test suite passes again.
17325
17326         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17327         field of the enumeration.
17328
17329         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17330         the case when the member is an EventExpr.
17331
17332         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17333         static has an associated instance expression.
17334
17335         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17336
17337         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17338
17339         * class.cs (Event.Define): Register event and perform appropriate checks
17340         for error #111.
17341
17342         We define the Add and Remove methods even if the use provides none because
17343         in that case, we provide default implementations ourselves.
17344
17345         Define a private field of the type of the event. This is done by the CSC compiler
17346         and we should be doing it too ;-)
17347
17348         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17349         More methods we use in code we generate.
17350
17351         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17352         is important.
17353
17354         (InitCoreTypes): Update accordingly for the above.
17355
17356         * class.cs (Event.Emit): Generate code for default accessors that we provide
17357
17358         (EmitDefaultMethod): Do the job in the above.
17359
17360         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17361         appropriate place.
17362
17363 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17364
17365         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17366         builders even if we were missing one.
17367
17368         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17369         pass the Basename as our class name instead of the Name.  The
17370         basename will be correctly composed for us.
17371
17372         * parameter.cs (Paramters): Now takes a Location argument.
17373
17374         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17375         make all the code call directly LookupType in RootContext and take
17376         this chance to pass the Location information everywhere.
17377
17378         * Everywhere: pass Location information.
17379
17380 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * class.cs (Constructor.Define): Updated way of detecting the
17383         length of the parameters.
17384
17385         (TypeContainer.DefineType): Use basename as the type name for
17386         nested types.
17387
17388         (TypeContainer.Define): Do not recursively define types here, as
17389         definition is taken care in order by the RootContext.
17390
17391         * tree.cs: Keep track of namespaces in a per-file basis.
17392
17393         * parameter.cs (Parameter.ComputeSignature): Update to use
17394         DeclSpace. 
17395
17396         (Parameters.GetSignature): ditto.
17397
17398         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17399         instead of a TypeContainer.
17400
17401         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17402         resolve names.  Because we need to be resolve in our context, not
17403         our parents.
17404
17405         * driver.cs: Implement response files.
17406
17407         * class.cs (TypeContainer.DefineType): If we are defined, do not
17408         redefine ourselves.
17409
17410         (Event.Emit): Emit the code for add/remove handlers.
17411         (Event.Define): Save the MethodBuilders for add/remove.
17412
17413         * typemanager.cs: Use pair here too.
17414
17415         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17416         DictionaryEntry requires the first argument to be non-null.  
17417
17418         (enum_declaration): Compute full name for registering the
17419         enumeration.
17420
17421         (delegate_declaration): Instead of using
17422         formal_parameter_list, use opt_formal_parameter_list as the list
17423         can be empty.
17424
17425         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17426         (EventParsing): New property that controls whether `add' and
17427         `remove' are returned as tokens or identifiers (for events);
17428
17429 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17430
17431         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17432         use MyEventBuilder only and let it wrap the real builder for us.
17433
17434         (MyEventBuilder): Revamp constructor etc.
17435
17436         Implement all operations that we perform on EventBuilder in precisely the same
17437         way here too.
17438
17439         (FindMembers): Update to use the EventBuilder member.
17440
17441         (Event.Emit): Update accordingly.
17442
17443 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17444
17445         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17446         by calling the appropriate methods.
17447
17448         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17449         useful.
17450
17451         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17452
17453 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17454
17455         * delegate.cs (Delegate.Populate): Check that the return type
17456         and various parameters types are indeed accessible.
17457
17458         * class.cs (Constructor.Define): Same here.
17459
17460         (Field.Define): Ditto.
17461
17462         (Event.Define): Ditto.
17463
17464         (Operator.Define): Check that the underlying Method defined itself
17465         correctly - so it's MethodBuilder should not be null.
17466
17467         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17468         expression happens to be null.
17469
17470         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17471         members but as of now we don't seem to be able to do anything really useful with it.
17472
17473         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17474         not the EventBuilder.
17475
17476 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17477
17478         * cs-tokenizer.cs: Add support for defines.
17479         Add support for #if, #elif, #else, #endif
17480
17481         (eval_var): evaluates a variable.
17482         (eval): stubbed for evaluating functions.
17483
17484         * cs-parser.jay: Pass the defines information
17485
17486         * driver.cs: Add --define command line option.
17487
17488         * decl.cs: Move MemberCore here.
17489
17490         Make it the base class for DeclSpace.  This allows us to catch and
17491         report 108 and 109 for everything now.
17492
17493         * class.cs (TypeContainer.Define): Extract all the members
17494         before populating and emit the warning 108 (new keyword required
17495         to override) instead of having each member implement this.
17496
17497         (MemberCore.Define): New abstract method, we will be using this in
17498         the warning reporting engine in Populate.
17499
17500         (Operator.Define): Adjust to new MemberCore protocol. 
17501
17502         * const.cs (Const): This does not derive from Expression, it is a
17503         temporary object we use to create fields, it is a MemberCore. 
17504
17505         * class.cs (Method.Define): Allow the entry point to be in a
17506         specific class.
17507
17508         * driver.cs: Rewrite the argument handler to clean it up a bit.
17509
17510         * rootcontext.cs: Made it just an auxiliary namespace feature by
17511         making everything static.
17512
17513         * driver.cs: Adapt code to use RootContext type name instead of
17514         instance variable.
17515
17516         * delegate.cs: Remove RootContext argument.
17517
17518         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17519         argument. 
17520
17521         * class.cs (Event.Define): The lookup can fail.
17522
17523         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17524
17525         * expression.cs: Resolve the this instance before invoking the code.
17526
17527 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * cs-parser.jay: Add a production in element_access that allows
17530         the thing to become a "type" reference.  This way we can parse
17531         things like "(string [])" as a type.
17532
17533         Note that this still does not handle the more complex rules of
17534         casts. 
17535
17536
17537         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17538
17539         * ecore.cs: (CopyNewMethods): new utility function used to
17540         assemble the list of methods from running FindMembers.
17541
17542         (MemberLookup): Rework FindMembers so that 
17543
17544 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * class.cs (TypeContainer): Remove Delegates who fail to be
17547         defined.
17548
17549         * delegate.cs (Populate): Verify that we dont get null return
17550         values.   TODO: Check for AsAccessible.
17551
17552         * cs-parser.jay: Use basename to emit error 574 (destructor should
17553         have the same name as container class), not the full name.
17554
17555         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17556         possible representation.  
17557
17558         Also implements integer type suffixes U and L.
17559
17560 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * expression.cs (ArrayCreation.DoResolve): We need to do the
17563         argument resolution *always*.
17564
17565         * decl.cs: Make this hold the namespace.  Hold the root context as
17566         well.
17567         (LookupType): Move here.
17568
17569         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17570
17571         * location.cs (Row, Name): Fixed the code, it was always returning
17572         references to the first file.
17573
17574         * interface.cs: Register properties defined through interfaces.
17575
17576         * driver.cs: Add support for globbing on the command line
17577
17578         * class.cs (Field): Make it derive from MemberCore as well.
17579         (Event): ditto.
17580
17581 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17582
17583         * class.cs (Event::Define): Check that the type of the event is a delegate
17584         type else flag error #66.
17585
17586         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17587         same.
17588
17589         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17590         values of EntryPoint, CharSet etc etc.
17591
17592         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17593
17594         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17595         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17596         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17597         which needs this to do its work.
17598
17599         * ../errors/cs0066.cs : Add.
17600
17601 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17602
17603         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17604         helper functions.
17605
17606         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17607         clears out the parameters field.
17608         (MemberSignatureCompare): Cleanup
17609
17610         (MemberCore): New base class used to share code between MethodCore
17611         and Property.
17612
17613         (RegisterRequiredImplementations) BindingFlags.Public requires
17614         either BindingFlags.Instace or Static.  Use instance here.
17615
17616         (Property): Refactored code to cope better with the full spec.
17617
17618         * parameter.cs (GetParameterInfo): Return an empty array instead
17619         of null on error.
17620
17621         * class.cs (Property): Abstract or extern properties have no bodies.
17622
17623         * parameter.cs (GetParameterInfo): return a zero-sized array.
17624
17625         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17626         method modifier validation to the typecontainer so we can reuse
17627         this on properties.
17628
17629         (MethodCore.ParameterTypes): return an empty sized array of types.
17630
17631         (Property.Define): Test property modifier validity.
17632
17633         Add tests for sealed/override too.
17634
17635         (Method.Emit): abstract or extern methods have no bodies.
17636
17637 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17638
17639         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17640         thing.
17641
17642         (Method::Define, ::Emit): Modify accordingly.
17643
17644         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17645
17646         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17647
17648         * makefile: Pass in /unsafe.
17649
17650 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17651
17652         * class.cs (MakeKey): Kill routine.
17653
17654         * class.cs (TypeContainer.Define): Correctly define explicit
17655         method implementations (they require the full interface name plus
17656         the method name).
17657
17658         * typemanager.cs: Deply the PtrHashtable here and stop using the
17659         lame keys.  Things work so much better.
17660
17661         This of course broke everyone who depended on `RegisterMethod' to
17662         do the `test for existance' test.  This has to be done elsewhere.
17663
17664         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17665         the object stupid Equals method (because, that like fails all over
17666         the place).  We still do not use it.
17667
17668         * class.cs (TypeContainer.SetRequiredInterface,
17669         TypeContainer.RequireMethods): Killed these two routines and moved
17670         all the functionality to RegisterRequiredImplementations.
17671
17672         (TypeContainer.RegisterRequiredImplementations): This routine now
17673         registers all the implementations required in an array for the
17674         interfaces and abstract methods.  We use an array of structures
17675         which can be computed ahead of time to reduce memory usage and we
17676         also assume that lookups are cheap as most classes will not
17677         implement too many interfaces.
17678
17679         We also avoid creating too many MethodSignatures.
17680
17681         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17682         clear the "pending" bit if we find that there are problems with
17683         the declaration.
17684
17685         (TypeContainer.VerifyPendingMethods): Update to report errors of
17686         methods that look like implementations but are not.
17687
17688         (TypeContainer.Define): Add support for explicit interface method
17689         implementation. 
17690
17691 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * typemanager.cs: Keep track of the parameters here instead of
17694         being a feature of the TypeContainer.
17695
17696         * class.cs: Drop the registration of parameters here, as
17697         InterfaceMethods are also interface declarations.
17698
17699         * delegate.cs: Register methods with the TypeManager not only with
17700         the TypeContainer.  This code was buggy.
17701
17702         * interface.cs: Full registation here.
17703
17704 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17705
17706         * expression.cs: Remove reducer for binary expressions, it can not
17707         be done this way.
17708
17709         * const.cs: Put here the code that used to go into constant.cs
17710
17711         * constant.cs: Put here the code for constants, this is a new base
17712         class for Literals.
17713
17714         * literal.cs: Make Literal derive from Constant.
17715
17716 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17717
17718         * statement.cs (Return.Emit): Report error 157 if the user
17719         attempts to return from a finally block.
17720
17721         (Return.Emit): Instead of emitting a return, jump to the end of
17722         the function.
17723
17724         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17725         LocalBuilder to store the result of the function.  ReturnLabel is
17726         the target where we jump.
17727
17728
17729 2001-12-09  Radek Doulik  <rodo@ximian.com>
17730
17731         * cs-parser.jay: remember alias in current namespace
17732
17733         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17734         namespaces
17735
17736         * class.cs (LookupAlias): lookup alias in my_namespace
17737
17738         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17739         aliases hashtable
17740         (LookupAlias): lookup alias in this and if needed in parent
17741         namespaces
17742
17743 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * support.cs: 
17746
17747         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17748         making things static.  I need this to avoid passing the
17749         TypeContainer when calling ParameterType.
17750
17751         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17752         that did string manipulation to compute the type and then call
17753         GetType.  Use Parameter.ParameterType instead.
17754
17755         * cs-tokenizer.cs: Consume the suffix for floating values.
17756
17757         * expression.cs (ParameterReference): figure out whether this is a
17758         reference parameter or not.  Kill an extra variable by computing
17759         the arg_idx during emission.
17760
17761         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17762         function that returns whether a parameter is an out/ref value or not.
17763
17764         (Parameter.ParameterType): The type of the parameter (base,
17765         without ref/out applied).
17766
17767         (Parameter.Resolve): Perform resolution here.
17768         (Parameter.ExternalType): The full type (with ref/out applied).
17769
17770         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17771         support for expressions on the using statement.
17772
17773 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * statement.cs (Using.EmitLocalVariableDecls): Split the
17776         localvariable handling of the using statement.
17777
17778         (Block.EmitMeta): Keep track of variable count across blocks.  We
17779         were reusing slots on separate branches of blocks.
17780
17781         (Try.Emit): Emit the general code block, we were not emitting it. 
17782
17783         Check the type of the declaration to be an IDisposable or
17784         something that can be implicity converted to it. 
17785
17786         Emit conversions if required.
17787
17788         * ecore.cs (EmptyExpression): New utility class.
17789         (Expression.ImplicitConversionExists): New utility function.
17790
17791 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17792
17793         * statement.cs (Using): Implement.
17794
17795         * expression.cs (LocalVariableReference): Support read only variables.
17796
17797         * statement.cs: Remove the explicit emit for the Leave opcode.
17798         (VariableInfo): Add a readonly field.
17799
17800 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * ecore.cs (ConvCast): new class used to encapsulate the various
17803         explicit integer conversions that works in both checked and
17804         unchecked contexts.
17805
17806         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17807         properly generate the overflow opcodes.
17808
17809 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * statement.cs: The correct type for the EmptyExpression is the
17812         element_type, not the variable type.  Ravi pointed this out.
17813
17814 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17815
17816         * class.cs (Method::Define): Handle PInvoke methods specially
17817         by using DefinePInvokeMethod instead of the usual one.
17818
17819         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17820         above to do the task of extracting information and defining the method.
17821
17822 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17823
17824         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17825         of the condition for string type.
17826
17827         (Emit): Move that here. 
17828
17829         (ArrayCreation::CheckIndices): Keep string literals in their expression
17830         form.
17831
17832         (EmitDynamicInitializers): Handle strings appropriately.
17833
17834 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * codegen.cs (EmitContext): Replace multiple variables with a
17837         single pointer to the current Switch statement.
17838
17839         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17840         EmitContext.
17841
17842 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17843
17844         * statement.cs 
17845
17846         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17847         default'.
17848
17849         (Foreach.Emit): Foreach on arrays was not setting
17850         up the loop variables (for break/continue).
17851
17852         (GotoCase): Semi-implented.
17853
17854 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17855
17856         * attribute.cs (CheckAttribute): Handle system attributes by using
17857         Attribute.GetAttributes to examine information we need.
17858
17859         (GetValidPlaces): Same here.
17860
17861         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17862
17863         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17864
17865         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17866
17867         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17868
17869         (Method::Emit): Handle the case when we are a PInvoke method.
17870
17871 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17872
17873         * expression.cs: Use ResolveWithSimpleName on compound names.
17874
17875 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17876
17877         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17878         before trying to reduce it.
17879
17880         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17881
17882         * constant.cs (LookupConstantValue): Implement.
17883
17884         (EmitConstant): Use the above in emitting the constant.
17885
17886         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17887         that are user-defined by doing a LookupConstantValue on them.
17888
17889         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17890         too, like above.
17891
17892 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17893
17894         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17895
17896         (BaseAccess.DoResolve): Implement.
17897
17898         (MemberAccess.DoResolve): Split this routine into a
17899         ResolveMemberAccess routine that can be used independently
17900
17901 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17904         As that share bits of the implementation.  Is returns a boolean,
17905         while As returns the Type that is being probed.
17906
17907 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17908
17909         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17910         instead of a Literal - much easier.
17911
17912         (EnumInTransit): Remove - utterly useless :-)
17913
17914         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17915
17916         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17917
17918         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17919         chain when we have no associated expression.
17920
17921 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17922
17923         * constant.cs (Define): Use Location while reporting the errror.
17924
17925         Also emit a warning when 'new' is used and there is no inherited
17926         member to hide.
17927
17928         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17929         populated.
17930
17931         (LookupEnumValue): Implement to lookup an enum member's value and define it
17932         if necessary.
17933
17934         (Populate): Re-write accordingly to use the above routine.
17935
17936 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17937
17938         * expression.cs (This): Fix prototype for DoResolveLValue to
17939         override the base class DoResolveLValue.
17940
17941         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17942         declarations) 
17943
17944         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17945         (we need to load the address of the field here).  This fixes
17946         test-22. 
17947
17948         (FieldExpr.DoResolveLValue): Call the DoResolve
17949         function to initialize the Instance expression.
17950
17951         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17952         correctly the GetEnumerator operation on a value type.
17953
17954         * cs-parser.jay: Add more simple parsing error catches.
17955
17956         * statement.cs (Switch): Add support for string switches.
17957         Handle null specially.
17958
17959         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17960
17961 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17962
17963         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17964
17965         (declare_local_constant): New helper function.
17966
17967         * statement.cs (AddConstant): Keep a separate record of constants
17968
17969         (IsConstant): Implement to determine if a variable is a constant.
17970
17971         (GetConstantExpression): Implement.
17972
17973         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17974
17975         * statement.cs (IsVariableDefined): Re-write.
17976
17977 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17978
17979         * class.cs (TypeContainer::FindMembers): Look for constants
17980         in the case when we are looking for MemberTypes.Field
17981
17982         * expression.cs (MemberAccess::DoResolve): Check that in the
17983         case we are a FieldExpr and a Literal, we are not being accessed
17984         by an instance reference.
17985
17986         * cs-parser.jay (local_constant_declaration): Implement.
17987
17988         (declaration_statement): Implement for constant declarations.
17989
17990 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17991
17992         * statement.cs (Switch): Catch double defaults.
17993
17994         (Switch): More work on the switch() statement
17995         implementation.  It works for integral values now, need to finish
17996         string support.
17997
17998
17999 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18000
18001         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18002         integer literals into other integer literals.  To be used by
18003         switch. 
18004
18005 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18006
18007         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18008         some memory.
18009
18010         (EmitDynamicInitializers): Cope with the above since we extract data
18011         directly from ArrayData now.
18012
18013         (ExpectInitializers): Keep track of whether initializers are mandatory
18014         or not.
18015
18016         (Bounds): Make it a hashtable to prevent the same dimension being 
18017         recorded for every element in that dimension.
18018
18019         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18020         from being found.
18021
18022         Also fix bug which was causing the indices to be emitted in the reverse
18023         order.
18024
18025 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18028         unfinished.  They do not work, because the underlying code is
18029         sloppy.
18030
18031 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * cs-parser.jay: Remove bogus fixme.
18034
18035         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18036         on Switch statement.
18037
18038 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18039
18040         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18041         the same. 
18042
18043         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18044         parameter. Apparently, any expression is allowed. 
18045
18046         (ValidateInitializers): Update accordingly.
18047
18048         (CheckIndices): Fix some tricky bugs thanks to recursion.
18049
18050         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18051         I was being completely brain-dead.
18052
18053         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18054         and re-write acordingly.
18055
18056         (DelegateInvocation): Re-write accordingly.
18057
18058         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18059
18060         (MakeByteBlob): Handle types more correctly.
18061
18062         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18063         initialization from expressions but it is incomplete because I am a complete
18064         Dodo :-|
18065
18066 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18067
18068         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18069         on If.  Basically, we have to return `true' (ie, we do return to
18070         our caller) only if both branches of the if return.
18071
18072         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18073         short-circuit operators, handle them as short circuit operators. 
18074
18075         (Cast.DoResolve): Resolve type.
18076         (Cast.Cast): Take an expression as the target type.
18077
18078         * cs-parser.jay (cast_expression): Remove old hack that only
18079         allowed a limited set of types to be handled.  Now we take a
18080         unary_expression and we resolve to a type during semantic
18081         analysis.
18082
18083         Use the grammar productions from Rhys to handle casts (this is
18084         not complete like Rhys syntax yet, we fail to handle that corner
18085         case that C# has regarding (-x), but we will get there.
18086
18087 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18088
18089         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18090         field which is an array type.
18091
18092         * cs-parser.jay (declare_local_variables): Support array initialization too.
18093
18094         * typemanager.cs (MakeKey): Implement.
18095
18096         (everywhere): Use the above appropriately.
18097
18098         * cs-parser.jay (for_statement): Update for array initialization while
18099         declaring variables.
18100
18101         * ecore.cs : The error message was correct, it's the variable's names that
18102         were misleading ;-) Make the code more readable.
18103
18104         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18105         the correct type etc.
18106
18107         (ConvertExplicit): Handle Enum types by examining the underlying type.
18108
18109 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18110
18111         * parameter.cs (GetCallingConvention): Always return
18112         CallingConventions.Standard for now.
18113
18114 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18117         and `r' after calling DoNumericPromotions.
18118
18119         * ecore.cs: Fix error message (the types were in the wrong order).
18120
18121         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18122         BindingFlags.Instance as well 
18123
18124         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18125         implicit int literal conversion in an empty cast so that we
18126         propagate the right type upstream.
18127
18128         (UnboxCast): new class used to unbox value types.
18129         (Expression.ConvertExplicit): Add explicit type conversions done
18130         by unboxing.
18131
18132         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18133         the target type before applying the implicit LongLiterals to ULong
18134         literal cast.
18135
18136 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * cs-parser.jay (for_statement): Reworked the way For works: now
18139         we declare manually any variables that are introduced in
18140         for_initializer to solve the problem of having out-of-band code
18141         emition (that is what got for broken).
18142
18143         (declaration_statement): Perform the actual variable declaration
18144         that used to be done in local_variable_declaration here.
18145
18146         (local_variable_declaration): Do not declare anything, just pass
18147         the information on a DictionaryEntry
18148
18149 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18150
18151         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18152         re-write of the logic to now make it recursive.
18153
18154         (UpdateIndices): Re-write accordingly.
18155
18156         Store element data in a separate ArrayData list in the above methods.
18157
18158         (MakeByteBlob): Implement to dump the array data into a byte array.
18159
18160 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18161
18162         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18163         into CheckIndices.
18164
18165         * constant.cs (Define): Implement.
18166
18167         (EmitConstant): Re-write fully.
18168
18169         Pass in location info.
18170
18171         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18172         respectively.
18173
18174         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18175         DictionaryEntry since we need location info too.
18176
18177         (constant_declaration): Update accordingly.
18178
18179         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18180         code into another method : UpdateIndices.
18181
18182 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18183
18184         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18185         some type checking etc.
18186
18187 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18188
18189         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18190         bits to provide dimension info if the user skips doing that.
18191
18192         Update second constructor to store the rank correctly.
18193
18194 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18195
18196         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18197         and try to implement.
18198
18199         * ../errors/cs0150.cs : Add.
18200
18201         * ../errors/cs0178.cs : Add.
18202
18203 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * statement.cs: Implement foreach on multi-dimensional arrays. 
18206
18207         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18208         name of the params argument.
18209
18210         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18211         initializing the array.
18212
18213         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18214         we can use this elsewhere.
18215
18216         * statement.cs: Finish implementation of foreach for single
18217         dimension arrays.
18218
18219         * cs-parser.jay: Use an out-of-band stack to pass information
18220         around, I wonder why I need this.
18221
18222         foreach_block: Make the new foreach_block the current_block.
18223
18224         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18225         function used to return a static Parameters structure.  Used for
18226         empty parameters, as those are created very frequently.
18227
18228         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18229
18230 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18231
18232         * interface.cs : Default modifier is private, not public. The
18233         make verify test passes again.
18234
18235 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18236
18237         * support.cs (ReflectionParameters): Fix logic to determine
18238         whether the last parameter is a params one. Test 9 passes again.
18239
18240         * delegate.cs (Populate): Register the builders we define with
18241         RegisterParameterForBuilder. Test 19 passes again.
18242
18243         * cs-parser.jay (property_declaration): Reference $6 instead
18244         of $$ to get at the location.
18245
18246         (indexer_declaration): Similar stuff.
18247
18248         (attribute): Ditto.
18249
18250         * class.cs (Property): Register parameters for the Get and Set methods
18251         if they exist. Test 23 passes again.
18252
18253         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18254         call to EmitArguments as we are sure there aren't any params arguments. 
18255         Test 32 passes again.
18256
18257         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18258         IndexOutOfRangeException. 
18259
18260         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18261         Test 33 now passes again.
18262
18263 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18264
18265         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18266         broke a bunch of things.  Will have to come up with a better way
18267         of tracking locations.
18268
18269         * statement.cs: Implemented foreach for single dimension arrays.
18270
18271 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18272
18273         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18274         an error.  This removes the lookup from the critical path.
18275
18276         * cs-parser.jay: Removed use of temporary_loc, which is completely
18277         broken. 
18278
18279 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18280
18281         * support.cs (ReflectionParameters.ParameterModifier): Report
18282         whether the argument is a PARAMS argument or not.
18283
18284         * class.cs: Set the attribute `ParamArrayAttribute' on the
18285         parameter argument.
18286
18287         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18288         and cons_param_array_attribute (ConstructorInfo for
18289         ParamArrayAttribute)., 
18290
18291         * codegen.cs: Emit the return using the `Return' statement, that
18292         way we can report the error correctly for missing return values. 
18293
18294         * class.cs (Method.Emit): Clean up.
18295
18296         * expression.cs (Argument.Resolve): Take another argument: the
18297         location where this argument is used.  Notice that this is not
18298         part of the "Argument" class as to reduce the size of the
18299         structure (we know the approximate location anyways).
18300
18301         Test if the argument is a variable-reference, if not, then
18302         complain with a 206.
18303
18304         (Argument.Emit): Emit addresses of variables.
18305
18306         (Argument.FullDesc): Simplify.
18307
18308         (Invocation.DoResolve): Update for Argument.Resolve.
18309
18310         (ElementAccess.DoResolve): ditto.
18311
18312         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18313         method should be virtual, as this method is always virtual.
18314
18315         (NewDelegate.DoResolve): Update for Argument.Resolve.
18316
18317         * class.cs (ConstructorInitializer.DoResolve): ditto.
18318
18319         * attribute.cs (Attribute.Resolve): ditto.
18320
18321 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18322
18323         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18324
18325         * expression.cs (ParameterReference): Drop IStackStorage and implement
18326         IAssignMethod instead. 
18327
18328         (LocalVariableReference): ditto.
18329
18330         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18331         IAssignMethod instead. 
18332
18333 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18334
18335         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18336         enumerations that are used in heavily used structures derive from
18337         byte in a laughable and pathetic attempt to reduce memory usage.
18338         This is the kind of pre-optimzations that you should not do at
18339         home without adult supervision.
18340
18341         * expression.cs (UnaryMutator): New class, used to handle ++ and
18342         -- separatedly from the other unary operators.  Cleans up the
18343         code, and kills the ExpressionStatement dependency in Unary.
18344
18345         (Unary): Removed `method' and `Arguments' from this class, making
18346         it smaller, and moving it all to SimpleCall, so I can reuse this
18347         code in other locations and avoid creating a lot of transient data
18348         strucutres when not required.
18349
18350         * cs-parser.jay: Adjust for new changes.
18351
18352 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18353
18354         * enum.cs (Enum.Populate): If there is a failure during
18355         definition, return
18356
18357         * cs-parser.jay (opt_enum_base): we used to catch type errors
18358         here, but this is really incorrect.  The type error should be
18359         catched during semantic analysis.
18360
18361 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18362
18363         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18364         current_local_parameters as expected since I, in my stupidity, had forgotten
18365         to do this :-)
18366
18367         * attribute.cs (GetValidPlaces): Fix stupid bug.
18368
18369         * class.cs (Method::Emit): Perform check on applicability of attributes.
18370
18371         (Constructor::Emit): Ditto.
18372
18373         (Field::Emit): Ditto.
18374
18375         (Field.Location): Store location information.
18376
18377         (Property, Event, Indexer, Operator): Ditto.
18378
18379         * cs-parser.jay (field_declaration): Pass in location for each field.
18380
18381         * ../errors/cs0592.cs : Add.
18382
18383 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18384
18385         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18386
18387         (InitCoreTypes): Update accordingly.
18388
18389         (RegisterAttrType, LookupAttr): Implement.
18390
18391         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18392         info about the same.
18393
18394         (Resolve): Update to populate the above as necessary.
18395
18396         (Error592): Helper.
18397
18398         (GetValidPlaces): Helper to the above.
18399
18400         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18401
18402         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18403
18404 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18405
18406         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18407
18408         * ../errors/cs0617.cs : Add.
18409
18410 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18411
18412         * enum.cs (Emit): Rename to Populate to be more consistent with what
18413         we expect it to do and when exactly it is called.
18414
18415         * class.cs, rootcontext.cs : Update accordingly.
18416
18417         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18418         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18419
18420         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18421
18422         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18423         of a fieldinfo using the above, when dealing with a FieldBuilder.
18424
18425 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18426
18427         * ../errors/cs0031.cs : Add.
18428
18429         * ../errors/cs1008.cs : Add.
18430
18431         * ../errrors/cs0543.cs : Add.
18432
18433         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18434         enum type.
18435
18436         (FindMembers): Implement.
18437
18438         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18439         enums and delegates too.
18440
18441         (enum_types): Rename to builder_to_enum.
18442
18443         (delegate_types): Rename to builder_to_delegate.
18444
18445         * delegate.cs (FindMembers): Implement.
18446
18447 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18448
18449         * typemanager.cs (IsEnumType): Implement.
18450
18451         * enum.cs (Emit): Re-write parts to account for the underlying type
18452         better and perform checking etc.
18453
18454         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18455         of the underlying type.
18456
18457         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18458         value
18459
18460         * enum.cs (error31): Helper to report error #31.
18461
18462         * cs-parser.jay (enum_declaration): Store location of each member too.
18463
18464         * enum.cs (member_to_location): New hashtable. 
18465
18466         (AddEnumMember): Update location hashtable.
18467
18468         (Emit): Use the location of each member while reporting errors.
18469
18470 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18471
18472         * cs-parser.jay: A for_initializer if is a
18473         local_variable_declaration really ammount to have an implicit
18474         block with the variable declaration and no initializer for for.
18475
18476         * statement.cs (For.Emit): Cope with null initializers.
18477
18478         This fixes the infinite loop on for initializers.
18479
18480 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18481
18482         * enum.cs: More cleanup.
18483
18484         * ecore.cs: Remove dead code.
18485
18486         * class.cs (Property.Emit): More simplification.
18487         (Event.Emit): ditto.
18488
18489         Reworked to have less levels of indentation.
18490
18491 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18492
18493         * class.cs (Property): Emit attributes.
18494
18495         (Field): Ditto.
18496
18497         (Event): Ditto.
18498
18499         (Indexer): Ditto.
18500
18501         (Operator): Ditto.
18502
18503         * enum.cs (Emit): Ditto.
18504
18505         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18506         Enums too.
18507
18508         * class.cs (Field, Event, etc.): Move attribute generation into the
18509         Emit method everywhere.
18510
18511         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18512         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18513         as we had no way of defining nested enums !
18514
18515         * rootcontext.cs : Adjust code accordingly.
18516
18517         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18518
18519 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18520
18521         * expression.cs (EvalConstantExpression): Move into ecore.cs
18522
18523         * enum.cs (Enum): Rename some members and make them public and readonly
18524         according to our convention.
18525
18526         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18527         nothing else.
18528
18529         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18530
18531         (Enum::Emit): Write a simple version for now which doesn't try to compute
18532         expressions. I shall modify this to be more robust in just a while.
18533
18534         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18535
18536         (TypeContainer::CloseType): Create the Enum types too.
18537
18538         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18539
18540         * expression.cs (EvalConstantExpression): Get rid of completely.
18541
18542         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18543         user-defined values and other cases.
18544
18545         (IsValidEnumLiteral): Helper function.
18546
18547         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18548         out there in the case we had a literal FieldExpr.
18549
18550         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18551
18552         (Literalize): Revamp a bit to take two arguments.
18553
18554         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18555
18556 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18557
18558         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18559
18560         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18561
18562         (Resolve): Use the above to ensure we have proper initializers.
18563
18564 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18565
18566         * expression.cs (Expression::EvalConstantExpression): New method to 
18567         evaluate constant expressions.
18568
18569         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18570
18571 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18572
18573         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18574         in an array.
18575
18576         (Binary.ResolveOperator): Handle operator != (object a, object b)
18577         and operator == (object a, object b);
18578
18579         (Binary.DoNumericPromotions): Indicate whether the numeric
18580         promotion was possible.
18581
18582         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18583         Implement.  
18584
18585         Made the ArrayAccess implement interface IAssignMethod instead of
18586         IStackStore as the order in which arguments are passed reflects
18587         this.
18588
18589         * assign.cs: Instead of using expr.ExprClass to select the way of
18590         assinging, probe for the IStackStore/IAssignMethod interfaces.
18591
18592         * typemanager.cs: Load InitializeArray definition.
18593
18594         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18595         static data that can be used to initialize arrays. 
18596
18597 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18598
18599         * expression.cs: Handle operator== and operator!= for booleans.
18600
18601         (Conditioal.Reduce): Implement reducer for the ?: operator.
18602
18603         (Conditional.Resolve): Implement dead code elimination.
18604
18605         (Binary.Resolve): Catch string literals and return a new
18606         concatenated string.
18607
18608         (Unary.Reduce): Implement reduction of unary expressions.
18609
18610         * ecore.cs: Split out the expression core handling here.
18611
18612         (Expression.Reduce): New method used to perform constant folding
18613         and CSE.  This is needed to support constant-expressions. 
18614
18615         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18616         targets, and optimize for !x.
18617
18618 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18619
18620         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18621         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18622         set custom atttributes.
18623
18624         * literal.cs (Literal::GetValue): New abstract method to return the actual
18625         value of the literal, cast as an object.
18626
18627         (*Literal): Implement GetValue method.
18628
18629         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18630         expressions to the arraylist but objects of type Argument.
18631
18632         * class.cs (TypeContainer::Emit): Emit our attributes too.
18633
18634         (Method::Emit, Constructor::Emit): Ditto.
18635
18636         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18637         to be ignoring earlier.
18638
18639 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18640
18641         * attribute.cs (AttributeSection::Define): Implement to do the business
18642         of constructing a CustomAttributeBuilder.
18643
18644         (Attribute): New trivial class. Increases readability of code.  
18645
18646         * cs-parser.jay : Update accordingly.
18647
18648         (positional_argument_list, named_argument_list, named_argument): New rules
18649
18650         (attribute_arguments): Use the above so that we are more correct.
18651
18652 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18653
18654         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18655         to perform all checks for a method with a params parameter.
18656
18657         (Invocation::OverloadResolve): Update to use the above method and therefore
18658         cope correctly with params method invocations.
18659
18660         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18661         params too.
18662
18663         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18664         constructors in our parent too because we can't afford to miss out on 
18665         protected ones ;-)
18666
18667         * attribute.cs (AttributeSection): New name for the class Attribute
18668
18669         Other trivial changes to improve readability.
18670
18671         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18672         use the new class names.
18673
18674 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18675
18676         * class.cs (Method::Define): Complete definition for params types too
18677
18678         (Indexer::Define): Ditto.
18679
18680         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18681         Cope everywhere with a request for info about the array parameter.
18682
18683 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18684
18685         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18686
18687         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18688         local_variable_type to extract the string corresponding to the type.
18689
18690         (local_variable_type): Fixup the action to use the new helper method.
18691
18692         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18693         go.
18694
18695         * expression.cs : Clean out code which uses the above.
18696
18697 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18698
18699         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18700         and bale out if necessary by returning a false.
18701
18702         (RegisterProperty): Ditto.
18703
18704         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18705         and print out appropriate error messages.
18706
18707         * interface.cs (everywhere): Ditto.
18708
18709         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18710         location to constructor.
18711
18712         * class.cs (Property, Event, Indexer): Update accordingly.
18713
18714         * ../errors/cs111.cs : Added.
18715
18716         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18717         of a method, as laid down by the spec.
18718
18719         (Invocation::OverloadResolve): Use the above method.
18720
18721 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18722
18723         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18724         now take a TypeContainer and a Parameters object.
18725
18726         (ParameterData): Modify return type of ParameterModifier method to be 
18727         Parameter.Modifier and not a string.
18728
18729         (ReflectionParameters, InternalParameters): Update accordingly.
18730
18731         * expression.cs (Argument::GetParameterModifier): Same here.
18732
18733         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18734         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18735         symbol in it at all so maybe this is only for now.
18736
18737 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18738
18739         * support.cs (InternalParameters): Constructor now takes an extra argument 
18740         which is the actual Parameters class.
18741
18742         (ParameterDesc): Update to provide info on ref/out modifiers.
18743
18744         * class.cs (everywhere): Update call to InternalParameters to pass in
18745         the second argument too.
18746
18747         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18748         to return the modifier info [ref/out etc]
18749
18750         (InternalParameters, ReflectionParameters): Implement the above.
18751
18752         * expression.cs (Argument::ParameterModifier): Similar function to return
18753         info about the argument's modifiers.
18754
18755         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18756         too.
18757
18758         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18759         a new SetFormalParameters object which we pass to InternalParameters.
18760
18761 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18762
18763         * expression.cs (NewArray): Merge into the ArrayCreation class.
18764
18765 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18766
18767         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18768         NewUserdefinedArray into one as there wasn't much of a use in having
18769         two separate ones.
18770
18771         * expression.cs (Argument): Change field's name to ArgType from Type.
18772
18773         (Type): New readonly property which returns the proper type, taking into 
18774         account ref/out modifiers.
18775
18776         (everywhere): Adjust code accordingly for the above.
18777
18778         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18779         whether we are emitting for a ref or out parameter.
18780
18781         * expression.cs (Argument::Emit): Use the above field to set the state.
18782
18783         (LocalVariableReference::Emit): Update to honour the flag and emit the
18784         right stuff.
18785
18786         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18787
18788         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18789
18790         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18791
18792         (ReflectionParameters, InternalParameters): Implement the above method.
18793
18794         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18795         reporting errors.
18796
18797         (Invocation::FullMethodDesc): Ditto. 
18798
18799 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * cs-parser.jay: Add extra production for the second form of array
18802         creation. 
18803
18804         * expression.cs (ArrayCreation): Update to reflect the above
18805         change. 
18806
18807         * Small changes to prepare for Array initialization.
18808
18809 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * typemanager.cs (ImplementsInterface): interface might be null;
18812         Deal with this problem;
18813
18814         Also, we do store negative hits on the cache (null values), so use
18815         this instead of calling t.GetInterfaces on the type everytime.
18816
18817 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18818
18819         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18820
18821         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18822         split functionality out into different classes.
18823
18824         (New::FormArrayType): Move into NewBuiltinArray.
18825
18826         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18827         quite useless.
18828
18829         (NewBuiltinArray): New class to handle creation of built-in arrays.
18830
18831         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18832         account creation of one-dimensional arrays.
18833
18834         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18835
18836         (NewUserdefinedArray::DoResolve): Implement.
18837
18838         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18839
18840         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18841         we maintain inside the TypeManager. This is necessary to perform lookups on the
18842         module builder.
18843
18844         (LookupType): Update to perform GetType on the module builders too.     
18845
18846         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18847
18848         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18849
18850 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18851
18852         * expression.cs (New::DoResolve): Implement guts of array creation.
18853
18854         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18855
18856 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * expression.cs: Fix bug I introduced lsat night that broke
18859         Delegates. 
18860
18861         (Expression.Resolve): Report a 246 error (can not resolve name)
18862         if we find a SimpleName in the stream.
18863
18864         (Expression.ResolveLValue): Ditto.
18865
18866         (Expression.ResolveWithSimpleName): This function is a variant of
18867         ResolveName, this one allows SimpleNames to be returned without a
18868         warning.  The only consumer of SimpleNames is MemberAccess
18869
18870 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18873         might arrive here.  I have my doubts that this is correct.
18874
18875         * statement.cs (Lock): Implement lock statement.
18876
18877         * cs-parser.jay: Small fixes to support `lock' and `using'
18878
18879         * cs-tokenizer.cs: Remove extra space
18880
18881         * driver.cs: New flag --checked, allows to turn on integer math
18882         checking. 
18883
18884         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18885         Threading.Monitor.Exit 
18886
18887 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18888
18889         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18890         Expression Class to be IndexerAccess.
18891
18892         Notice that Indexer::DoResolve sets the eclass to Value.
18893
18894 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18895
18896         * class.cs (TypeContainer::Emit): Emit code for indexers.
18897
18898         * assign.cs (IAssignMethod): New interface implemented by Indexers
18899         and Properties for handling assignment.
18900
18901         (Assign::Emit): Simplify and reuse code. 
18902
18903         * expression.cs (IndexerAccess, PropertyExpr): Implement
18904         IAssignMethod, clean up old code. 
18905
18906 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18907
18908         * typemanager.cs (ImplementsInterface): New method to determine if a type
18909         implements a given interface. Provides a nice cache too.
18910
18911         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18912         method.
18913
18914         (ConvertReferenceExplicit): Ditto.
18915
18916         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18917         various methods, with correct names etc.
18918
18919         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18920         Operator.UnaryNegation.
18921
18922         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18923         we have a unary plus or minus operator.
18924
18925         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18926         UnaryMinus.
18927
18928         * everywhere : update accordingly.
18929
18930         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18931         respectively.
18932
18933         * class.cs (Method::Define): For the case where we are implementing a method
18934         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18935         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18936
18937 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18938
18939         * interface.cs (FindMembers): Implement to work around S.R.E
18940         lameness.
18941
18942         * typemanager.cs (IsInterfaceType): Implement.
18943
18944         (FindMembers): Update to handle interface types too.
18945
18946         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18947         use IsAssignableFrom as that is not correct - it doesn't work.
18948
18949         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18950         and accordingly override EmitStatement.
18951
18952         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18953         using the correct logic :-)
18954
18955 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18956
18957         * ../errors/cs-11.cs : Add to demonstrate error -11 
18958
18959 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18962         then pass this as a hint to ResolveLValue.
18963
18964         * expression.cs (FieldExpr): Add Location information
18965
18966         (FieldExpr::LValueResolve): Report assignment to readonly
18967         variable. 
18968
18969         (Expression::ExprClassFromMemberInfo): Pass location information.
18970
18971         (Expression::ResolveLValue): Add new method that resolves an
18972         LValue. 
18973
18974         (Expression::DoResolveLValue): Default invocation calls
18975         DoResolve. 
18976
18977         (Indexers): New class used to keep track of indexers in a given
18978         Type. 
18979
18980         (IStackStore): Renamed from LValue, as it did not really describe
18981         what this did.  Also ResolveLValue is gone from this interface and
18982         now is part of Expression.
18983
18984         (ElementAccess): Depending on the element access type
18985
18986         * typemanager.cs: Add `indexer_name_type' as a Core type
18987         (System.Runtime.CompilerServices.IndexerNameAttribute)
18988
18989         * statement.cs (Goto): Take a location.
18990
18991 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18992
18993         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18994         if two delegates are compatible.
18995
18996         (NewDelegate::DoResolve): Update to take care of the case when
18997         we instantiate a delegate from another delegate.
18998
18999         * typemanager.cs (FindMembers): Don't even try to look up members
19000         of Delegate types for now.
19001
19002 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19003
19004         * delegate.cs (NewDelegate): New class to take care of delegate
19005         instantiation.
19006
19007         * expression.cs (New): Split the delegate related code out into 
19008         the NewDelegate class.
19009
19010         * delegate.cs (DelegateInvocation): New class to handle delegate 
19011         invocation.
19012
19013         * expression.cs (Invocation): Split out delegate related code into
19014         the DelegateInvocation class.
19015
19016 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19017
19018         * expression.cs (New::DoResolve): Implement delegate creation fully
19019         and according to the spec.
19020
19021         (New::DoEmit): Update to handle delegates differently.
19022
19023         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19024         because of which we were printing out arguments in reverse order !
19025
19026         * delegate.cs (VerifyMethod): Implement to check if the given method
19027         matches the delegate.
19028
19029         (FullDelegateDesc): Implement.
19030
19031         (VerifyApplicability): Implement.
19032
19033         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19034         delegate invocations too.
19035
19036         (Invocation::Emit): Ditto.
19037
19038         * ../errors/cs1593.cs : Added.
19039
19040         * ../errors/cs1594.cs : Added.
19041
19042         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19043
19044 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19045
19046         * typemanager.cs (intptr_type): Core type for System.IntPtr
19047
19048         (InitCoreTypes): Update for the same.
19049
19050         (iasyncresult_type, asynccallback_type): Ditto.
19051
19052         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19053         correct.
19054
19055         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19056         too.
19057
19058         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19059         the builders for the 4 members of a delegate type :-)
19060
19061         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19062         type.
19063
19064         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19065
19066         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19067
19068 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19069
19070         * statement.cs (Break::Emit): Implement.   
19071         (Continue::Emit): Implement.
19072
19073         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19074         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19075         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19076         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19077         end loop
19078
19079         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19080         properties that track the label for the current loop (begin of the
19081         loop and end of the loop).
19082
19083 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19084
19085         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19086         use of emitting anything at all.
19087
19088         * class.cs, rootcontext.cs : Get rid of calls to the same.
19089
19090         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19091
19092         (Populate): Define the constructor correctly and set the implementation
19093         attributes.
19094
19095         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19096         have been defined.
19097
19098         (AddDelegateType): Implement.
19099
19100         (IsDelegateType): Implement helper method.
19101
19102         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19103
19104         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19105         and accordingly handle it.
19106
19107         * delegate.cs (Populate): Take TypeContainer argument.
19108         Implement bits to define the Invoke method. However, I still haven't figured out
19109         how to take care of the native int bit :-(
19110
19111         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19112         Qualify the name of the delegate, not its return type !
19113
19114         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19115         conversion.
19116
19117         (StandardConversionExists): Checking for array types turns out to be recursive.
19118
19119         (ConvertReferenceExplicit): Implement array conversion.
19120
19121         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19122
19123 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19124
19125         * cs-parser.jay (delegate_declaration): Store the fully qualified
19126         name as it is a type declaration.
19127
19128         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19129         readonly.
19130
19131         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19132         as TypeContainer::DefineType.
19133
19134         (Populate): Method in which all the definition of the various methods (Invoke)
19135         etc is done.
19136
19137         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19138         see.
19139
19140         (CloseDelegate): Finally creates the delegate.
19141
19142         * class.cs (TypeContainer::DefineType): Update to define delegates.
19143         (Populate, Emit and CloseType): Do the same thing here too.
19144
19145         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19146         delegates in all these operations.
19147
19148 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * expression.cs: LocalTemporary: a new expression used to
19151         reference a temporary that has been created.
19152
19153         * assign.cs: Handle PropertyAccess back here, so that we can
19154         provide the proper semantic access to properties.
19155
19156         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19157         a few more explicit conversions. 
19158
19159         * modifiers.cs: `NEW' modifier maps to HideBySig.
19160
19161         * expression.cs (PropertyExpr): Make this into an
19162         ExpressionStatement, and support the EmitStatement code path. 
19163
19164         Perform get/set error checking, clean up the interface.
19165
19166         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19167         them into toplevel access objects.
19168
19169 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19172         SRE.
19173
19174         * typemanager.cs: Keep track here of our PropertyBuilders again to
19175         work around lameness in SRE.
19176
19177 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19178
19179         * expression.cs (LValue::LValueResolve): New method in the
19180         interface, used to perform a second resolution pass for LValues. 
19181
19182         (This::DoResolve): Catch the use of this in static methods.
19183
19184         (This::LValueResolve): Implement.
19185
19186         (This::Store): Remove warning, assigning to `this' in structures
19187         is 
19188
19189         (Invocation::Emit): Deal with invocation of
19190         methods on value types.  We need to pass the address to structure
19191         methods rather than the object itself.  (The equivalent code to
19192         emit "this" for structures leaves the entire structure on the
19193         stack instead of a pointer to it). 
19194
19195         (ParameterReference::DoResolve): Compute the real index for the
19196         argument based on whether the method takes or not a `this' pointer
19197         (ie, the method is static).
19198
19199         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19200         value types returned from functions when we need to invoke a
19201         method on the sturcture.
19202
19203
19204 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19205
19206         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19207         defining the type in the Modulebuilder or Typebuilder. This is to take
19208         care of nested types which need to be defined on the TypeBuilder using
19209         DefineNestedMethod.
19210
19211         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19212         methods in RootContext, only ported to be part of TypeContainer.
19213
19214         (TypeContainer::GetInterfaceOrClass): Ditto.
19215
19216         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19217
19218         * interface.cs (Interface::DefineInterface): New method. Does exactly
19219         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19220         too.
19221
19222         (Interface::GetInterfaces): Move from RootContext here and port.
19223
19224         (Interface::GetInterfaceByName): Same here.
19225
19226         * rootcontext.cs (ResolveTree): Re-write.
19227
19228         (PopulateTypes): Re-write.
19229
19230         * class.cs (TypeContainer::Populate): Populate nested types too.
19231         (TypeContainer::Emit): Emit nested members too.
19232
19233         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19234         instead just use the name argument passed in as it is already fully
19235         qualified.
19236
19237         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19238         to TypeContainer mapping to see if a type is user-defined.
19239
19240         * class.cs (TypeContainer::CloseType): Implement. 
19241
19242         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19243         the default constructor.
19244
19245         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19246         twice.
19247
19248         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19249
19250         * interface.cs (CloseType): Create the type here.
19251
19252         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19253         the hierarchy.
19254
19255         Remove all the methods which are now in TypeContainer.
19256
19257 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19258
19259         * delegate.cs (Define): Re-write bits to define the delegate
19260         correctly.
19261
19262 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19265
19266         * expression.cs (ImplicitReferenceConversion): handle null as well
19267         as a source to convert to any reference type.
19268
19269         * statement.cs (Return): Perform any implicit conversions to
19270         expected return type.  
19271
19272         Validate use of return statement.  
19273
19274         * codegen.cs (EmitContext): Pass the expected return type here.
19275
19276         * class.cs (Method, Constructor, Property): Pass expected return
19277         type to EmitContext.
19278
19279 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * expression.cs: Make DoResolve take an EmitContext instead of a
19282         TypeContainer.
19283
19284         Replaced `l' and `location' for `loc', for consistency.
19285
19286         (Error, Warning): Remove unneeded Tc argument.
19287
19288         * assign.cs, literal.cs, constant.cs: Update to new calling
19289         convention. 
19290
19291         * codegen.cs: EmitContext now contains a flag indicating whether
19292         code is being generated in a static method or not.
19293
19294         * cs-parser.jay: DecomposeQI, new function that replaces the old
19295         QualifiedIdentifier.  Now we always decompose the assembled
19296         strings from qualified_identifier productions into a group of
19297         memberaccesses.
19298
19299 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * rootcontext.cs: Deal with field-less struct types correctly now
19302         by passing the size option to Define Type.
19303
19304         * class.cs: Removed hack that created one static field. 
19305
19306 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * statement.cs: Moved most of the code generation here. 
19309
19310 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19311
19312         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19313         seem very right.
19314
19315         (ElementAccess): Remove useless bits for now - keep checks as the spec
19316         says.
19317
19318 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19319
19320         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19321         and start performing checks according to the spec.
19322
19323 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19324
19325         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19326         rank_specifiers instead.
19327
19328         (rank_specifiers): Change the order in which the rank specifiers are stored
19329
19330         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19331
19332         * expression.cs (ElementAccess): Implement the LValue interface too.
19333
19334 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19335
19336         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19337         except that user defined conversions are not included.
19338
19339         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19340         perform the conversion of the return type, if necessary.
19341
19342         (New::DoResolve): Check whether we are creating an array or an object
19343         and accordingly do the needful.
19344
19345         (New::Emit): Same here.
19346
19347         (New::DoResolve): Implement guts of array creation.
19348
19349         (New::FormLookupType): Helper function.
19350
19351 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * codegen.cs: Removed most of the code generation here, and move the
19354         corresponding code generation bits to the statement classes. 
19355
19356         Added support for try/catch/finalize and throw.
19357
19358         * cs-parser.jay: Added support for try/catch/finalize.
19359
19360         * class.cs: Catch static methods having the flags override,
19361         virtual or abstract.
19362
19363         * expression.cs (UserCast): This user cast was not really doing
19364         what it was supposed to do.  Which is to be born in fully resolved
19365         state.  Parts of the resolution were being performed at Emit time! 
19366
19367         Fixed this code.
19368
19369 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * expression.cs: Implicity convert the result from UserCast.
19372
19373 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19374
19375         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19376         prevented it from working correctly. 
19377
19378         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19379         merely ConvertImplicit.
19380
19381 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19382
19383         * typemanager.cs: Make the LookupTypeContainer function static,
19384         and not per-instance.  
19385
19386         * class.cs: Make static FindMembers (the one that takes a Type
19387         argument). 
19388
19389         * codegen.cs: Add EmitForeach here.
19390
19391         * cs-parser.jay: Make foreach a toplevel object instead of the
19392         inline expansion, as we need to perform semantic analysis on it. 
19393
19394 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19395
19396         * expression.cs (Expression::ImplicitUserConversion): Rename to
19397         UserDefinedConversion.
19398
19399         (Expression::UserDefinedConversion): Take an extra argument specifying 
19400         whether we look for explicit user conversions too.
19401
19402         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19403
19404         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19405
19406         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19407         with the appropriate arguments.
19408
19409         * cs-parser.jay (cast_expression): Record location too.
19410
19411         * expression.cs (Cast): Record location info.
19412
19413         (Expression::ConvertExplicit): Take location argument.
19414
19415         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19416         to determine if we are doing explicit conversions.
19417
19418         (UserCast::Emit): Update accordingly.
19419
19420         (Expression::ConvertExplicit): Report an error if everything fails.
19421
19422         * ../errors/cs0030.cs : Add.
19423
19424 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19425
19426         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19427         virtual and newslot bits. 
19428
19429         * class.cs (TypeContainer::RegisterRequiredImplementations):
19430         Record methods we need.
19431
19432         (TypeContainer::MakeKey): Helper function to make keys for
19433         MethodBases, since the Methodbase key is useless.
19434
19435         (TypeContainer::Populate): Call RegisterRequiredImplementations
19436         before defining the methods.   
19437
19438         Create a mapping for method_builders_to_methods ahead of time
19439         instead of inside a tight loop.
19440
19441         (::RequireMethods):  Accept an object as the data to set into the
19442         hashtable so we can report interface vs abstract method mismatch.
19443
19444 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19445
19446         * report.cs: Make all of it static.
19447
19448         * rootcontext.cs: Drop object_type and value_type computations, as
19449         we have those in the TypeManager anyways.
19450
19451         Drop report instance variable too, now it is a global.
19452
19453         * driver.cs: Use try/catch on command line handling.
19454
19455         Add --probe option to debug the error reporting system with a test
19456         suite. 
19457
19458         * report.cs: Add support for exiting program when a probe
19459         condition is reached.
19460
19461 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19462
19463         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19464         we do a forcible conversion regardless of type, to check if 
19465         ForceConversion returns a null.
19466
19467         (Binary::error19): Use location to report error.
19468
19469         (Unary::error23): Use location here too.
19470
19471         * ../errors/cs0019.cs : Check in.
19472
19473         * ../errors/cs0023.cs : Check in.
19474
19475         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19476         case of a non-null MethodInfo object with a length of 0 !
19477
19478         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19479         an applicable member - according to the spec :-)
19480         Also fix logic to find members in base types.
19481
19482         (Unary::ResolveOperator): Same here.
19483
19484         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19485         as I was getting thoroughly confused between this and error19 :-)
19486
19487         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19488         (::FindMostEncompassedType): Implement.
19489         (::FindMostEncompassingType): Implement.
19490         (::StandardConversionExists): Implement.
19491
19492         (UserImplicitCast): Re-vamp. We now need info about most specific
19493         source and target types so that we can do the necessary conversions.
19494
19495         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19496         mathematical union with no duplicates.
19497
19498 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19501         in order from base classes to child classes, so that we can in
19502         child classes look up in our parent for method names and
19503         attributes (required for handling abstract, virtual, new, override
19504         constructs: we need to instrospect our base class, and if we dont
19505         populate the classes in order, the introspection might be
19506         incorrect.  For example, a method could query its parent before
19507         the parent has any methods and would determine that the parent has
19508         no abstract methods (while it could have had them)).
19509
19510         (RootContext::CreateType): Record the order in which we define the
19511         classes.
19512
19513 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19514
19515         * class.cs (TypeContainer::Populate): Also method definitions can
19516         fail now, keep track of this.
19517
19518         (TypeContainer::FindMembers): Implement support for
19519         DeclaredOnly/noDeclaredOnly flag.
19520
19521         (Constructor::Emit) Return the ConstructorBuilder.
19522
19523         (Method::Emit) Return the MethodBuilder. 
19524         Check for abstract or virtual methods to be public.
19525
19526         * rootcontext.cs (RootContext::CreateType): Register all the
19527         abstract methods required for the class to be complete and the
19528         interface methods that must be implemented. 
19529
19530         * cs-parser.jay: Report error 501 (method requires body if it is
19531         not marked abstract or extern).
19532
19533         * expression.cs (TypeOf::Emit): Implement.
19534
19535         * typemanager.cs: runtime_handle_type, new global type.
19536
19537         * class.cs (Property::Emit): Generate code for properties.
19538
19539 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19540
19541         * expression.cs (Unary::ResolveOperator): Find operators on base type
19542         too - we now conform exactly to the spec.
19543
19544         (Binary::ResolveOperator): Same here.
19545
19546         * class.cs (Operator::Define): Fix minor quirk in the tests.
19547
19548         * ../errors/cs0215.cs : Added.
19549
19550         * ../errors/cs0556.cs : Added.
19551
19552         * ../errors/cs0555.cs : Added.
19553
19554 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19555
19556         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19557         single integer which is really efficient
19558
19559 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19560
19561         *  expression.cs (Expression::ImplicitUserConversion): Use location
19562         even in the case when we are examining True operators.
19563  
19564         * class.cs (Operator::Define): Perform extensive checks to conform
19565         with the rules for operator overloading in the spec.
19566
19567         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19568         some of the other conversions mentioned in the spec.
19569
19570         * typemanager.cs (array_type): New static member for the System.Array built-in
19571         type.
19572
19573         (cloneable_interface): For System.ICloneable interface.
19574
19575         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19576         we start resolving the tree and populating types.
19577
19578         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19579  
19580 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * expression.cs (Expression::ExprClassFromMemberInfo,
19583         Expression::Literalize): Create literal expressions from
19584         FieldInfos which are literals.
19585
19586         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19587         type casts, because they were wrong.  The test suite in tests
19588         caught these ones.
19589
19590         (ImplicitNumericConversion): ushort to ulong requires a widening
19591         cast. 
19592
19593         Int32 constant to long requires widening cast as well.
19594
19595         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19596         for integers because the type on the stack is not i4.
19597
19598 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * expression.cs (report118): require location argument. 
19601
19602         * parameter.cs: Do not dereference potential null value.
19603
19604         * class.cs: Catch methods that lack the `new' keyword when
19605         overriding a name.  Report warnings when `new' is used without
19606         anything being there to override.
19607
19608         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19609
19610         * class.cs: Only add constructor to hashtable if it is non-null
19611         (as now constructors can fail on define).
19612
19613         (TypeManager, Class, Struct): Take location arguments.
19614
19615         Catch field instance initialization in structs as errors.
19616
19617         accepting_filter: a new filter for FindMembers that is static so
19618         that we dont create an instance per invocation.
19619
19620         (Constructor::Define): Catch errors where a struct constructor is
19621         parameterless 
19622
19623         * cs-parser.jay: Pass location information for various new
19624         constructs. 
19625
19626         * delegate.cs (Delegate): take a location argument.
19627
19628         * driver.cs: Do not call EmitCode if there were problesm in the
19629         Definition of the types, as many Builders wont be there. 
19630
19631         * decl.cs (Decl::Decl): Require a location argument.
19632
19633         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19634         into integers, and find the most appropiate integer for it.
19635
19636         * literal.cs: Implement ULongLiteral.
19637
19638         * rootcontext.cs: Provide better information about the location of
19639         failure when CreateType fails.
19640
19641 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19642
19643         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19644         as well.
19645
19646         * expression.cs (Binary::CheckShiftArguments): Add missing type
19647         computation.
19648         (Binary::ResolveOperator): Add type to the logical and and logical
19649         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19650         before.
19651
19652         (Binary::DoNumericPromotions): In the case where either argument
19653         is ulong (and most signed types combined with ulong cause an
19654         error) perform implicit integer constant conversions as well.
19655
19656 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * expression.cs (UserImplicitCast): Method should always be
19659         non-null. 
19660         (Invocation::BetterConversion): Simplified test for IntLiteral.
19661
19662         (Expression::ImplicitNumericConversion): Split this routine out.
19663         Put the code that performs implicit constant integer conversions
19664         here. 
19665
19666         (Expression::Resolve): Become a wrapper around DoResolve so we can
19667         check eclass and type being set after resolve.
19668
19669         (Invocation::Badness): Remove this dead function
19670
19671         (Binary::ResolveOperator): Do not compute the expensive argumnets
19672         unless we have a union for it.
19673
19674         (Probe::Emit): Is needs to do an isinst and then
19675         compare against null.
19676
19677         (::CanConvert): Added Location argument.  If the Location argument
19678         is null (Location.Null), then we do not report errors.  This is
19679         used by the `probe' mechanism of the Explicit conversion.  We do
19680         not want to generate an error for something that the user
19681         explicitly requested to be casted.  But the pipeline for an
19682         explicit cast first tests for potential implicit casts.
19683
19684         So for now, if the Location is null, it means `Probe only' to
19685         avoid adding another argument.   Might have to revise this
19686         strategy later.
19687
19688         (ClassCast): New class used to type cast objects into arbitrary
19689         classes (used in Explicit Reference Conversions).
19690
19691         Implement `as' as well.
19692
19693         Reverted all the patches from Ravi below: they were broken:
19694
19695                 * The use of `level' as a mechanism to stop recursive
19696                   invocations is wrong.  That was there just to catch the
19697                   bug with a strack trace but not as a way of addressing
19698                   the problem.
19699
19700                   To fix the problem we have to *understand* what is going
19701                   on and the interactions and come up with a plan, not
19702                   just get things going.
19703
19704                 * The use of the type conversion cache that I proposed
19705                   last night had an open topic: How does this work across
19706                   protection domains.  A user defined conversion might not
19707                   be public in the location where we are applying the
19708                   conversion, a different conversion might be selected
19709                   (ie, private A->B (better) but public B->A (worse),
19710                   inside A, A->B applies, but outside it, B->A will
19711                   apply).
19712
19713                 * On top of that (ie, even if the above is solved),
19714                   conversions in a cache need to be abstract.  Ie, `To
19715                   convert from an Int to a Short use an OpcodeCast', not
19716                   `To convert from an Int to a Short use the OpcodeCast on
19717                   the variable 5' (which is what this patch was doing).
19718
19719 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19720
19721         * expression.cs (Invocation::ConversionExists): Re-write to use
19722         the conversion cache
19723
19724         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19725         cache all conversions done, not just user-defined ones.
19726
19727         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19728         to determine if a conversion exists instead of acutually trying to 
19729         perform the conversion. It's faster too.
19730
19731         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19732         and only then attempt the implicit conversion.
19733
19734 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19735
19736         * expression.cs (ConvertImplicit): Use a cache for conversions
19737         already found. Check level of recursion and bail out if necessary.
19738
19739 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19742         Export standard methods that we expect for string operations.
19743
19744         * statement.cs (Block::UsageWarning): Track usage of variables and
19745         report the errors for not used variables.
19746
19747         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19748         operator. 
19749
19750 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19751
19752         * codegen.cs: remove unnneded code 
19753
19754         * expression.cs: Removed BuiltinTypeAccess class
19755
19756         Fix the order in which implicit conversions are
19757         done.  
19758
19759         The previous fixed dropped support for boxed conversions (adding a
19760         test to the test suite now)
19761
19762         (UserImplicitCast::CanConvert): Remove test for source being null,
19763         that code is broken.  We should not feed a null to begin with, if
19764         we do, then we should track the bug where the problem originates
19765         and not try to cover it up here.
19766
19767         Return a resolved expression of type UserImplicitCast on success
19768         rather than true/false.  Ravi: this is what I was talking about,
19769         the pattern is to use a static method as a "constructor" for
19770         objects. 
19771
19772         Also, do not create arguments until the very last minute,
19773         otherwise we always create the arguments even for lookups that
19774         will never be performed. 
19775
19776         (UserImplicitCast::Resolve): Eliminate, objects of type
19777         UserImplicitCast are born in a fully resolved state. 
19778
19779         * typemanager.cs (InitCoreTypes): Init also value_type
19780         (System.ValueType). 
19781
19782         * expression.cs (Cast::Resolve): First resolve the child expression.
19783
19784         (LValue): Add new method AddressOf to be used by
19785         the `&' operator.  
19786
19787         Change the argument of Store to take an EmitContext instead of an
19788         ILGenerator, because things like FieldExpr need to be able to call
19789         their children expression to generate the instance code. 
19790
19791         (Expression::Error, Expression::Warning): Sugar functions for
19792         reporting errors.
19793
19794         (Expression::MemberLookup): Accept a TypeContainer instead of a
19795         Report as the first argument.
19796
19797         (Expression::ResolvePrimary): Killed.  I still want to improve
19798         this as currently the code is just not right.
19799
19800         (Expression::ResolveMemberAccess): Simplify, but it is still
19801         wrong. 
19802
19803         (Unary::Resolve): Catch errors in AddressOf operators.
19804
19805         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19806         index to a byte for the short-version, or the compiler will choose
19807         the wrong Emit call, which generates the wrong data.
19808
19809         (ParameterReference::Emit, ::Store): same.
19810
19811         (FieldExpr::AddressOf): Implement.
19812
19813         * typemanager.cs: TypeManager: made public variable instead of
19814         property.
19815
19816         * driver.cs: document --fatal.
19817
19818         * report.cs (ErrorMessage, WarningMessage): new names for the old
19819         Error and Warning classes.
19820
19821         * cs-parser.jay (member_access): Turn built-in access to types
19822         into a normal simplename
19823
19824 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19825
19826         * expression.cs (Invocation::BetterConversion): Fix to cope
19827         with q being null, since this was introducing a bug.
19828
19829         * expression.cs (ConvertImplicit): Do built-in conversions first.
19830
19831 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19832
19833         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19834
19835 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19836
19837         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19838         I had introduced long ago (what's new ?).
19839
19840         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19841         the work of all the checking. 
19842         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19843         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19844
19845         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19846         that is the right way. 
19847
19848         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19849         overloading resolution. Use everywhere instead of cutting and pasting code.
19850
19851         (Binary::ResolveOperator): Use MakeUnionSet.
19852
19853         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19854         we have to convert to bool types. Not complete yet.
19855
19856 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * typemanager.cs (TypeManager::CSharpName): support ushort.
19859
19860         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19861         to provide an expression that performsn an implicit constant int
19862         conversion (section 6.1.6).
19863         (Expression::ConvertImplicitRequired): Reworked to include
19864         implicit constant expression conversions.
19865
19866         (Expression::ConvertNumericExplicit): Finished.
19867
19868         (Invocation::Emit): If InstanceExpression is null, then it means
19869         that we perform a call on this.
19870
19871 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19872
19873         * expression.cs (Unary::Emit): Remove some dead code.
19874         (Probe): Implement Resolve and Emit for `is'.
19875         (Expression::ConvertImplicitRequired): Attempt to do constant
19876         expression conversions here.  Maybe should be moved to
19877         ConvertImplicit, but I am not sure.
19878         (Expression::ImplicitLongConstantConversionPossible,
19879         Expression::ImplicitIntConstantConversionPossible): New functions
19880         that tell whether is it possible to apply an implicit constant
19881         expression conversion.
19882
19883         (ConvertNumericExplicit): Started work on explicit numeric
19884         conversions.
19885
19886         * cs-parser.jay: Update operator constants.
19887
19888         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19889         (Parameters::GetSignature): Hook up VerifyArgs here.
19890         (Parameters::VerifyArgs): Verifies that no two arguments have the
19891         same name. 
19892
19893         * class.cs (Operator): Update the operator names to reflect the
19894         ones that the spec expects (as we are just stringizing the
19895         operator names).
19896
19897         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19898         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19899         previous usage did only work for our methods.
19900         (Expression::ConvertImplicit): Handle decimal implicit numeric
19901         conversions as well.
19902         (Expression::InternalTypeConstructor): Used to invoke constructors
19903         on internal types for default promotions.
19904
19905         (Unary::Emit): Implement special handling for the pre/post
19906         increment/decrement for overloaded operators, as they need to have
19907         the same semantics as the other operators.
19908
19909         (Binary::ResolveOperator): ditto.
19910         (Invocation::ConversionExists): ditto.
19911         (UserImplicitCast::Resolve): ditto.
19912
19913 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19914
19915         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19916         operator, return after emitting body. Regression tests pass again !
19917
19918         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19919         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19920         (Invocation::OverloadResolve): Ditto.
19921         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19922
19923         * everywhere : update calls to the above methods accordingly.
19924
19925 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19928
19929         * expression.cs (ExpressionStatement): New base class used for
19930         expressions that can appear in statements, so that we can provide
19931         an alternate path to generate expression that do not leave a value
19932         on the stack.
19933
19934         (Expression::Emit, and all the derivatives): We no longer return
19935         whether a value is left on the stack or not.  Every expression
19936         after being emitted leaves a single value on the stack.
19937
19938         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19939         facilties of ExpressionStatement if possible.
19940
19941         * cs-parser.jay: Update statement_expression.
19942
19943 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19944
19945         * driver.cs: Change the wording of message
19946
19947 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19948
19949         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19950         the type of the expression to the return type of the method if
19951         we have an overloaded operator match ! The regression tests pass again !
19952         (Unary::ResolveOperator): Ditto.
19953
19954         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19955         to find "op_Implicit", not "implicit" ;-)
19956         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19957         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19958
19959         * everywhere : Correct calls to the above accordingly.
19960
19961         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19962         (ConvertImplicit): Do user-defined conversion if it exists.
19963
19964 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * assign.cs: track location.
19967         (Resolve): Use implicit conversions on assignment.
19968
19969         * literal.cs: Oops.  Not good, Emit of short access values should
19970         pass (Bytes) or the wrong argument will be selected.
19971
19972         * expression.cs (Unary::Emit): Emit code for -expr.
19973
19974         (Unary::ResolveOperator): Handle `Substract' for non-constants
19975         (substract from zero from the non-constants).
19976         Deal with Doubles as well. 
19977
19978         (Expression::ConvertImplicitRequired): New routine that reports an
19979         error if no implicit conversion exists. 
19980
19981         (Invocation::OverloadResolve): Store the converted implicit
19982         expressions if we make them
19983
19984 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19985
19986         * class.cs (ConstructorInitializer): Take a Location argument.
19987         (ConstructorBaseInitializer): Same here.
19988         (ConstructorThisInitializer): Same here.
19989
19990         * cs-parser.jay : Update all calls accordingly.
19991
19992         * expression.cs (Unary, Binary, New): Take location argument.
19993         Update accordingly everywhere.
19994
19995         * cs-parser.jay : Update all calls to the above to take a location
19996         argument.
19997
19998         * class.cs : Ditto.
19999
20000 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20001
20002         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20003         (Invocation::BetterConversion): Same here
20004         (Invocation::ConversionExists): Ditto.
20005
20006         (Invocation::ConversionExists): Implement.
20007
20008 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20009
20010         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20011         Also take an additional TypeContainer argument.
20012
20013         * All over : Pass in TypeContainer as argument to OverloadResolve.
20014
20015         * typemanager.cs (CSharpName): Update to check for the string type and return
20016         that too.
20017
20018         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20019         a given method.
20020
20021 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20022
20023         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20024         (Invocation::BetterFunction): Implement.
20025         (Invocation::BetterConversion): Implement.
20026         (Invocation::ConversionExists): Skeleton, no implementation yet.
20027
20028         Okay, things work fine !
20029
20030 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * typemanager.cs: declare and load enum_type, delegate_type and
20033         void_type. 
20034
20035         * expression.cs (Expression::Emit): Now emit returns a value that
20036         tells whether a value is left on the stack or not.  This strategy
20037         might be reveted tomorrow with a mechanism that would address
20038         multiple assignments.
20039         (Expression::report118): Utility routine to report mismatches on
20040         the ExprClass.
20041
20042         (Unary::Report23): Report impossible type/operator combination
20043         utility function.
20044
20045         (Unary::IsIncrementableNumber): Whether the type can be
20046         incremented or decremented with add.
20047         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20048         complemented. 
20049         (Unary::ResolveOperator): Implement ++, !, ~,
20050
20051         (Invocation::Emit): Deal with new Emit convetion.
20052
20053         * All Expression derivatives: Updated their Emit method to return
20054         whether they leave values on the stack or not.
20055
20056         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20057         stack for expressions that are statements. 
20058
20059 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * expression.cs (LValue): New interface.  Must be implemented by
20062         LValue objects.
20063         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20064         LValue interface.
20065
20066         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20067         interface for generating code, simplifies the code.
20068
20069 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20070
20071         * expression.cs (everywhere): Comment out return statements in ::Resolve
20072         methods to avoid the warnings.
20073
20074 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20075
20076         * driver.cs (parse): Report error 2001 if we can not open the
20077         source file.
20078
20079         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20080         not resolve it.
20081
20082         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20083         object. 
20084
20085         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20086         otherwise nested blocks end up with the same index.
20087
20088         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20089
20090         * expression.cs:  Instead of having FIXMEs in the Resolve
20091         functions, throw exceptions so it is obvious that we are facing a
20092         bug. 
20093
20094         * cs-parser.jay (invocation_expression): Pass Location information.
20095
20096         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20097         Use a basename for those routines because .NET does not like paths
20098         on them. 
20099
20100         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20101         already defined.
20102
20103 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20106         are loading the correct data types (throws an exception if not).
20107         (TypeManager::InitCoreTypes): Use CoreLookupType
20108
20109         * expression.cs (Unary::ResolveOperator): return the child
20110         expression for expressions which are just +expr.
20111         (Unary::ResolveOperator): Return negative literals for -LITERAL
20112         expressions (otherwise they are Unary {Literal}).
20113         (Invocation::Badness): Take into account `Implicit constant
20114         expression conversions'.
20115
20116         * literal.cs (LongLiteral): Implement long literal class.
20117         (IntLiteral): export the `Value' of the intliteral. 
20118
20119 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20120
20121         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20122
20123         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20124         instead of 'Operator'
20125
20126         * expression.cs (Binary::ResolveOperator): Update accordingly.
20127         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20128         and 'Minus'
20129
20130         * cs-parser.jay (unary_expression): Update to use the new names.
20131
20132         * gen-treedump.cs (GetUnary): Same here.
20133
20134         * expression.cs (Unary::Resolve): Implement.
20135         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20136         operators are found instead of making noise ;-)
20137         (Unary::ResolveOperator): New method to do precisely the same thing which
20138         Binary::ResolveOperator does for Binary expressions.
20139         (Unary.method, .Arguments): Add.
20140         (Unary::OperName): Implement.   
20141         (Unary::ForceConversion): Copy and Paste !
20142
20143         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20144         a unary operator.
20145
20146         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20147         for the inbuilt operators. Only overloading works for now ;-)
20148
20149 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20152         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20153
20154         * expression.cs (This::Emit): Implement. 
20155         (This::Resolve): Implement.
20156         (TypeOf:Resolve): Implement.
20157         (Expression::ResolveSimpleName): Add an implicit this to instance
20158         field references. 
20159         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20160         Bind instance variable to Field expressions.
20161         (FieldExpr::Instance): New field used to track the expression that
20162         represents the object instance.
20163         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20164         binding 
20165         (FieldExpr::Emit): Implement.
20166
20167         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20168         the last instruction contains a return opcode to avoid generating
20169         the last `ret' instruction (this generates correct code, and it is
20170         nice to pass the peverify output).
20171
20172         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20173         initializer for static and instance variables.
20174         (Constructor::Emit): Allow initializer to be null in the case of
20175         static constructors.  Only emit initializer for instance
20176         constructors. 
20177
20178         (TypeContainer::FindMembers): Return a null array if there are no
20179         matches.
20180
20181         Also fix the code for the MemberTypes.Method branch, as it was not
20182         scanning that for operators (or tried to access null variables before).
20183
20184         * assign.cs (Assign::Emit): Handle instance and static fields. 
20185
20186         * TODO: Updated.
20187
20188         * driver.cs: Stop compilation if there are parse errors.
20189
20190         * cs-parser.jay (constructor_declaration): Provide default base
20191         initializer for non-static constructors.
20192         (constructor_declarator): Do not provide a default base
20193         initializers if none was specified.
20194         Catch the fact that constructors should not have parameters.
20195
20196         * class.cs: Do not emit parent class initializers for static
20197         constructors, that should be flagged as an error.
20198
20199 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20200
20201         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20202         Move back code into TypeContainer::Populate.
20203
20204 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20205
20206         * class.cs (TypeContainer::AddConstructor): Fix the check to
20207         compare against Name, not Basename. 
20208         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20209
20210         * cs-parser.jay : Update accordingly.
20211
20212         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20213         for methods, don't forget to look into the operators too.
20214         (RegisterMethodBuilder): Helper method to take care of this for
20215         methods, constructors and operators.
20216         (Operator::Define): Completely revamp.
20217         (Operator.OperatorMethod, MethodName): New fields.
20218         (TypeContainer::Populate): Move the registering of builders into
20219         RegisterMethodBuilder.
20220         (Operator::Emit): Re-write.
20221
20222         * expression.cs (Binary::Emit): Comment out code path to emit method
20223         invocation stuff for the case when we have a user defined operator. I am
20224         just not able to get it right !
20225
20226 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20229         argument. 
20230
20231         (Expression::MemberLookup): Provide a version that allows to
20232         specify the MemberTypes and BindingFlags. 
20233
20234         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20235         so it was not fetching variable information from outer blocks.
20236
20237         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20238         Beforefieldinit as it was buggy.
20239
20240         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20241         that Ravi put here.  
20242
20243         * class.cs (Constructor::Emit): Only emit if block is not null.
20244         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20245         deal with this by semantically definining it as if the user had
20246         done it.
20247
20248         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20249         constructors as we now "emit" them at a higher level.
20250
20251         (TypeContainer::DefineDefaultConstructor): Used to define the
20252         default constructors if none was provided.
20253
20254         (ConstructorInitializer): Add methods Resolve and Emit. 
20255
20256         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20257
20258 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20259
20260         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20261         the default constructor builder with our hashtable for methodbuilders
20262         to methodcores.
20263
20264         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20265         and argument_count is 0 in which case we have a match.
20266         (Binary::ResolveOperator): More null checking and miscellaneous coding
20267         style cleanup.
20268
20269 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20270
20271         * rootcontext.cs (IsNameSpace): Compare against null.
20272
20273         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20274
20275         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20276         and Unary::Operator.
20277
20278         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20279         accordingly.
20280
20281         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20282         we have overloaded operators.
20283         (Binary::ResolveOperator): Implement the part which does the operator overload
20284         resolution.
20285
20286         * class.cs (Operator::Emit): Implement.
20287         (TypeContainer::Emit): Emit the operators we have too.
20288
20289         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20290         the case when we have a user-defined operator.
20291
20292 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20293
20294         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20295
20296 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20297
20298         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20299         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20300         (Constructor::Emit): Implement.
20301         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20302         if we have no work to do. 
20303         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20304         Emit method.
20305
20306         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20307         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20308
20309         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20310         of parent.parent.
20311
20312 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20313
20314         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20315         in the source.
20316         (Tree::RecordNamespace): Method to do what the name says ;-)
20317         (Tree::Namespaces): Property to get at the namespaces hashtable.
20318
20319         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20320         keep track.
20321
20322         * rootcontext.cs (IsNamespace): Fixed it :-)
20323
20324 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * class.cs (TypeContainer::FindMembers): Add support for
20327         constructors. 
20328         (MethodCore): New class that encapsulates both the shared aspects
20329         of a Constructor and a Method.  
20330         (Method, Constructor): Factored pieces into MethodCore.
20331
20332         * driver.cs: Added --fatal which makes errors throw exceptions.
20333         Load System assembly as well as part of the standard library.
20334
20335         * report.cs: Allow throwing exceptions on errors for debugging.
20336
20337         * modifiers.cs: Do not use `parent', instead use the real type
20338         container to evaluate permission settings.
20339
20340         * class.cs: Put Ravi's patch back in.  He is right, and we will
20341         have to cope with the
20342
20343 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20344
20345         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20346         FamORAssem, not FamANDAssem.
20347
20348 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * driver.cs: Added --parse option that only parses its input files
20351         and terminates.
20352
20353         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20354         incorrect.  IsTopLevel is not used to tell whether an object is
20355         root_types or not (that can be achieved by testing this ==
20356         root_types).  But to see if this is a top-level *class* (not
20357         necessarly our "toplevel" container). 
20358
20359 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20360
20361         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20362         parent instead of a direct call to GetType.
20363
20364 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20365
20366         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20367         Modifiers.TypeAttr. This should just be a call to that method.
20368
20369         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20370         object so that we can determine if we are top-level or not.
20371
20372         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20373         TypeContainer too.
20374
20375         * enum.cs (Enum::Define): Ditto.
20376
20377         * modifiers.cs (FieldAttr): Re-write.
20378
20379         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20380         (TypeContainer::HaveStaticConstructor): New property to provide access
20381         to precisely that info.
20382
20383         * modifiers.cs (MethodAttr): Re-write.
20384         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20385
20386         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20387         of top-level types as claimed.
20388
20389 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20390
20391         * expression.cs (MemberLookup): Fruitless attempt to lookup
20392         constructors.  Maybe I need to emit default constructors?  That
20393         might be it (currently .NET emits this for me automatically).
20394         (Invocation::OverloadResolve): Cope with Arguments == null.
20395         (Invocation::EmitArguments): new function, shared by the new
20396         constructor and us.
20397         (Invocation::Emit): Handle static and instance methods.  Emit
20398         proper call instruction for virtual or non-virtual invocations.
20399         (New::Emit): Implement.
20400         (New::Resolve): Implement.
20401         (MemberAccess:Resolve): Implement.
20402         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20403         to track instances.
20404         (FieldExpr::Resolve): Set type.
20405
20406         * support.cs: Handle empty arguments.
20407                 
20408         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20409         SimpleLookup): Auxiliary routines to help parse a qualifier
20410         identifier.  
20411
20412         Update qualifier_identifier rule.
20413
20414         * codegen.cs: Removed debugging messages.
20415
20416         * class.cs: Make this a global thing, this acts just as a "key" to
20417         objects that we might have around.
20418
20419         (Populate): Only initialize method_builders_to_methods once.
20420
20421         * expression.cs (PropertyExpr): Initialize type from the
20422         PropertyType. 
20423
20424         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20425         Resolve pattern.  Attempt to implicitly convert value to boolean.
20426         Emit code.
20427
20428         * expression.cs: Set the type for the int32/int32 argument case.
20429         (Binary::ResolveOperator): Set the return type to boolean for
20430         comparission operators
20431
20432         * typemanager.cs: Remove debugging print code.
20433
20434         (Invocation::Resolve): resolve type.
20435
20436         * class.cs: Allocate a MemberInfo of the correct size, as the code
20437         elsewhere depends on the test to reflect the correct contents.
20438
20439         (Method::) Keep track of parameters, due to System.Reflection holes
20440
20441         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20442         mapping here.
20443
20444         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20445         of the exact size and return that.
20446
20447         (Class::LookupMethodByBuilder): New function that maps
20448         MethodBuilders to its methods.  Required to locate the information
20449         on methods because System.Reflection bit us again.
20450
20451         * support.cs: New file, contains an interface ParameterData and
20452         two implementations: ReflectionParameters and InternalParameters
20453         used to access Parameter information.  We will need to grow this
20454         as required.
20455
20456         * expression.cs (Invocation::GetParameterData): implement a cache
20457         and a wrapper around the ParameterData creation for methods. 
20458         (Invocation::OverloadResolve): Use new code.
20459
20460 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20461
20462         * class.cs (TypeContainer::EmitField): Remove and move into 
20463         (Field::Define): here and modify accordingly.
20464         (Field.FieldBuilder): New member.
20465         (TypeContainer::Populate): Update accordingly.
20466         (TypeContainer::FindMembers): Implement.
20467
20468 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20469
20470         * statement.cs: (VariableInfo::VariableType): New field to be
20471         initialized with the full type once it is resolved. 
20472
20473 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20474
20475         * parameter.cs (GetParameterInfo): Use a type cache to compute
20476         things only once, and to reuse this information
20477
20478         * expression.cs (LocalVariableReference::Emit): Implement.
20479         (OpcodeCast::Emit): fix.
20480
20481         (ParameterReference::Resolve): Implement.
20482         (ParameterReference::Emit): Implement.
20483
20484         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20485         that are expressions need to stay as Expressions.
20486
20487         * typemanager.cs (CSharpName): Returns the C# name of a type if
20488         possible. 
20489
20490         * expression.cs (Expression::ConvertImplicit): New function that
20491         implements implicit type conversions.
20492
20493         (Expression::ImplicitReferenceConversion): Implements implicit
20494         reference conversions.
20495
20496         (EmptyCast): New type for transparent casts.
20497
20498         (OpcodeCast): New type for casts of types that are performed with
20499         a sequence of bytecodes.
20500
20501         (BoxedCast): New type used for casting value types into reference
20502         types.  Emits a box opcode.
20503
20504         (Binary::DoNumericPromotions): Implements numeric promotions of
20505         and computation of the Binary::Type.
20506
20507         (Binary::EmitBranchable): Optimization.
20508
20509         (Binary::Emit): Implement code emission for expressions.
20510
20511         * typemanager.cs (TypeManager): Added two new core types: sbyte
20512         and byte.
20513
20514 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20515
20516         * class.cs (TypeContainer::FindMembers): Method which does exactly
20517         what Type.FindMembers does, only we don't have to use reflection. No
20518         implementation yet.
20519
20520         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20521         typecontainer objects as we need to get at them.
20522         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20523
20524         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20525         typecontainer object.
20526
20527         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20528         of just a Report object.
20529
20530 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20531
20532         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20533         "remove_"
20534         (TypeContainer::Populate): Now define the delegates of the type too.
20535         (TypeContainer.Delegates): Property to access the list of delegates defined
20536         in the type.
20537
20538         * delegates.cs (Delegate::Define): Implement partially.
20539
20540         * modifiers.cs (TypeAttr): Handle more flags.
20541
20542 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20543
20544         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20545         and not <=
20546         (Operator::Define): Re-write logic to get types by using the LookupType method
20547         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20548         (Indexer::Define): Ditto.
20549         (Event::Define): Ditto.
20550         (Property::Define): Ditto.
20551
20552 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20553
20554         * class.cs (TypeContainer::Populate): Now define operators too. 
20555         (TypeContainer.Operators): New property to access the list of operators
20556         in a type.
20557         (Operator.OperatorMethodBuilder): New member to hold the method builder
20558         for the operator we are defining.
20559         (Operator::Define): Implement.
20560
20561 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20562
20563         * class.cs (Event::Define): Make the prefixes of the accessor methods
20564         addOn_ and removeOn_ 
20565
20566         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20567         of the location being passed in too. Ideally, this should go later since all
20568         error reporting should be done through the Report object.
20569
20570         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20571         (Populate): Iterate thru the indexers we have and define them too.
20572         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20573         for the get and set accessors.
20574         (Indexer::Define): Implement.
20575
20576 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20579         my previous implementation, did not work.
20580
20581         * typemanager.cs: Add a couple of missing types (the longs).
20582
20583         * literal.cs: Use TypeManager.bool_type instead of getting it.
20584
20585         * expression.cs (EventExpr): New kind of expressions.
20586         (Expressio::ExprClassFromMemberInfo): finish
20587
20588 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20589
20590         * assign.cs: Emit stores to static fields differently.
20591
20592 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20593
20594         * Merge in changes and adjust code to tackle conflicts. Backed out my
20595         code in Assign::Resolve ;-) 
20596
20597 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20598
20599         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20600         instead Report.Error and also pass in the location.
20601         (CSharpParser::Lexer): New readonly property to return the reference
20602         to the Tokenizer object.
20603         (declare_local_variables): Use Report.Error with location instead of plain 
20604         old error.
20605         (CheckDef): Ditto.
20606
20607         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20608         (Operator.CheckBinaryOperator): Ditto.
20609
20610         * cs-parser.jay (operator_declarator): Update accordingly.
20611
20612         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20613         (CheckBinaryOperator): Same here.
20614
20615         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20616         on the name without any prefixes of namespace names etc. This is because we
20617         already might have something already fully qualified like 
20618         'System.Console.WriteLine'
20619
20620         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20621
20622 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20623
20624         * cs-tokenizer.cs (location): Return a string which also contains
20625         the file name.
20626
20627         * expression.cs (ElementAccess): New class for expressions of the
20628         type 'element access.'
20629         (BaseAccess): New class for expressions of the type 'base access.'
20630         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20631         respectively.
20632
20633         * cs-parser.jay (element_access): Implement action.
20634         (base_access): Implement actions.
20635         (checked_expression, unchecked_expression): Implement.
20636
20637         * cs-parser.jay (local_variable_type): Correct and implement.
20638         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20639
20640         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20641
20642         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20643         name and the specifiers.
20644
20645         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20646
20647         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20648         making them all public ;-)
20649
20650         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20651         class anyways.
20652
20653 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20656         PropertyExprs.
20657         (FieldExpr, PropertyExprs): New resolved expressions.
20658         (SimpleName::MemberStaticCheck): Perform static checks for access
20659         to non-static fields on static methods. Maybe this should be
20660         generalized for MemberAccesses. 
20661         (SimpleName::ResolveSimpleName): More work on simple name
20662         resolution. 
20663
20664         * cs-parser.jay (primary_expression/qualified_identifier): track
20665         the parameter index.
20666
20667         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20668         (EmitContext::EmitBoolExpression): Chain to expression generation
20669         instead of temporary hack.
20670         (::EmitStatementExpression): Put generic expression code generation.
20671
20672         * assign.cs (Assign::Emit): Implement variable assignments to
20673         local variables, parameters and fields.
20674
20675 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20676
20677         * statement.cs (Block::GetVariableInfo): New method, returns the
20678         VariableInfo for a variable name in a block.
20679         (Block::GetVariableType): Implement in terms of GetVariableInfo
20680
20681         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20682         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20683
20684 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20685
20686         * cs-parser.jay (operator_declaration): Continue on my quest : update
20687         to take attributes argument.
20688         (event_declaration): Ditto.
20689         (enum_declaration): Ditto.
20690         (indexer_declaration): Ditto.
20691
20692         * class.cs (Operator::Operator): Update constructor accordingly.
20693         (Event::Event): Ditto.
20694
20695         * delegate.cs (Delegate::Delegate): Same here.
20696
20697         * enum.cs (Enum::Enum): Same here.
20698
20699 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20700
20701         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20702
20703         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20704
20705         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20706         being passed around as an arraylist.
20707         (Attributes::AddAttribute): Method to add attribute sections.
20708
20709         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20710         (struct_declaration): Update accordingly.
20711         (constant_declaration): Update.
20712         (field_declaration): Update.
20713         (method_header): Update.
20714         (fixed_parameter): Update.
20715         (parameter_array): Ditto.
20716         (property_declaration): Ditto.
20717         (destructor_declaration): Ditto.
20718
20719         * class.cs (Struct::Struct): Update constructors accordingly.
20720         (Class::Class): Ditto.
20721         (Field::Field): Ditto.
20722         (Method::Method): Ditto.
20723         (Property::Property): Ditto.
20724         (TypeContainer::OptAttribute): update property's return type.
20725
20726         * interface.cs (Interface.opt_attributes): New member.
20727         (Interface::Interface): Update to take the extra Attributes argument.
20728
20729         * parameter.cs (Parameter::Parameter): Ditto.
20730
20731         * constant.cs (Constant::Constant): Ditto.
20732
20733         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20734         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20735         the attributes as a parameter.
20736         (InterfaceProperty): Update constructor call.
20737         (InterfaceEvent): Ditto.
20738         (InterfaceMethod): Ditto.
20739         (InterfaceIndexer): Ditto.
20740
20741         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20742         pass the attributes too.
20743         (interface_event_declaration): Ditto.
20744         (interface_property_declaration): Ditto.
20745         (interface_method_declaration): Ditto.
20746         (interface_declaration): Ditto.
20747
20748 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20749
20750         * class.cs (Method::Define): Track the "static Main" definition to
20751         create an entry point. 
20752
20753         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20754         EntryPoint if we find it. 
20755
20756         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20757         (EmitContext::ig): Make this variable public.
20758
20759         * driver.cs: Make the default output file be the first file name
20760         with the .exe extension.  
20761
20762         Detect empty compilations
20763
20764         Handle various kinds of output targets.  Handle --target and
20765         rename -t to --dumper.
20766
20767         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20768         methods inherited from Expression return now an Expression.  This
20769         will is used during the tree rewriting as we resolve them during
20770         semantic analysis.
20771
20772         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20773         the spec.  Missing entirely is the information about
20774         accessability of elements of it.
20775
20776         (Expression::ExprClassFromMemberInfo): New constructor for
20777         Expressions that creates a fully initialized Expression based on
20778         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20779         a Type.
20780
20781         (Invocation::Resolve): Begin implementing resolution of invocations.
20782
20783         * literal.cs (StringLiteral):  Implement Emit.
20784
20785 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20786
20787         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20788         member.
20789
20790 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20791
20792         * cs-parser.jay (attribute_arguments): Implement actions.
20793         (attribute): Fix bug in production. Implement action.
20794         (attribute_list): Implement.
20795         (attribute_target): Implement.
20796         (attribute_target_specifier, opt_target_specifier): Implement
20797         (CheckAttributeTarget): New method to check if the attribute target
20798         is valid.
20799         (attribute_section): Implement.
20800         (opt_attributes): Implement.
20801
20802         * attribute.cs : New file to handle attributes.
20803         (Attribute): Class to hold attribute info.
20804
20805         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20806         (attribute_section): Modify production to use 2 different rules to 
20807         achieve the same thing. 1 s/r conflict down !
20808         Clean out commented, useless, non-reducing dimension_separator rules.
20809
20810         * class.cs (TypeContainer.attributes): New member to hold list
20811         of attributes for a type.
20812         (Struct::Struct): Modify to take one more argument, the attribute list.
20813         (Class::Class): Ditto.
20814         (Field::Field): Ditto.
20815         (Method::Method): Ditto.
20816         (Property::Property): Ditto.
20817
20818         * cs-parser.jay (struct_declaration): Update constructor call to
20819         pass in the attributes too.
20820         (class_declaration): Ditto.
20821         (constant_declaration): Ditto.
20822         (field_declaration): Ditto.
20823         (method_header): Ditto.
20824         (fixed_parameter): Ditto.
20825         (parameter_array): Ditto.
20826         (property_declaration): Ditto.
20827
20828         * constant.cs (Constant::Constant): Update constructor similarly.
20829         Use System.Collections.
20830
20831         * parameter.cs (Parameter::Parameter): Update as above.
20832
20833 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20834
20835         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20836         (TypeContainer.delegates): New member to hold list of delegates.
20837
20838         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20839         this time as I seem to be on crack ;-)
20840
20841 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20842
20843         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20844         tell whether an identifier represents a namespace.
20845
20846         * expression.cs (NamespaceExpr): A namespace expression, used only
20847         temporarly during expression resolution.
20848         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20849         utility functions to resolve names on expressions.
20850
20851 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * codegen.cs: Add hook for StatementExpressions. 
20854
20855         * class.cs: Fix inverted test for static flag in methods.
20856
20857 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20858
20859         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20860         to make it coincide with MS' number.
20861         (Operator::CheckBinaryOperator): Ditto.
20862
20863         * ../errors/errors.txt : Remove error numbers added earlier.
20864
20865         * ../errors/cs1019.cs : Test case for error # 1019
20866
20867         * ../errros/cs1020.cs : Test case for error # 1020
20868
20869         * cs-parser.jay : Clean out commented cruft.
20870         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20871         used anywhere - non-reducing rule.
20872         (namespace_declarations): Non-reducing rule - comment out.
20873
20874         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20875         with TypeContainer::AddEnum.
20876
20877         * delegate.cs : New file for delegate handling classes.
20878         (Delegate): Class for declaring delegates.
20879
20880         * makefile : Update.
20881
20882         * cs-parser.jay (delegate_declaration): Implement.
20883
20884 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20885
20886         * class.cs (Event::Define): Implement.
20887         (Event.EventBuilder): New member.
20888
20889         * class.cs (TypeContainer::Populate): Update to define all enums and events
20890         we have.
20891         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20892         readonly fields for all these cases ?
20893
20894 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20895
20896         * class.cs (Property): Revamp to use the convention of making fields readonly.
20897         Accordingly modify code elsewhere.
20898
20899         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20900         the Define method of the Property class.
20901
20902         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20903         trivial bug.
20904         (TypeContainer::Populate): Update to define all the properties we have. Also
20905         define all enumerations.
20906
20907         * enum.cs (Define): Implement.
20908
20909 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20910
20911         * cs-parser.jay (overloadable_operator): The semantic value is an
20912         enum of the Operator class.
20913         (operator_declarator): Implement actions.
20914         (operator_declaration): Implement.
20915
20916         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20917         validity of definitions.
20918         (Operator::CheckBinaryOperator): Static method to check for binary operators
20919         (TypeContainer::AddOperator): New method to add an operator to a type.
20920
20921         * cs-parser.jay (indexer_declaration): Added line to actually call the
20922         AddIndexer method so it gets added ;-)
20923
20924         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20925         already taken care of by the MS compiler ?  
20926
20927 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20928
20929         * class.cs (Operator): New class for operator declarations.
20930         (Operator::OpType): Enum for the various operators.
20931
20932 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20933
20934         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20935         ostensibly handle this in semantic analysis.
20936
20937         * cs-parser.jay (general_catch_clause): Comment out
20938         (specific_catch_clauses, specific_catch_clause): Ditto.
20939         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20940         (catch_args, opt_catch_args): New productions.
20941         (catch_clause): Rewrite to use the new productions above
20942         (catch_clauses): Modify accordingly.
20943         (opt_catch_clauses): New production to use in try_statement
20944         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20945         and re-write the code in the actions to extract the specific and
20946         general catch clauses by being a little smart ;-)
20947
20948         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20949         Hooray, try and catch statements parse fine !
20950
20951 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20952
20953         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20954         string from the hashtable of variables.
20955
20956         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20957         I end up making that mistake ;-)
20958         (catch_clauses): Fixed gross error which made Key and Value of the 
20959         DictionaryEntry the same : $1 !!
20960
20961 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20962
20963         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20964
20965         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20966         when the add and remove accessors are specified. 
20967
20968 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20969
20970         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20971         information about indexer_declarator.
20972         (indexer_declarator): Implement actions.
20973         (parsing_indexer): New local boolean used to keep track of whether
20974         we are parsing indexers or properties. This is necessary because 
20975         implicit_parameters come into picture even for the get accessor in the 
20976         case of an indexer.
20977         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20978
20979         * class.cs (Indexer): New class for indexer declarations.
20980         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20981         (TypeContainer::indexers): New member to hold list of indexers for the
20982         type.
20983
20984 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20985
20986         * cs-parser.jay (add_accessor_declaration): Implement action.
20987         (remove_accessor_declaration): Implement action.
20988         (event_accessors_declaration): Implement
20989         (variable_declarators): swap statements for first rule - trivial.
20990
20991         * class.cs (Event): New class to hold information about event
20992         declarations.
20993         (TypeContainer::AddEvent): New method to add an event to a type
20994         (TypeContainer::events): New member to hold list of events.
20995
20996         * cs-parser.jay (event_declaration): Implement actions.
20997
20998 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20999
21000         * cs-parser.jay (dim_separators): Implement. Make it a string
21001         concatenating all the commas together, just as they appear.
21002         (opt_dim_separators): Modify accordingly
21003         (rank_specifiers): Update accordingly. Basically do the same
21004         thing - instead, collect the brackets here.
21005         (opt_rank_sepcifiers): Modify accordingly.
21006         (array_type): Modify to actually return the complete type string
21007         instead of ignoring the rank_specifiers.
21008         (expression_list): Implement to collect the expressions
21009         (variable_initializer): Implement. We make it a list of expressions
21010         essentially so that we can handle the array_initializer case neatly too.
21011         (variable_initializer_list): Implement.
21012         (array_initializer): Make it a list of variable_initializers
21013         (opt_array_initializer): Modify accordingly.
21014
21015         * expression.cs (New::NType): Add enumeration to help us
21016         keep track of whether we have an object/delegate creation
21017         or an array creation.
21018         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21019         members to hold data about array creation.
21020         (New:New): Modify to update NewType
21021         (New:New): New Overloaded contructor for the array creation
21022         case.
21023
21024         * cs-parser.jay (array_creation_expression): Implement to call
21025         the overloaded New constructor.
21026
21027 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21028
21029         * class.cs (TypeContainer::Constructors): Return member
21030         constructors instead of returning null.
21031
21032 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21033
21034         * typemanager.cs (InitCoreTypes): Initialize the various core
21035         types after we have populated the type manager with the user
21036         defined types (this distinction will be important later while
21037         compiling corlib.dll)
21038
21039         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21040         on Expression Classification.  Now all expressions have a method
21041         `Resolve' and a method `Emit'.
21042
21043         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21044         generation from working.     Also add some temporary debugging
21045         code. 
21046
21047 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * codegen.cs: Lots of code generation pieces.  This is only the
21050         beginning, will continue tomorrow with more touches of polish.  We
21051         handle the fundamentals of if, while, do, for, return.  Others are
21052         trickier and I need to start working on invocations soon.
21053
21054         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21055         s.InitStatement. 
21056
21057         * codegen.cs (EmitContext): New struct, used during code
21058         emission to keep a context.   Most of the code generation will be
21059         here. 
21060
21061         * cs-parser.jay: Add embedded blocks to the list of statements of
21062         this block.  So code generation proceeds in a top down fashion.
21063
21064 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21065
21066         * statement.cs: Add support for multiple child blocks.
21067
21068 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21069
21070         * codegen.cs (EmitCode): New function, will emit the code for a
21071         Block of code given a TypeContainer and its ILGenerator. 
21072
21073         * statement.cs (Block): Standard public readonly optimization.
21074         (Block::Block constructors): Link children. 
21075         (Block::Child): Child Linker.
21076         (Block::EmitVariables): Emits IL variable declarations.
21077
21078         * class.cs: Drop support for MethodGroups here, delay until
21079         Semantic Analysis.
21080         (Method::): Applied the same simplification that I did before, and
21081         move from Properties to public readonly fields.
21082         (Method::ParameterTypes): Returns the parameter types for the
21083         function, and implements a cache that will be useful later when I
21084         do error checking and the semantic analysis on the methods is
21085         performed.
21086         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21087         and made a method, optional argument tells whether this is a class
21088         or a structure to apply the `has-this' bit.
21089         (Method::GetCallingConvention): Implement, returns the calling
21090         convention. 
21091         (Method::Define): Defines the type, a second pass is performed
21092         later to populate the methods.
21093
21094         (Constructor::ParameterTypes): implement a cache similar to the
21095         one on Method::ParameterTypes, useful later when we do semantic
21096         analysis. 
21097
21098         (TypeContainer::EmitMethod):  New method.  Emits methods.
21099
21100         * expression.cs: Removed MethodGroup class from here.
21101
21102         * parameter.cs (Parameters::GetCallingConvention): new method.
21103
21104 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21105
21106         * class.cs (TypeContainer::Populate): Drop RootContext from the
21107         argument. 
21108
21109         (Constructor::CallingConvention): Returns the calling convention.
21110         (Constructor::ParameterTypes): Returns the constructor parameter
21111         types. 
21112
21113         (TypeContainer::AddConstructor): Keep track of default constructor
21114         and the default static constructor.
21115
21116         (Constructor::) Another class that starts using `public readonly'
21117         instead of properties. 
21118
21119         (Constructor::IsDefault): Whether this is a default constructor. 
21120
21121         (Field::) use readonly public fields instead of properties also.
21122
21123         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21124         track of static constructors;  If none is used, turn on
21125         BeforeFieldInit in the TypeAttributes. 
21126
21127         * cs-parser.jay (opt_argument_list): now the return can be null
21128         for the cases where there are no arguments. 
21129
21130         (constructor_declarator): If there is no implicit `base' or
21131         `this', then invoke the default parent constructor. 
21132
21133         * modifiers.cs (MethodAttr): New static function maps a set of
21134         modifiers flags into a MethodAttributes enum
21135         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21136         MethodAttr, TypeAttr to represent the various mappings where the
21137         modifiers are used.
21138         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21139
21140 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21141
21142         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21143         method arguments.
21144
21145         * interface.cs (PopulateIndexer): Implemented the code generator
21146         for interface indexers.
21147
21148 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21149
21150         * interface.cs (InterfaceMemberBase): Now we track the new status
21151         here.  
21152
21153         (PopulateProperty): Implement property population.  Woohoo!  Got
21154         Methods and Properties going today. 
21155
21156         Removed all the properties for interfaces, and replaced them with
21157         `public readonly' fields. 
21158
21159 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21162         initialize their hashtables/arraylists only when they are needed
21163         instead of doing this always.
21164
21165         * parameter.cs: Handle refs and out parameters.
21166
21167         * cs-parser.jay: Use an ArrayList to construct the arguments
21168         instead of the ParameterCollection, and then cast that to a
21169         Parameter[] array.
21170
21171         * parameter.cs: Drop the use of ParameterCollection and use
21172         instead arrays of Parameters.
21173
21174         (GetParameterInfo): Use the Type, not the Name when resolving
21175         types. 
21176
21177 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21180         and instead use public readonly fields.
21181
21182         * class.cs: Put back walking code for type containers.
21183
21184 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * class.cs (MakeConstant): Code to define constants.
21187
21188         * rootcontext.cs (LookupType): New function.  Used to locate types 
21189
21190
21191 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21194         this System.Reflection code is.  Kudos to Microsoft
21195
21196         * typemanager.cs: Implement a type cache and avoid loading all
21197         types at boot time.  Wrap in LookupType the internals.  This made
21198         the compiler so much faster.  Wow.  I rule!
21199
21200         * driver.cs: Make sure we always load mscorlib first (for
21201         debugging purposes, nothing really important).
21202
21203         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21204         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21205
21206         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21207         on namespaces that have been imported using the `using' keyword.
21208
21209         * class.cs (TypeContainer::TypeAttr): Virtualize.
21210         (Class::TypeAttr): Return attributes suitable for this bad boy.
21211         (Struct::TypeAttr): ditto.
21212         Handle nested classes.
21213         (TypeContainer::) Remove all the type visiting code, it is now
21214         replaced with the rootcontext.cs code
21215
21216         * rootcontext.cs (GetClassBases): Added support for structs. 
21217
21218 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21219
21220         * interface.cs, statement.cs, class.cs, parameter.cs,
21221         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21222         Drop use of TypeRefs, and use strings instead.
21223
21224 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * rootcontext.cs: 
21227
21228         * class.cs (Struct::Struct): set the SEALED flags after
21229         checking the modifiers.
21230         (TypeContainer::TypeAttr): new property, returns the
21231         TypeAttributes for a class.  
21232
21233         * cs-parser.jay (type_list): Oops, list production was creating a
21234         new list of base types.
21235
21236         * rootcontext.cs (StdLib): New property.
21237         (GetInterfaceTypeByName): returns an interface by type name, and
21238         encapsulates error handling here.
21239         (GetInterfaces): simplified.
21240         (ResolveTree): Encapsulated all the tree resolution here.
21241         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21242         types. 
21243
21244         * driver.cs: Add support for --nostdlib, to avoid loading the
21245         default assemblies.
21246         (Main): Do not put tree resolution here. 
21247
21248         * rootcontext.cs: Beginning of the class resolution.
21249
21250 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * rootcontext.cs: Provide better error reporting. 
21253
21254         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21255
21256         * rootcontext.cs (CreateInterface): Handle the case where there
21257         are no parent interfaces.
21258
21259         (CloseTypes): Routine to flush types at the end.
21260         (CreateInterface): Track types.
21261         (GetInterfaces): Returns an array of Types from the list of
21262         defined interfaces.
21263
21264         * typemanager.c (AddUserType): Mechanism to track user types (puts
21265         the type on the global type hash, and allows us to close it at the
21266         end). 
21267
21268 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21269
21270         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21271         RecordInterface instead.
21272
21273         * cs-parser.jay: Updated to reflect changes above.
21274
21275         * decl.cs (Definition): Keep track of the TypeBuilder type that
21276         represents this type here.  Not sure we will use it in the long
21277         run, but wont hurt for now.
21278
21279         * driver.cs: Smaller changes to accomodate the new code.
21280
21281         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21282         when done. 
21283
21284         * rootcontext.cs (CreateInterface):  New method, used to create
21285         the System.TypeBuilder type for interfaces.
21286         (ResolveInterfaces): new entry point to resolve the interface
21287         hierarchy. 
21288         (CodeGen): Property, used to keep track of the code generator.
21289
21290 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21291
21292         * cs-parser.jay: Add a second production for delegate_declaration
21293         with `VOID'.
21294
21295         (enum_body): Put an opt_comma here instead of putting it on
21296         enum_body or enum_member_declarations so we can handle trailing
21297         commas on enumeration members.  Gets rid of a shift/reduce.
21298
21299         (type_list): Need a COMMA in the middle.
21300
21301         (indexer_declaration): Tell tokenizer to recognize get/set
21302
21303         * Remove old targets.
21304
21305         * Re-add the parser target.
21306
21307 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21308
21309         * cs-parser.jay: Add precendence rules for a number of operators
21310         ot reduce the number of shift/reduce conflicts in the grammar.
21311
21312 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21315         and put it here.
21316
21317         Get rid of old crufty code.
21318
21319         * rootcontext.cs: Use this to keep track of the parsed
21320         representation and the defined types available to the program. 
21321
21322         * gen-treedump.cs: adjust for new convention.
21323
21324         * type.cs: Split out the type manager, and the assembly builder
21325         from here. 
21326
21327         * typemanager.cs: the type manager will live here now.
21328
21329         * cil-codegen.cs: And the code generator here. 
21330
21331 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21332
21333         * makefile: Fixed up for easy making.
21334
21335 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21336
21337         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21338         the 
21339
21340         (unary_expression): Expand pre_increment_expression and
21341         post_decrement_expression to reduce a shift/reduce.
21342
21343 2001-07-11  Simon Cozens
21344
21345         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21346
21347         Improve allow_keyword_as_indent name.
21348
21349 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21350
21351         * Adjustments for Beta2. 
21352
21353 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21354
21355         * decl.cs: Added `Define' abstract method.
21356         (InTransit): new property, used to catch recursive definitions. 
21357
21358         * interface.cs: Implement `Define'. 
21359
21360         * modifiers.cs: Map Modifiers.constants to
21361         System.Reflection.TypeAttribute flags.
21362
21363         * class.cs: Keep track of types and user-defined types.
21364         (BuilderInit): New method for creating an assembly
21365         (ResolveType): New function to launch the resolution process, only
21366         used by interfaces for now.
21367
21368         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21369         that are inserted into the name space. 
21370
21371 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * ARGH.  I have screwed up my tree so many times due to the use of
21374         rsync rather than using CVS.  Going to fix this at once. 
21375
21376         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21377         load types.
21378
21379 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * Experiment successful: Use System.Type rather that our own
21382         version of Type.  
21383
21384 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21385
21386         * cs-parser.jay: Removed nsAliases from here.
21387
21388         Use new namespaces, handle `using XXX;' 
21389
21390         * namespace.cs: Reimplemented namespace handling, use a recursive
21391         definition of the class.  Now we can keep track of using clauses
21392         and catch invalid using clauses.
21393
21394 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * gen-treedump.cs: Adapted for all the renaming.
21397
21398         * expression.cs (Expression): this class now has a Type property
21399         which returns an expression Type.
21400
21401         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21402         `Type', as this has a different meaning now in the base
21403
21404 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21405
21406         * interface.cs, class.cs: Removed from all the sources the
21407         references to signature computation, as we can not do method
21408         signature computation during the parsing time, as we are not
21409         trying to solve at that point distinguishing:
21410
21411         class X {
21412                 void a (Blah x) {}
21413                 void a (NS.Blah x) {}
21414         }
21415
21416         Which depending on the context might be valid or not, as we do not
21417         know if Blah is the same thing as NS.Blah at that point.
21418
21419         * Redid everything so the code uses TypeRefs now instead of
21420         Types.  TypeRefs are just temporary type placeholders, that need
21421         to be resolved.  They initially have a pointer to a string and the
21422         current scope in which they are used.  This is used later by the
21423         compiler to resolve the reference to an actual Type. 
21424
21425         * DeclSpace is no longer a CIR.Type, and neither are
21426         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21427         are all DeclSpaces, but no Types. 
21428
21429         * type.cs (TypeRefManager): This implements the TypeRef manager,
21430         which keeps track of all the types that need to be resolved after
21431         the parsing has finished. 
21432
21433 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21434
21435         * ARGH.  We are going to have to store `foreach' as a class rather
21436         than resolving it, as we need to verify error 1579 after name
21437         resolution.   *OR* we could keep a flag that says `This request to
21438         IEnumerator comes from a foreach statement' which we can then use
21439         to generate the error.
21440
21441 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21442
21443         * class.cs (TypeContainer.AddMethod): we now add methods to the
21444         MethodGroup instead of the method hashtable.  
21445
21446         * expression.cs: Add MethodGroup abstraction, which gets us one
21447         step closer to the specification in the way we handle method
21448         declarations.  
21449
21450         * cs-parser.jay (primary_expression): qualified_identifier now
21451         tried to match up an identifier to a local variable reference or
21452         to a parameter reference.
21453
21454         current_local_parameters is now a parser global variable that
21455         points to the current parameters for the block, used during name
21456         lookup.
21457
21458         (property_declaration): Now creates an implicit `value' argument to
21459         the set accessor.
21460
21461 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21462
21463         * parameter.cs: Do not use `param' arguments as part of the
21464         signature, per the spec.
21465
21466 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * decl.cs: Base class for classes, structs and interfaces.  This
21469         is the "Declaration Space" 
21470
21471         * cs-parser.jay: Use CheckDef for checking declaration errors
21472         instead of having one on each function.
21473
21474         * class.cs: Factor out some code for handling error handling in
21475         accordance to the "Declarations" section in the "Basic Concepts"
21476         chapter in the ECMA C# spec.
21477
21478         * interface.cs: Make all interface member classes derive from
21479         InterfaceMemberBase.
21480
21481 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21482
21483         * Many things: all interfaces are parsed and generated in
21484         gen-treedump.  Support for member variables, constructors,
21485         destructors, properties, constants is there.
21486
21487         Beginning of the IL backend, but very little done, just there for
21488         testing purposes. 
21489
21490 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21491
21492         * cs-parser.jay: Fix labeled statement.
21493
21494         * cs-tokenizer.cs (escape): Escape " and ' always.
21495         ref_line, ref_name: keep track of the line/filename as instructed
21496         by #line by the compiler.
21497         Parse #line.
21498
21499 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21500
21501         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21502         to match the values in System.CodeDOM.
21503
21504         Divid renamed to Divide.
21505
21506         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21507         statements. 
21508         (Statements.set): remove.
21509
21510         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21511         statements. 
21512
21513         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21514         falseStatements always have valid values. 
21515
21516         * cs-parser.jay: Use System.CodeDOM now.
21517